/* ============================================================
   INVENTORY SYSTEM — GLASSMORPHISM CSS
   Author: Full-Stack Build
   ============================================================ */

/* ——— Google Fonts ——— */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ——— CSS Variables ——— */
:root {
  /* Core Colors */
  --color-primary:       #6366f1;
  --color-primary-dark:  #4f46e5;
  --color-secondary:     #8b5cf6;
  --color-accent:        #06b6d4;

  /* Status Colors */
  --color-success:       #10b981;
  --color-warning:       #f59e0b;
  --color-danger:        #ef4444;
  --color-info:          #3b82f6;

  /* Background */
  --bg-base:             #0d0f1a;
  --bg-card:             rgba(255,255,255,0.06);
  --bg-card-hover:       rgba(255,255,255,0.09);
  --bg-sidebar:          rgba(13,15,26,0.95);
  --bg-topbar:           rgba(13,15,26,0.8);
  --bg-input:            rgba(255,255,255,0.06);
  --bg-input-focus:      rgba(255,255,255,0.1);

  /* Glass Effect */
  --glass-blur:          blur(20px);
  --glass-border:        rgba(255,255,255,0.12);
  --glass-shadow:        0 8px 32px rgba(0,0,0,0.4);

  /* Text */
  --text-primary:        #f1f5f9;
  --text-secondary:      #94a3b8;
  --text-muted:          #64748b;

  /* Sizing */
  --sidebar-width:       260px;
  --topbar-height:       64px;
  --radius-sm:           8px;
  --radius-md:           12px;
  --radius-lg:           16px;
  --radius-xl:           24px;

  /* Transitions */
  --transition:          0.2s ease;
  --transition-slow:     0.35s ease;
}

body.light-theme {
  --bg-base:             #f8fafc;
  --bg-card:             rgba(255,255,255,0.7);
  --bg-card-hover:       rgba(255,255,255,0.9);
  --bg-sidebar:          rgba(255,255,255,0.95);
  --bg-topbar:           rgba(255,255,255,0.8);
  --bg-input:            rgba(255,255,255,0.8);
  --bg-input-focus:      #ffffff;

  --glass-border:        rgba(0,0,0,0.08);
  --glass-shadow:        0 8px 32px rgba(0,0,0,0.05);

  --text-primary:        #0f172a;
  --text-secondary:      #334155;
  --text-muted:          #64748b;
}

body.light-theme .app-body, 
body.light-theme.app-body {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
}

body.light-theme .login-body,
body.light-theme.login-body {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
}

body.light-theme .nav-item:hover {
  background: rgba(0,0,0,0.04);
}

body.light-theme .data-table th {
  background: rgba(0,0,0,0.02);
}

body.light-theme .data-table tbody tr:hover {
  background: rgba(0,0,0,0.02);
}

body.light-theme .data-table td {
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

body.light-theme .topbar-icon-btn {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
  color: var(--text-secondary);
}
body.light-theme .topbar-icon-btn:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text-primary);
}

body.light-theme .topbar-user-menu {
  background: rgba(0,0,0,0.02);
}
body.light-theme .topbar-user-menu:hover {
  background: rgba(0,0,0,0.06);
}

body.light-theme .filter-select option {
  background: #ffffff;
}

body.light-theme .user-dropdown {
  background: rgba(255,255,255,0.98);
}

body.light-theme .dropdown-item:hover {
  background: rgba(0,0,0,0.04);
}

/* ——— Reset & Base ——— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ——— Animated Background ——— */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d0f1a 0%, #1a1033 50%, #0d1a2a 100%);
  position: relative;
  overflow: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  animation: floatOrb 12s ease-in-out infinite alternate;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -150px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  bottom: -120px; right: -80px;
  animation-delay: -4s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  animation-delay: -8s;
}
@keyframes floatOrb {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(30px,30px) scale(1.1); }
}

/* ——— Glass Card ——— */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

/* ——— Login Page ——— */
.login-container {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
  z-index: 1;
}

.login-card {
  padding: 2.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo {
  margin-bottom: 1rem;
  display: inline-block;
  filter: drop-shadow(0 0 20px rgba(99,102,241,0.5));
}
.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.login-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 1.5rem;
}

/* ——— App Layout ——— */
.app-body {
  background: linear-gradient(135deg, #0d0f1a 0%, #1a1033 50%, #0d1a2a 100%);
  min-height: 100vh;
}

/* ——— SIDEBAR ——— */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}
.sidebar-brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}
.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.nav-section { margin-bottom: 1.5rem; }
.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15));
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
}
.nav-icon { opacity: 0.8; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(0.95); }
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 0.8rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em;
}
.badge-role-admin { color: #a5b4fc; }
.badge-role-staff { color: #7dd3fc; }

.btn-logout {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  color: #f87171;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.btn-logout:hover {
  background: rgba(239,68,68,0.2);
  color: #fca5a5;
}

/* ——— TOPBAR ——— */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.topbar-menu-btn {
  background: none; border: none;
  color: var(--text-secondary); cursor: pointer;
  padding: 0.4rem; border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: none;
}
.topbar-menu-btn:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }

.breadcrumb {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--text-muted);
}
.breadcrumb a:hover { color: var(--text-primary); }
.bc-sep { color: var(--text-muted); }
.bc-current { color: var(--text-secondary); font-weight: 500; }

.topbar-alert {
  position: relative;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  color: #f87171;
  display: flex; align-items: center;
  transition: all var(--transition);
  cursor: pointer;
}
.topbar-alert:hover { background: rgba(239,68,68,0.2); }
.topbar-alert-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--color-danger);
  color: #fff; font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.topbar-icon-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.topbar-icon-btn:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.topbar-user-menu {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  border-radius: 99px;
  background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.topbar-user-menu:hover { 
  background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}
.topbar-username {
  font-weight: 600; font-size: 0.9rem; letter-spacing: 0.02em; color: var(--text-primary);
}

.user-dropdown {
  position: absolute; top: calc(100% + 0.5rem); right: 0;
  min-width: 180px;
  background: rgba(20,22,36,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  display: none; z-index: 200;
}
.user-dropdown.show { display: block; animation: dropIn 0.2s ease; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-header { padding: 0.875rem 1rem; }
.dropdown-name { font-size: 0.85rem; font-weight: 600; }
.dropdown-role { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
.dropdown-divider { height: 1px; background: var(--glass-border); }
.dropdown-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.825rem;
  transition: all var(--transition);
  cursor: pointer;
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); }
.dropdown-item.danger { color: #f87171; }

/* ——— MAIN CONTENT ——— */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrapper {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1400px;
  width: 100%;
}

/* ——— PAGE HEADER ——— */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.15rem; }

.badge-date {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.page-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ——— STATS GRID ——— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.stats-grid-3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.stat-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, currentColor, transparent);
  opacity: 0.04;
  border-radius: inherit;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }

.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 1.75rem; font-weight: 800; margin-top: 0.1rem; line-height: 1; }

/* Stat card color themes */
.stat-blue .stat-icon  { background: rgba(59,130,246,0.15); color: #60a5fa; }
.stat-blue .stat-value { color: #93c5fd; }
.stat-purple .stat-icon { background: rgba(139,92,246,0.15); color: #a78bfa; }
.stat-purple .stat-value { color: #c4b5fd; }
.stat-orange .stat-icon { background: rgba(245,158,11,0.15); color: #fbbf24; }
.stat-orange .stat-value { color: #fcd34d; }
.stat-red .stat-icon   { background: rgba(239,68,68,0.15); color: #f87171; }
.stat-red .stat-value  { color: #fca5a5; }
.stat-green .stat-icon { background: rgba(16,185,129,0.15); color: #34d399; }
.stat-green .stat-value { color: #6ee7b7; }
.stat-teal .stat-icon  { background: rgba(6,182,212,0.15); color: #22d3ee; }
.stat-teal .stat-value { color: #67e8f9; }
.stat-indigo .stat-icon { background: rgba(99,102,241,0.15); color: #818cf8; }
.stat-indigo .stat-value { color: #a5b4fc; }

.stat-pulse {
  position: absolute; top: 1rem; right: 1rem;
  width: 10px; height: 10px;
  background: var(--color-danger);
  border-radius: 50%;
  animation: pulseDot 1.5s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* ——— DASHBOARD GRID ——— */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.dashboard-panel { padding: 0; }

/* ——— PANEL HEADER ——— */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}
.panel-title {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.9rem; font-weight: 700;
}
.panel-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.panel-icon.red { background: rgba(239,68,68,0.15); color: #f87171; }
.panel-icon.blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
.panel-icon.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }

.panel-body { padding: 1rem; }
.btn-link { font-size: 0.78rem; color: var(--color-primary); font-weight: 500; transition: color var(--transition); }
.btn-link:hover { color: #818cf8; }

/* ——— FILTER BAR (STOCK LOGS) ——— */
.filter-bar {
  margin-bottom: 1.25rem;
  padding: 1rem;
}
.filter-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.filter-search {
  flex: 1;
  min-width: 250px;
  position: relative;
}
.filter-search svg {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.filter-input, .filter-select {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
  height: 38px;
}
.filter-select { cursor: pointer; }
.filter-select option { background: #1a1033; }
.filter-search .filter-input {
  width: 100%;
  padding-left: 2.2rem;
}
.filter-input:focus, .filter-select:focus {
  border-color: var(--color-primary);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Modern Date Input Styling */
.filter-date-group {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 0 0.5rem;
  height: 38px;
  transition: all 0.2s ease;
}
.filter-date-group:focus-within {
  border-color: var(--color-primary);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.filter-date-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  padding: 0.2rem;
  color-scheme: dark;
  cursor: pointer;
}
.date-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0 0.4rem;
}
.filter-date-input::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s;
}
.filter-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ——— LOW STOCK LIST ——— */
.low-stock-list { display: flex; flex-direction: column; gap: 0.5rem; }
.low-stock-item {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background var(--transition);
}
.low-stock-item:hover { background: rgba(255,255,255,0.06); }
.low-stock-item.out-of-stock { border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.05); }
.ls-name { font-size: 0.85rem; font-weight: 600; }
.ls-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }
.low-stock-qty { text-align: right; }
.qty-badge {
  font-size: 0.8rem; font-weight: 700; padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}
.qty-low  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.qty-zero { background: rgba(239,68,68,0.15); color: #f87171; }
.qty-min  { font-size: 0.7rem; color: var(--text-muted); display: block; margin-top: 0.1rem; }

/* ——— ACTIVITY LIST ——— */
.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.activity-item:hover { background: rgba(255,255,255,0.04); }

.activity-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 0.1rem;
}
.icon-in  { background: rgba(16,185,129,0.15); color: #34d399; }
.icon-out { background: rgba(239,68,68,0.15); color: #f87171; }
.icon-adj { background: rgba(59,130,246,0.15); color: #60a5fa; }

.activity-desc { font-size: 0.8rem; line-height: 1.4; }
.activity-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
.activity-ref {
  font-size: 0.7rem; color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 0.15rem 0.4rem; border-radius: 4px;
  white-space: nowrap; margin-left: auto;
}

/* ——— STATUS SUMMARY ——— */
.status-summary-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; padding: 1rem;
}
.status-item {
  text-align: center; padding: 1rem;
  border-radius: var(--radius-md);
}
.status-item.available  { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); }
.status-item.reserved   { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); }
.status-item.maintenance { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); }

.status-count { display: block; font-size: 2rem; font-weight: 800; }
.status-item.available  .status-count { color: #34d399; }
.status-item.reserved   .status-count { color: #fbbf24; }
.status-item.maintenance .status-count { color: #f87171; }
.status-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-top: 0.25rem; display: block; }

/* ——— FILTER BAR ——— */
.filter-bar { padding: 1rem 1.25rem; }
.filter-form {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 0.6rem;
}
.filter-search {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-input); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 0 0.75rem;
  flex: 1; min-width: 180px;
  color: var(--text-muted);
}
.filter-input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.85rem;
  padding: 0.5rem 0; width: 100%;
  font-family: inherit;
}
.filter-input::placeholder { color: var(--text-muted); }
input[type="date"].filter-input { padding: 0.5rem 0; }

.filter-select {
  background: var(--bg-input); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem;
  color: var(--text-primary); font-size: 0.85rem;
  font-family: inherit; cursor: pointer; outline: none;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--color-primary); }
.filter-select option { background: #1a1033; }

.filter-active-tag {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--color-warning);
  margin-top: 0.5rem;
}

/* ——— DATA TABLE ——— */
.table-card { padding: 0; overflow: hidden; }
.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.data-table th {
  background: rgba(255,255,255,0.04);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--glass-border);
}
.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr.row-low-stock { background: rgba(239,68,68,0.04); }
.data-table tr.row-low-stock:hover { background: rgba(239,68,68,0.07); }

.td-num { color: var(--text-muted); font-size: 0.75rem; width: 40px; }
.td-qty { white-space: nowrap; }
.td-meta { min-width: 130px; }
.meta-row { font-size: 0.8rem; line-height: 1.6; }
.meta-label { color: var(--text-muted); font-size: 0.72rem; }
.td-actions { white-space: nowrap; }
.td-date { white-space: nowrap; }

.product-name-cell { display: flex; align-items: center; gap: 0.4rem; }
.low-stock-indicator { color: var(--color-warning); font-size: 0.9rem; }
.product-name { font-weight: 600; font-size: 0.875rem; }
.product-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

.brand-pill {
  display: inline-block;
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.project-tag {
  display: inline-block;
  background: rgba(6,182,212,0.12);
  color: #22d3ee;
  border: 1px solid rgba(6,182,212,0.2);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
}
.project-tag-sm {
  display: inline-block;
  background: rgba(6,182,212,0.1);
  color: #22d3ee;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-top: 0.2rem;
}

/* Status badges */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  white-space: nowrap;
}
.status-available  { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.status-reserved   { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.status-maintenance { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

/* Role badges */
.role-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.role-admin { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }
.role-staff { background: rgba(14,165,233,0.15); color: #38bdf8; border: 1px solid rgba(14,165,233,0.25); }

/* ——— QUANTITY CONTROL ——— */
.qty-control {
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 6px; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
  font-size: 0.9rem; font-weight: 700;
}
.qty-in  { background: rgba(16,185,129,0.15); color: #34d399; }
.qty-out { background: rgba(239,68,68,0.15); color: #f87171; }
.qty-in:hover  { background: rgba(16,185,129,0.3); }
.qty-out:hover { background: rgba(239,68,68,0.3); }

.qty-display {
  min-width: 36px; text-align: center;
  font-weight: 700; font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  transition: all 0.3s ease;
}
.qty-display.qty-low { color: #fbbf24; background: rgba(245,158,11,0.1); }
.qty-display.qty-updated {
  background: rgba(16,185,129,0.2);
  color: #34d399;
  transform: scale(1.15);
}
.qty-unit  { font-size: 0.72rem; color: var(--text-muted); }
.qty-min-warn { display: block; font-size: 0.68rem; color: var(--color-warning); margin-top: 0.15rem; }

/* ——— ACTION BUTTONS ——— */
.btn-icon {
  width: 32px; height: 32px;
  border: none; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.btn-icon-blue   { background: rgba(59,130,246,0.1); color: #60a5fa; }
.btn-icon-orange { background: rgba(245,158,11,0.1); color: #fbbf24; }
.btn-icon-red    { background: rgba(239,68,68,0.1); color: #f87171; }
.btn-icon-blue:hover   { background: rgba(59,130,246,0.25); }
.btn-icon-orange:hover { background: rgba(245,158,11,0.25); }
.btn-icon-red:hover    { background: rgba(239,68,68,0.25); }

/* ——— BUTTONS ——— */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.125rem; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(99,102,241,0.5); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}
.btn-danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.4); }
.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; padding: 0.75rem; }

.btn-login {
  width: 100%; justify-content: center;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* ——— FORMS ——— */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 0.4rem;
}
.required { color: var(--color-danger); margin-left: 0.15rem; }

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.form-control:focus {
  border-color: var(--color-primary);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2), inset 0 2px 4px rgba(0,0,0,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: #1a1033; }
textarea.form-control { resize: vertical; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon-wrap .form-control { padding-left: 2.5rem; }
.btn-toggle-pw {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0;
  transition: color var(--transition);
}
.btn-toggle-pw:hover { color: var(--text-primary); }

/* Toggle / Checkbox */
.toggle-label {
  display: flex; align-items: center; gap: 0.75rem;
  cursor: pointer; font-size: 0.85rem; font-weight: 500;
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-slider {
  width: 42px; height: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--glass-border);
  border-radius: 999px; position: relative;
  transition: background var(--transition);
}
.toggle-slider::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition);
}
.toggle-label input:checked + .toggle-slider { background: var(--color-primary); border-color: var(--color-primary); }
.toggle-label input:checked + .toggle-slider::after { left: calc(100% - 19px); background: #fff; }

/* ——— MODALS ——— */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 1rem;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal-sm { max-width: 420px; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}
.modal-title { font-size: 1rem; font-weight: 700; }
.danger-title { color: #f87171; }
.modal-close {
  background: rgba(255,255,255,0.07); border: none;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 1.1rem; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.14); color: var(--text-primary); }

.modal-form, .modal-body { padding: 1.25rem 1.5rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.delete-warning-icon {
  text-align: center; color: #f87171;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(239,68,68,0.3));
}
.delete-item-name {
  font-weight: 700; font-size: 1rem; color: var(--text-primary);
  text-align: center; margin: 0.5rem 0;
}

/* ——— ALERTS ——— */
.alert {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500;
}
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-danger  { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.alert-dismissible { justify-content: space-between; }
.alert-close {
  background: none; border: none; color: inherit;
  font-size: 1.25rem; cursor: pointer; padding: 0; line-height: 1;
  opacity: 0.7; transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ——— BADGES ——— */
.badge { padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.badge-danger { background: var(--color-danger); color: #fff; }

/* ——— EMPTY STATE ——— */
.empty-state {
  text-align: center; padding: 2.5rem;
  color: var(--text-muted);
}
.empty-state svg { opacity: 0.3; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.875rem; }

/* ——— PAGINATION ——— */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.35rem; padding: 1rem;
  border-top: 1px solid var(--glass-border);
}
.page-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  font-size: 0.8rem; color: var(--text-secondary);
  transition: all var(--transition);
}
/* ——— MODERN QTY WRAPPER ——— */
.qty-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 44px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.qty-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2), inset 0 2px 4px rgba(0,0,0,0.1);
}
.qty-btn {
  width: 44px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.qty-btn svg {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.qty-btn:active svg {
  transform: scale(0.85);
}
.qty-wrapper input[type="number"] {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
  -moz-appearance: textfield;
  width: 100%;
}
.qty-wrapper input[type="number"]::-webkit-inner-spin-button, 
.qty-wrapper input[type="number"]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
.page-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ——— STOCK PAGE ——— */
.stock-grid { display: grid; grid-template-columns: 400px 1fr; gap: 1.25rem; align-items: start; }
.stock-form-card { padding: 1.25rem; }

/* ——— SEGMENTED CONTROL (Ultra Modern Tabs) ——— */
.segmented-control {
  position: relative;
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 99px;
  padding: 0.35rem;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}
.segmented-control input {
  display: none;
}
.segmented-label {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.segmented-control input:checked + .segmented-label {
  color: #fff;
}
.segmented-slider {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  width: calc(50% - 0.35rem);
  background: linear-gradient(135deg, rgba(99,102,241,0.8), rgba(139,92,246,0.8));
  border-radius: 99px;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
#tab-in:checked ~ .segmented-slider {
  transform: translateX(0);
  background: linear-gradient(135deg, rgba(16,185,129,0.8), rgba(5,150,105,0.8));
  box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
#tab-out:checked ~ .segmented-slider {
  transform: translateX(100%);
  background: linear-gradient(135deg, rgba(239,68,68,0.8), rgba(220,38,38,0.8));
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

.product-info-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  margin-bottom: 1rem;
}
.pi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.pi-item { text-align: center; }
.pi-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; display: block; letter-spacing: 0.05em; }
.pi-value { font-size: 1.1rem; font-weight: 700; display: block; margin-top: 0.2rem; }
.pi-after { color: #a5b4fc; }
.pi-after-neg { color: #f87171; }


.qty-input-center { 
    text-align: center; 
    font-weight: 700; 
    font-size: 1.15rem; 
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    color: var(--text-primary);
    transition: all 0.3s ease;
}
.qty-input-center:focus {
    background: rgba(255,255,255,0.05);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2), inset 0 2px 4px rgba(0,0,0,0.2);
}
.qty-input-center::-webkit-outer-spin-button,
.qty-input-center::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-input-center[type=number] {
    -moz-appearance: textfield;
}

/* Transaction list */
.tx-list { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; max-height: 600px; overflow-y: auto; }
.tx-item {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  transition: background var(--transition);
}
.tx-item:hover { background: rgba(255,255,255,0.06); }
.tx-type-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.05em;
  flex-shrink: 0;
}
.type-in  { background: rgba(16,185,129,0.15); color: #34d399; }
.type-out { background: rgba(239,68,68,0.15); color: #f87171; }
.type-adj { background: rgba(59,130,246,0.15); color: #60a5fa; }

.tx-info { flex: 1; min-width: 0; }
.tx-product { font-size: 0.825rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }
.tx-note { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; font-style: italic; }

.tx-qty-change { text-align: right; flex-shrink: 0; }
.tx-qty { font-weight: 700; font-size: 0.875rem; display: block; }
.qty-in { color: #34d399; }
.qty-out-txt { color: #f87171; }
.tx-balance { font-size: 0.7rem; color: var(--text-muted); display: block; margin-top: 0.1rem; }

/* Log page table */
.log-type-badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700;
}
.type-in  .log-type-badge, .log-type-badge.type-in  { background: rgba(16,185,129,0.15); color: #34d399; }
.type-out .log-type-badge, .log-type-badge.type-out { background: rgba(239,68,68,0.15); color: #f87171; }
.type-adjustment .log-type-badge, .log-type-badge.type-adjustment { background: rgba(59,130,246,0.15); color: #60a5fa; }

.td-qty-log { font-weight: 700; }
.td-balance { display: flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.balance-before { color: var(--text-muted); }
.balance-after  { color: var(--color-primary); font-weight: 700; }
.balance-unit   { font-size: 0.72rem; color: var(--text-muted); }
.date-main { font-size: 0.8rem; font-weight: 600; }
.date-time { font-size: 0.7rem; color: var(--text-muted); }
.note-text { font-size: 0.8rem; }
.td-user, .user-cell { display: flex; align-items: center; gap: 0.5rem; }
.user-avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 0.8rem; font-weight: 600; }
.user-role-sm { font-size: 0.7rem; color: var(--text-muted); }
.td-desc { max-width: 200px; }

/* ——— BRANDS GRID ——— */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.brand-card {
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all var(--transition);
}
.brand-card:hover { transform: translateY(-2px); }
.brand-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2));
  border: 1px solid rgba(99,102,241,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 800; color: #a5b4fc;
  flex-shrink: 0;
}
.brand-info { flex: 1; min-width: 0; }
.brand-name { font-size: 0.9rem; font-weight: 700; }
.brand-count { display: flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.brand-actions { display: flex; gap: 0.35rem; }

/* ——— UTILITIES ——— */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.small { font-size: 0.8rem; }

code {
  background: rgba(255,255,255,0.07);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #a5b4fc;
  font-family: 'Courier New', monospace;
}

.count-link { color: var(--color-accent); font-size: 0.825rem; font-weight: 600; }
.count-link:hover { color: #67e8f9; }

/* ——— TOAST ——— */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(20,22,36,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  font-size: 0.875rem; font-weight: 500;
  animation: slideInRight 0.3s ease;
  min-width: 280px; max-width: 380px;
}
.toast.success { border-left: 3px solid #34d399; }
.toast.error   { border-left: 3px solid #f87171; }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ——— SIDEBAR OVERLAY (mobile) ——— */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 99;
}

/* ——— CUSTOM COMBO BOX ——— */
.custom-combo {
    position: relative;
    width: 100%;
}
.combo-input {
    padding-right: 30px; 
}
.combo-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    cursor: pointer;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}
.combo-arrow:hover {
    color: var(--text-primary);
}
.custom-combo.open .combo-arrow {
    transform: translateY(-50%) rotate(180deg);
}
.combo-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 0.3rem;
}
.combo-list.show {
    display: flex;
    animation: dropdownFade 0.2s ease;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.combo-item {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}
.combo-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    padding-left: 1.1rem;
}
.combo-list::-webkit-scrollbar {
    width: 6px;
}
.combo-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* ——— RESPONSIVE ——— */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .stock-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(0,0,0,0.5);
  }
  .sidebar-overlay.show { display: block; }
  .sidebar-close-btn { display: flex; }
  .topbar-menu-btn { display: flex; }

  .main-content { margin-left: 0; }
  .page-wrapper { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid-2 { grid-template-columns: 1fr; }
  .topbar-username { display: none; }
  .brands-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .status-summary-grid { grid-template-columns: repeat(3,1fr); }
  .pi-row { grid-template-columns: repeat(2,1fr); }
  .login-card { padding: 1.75rem 1.5rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .modal { margin: 0.5rem; }
  .filter-form { gap: 0.4rem; }
  .tx-type-tabs { grid-template-columns: 1fr; }
}

/* ——— NUMBER SPINNER HIDE (GLOBAL) ——— */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ——— QTY WRAPPER WITH +/- BUTTONS ——— */
.qty-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}
.qty-wrapper .form-control {
    text-align: center;
    padding-left: 40px;
    padding-right: 40px;
}
.qty-btn {
    position: absolute;
    top: 2px;
    bottom: 2px;
    width: 36px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-radius: calc(var(--radius-md) - 2px);
}
.qty-btn:hover {
    background: rgba(255,255,255,0.1);
}
.minus-btn { left: 2px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.plus-btn { right: 2px; border-top-left-radius: 0; border-bottom-left-radius: 0; }

.cursor-pointer { cursor: pointer !important; }
