/* =========================================================
   Konveksi Stock — Modern UI
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-soft: rgba(99, 102, 241, 0.12);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --info: #06b6d4;
  --dark: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --bg: #f1f5f9;
  --bg-subtle: #f8fafc;
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --bottom-nav-h: 64px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 8px 24px rgba(99, 102, 241, 0.25);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% -20%, rgba(99, 102, 241, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(139, 92, 246, 0.06), transparent);
  background-attachment: fixed;
  margin: 0;
  color: var(--text);
  overscroll-behavior-y: none;
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.app-wrapper { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(165deg, #0f172a 0%, #1e1b4b 45%, #1e293b 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow: hidden; /* tidak ada scroll pada sidebar */
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.2), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15), transparent 45%);
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  padding-top: calc(20px + var(--safe-top));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

.sidebar-brand img {
  width: 42px; height: 42px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-brand span {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  padding: 8px 10px;
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 2px;
}

.sidebar-nav,
.sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Standalone & group child links */
.sidebar-nav .nav-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #94a3b8;
  text-decoration: none;
  transition: all .2s ease;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 40px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-nav .nav-link-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-link-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.sidebar-nav .nav-link-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.28));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.sidebar-nav .nav-link-item.active i { color: #c7d2fe; }

/* Expand group */
.nav-group {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  flex-shrink: 0;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  min-height: 40px;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s;
  text-align: left;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.nav-group.open > .nav-group-toggle {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
}

.nav-group-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-group-left i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-chevron {
  font-size: 0.75rem;
  transition: transform .25s ease;
  opacity: 0.7;
}

.nav-group.open > .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
}

.nav-group-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}

.nav-group.open > .nav-group-body {
  grid-template-rows: 1fr;
}

.nav-group-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 4px 4px;
}

.nav-group-body .nav-link-item {
  padding-left: 16px;
  font-weight: 500;
  font-size: 0.84rem;
  min-height: 36px;
}

.nav-group-body .nav-link-item i {
  font-size: 1rem;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 10px calc(12px + var(--safe-bottom));
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.sidebar-footer .logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #fb7185;
  text-decoration: none;
  min-height: 40px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
  transition: background .2s, color .2s;
}

.sidebar-footer .logout-link:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #fecdd3;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  transition: margin .3s;
  width: 100%;
  min-width: 0;
}

.topbar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  padding: 0 28px;
  height: var(--topbar-h);
  padding-top: var(--safe-top);
  height: calc(var(--topbar-h) + var(--safe-top));
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.topbar h5 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55vw;
  margin: 0;
}

.btn-toggle {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 1.25rem;
  margin-right: 12px;
  color: var(--text);
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-xs);
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}

.btn-toggle:hover { background: #e2e8f0; }
.btn-toggle:active { background: #e2e8f0; }

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 0;
  padding: 6px 12px 6px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.user-info i { font-size: 1.25rem; color: var(--primary); }
.user-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  color: var(--text);
}

.user-info .badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3em 0.55em;
  border-radius: 6px;
}

.content-area {
  padding: 28px 32px 36px;
  flex: 1;
  width: 100%;
}

.app-footer {
  text-align: center;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.app-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
  color: var(--primary-dark);
}

.footer-sep { opacity: 0.5; }

.sidebar-dev {
  text-align: center;
  padding: 6px 8px 2px;
  font-size: 0.7rem;
}

.sidebar-dev a {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s;
}

.sidebar-dev a:hover {
  color: #a5b4fc;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1050;
  opacity: 0;
  transition: opacity .28s;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* Bottom nav mobile */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.06);
  z-index: 1000;
  justify-content: space-around;
  align-items: stretch;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 8px 4px;
  min-height: var(--bottom-nav-h);
  transition: color .15s;
  letter-spacing: 0.01em;
}

.bottom-nav a i { font-size: 1.35rem; line-height: 1; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a:active { background: var(--bg-subtle); }

/* === CARDS === */
.card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow .25s, transform .25s;
}

.card-header {
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 14px 20px;
  letter-spacing: -0.01em;
  color: var(--dark);
}

/* === STAT CARDS === */
.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 26px;
  border-radius: var(--radius);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s;
  min-height: 108px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  top: -40px;
  right: -30px;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
}

.stat-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a78bfa 100%);
}
.stat-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 60%, #34d399 100%);
}
.stat-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 55%, #fb7185 100%);
}

.stat-icon {
  width: 56px; height: 56px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  opacity: 0.92;
  font-size: 0.82rem;
  margin-top: 6px;
  font-weight: 500;
}

/* Product thumb */
.product-thumb, .product-thumb-placeholder {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.product-thumb-placeholder {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.15rem;
}

/* Report cards */
.report-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
  text-align: center;
  min-height: 160px;
}

.report-card:hover, .report-card:active {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.25);
}

.report-card i {
  font-size: 2.4rem;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  display: block;
}

.report-card strong {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Forms */
.form-control, .form-select {
  min-height: 46px;
  border-radius: var(--radius-xs);
  font-size: 15px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
  font-family: var(--font);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-control-lg {
  min-height: 50px;
  border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
  border-radius: var(--radius-xs);
  min-height: 42px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: -0.01em;
  transition: transform .15s, box-shadow .2s, background .2s;
  padding: 0.5rem 1.1rem;
}

.btn:active { transform: scale(0.98); }

.btn-lg {
  min-height: 50px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border: none;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #6d28d9 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  border: none;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border: none;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-outline-primary {
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-outline-danger {
  border: 1.5px solid rgba(244, 63, 94, 0.35);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: #be123c;
}

.btn-sm {
  min-height: 34px;
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

/* Tom Select */
.ts-wrapper .ts-control {
  min-height: 46px !important;
  border-radius: var(--radius-xs) !important;
  font-size: 15px !important;
  padding: 8px 12px !important;
  border: 1.5px solid var(--border) !important;
  font-family: var(--font) !important;
}

.ts-wrapper.focus .ts-control {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px var(--primary-soft) !important;
}

.ts-dropdown {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: var(--font) !important;
}

/* Tables */
.table {
  font-size: 0.9rem;
  --bs-table-hover-bg: rgba(99, 102, 241, 0.04);
}

.table th {
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom-width: 1px;
  background: var(--bg-subtle) !important;
  padding: 0.85rem 1rem;
}

.table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-color: #f1f5f9;
}

.table-hover tbody tr {
  transition: background .15s;
}

code {
  font-size: 0.82rem;
  background: var(--bg-subtle);
  padding: 0.2em 0.45em;
  border-radius: 6px;
  color: var(--primary-dark);
  font-weight: 600;
  border: 1px solid var(--border);
}

/* Badges */
.badge {
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4em 0.65em;
  border-radius: 8px;
  font-size: 0.75rem;
}

.bg-info { background: linear-gradient(135deg, #06b6d4, #0891b2) !important; }
.bg-success { background: linear-gradient(135deg, #10b981, #059669) !important; }
.bg-danger { background: linear-gradient(135deg, #f43f5e, #e11d48) !important; }
.bg-warning { background: linear-gradient(135deg, #fbbf24, #f59e0b) !important; }
.bg-primary { background: linear-gradient(135deg, #6366f1, #7c3aed) !important; }
.bg-secondary { background: linear-gradient(135deg, #64748b, #475569) !important; }

/* Alerts */
.alert {
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  padding: 0.9rem 1.1rem;
}

.alert-success {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
}

.alert-danger {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  color: #9f1239;
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
}

.alert-info {
  background: linear-gradient(135deg, #ecfeff, #cffafe);
  color: #155e75;
}

/* Page titles */
h4 {
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  color: var(--dark);
}

h4 i {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Login */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(99, 102, 241, 0.45), transparent),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(236, 72, 153, 0.35), transparent),
    linear-gradient(145deg, #4f46e5 0%, #7c3aed 40%, #db2777 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.login-container { width: 100%; max-width: 440px; }

.login-card {
  background: rgba(255, 255, 255, 0.97);
  padding: 44px 40px;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  text-align: center;
  backdrop-filter: blur(20px);
}

.login-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
}

.login-logo {
  max-width: 112px;
  max-height: 112px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  background: #fff;
  padding: 12px;
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
}

.login-icon {
  width: 80px; height: 80px;
  margin: 0 auto;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.4rem;
  animation: float 3s ease-in-out infinite;
  box-shadow: var(--shadow-glow);
}

.login-card h2 {
  font-weight: 800;
  margin-bottom: 4px;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: var(--dark);
}

.login-card .form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}

.login-footer-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  margin-top: 22px;
  margin-bottom: 0;
  font-weight: 500;
  line-height: 1.6;
}

.login-footer-text a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-footer-text a:hover {
  color: #e0e7ff;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp .5s cubic-bezier(.22, 1, .36, 1) both; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}


.time-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: none;
  padding: 0.25em 0.55em;
  border-radius: 6px;
}

/* Search box */
.search-box {
  position: relative;
  min-width: 220px;
  flex: 1;
  max-width: 320px;
}
.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.search-box .form-control {
  padding-left: 40px;
  min-height: 42px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--border);
}
.search-box .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
@media (max-width: 576px) {
  .search-box { max-width: none; min-width: 0; width: 100%; }
}

/* ========== MOBILE ========== */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-105%);
    width: min(300px, 86vw);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.3);
  }

  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .btn-toggle { display: inline-flex; }

  .content-area {
    padding: 16px 14px;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 18px);
  }

  .app-footer {
    display: flex;
    padding: 10px 12px calc(10px + var(--bottom-nav-h) + var(--safe-bottom));
    font-size: 0.72rem;
    background: transparent;
    border-top: none;
  }
  .bottom-nav { display: flex; }

  .stat-card {
    padding: 18px;
    gap: 14px;
    min-height: 88px;
  }

  .stat-icon { width: 48px; height: 48px; font-size: 1.35rem; }
  .stat-value { font-size: 1.45rem; }

  .user-info .badge { display: none; }
  .user-info span { max-width: 90px; font-size: 0.8rem; }
  .user-info { padding: 4px 10px 4px 6px; }

  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar h5 { font-size: 0.95rem; }

  form.card.p-4 { padding: 1.15rem !important; }

  .table td, .table th { padding: 0.65rem 0.55rem; }

  .btn-sm {
    min-height: 36px;
    min-width: 36px;
  }

  .report-card { padding: 22px 14px; min-height: 140px; }
  .report-card i { font-size: 2rem; }
}

@media (max-width: 576px) {
  .content-area { padding-left: 12px; padding-right: 12px; }
  .stat-label { font-size: 0.75rem; }
  h4 { font-size: 1.1rem !important; }
  .login-card { padding: 32px 22px; border-radius: 20px; }
}

@media (max-width: 992px) and (orientation: landscape) {
  .bottom-nav {
    height: calc(52px + var(--safe-bottom));
  }
  .bottom-nav a {
    min-height: 52px;
    flex-direction: row;
    gap: 6px;
    font-size: 0.72rem;
  }
  .bottom-nav a i { font-size: 1.15rem; }
  .content-area {
    padding-bottom: calc(52px + var(--safe-bottom) + 12px);
  }
}

/* ========== DESKTOP / LAPTOP ========== */
@media (min-width: 993px) {
  :root {
    --sidebar-w: 268px;
    --topbar-h: 64px;
  }

  .bottom-nav { display: none !important; }
  .sidebar-overlay { display: none !important; }
  .btn-toggle { display: none !important; }

  .sidebar {
    transform: none !important;
    width: var(--sidebar-w) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
  }

  .main-content {
    margin-left: var(--sidebar-w) !important;
    width: calc(100% - var(--sidebar-w)) !important;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .topbar {
    padding: 0 32px;
    height: var(--topbar-h);
  }

  .topbar h5 { max-width: none; font-size: 1.08rem; }
  .user-info span { max-width: 200px; }

  .content-area {
    flex: 1;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 28px 32px 36px !important;
  }

  .app-footer { display: block; flex-shrink: 0; }

  .card { width: 100%; }

  .card-body:has(.table-responsive) { padding: 0; }
  .card-body .table-responsive { margin: 0; }
  .card-body .table { margin-bottom: 0; }
  .card-body:not(:has(.table-responsive)) { padding: 1.35rem 1.5rem; }

  form.card { max-width: 960px; }
  form.card.p-4 { padding: 1.85rem !important; }

  .stat-card { padding: 24px 28px; min-height: 112px; }
  .stat-value { font-size: 2rem; }
  .stat-icon { width: 58px; height: 58px; font-size: 1.65rem; }

  .login-card { padding: 48px 44px; }
  .login-logo { max-width: 128px; max-height: 128px; }
}

@media (min-width: 993px) and (max-width: 1366px) {
  :root { --sidebar-w: 248px; }
  .content-area { padding: 22px 24px 28px !important; }
  .sidebar-nav .nav-link-item,
  .sidebar-nav .nav-group-toggle { padding: 9px 12px; font-size: 0.85rem; min-height: 38px; }
  .stat-card { padding: 20px; min-height: 96px; }
  .stat-value { font-size: 1.7rem; }
}

@media (min-width: 1600px) {
  :root { --sidebar-w: 280px; }
  .content-area { padding: 32px 40px 40px !important; }
  .stat-value { font-size: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
