/* ============================================
   INVENTÁRIO TI — ESTILOS GLOBAIS
   ============================================ */

:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1a1d2e;
  --sidebar-text: #a8b2d8;
  --sidebar-active: #4361ee;
  --topbar-h: 60px;
  --primary: #4361ee;
  --primary-dark: #3651d4;
  --body-bg: #f0f2f5;
  --card-bg: #ffffff;
  --card-radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
  --font: 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--body-bg);
  color: #2d3250;
  font-size: 14px;
}

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-logo {
  width: 38px; height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

.sidebar-logo-text {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
}

.brand-name {
  display: block;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.brand-sub {
  display: block;
  color: var(--sidebar-text);
  font-size: 11px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  padding: 10px 18px;
  border-radius: 8px;
  margin: 2px 8px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .2s;
  text-decoration: none;
}

.sidebar-nav .nav-link i { font-size: 16px; }

.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(67,97,238,.35);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}

.user-name {
  display: block;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: block;
  color: var(--sidebar-text);
  font-size: 11px;
}

.btn-logout {
  color: var(--sidebar-text);
  font-size: 18px;
  text-decoration: none;
  transition: color .2s;
  flex-shrink: 0;
}
.btn-logout:hover { color: #ef476f; }

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid #e8ecf0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.btn-toggle-sidebar {
  background: none;
  border: none;
  font-size: 22px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .2s;
}
.btn-toggle-sidebar:hover { background: #f0f2f5; }

.topbar-title h5 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1d2e;
  margin: 0;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-date {
  color: #6b7280;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---- PAGE CONTENT ---- */
.page-content { flex: 1; padding-top: 8px; }

/* ---- CARDS / PANELS ---- */
.card-panel {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f2f5;
  background: #fafbfc;
}

.panel-header h6 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1d2e;
  display: flex;
  align-items: center;
}

.panel-body { padding: 16px 18px; }

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid transparent;
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}

.stat-blue  { border-color: #4361ee; }
.stat-blue  .stat-icon { background: rgba(67,97,238,.1); color: #4361ee; }
.stat-blue  .stat-value { color: #4361ee; }

.stat-green { border-color: #06d6a0; }
.stat-green .stat-icon { background: rgba(6,214,160,.1); color: #06d6a0; }
.stat-green .stat-value { color: #06d6a0; }

.stat-orange{ border-color: #ffd166; }
.stat-orange .stat-icon { background: rgba(255,209,102,.15); color: #f4a01c; }
.stat-orange .stat-value { color: #f4a01c; }

.stat-red   { border-color: #ef476f; }
.stat-red   .stat-icon { background: rgba(239,71,111,.1); color: #ef476f; }
.stat-red   .stat-value { color: #ef476f; }

/* ---- TABELAS ---- */
.table thead th {
  background: #fafbfc;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #e8ecf0;
  padding: 10px 14px;
}
.table tbody td { padding: 10px 14px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8f9ff; }

/* ---- AVATAR PEQUENO ---- */
.avatar-sm {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}

/* ---- FLASH MESSAGES ---- */
.flash-container .alert {
  border-radius: 10px;
  font-size: 13.5px;
}

/* ---- FORMULÁRIOS ---- */
.form-control, .form-select {
  border-radius: 8px;
  font-size: 14px;
  border-color: #dde1e7;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}
.form-label { font-size: 13px; color: #374151; margin-bottom: 5px; }
.fw-500 { font-weight: 500; }

/* ---- BOTÕES ---- */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 8px;
  font-weight: 500;
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* ---- LOGIN ---- */
.login-body {
  background: linear-gradient(135deg, #1a1d2e 0%, #2d3250 50%, #1a1d2e 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-header { text-align: center; margin-bottom: 28px; }

.login-logo {
  width: 64px; height: 64px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 14px;
}

.login-icon {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  margin: 0 auto 14px;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1d2e;
  margin-bottom: 4px;
}

.login-subtitle {
  color: #6b7280;
  font-size: 13px;
  margin: 0;
}

.btn-toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  z-index: 10;
}
.btn-toggle-pass:hover { color: var(--primary); }

.btn-login {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: background .2s, transform .1s;
}
.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}
.btn-login:active { transform: translateY(0); }

.login-footer {
  text-align: center;
  margin-top: 20px;
  color: #9ca3af;
  font-size: 12px;
}

.login-version {
  color: rgba(255,255,255,.35);
  font-size: 12px;
  margin-top: 16px;
}

/* ---- RESPONSIVO ---- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .topbar-date { display: none; }
}