/* ========================================
   Hoàng Vinh IOT - Design System
   Mobile-first | Blue & Orange Theme
   ======================================== */

:root {
  /* Primary palette - True Blue (not purple) */
  --primary-900: #0a1628;
  --primary-800: #0e2240;
  --primary-700: #0f3460;
  --primary-600: #1155a8;
  --primary-500: #1a73e8;
  --primary-400: #4d94ef;
  --primary-300: #82b4f4;
  --primary-200: #b8d4fa;
  --primary-100: #deeafb;
  --primary-50: #eef5fd;
  
  /* Accent - Orange */
  --accent-600: #d4760a;
  --accent-500: #f59e0b;
  --accent-400: #fbbf24;
  --accent-300: #fcd34d;
  --accent-100: #fef3c7;
  
  /* Success */
  --success-500: #10b981;
  --success-100: #d1fae5;
  --success-700: #047857;
  
  /* Danger */
  --danger-500: #ef4444;
  --danger-100: #fee2e2;
  --danger-200: #fecaca;
  --danger-700: #b91c1c;
  
  /* Warning */
  --warning-500: #f59e0b;
  --warning-100: #fef3c7;
  
  /* Neutral */
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  
  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);
  
  /* Layout */
  --top-bar-height: 56px;
  --bottom-nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  
  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ======== RESET & BASE ======== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: #e8edf5;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(30,77,143,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(26,115,232,0.06) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--gray-800);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }
a { color: var(--primary-500); text-decoration: none; }
input, select, textarea, button { font-family: var(--font); font-size: inherit; }

/* ======== LOADING SCREEN ======== */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(160deg, #0a0f1e 0%, #0d1b2a 40%, #0f2952 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
.loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-logo { text-align: center; color: var(--white); }
.logo-icon-large {
  width: 80px; height: 80px; border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.15); display: flex; align-items: center;
  justify-content: center; margin: 0 auto var(--sp-4);
  backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2);
}
.logo-icon-large .material-icons-round { font-size: 40px; color: var(--accent-400); }
.loading-logo h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.loading-logo p { font-size: 0.85rem; opacity: 0.7; margin-bottom: var(--sp-6); }
.loading-bar {
  width: 160px; height: 4px; background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full); margin: 0 auto; overflow: hidden;
}
.loading-bar-inner {
  height: 100%; width: 30%; background: var(--accent-400);
  border-radius: var(--radius-full);
  animation: loading-slide 1.2s ease-in-out infinite;
}
@keyframes loading-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(500%); }
}

/* ======== LOGIN ======== */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(160deg, #0a0f1e 0%, #0d1b2a 40%, #0f2952 100%);
  display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
}
.login-container {
  width: 100%; max-width: 380px;
  background: var(--white); border-radius: var(--radius-xl);
  padding: var(--sp-8); box-shadow: var(--shadow-xl);
  animation: slideUp 0.5s ease;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.login-header { text-align: center; margin-bottom: var(--sp-6); }
.login-logo {
  width: 64px; height: 64px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-4); box-shadow: 0 4px 15px rgba(26,115,232,0.3);
}
.login-logo .material-icons-round { font-size: 32px; color: var(--white); }
.login-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--primary-800); }
.login-header p { font-size: 0.85rem; color: var(--gray-500); }
.login-form .form-group { margin-bottom: var(--sp-4); }
.input-icon {
  position: relative; display: flex; align-items: center;
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md); transition: all 0.2s;
}
.input-icon:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
  background: var(--white);
}
.input-icon .material-icons-round {
  padding: 0 var(--sp-3); color: var(--gray-400); font-size: 20px;
}
.input-icon input {
  flex: 1; padding: 12px var(--sp-3) 12px 0;
  border: none; outline: none; background: transparent;
  font-size: 0.95rem; color: var(--gray-800);
}
.form-error {
  background: var(--danger-100); color: var(--danger-700);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
  font-size: 0.85rem; margin-bottom: var(--sp-3);
}
.login-footer { text-align: center; margin-top: var(--sp-4); }
.login-footer p { font-size: 0.75rem; color: var(--gray-400); }
.login-footer strong { color: var(--primary-500); }

/* ======== TOP BAR — Navy Gradient ======== */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--top-bar-height); padding: 0 var(--sp-4);
  background: linear-gradient(135deg, #0e2240 0%, #1155a8 60%, #1a73e8 100%);
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 16px rgba(17,85,168,0.45);
}
.top-bar-left { display: flex; align-items: center; gap: var(--sp-3); }
.logo-small {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: all 0.2s;
}
.logo-small:hover { background: rgba(255,255,255,0.25); }
.logo-small:active { opacity: 0.7; }
.logo-small .material-icons-round { font-size: 22px; color: var(--accent-400); }
.top-bar-title h2 {
  font-size: 1.05rem; font-weight: 600; color: #ffffff;
  letter-spacing: 0.01em;
}
.top-bar-right { display: flex; gap: var(--sp-2); }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.12); color: #ffffff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.2s, transform 0.2s; position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,0.22); }
.icon-btn:active { background: rgba(255,255,255,0.28); transform: scale(0.93); }
.icon-btn .material-icons-round { font-size: 22px; }
.badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  background: var(--danger-500); color: var(--white); font-size: 0.65rem;
  font-weight: 700; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ======== BOTTOM NAV — White ======== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex; align-items: flex-start; justify-content: space-around;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 8px 0; gap: 2px;
  border: none; background: none; cursor: pointer;
  color: var(--gray-400); transition: all 0.2s; height: var(--bottom-nav-height);
}
.nav-item .material-icons-round { font-size: 24px; transition: transform 0.2s ease, color 0.2s ease; }
.nav-item span:last-child { font-size: 0.65rem; font-weight: 500; }
.nav-item:hover { color: var(--primary-500); }
.nav-item:hover .material-icons-round { transform: scale(1.15) translateY(-1px); color: var(--primary-400); }
.nav-item.active { color: var(--accent-500); }
.nav-item.active .material-icons-round { color: var(--accent-500); transform: scale(1.1); }

/* ======== PAGE CONTENT ======== */
.page-content {
  margin-top: var(--top-bar-height);
  margin-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  min-height: calc(100vh - var(--top-bar-height) - var(--bottom-nav-height) - var(--safe-bottom));
  min-height: calc(100dvh - var(--top-bar-height) - var(--bottom-nav-height) - var(--safe-bottom));
  padding: var(--sp-4);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======== CARDS ======== */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
  box-shadow: 0 2px 8px rgba(13,27,42,0.08), 0 1px 2px rgba(13,27,42,0.04);
  border: 1px solid rgba(30,77,143,0.08);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { box-shadow: 0 6px 24px rgba(13,27,42,0.13), 0 2px 6px rgba(30,77,143,0.08); transform: translateY(-2px); }
.card:active { box-shadow: 0 2px 8px rgba(13,27,42,0.08); transform: translateY(0) scale(0.99); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.card-header h3 { font-size: 1rem; font-weight: 600; color: var(--gray-800); }
.card-header .card-badge {
  font-size: 0.7rem; font-weight: 600; padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* ======== STAT CARDS (Dashboard) ======== */
.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.stat-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: var(--sp-4); box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  cursor: pointer;
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.stat-card:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-sm); }
.stat-card.highlight {
  background: linear-gradient(135deg, #0e2240 0%, #1a73e8 100%);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(26,115,232,0.35);
}
.stat-card.highlight .stat-label { color: rgba(255,255,255,0.7); }
.stat-card.highlight .stat-value { color: var(--white); }
.stat-card.highlight .stat-icon { background: rgba(255,255,255,0.2); color: var(--white); }
.stat-card.accent {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-400));
  border: none; color: var(--white);
}
.stat-card.accent .stat-label { color: rgba(255,255,255,0.8); }
.stat-card.accent .stat-value { color: var(--white); }
.stat-card.accent .stat-icon { background: rgba(255,255,255,0.2); color: var(--white); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.stat-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: var(--primary-50); color: var(--primary-500);
  display: flex; align-items: center; justify-content: center;
}
.stat-icon .material-icons-round { font-size: 20px; }
.stat-label { font-size: 0.75rem; color: var(--gray-500); font-weight: 500; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--gray-800); margin-top: 2px; }
.stat-sub { font-size: 0.7rem; color: var(--gray-400); margin-top: 2px; }

/* ======== BUTTONS ======== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 10px 20px; border: none; border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: all 0.2s ease; white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background 0.2s;
  border-radius: inherit;
}
.btn:hover::after { background: rgba(255,255,255,0.1); }
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: var(--white); box-shadow: 0 2px 8px rgba(26,115,232,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(26,115,232,0.45); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.96); box-shadow: 0 2px 8px rgba(26,115,232,0.3); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-400));
  color: var(--white); box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.btn-accent:hover { box-shadow: 0 6px 20px rgba(245,158,11,0.45); transform: translateY(-1px); }
.btn-accent:active { transform: translateY(0) scale(0.96); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--gray-300);
  color: var(--gray-600);
}
.btn-outline:hover { border-color: var(--primary-500); color: var(--primary-500); background: var(--primary-50); }
.btn-danger { background: var(--danger-500); color: var(--white); }
.btn-danger:hover { background: var(--danger-700); box-shadow: 0 4px 12px rgba(239,68,68,0.4); transform: translateY(-1px); }
.btn-danger:active { transform: translateY(0) scale(0.96); }
.btn-success { background: var(--success-500); color: var(--white); }
.btn-success:hover { background: var(--success-700); box-shadow: 0 4px 12px rgba(16,185,129,0.4); transform: translateY(-1px); }
.btn-success:active { transform: translateY(0) scale(0.96); }
.btn-small { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-fab {
  position: fixed; bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  right: 16px; width: 52px; height: 52px; border-radius: var(--radius-full);
  z-index: 40; padding: 0;
}
.btn-fab .material-icons-round { font-size: 26px; }

/* ======== FORMS ======== */
.form-section { margin-bottom: var(--sp-5); }
.form-section-title {
  font-size: 0.85rem; font-weight: 600; color: var(--primary-600);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: var(--sp-3); display: flex; align-items: center; gap: var(--sp-2);
}
.form-section-title .material-icons-round { font-size: 18px; }
.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 500;
  color: var(--gray-600); margin-bottom: var(--sp-1);
}
.form-label.required::after { content: ' *'; color: var(--danger-500); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px var(--sp-3);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  font-size: 0.9rem; background: var(--white); color: var(--gray-800);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}
.form-input.readonly { background: var(--gray-50); color: var(--gray-500); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-hint { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.form-row { display: flex; gap: var(--sp-3); }
.form-row .form-group { flex: 1; }
.form-actions {
  display: flex; gap: var(--sp-3); padding: var(--sp-4) 0;
  position: sticky; bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  background: var(--gray-100); z-index: 5;
}

/* ======== CHIPS & TAGS ======== */
.chip-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  padding: 6px 12px; border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-600);
  transition: all 0.2s;
}
.chip.active { background: var(--primary-500); color: var(--white); border-color: var(--primary-500); }
.chip:active { transform: scale(0.95); }

/* Status badges */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 600;
}
.status-new { background: var(--primary-100); color: var(--primary-700); }
.status-in_progress { background: #dbeafe; color: #1d4ed8; }
.status-overdue { background: var(--danger-100); color: var(--danger-700); }
.status-completed { background: var(--success-100); color: var(--success-700); }
.status-cancelled { background: var(--gray-200); color: var(--gray-600); }
.status-packing { background: var(--warning-100); color: #92400e; }
.status-shipped { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: var(--success-100); color: var(--success-700); }
.status-paid { background: #d1fae5; color: #065f46; }
.status-active { background: var(--success-100); color: var(--success-700); }
.status-in_repair { background: var(--warning-100); color: #92400e; }
.status-resolved { background: #d1fae5; color: #065f46; }
.status-open { background: var(--danger-100); color: var(--danger-700); }
.status-closed { background: var(--gray-200); color: var(--gray-600); }
.status-assigned { background: #e0e7ff; color: #3730a3; }
.status-accepted { background: #dbeafe; color: #1d4ed8; }
.status-expired { background: var(--gray-200); color: var(--gray-500); }
.status-unpaid { background: var(--danger-100); color: var(--danger-700); }
.status-deposit_paid { background: var(--warning-100); color: #92400e; }
.status-fully_paid { background: #d1fae5; color: #065f46; }

/* ======== LIST ITEMS ======== */
.list-item {
  background: var(--white); border-radius: var(--radius-lg);
  padding: var(--sp-4); margin-bottom: var(--sp-3);
  box-shadow: 0 2px 8px rgba(13,27,42,0.08), 0 1px 2px rgba(13,27,42,0.04);
  border: 1px solid rgba(30,77,143,0.07);
  cursor: pointer; transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  animation: fadeIn 0.3s ease;
}
.list-item:hover { box-shadow: 0 8px 28px rgba(13,27,42,0.13), 0 2px 6px rgba(30,77,143,0.1); transform: translateY(-2px); border-color: rgba(30,77,143,0.15); }
.list-item:active { box-shadow: 0 2px 8px rgba(13,27,42,0.08); transform: translateY(0) scale(0.99); }
.list-item-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.list-item-code { font-size: 0.68rem; font-weight: 500; color: var(--gray-500); }
.list-item-name { font-size: 0.92rem; font-weight: 700; color: var(--gray-800); }
.list-item-meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  font-size: 0.8rem; color: var(--gray-500); margin-top: var(--sp-2);
}
.list-item-meta .meta-item { display: flex; align-items: center; gap: 3px; }
.list-item-meta .material-icons-round { font-size: 14px; }
.list-item-amount {
  font-size: 1rem; font-weight: 700; color: var(--primary-700);
  text-align: right;
}
.list-item-debt { color: var(--danger-500); }

/* ======== SEARCH BAR ======== */
.search-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--white); border-radius: var(--radius-lg);
  padding: 6px var(--sp-3); margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200);
}
.search-bar .material-icons-round { color: var(--gray-400); font-size: 20px; }
.search-bar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 0.9rem; padding: 6px 0;
}
.search-bar .filter-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--primary-500);
}

/* ======== TABS ======== */
.tabs {
  display: flex; gap: var(--sp-2); overflow-x: auto;
  margin-bottom: var(--sp-4); padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 16px; border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 500; white-space: nowrap;
  border: 1.5px solid var(--gray-200); background: var(--white);
  color: var(--gray-600); cursor: pointer; transition: all 0.2s;
}
.tab:hover:not(.active) { border-color: var(--primary-300); color: var(--primary-600); background: var(--primary-50); }
.tab:active { transform: scale(0.95); }
.tab.active {
  background: var(--primary-500); color: var(--white);
  border-color: var(--primary-500); box-shadow: 0 2px 8px rgba(26,115,232,0.3);
}
.tab .tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.3); font-size: 0.65rem; font-weight: 700;
  margin-left: 4px; padding: 0 4px;
}

/* ======== CHECKLIST ======== */
.checklist-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); background: var(--gray-50);
  border-radius: var(--radius-md); margin-bottom: var(--sp-2);
  transition: background 0.2s;
}
.checklist-item.completed { background: var(--success-100); }
.checklist-check {
  width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid var(--gray-300); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all 0.2s;
}
.checklist-item.completed .checklist-check {
  background: var(--success-500); border-color: var(--success-500);
}
.checklist-item.completed .checklist-check::after {
  content: '✓'; color: var(--white); font-size: 14px; font-weight: 700;
}
.checklist-text { flex: 1; font-size: 0.85rem; }
.checklist-item.completed .checklist-text { color: var(--gray-400); text-decoration: line-through; }
.checklist-photo {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px dashed var(--gray-300); display: flex; align-items: center;
  justify-content: center; cursor: pointer; flex-shrink: 0;
  overflow: hidden;
}
.checklist-photo img { width: 100%; height: 100%; object-fit: cover; }
.checklist-photo .material-icons-round { font-size: 16px; color: var(--gray-400); }

/* ======== MENU ITEMS (Shipping Module) ======== */
.menu-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.menu-item {
  display: flex; align-items: center; gap: var(--sp-4);
  background: var(--white); padding: var(--sp-4); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--gray-100);
}
.menu-item:hover { box-shadow: var(--shadow-md); transform: translateX(4px); border-color: var(--primary-100); }
.menu-item:active { box-shadow: var(--shadow-sm); transform: translateX(2px) scale(0.99); }
.menu-item-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.menu-item-icon.blue { background: var(--primary-100); color: var(--primary-600); }
.menu-item-icon.orange { background: var(--accent-100); color: var(--accent-600); }
.menu-item-icon.green { background: var(--success-100); color: var(--success-700); }
.menu-item-icon.red { background: var(--danger-100); color: var(--danger-700); }
.menu-item-icon.purple { background: #f3e8ff; color: #7c3aed; }
.menu-item-icon .material-icons-round { font-size: 24px; }
.menu-item-content { flex: 1; }
.menu-item-content h4 { font-size: 0.95rem; font-weight: 600; color: var(--gray-800); }
.menu-item-content p { font-size: 0.75rem; color: var(--gray-400); }
.menu-item-arrow { color: var(--gray-300); }

/* ======== MODAL ======== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 100; backdrop-filter: blur(4px);
  animation: overlayIn 0.25s ease;
}
.modal-overlay.closing { animation: overlayOut 0.25s ease forwards; }
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes overlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.modal-container {
  position: fixed; left: 5%; right: 5%; z-index: 101;
  top: 50%; transform: translateY(-50%);
  background: var(--white); border-radius: var(--radius-xl);
  max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  animation: slideUpModal 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding-bottom: var(--safe-bottom);
}
.modal-container.modal-fullheight {
  top: auto; bottom: 0; left: 0; right: 0; transform: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: hidden; display: flex; flex-direction: column; padding-bottom: 0; will-change: transform;
}
.modal-container.closing { animation: slideDownModal 0.25s ease forwards; }
.qt-card { transition: transform .15s ease, box-shadow .15s ease; }
.qt-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08) !important; }
@keyframes slideUpModal {
  from { transform: translateY(100%); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes slideDownModal {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}
.modal-handle {
  width: 40px; height: 4px; background: var(--gray-300);
  border-radius: var(--radius-full); margin: var(--sp-3) auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  border: none; background: var(--gray-100); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: var(--sp-4); }
.modal-body .form-actions { bottom: 0; background: var(--white); padding-bottom: var(--sp-3); }
.modal-footer {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--gray-100);
  display: flex; gap: var(--sp-3); justify-content: flex-end;
}

/* Full-screen modal for forms */
.modal-container.fullscreen {
  top: 0; left: 0; right: 0; bottom: 0; transform: none;
  border-radius: 0; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-container.fullscreen .modal-header {
  flex-shrink: 0;
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, #0e2240 0%, #1155a8 60%, #1a73e8 100%);
  border-bottom: none;
  color: var(--white);
}
.modal-container.fullscreen .modal-handle { flex-shrink: 0; }
.modal-container.fullscreen .modal-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-container.fullscreen .modal-header h3 { color: #ffffff; }
.modal-container.fullscreen .modal-close { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2); color: #ffffff; }
.modal-container.fullscreen .modal-close:hover { background: rgba(255,255,255,0.25); }

/* ======== TOAST ======== */
.toast-container {
  position: fixed; top: calc(var(--top-bar-height) + var(--sp-3));
  left: var(--sp-3); right: var(--sp-3); z-index: 200;
  display: flex; flex-direction: column; gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 500; color: var(--white);
  box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease;
  pointer-events: auto; display: flex; align-items: center; gap: var(--sp-2);
}
.toast.success { background: var(--success-700); }
.toast.error { background: var(--danger-700); }
.toast.info { background: var(--primary-700); }
@keyframes toastIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast.fade-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut {
  to { transform: translateY(-20px); opacity: 0; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ======== PROFIT/LOSS ======== */
.profit-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.profit-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-2) 0;
}
.profit-row.total {
  border-top: 2px solid var(--gray-200); margin-top: var(--sp-2);
  padding-top: var(--sp-3); font-weight: 700; font-size: 1.1rem;
}
.profit-row .label { color: var(--gray-600); }
.profit-row .value { font-weight: 600; }
.profit-row .value.positive { color: var(--success-700); }
.profit-row .value.negative { color: var(--danger-700); }

/* ======== MULTI-SELECT TAGS ======== */
.tag-input-container {
  display: flex; flex-wrap: wrap; gap: var(--sp-1); padding: 6px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  background: var(--white); min-height: 42px; cursor: text;
}
.tag-item {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-full);
  background: var(--primary-100); color: var(--primary-700);
  font-size: 0.8rem; font-weight: 500;
}
.tag-item .tag-remove {
  cursor: pointer; font-size: 14px; opacity: 0.7; background: none;
  border: none; color: var(--primary-700); padding: 0;
}

/* ======== FILE UPLOAD ======== */
.file-upload-area {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-md);
  padding: var(--sp-5); text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--gray-50);
}
.file-upload-area:hover { border-color: var(--primary-500); background: var(--primary-50); }
.file-upload-area .material-icons-round { font-size: 32px; color: var(--gray-400); }
.file-upload-area p { color: var(--gray-500); font-size: 0.85rem; margin-top: var(--sp-2); }
.file-preview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2); margin-top: var(--sp-3);
}
.file-preview {
  aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  position: relative;
}
.file-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-preview .remove-file {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border-radius: var(--radius-full); background: rgba(0,0,0,0.6);
  color: var(--white); border: none; display: flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: 12px;
}

/* ======== DETAIL PAGE ======== */
.detail-back {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 0.9rem; font-weight: 500; color: var(--gray-600);
  margin-bottom: var(--sp-3); cursor: pointer; background: none;
  border: none; padding: 0;
}
.detail-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-2); margin-bottom: var(--sp-4);
}
.info-item { padding: var(--sp-2) 0; }
.info-label { font-size: 0.7rem; color: var(--gray-400); text-transform: uppercase; font-weight: 500; }
.info-value { font-size: 0.9rem; font-weight: 500; color: var(--gray-800); margin-top: 2px; }
.info-value.accent { color: var(--accent-600); font-weight: 700; }

/* ======== SECTION TABS (Detail page) ======== */
.section-tabs {
  display: flex; overflow-x: auto; gap: 0;
  border-bottom: none;
  margin-bottom: var(--sp-3);
  scrollbar-width: none;
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tab {
  padding: var(--sp-2) var(--sp-3); font-size: 0.8rem; font-weight: 500;
  color: var(--gray-400); white-space: nowrap; cursor: pointer;
  border: none; background: none; position: relative;
  transition: all 0.15s; border-radius: 8px;
}
.section-tab .material-icons-round { transition: color 0.15s; }
.section-tab.active {
  color: #fff; font-weight: 600;
  background: var(--primary-600);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.section-tab.active .material-icons-round { color: #fff; }
.section-tab.active::after { display: none; }

/* ======== TABLE (Simple) ======== */
.simple-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
.simple-table th {
  text-align: left; padding: var(--sp-2) var(--sp-3);
  font-weight: 600; color: var(--gray-600); font-size: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  text-transform: uppercase;
}
.simple-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--gray-100);
}
.simple-table tr:last-child td { border-bottom: none; }

/* ======== EMPTY STATE ======== */
.empty-state {
  text-align: center; padding: var(--sp-8) var(--sp-4);
  color: var(--gray-400);
}
.empty-state .material-icons-round { font-size: 48px; margin-bottom: var(--sp-3); }
.empty-state p { font-size: 0.9rem; margin-bottom: var(--sp-4); }

/* ======== RESPONSIVE ======== */
@media (min-width: 768px) and (max-width: 1023px) {
  .page-content { max-width: 720px; margin-left: auto; margin-right: auto; }
  .modal-container { max-width: 600px; left: 50%; right: auto; top: 50%; transform: translate(-50%, -50%); border-radius: var(--radius-xl); }
  .modal-container.fullscreen { max-width: 720px; }
}

/* ======== DESKTOP LAYOUT (≥1024px) ======== */
.desktop-only { display: none; }
.mobile-only { display: flex; }
.desktop-sidebar { display: none; }
.desktop-right-panel { display: none; }
.main-wrapper { display: contents; }
.ds-sidebar-toggle { display: none; }

@media (min-width: 1024px) {
  :root {
    --ds-sidebar-w: 248px;
    --ds-sidebar-collapsed-w: 72px;
    --ds-panel-w: 480px;
    --top-bar-height: 64px;
  }

  .desktop-only { display: flex; }
  .mobile-only { display: none !important; }

  /* Main App - Grid Layout */
  .main-app {
    display: grid;
    grid-template-columns: var(--ds-sidebar-w) 1fr;
    grid-template-rows: 100vh;
    min-height: 100vh;
    background: #f8fafc;
  }
  .main-app.sidebar-collapsed { grid-template-columns: var(--ds-sidebar-collapsed-w) 1fr; }
  .main-app.right-panel-open { grid-template-columns: var(--ds-sidebar-w) 1fr var(--ds-panel-w); }
  .main-app.sidebar-collapsed.right-panel-open { grid-template-columns: var(--ds-sidebar-collapsed-w) 1fr var(--ds-panel-w); }

  /* Sidebar */
  .desktop-sidebar {
    display: flex; flex-direction: column;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    height: 100vh; position: sticky; top: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .ds-sidebar-header {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 16px; border-bottom: 1px solid #f1f5f9;
    min-height: var(--top-bar-height);
  }
  .ds-logo {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
  }
  .ds-logo .material-icons-round { font-size: 22px; }
  .ds-logo img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
  .ds-brand { flex: 1; min-width: 0; overflow: hidden; }
  .ds-brand-name { font-weight: 800; font-size: 1rem; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ds-brand-sub { font-size: 0.72rem; color: #94a3b8; margin-top: 1px; }

  .ds-sidebar-nav {
    flex: 1; overflow-y: auto;
    padding: 12px 10px; display: flex; flex-direction: column; gap: 2px;
  }
  .ds-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    cursor: pointer; color: #475569; font-size: 0.875rem; font-weight: 500;
    transition: all 0.15s;
    border: none; background: transparent; width: 100%; text-align: left;
  }
  .ds-nav-item:hover { background: #f1f5f9; color: #1e293b; }
  .ds-nav-item.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: #fff; font-weight: 600;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  }
  .ds-nav-item.active .material-icons-round { color: #fff; }
  .ds-nav-item .material-icons-round { font-size: 20px; color: #64748b; flex-shrink: 0; }
  .ds-nav-item-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ds-nav-item-badge {
    background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700;
    padding: 1px 7px; border-radius: 999px; min-width: 18px; text-align: center;
  }
  .ds-nav-section {
    font-size: 0.65rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 16px 12px 6px;
  }

  .ds-sidebar-footer { padding: 12px; border-top: 1px solid #f1f5f9; }
  .ds-user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer;
    background: #f8fafc; transition: all 0.15s;
  }
  .ds-user-card:hover { background: #f1f5f9; }
  .ds-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0; overflow: hidden;
  }
  .ds-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .ds-user-name { font-size: 0.85rem; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ds-user-role { font-size: 0.7rem; color: #64748b; margin-top: 1px; }

  /* Collapsed sidebar */
  .main-app.sidebar-collapsed .ds-brand,
  .main-app.sidebar-collapsed .ds-nav-item-label,
  .main-app.sidebar-collapsed .ds-nav-section,
  .main-app.sidebar-collapsed .ds-user-name,
  .main-app.sidebar-collapsed .ds-user-role,
  .main-app.sidebar-collapsed .ds-user-card .material-icons-round:last-child { display: none; }
  .main-app.sidebar-collapsed .ds-nav-item { justify-content: center; padding: 12px; }
  .main-app.sidebar-collapsed .ds-user-card { justify-content: center; padding: 8px; }
  .main-app.sidebar-collapsed .ds-sidebar-header { justify-content: center; padding: 18px 8px; }

  /* Main wrapper */
  .main-wrapper {
    display: flex; flex-direction: column;
    min-height: 100vh; max-height: 100vh; overflow: hidden;
  }

  /* Top bar */
  .top-bar {
    position: sticky; top: 0; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid #e2e8f0; box-shadow: none;
    height: var(--top-bar-height); padding: 0 24px;
    color: #1e293b; z-index: 100;
  }
  .top-bar .top-bar-title h2 { color: #0f172a; font-size: 1.1rem; font-weight: 700; }
  .ds-sidebar-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    border: none; background: #f1f5f9; color: #475569; cursor: pointer;
    margin-right: 8px;
  }
  .ds-sidebar-toggle:hover { background: #e2e8f0; }
  .top-bar-center { flex: 1; display: flex; justify-content: center; max-width: 520px; margin: 0 24px; }
  .ds-global-search {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 0 14px; height: 40px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    transition: all 0.15s;
  }
  .ds-global-search:focus-within { border-color: var(--primary-400); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
  .ds-global-search .material-icons-round { color: #94a3b8; font-size: 20px; }
  .ds-global-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 0.9rem; color: #1e293b; }
  .ds-kbd {
    font-size: 0.68rem; font-weight: 600; color: #64748b;
    padding: 2px 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  }
  .top-bar .icon-btn { color: #475569; }
  .top-bar .icon-btn:hover { background: #f1f5f9; }

  /* Page content */
  .page-content {
    margin: 0 !important; padding: 24px 28px !important;
    max-width: none !important;
    flex: 1; overflow-y: auto;
    min-height: 0 !important; height: auto !important;
  }
  .page-content::-webkit-scrollbar { width: 10px; }
  .page-content::-webkit-scrollbar-track { background: transparent; }
  .page-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 2px solid #f8fafc; }
  .page-content::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

  /* Right panel */
  .desktop-right-panel {
    display: flex; flex-direction: column;
    background: #fff; border-left: 1px solid #e2e8f0;
    height: 100vh; overflow: hidden;
    box-shadow: -4px 0 16px rgba(0,0,0,0.04);
  }
  .drp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
    min-height: var(--top-bar-height);
  }
  .drp-header h3 { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0; }
  .drp-body { flex: 1; overflow-y: auto; padding: 20px; }

  /* Modal adjustments for desktop */
  .modal-overlay { background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px); }
  .modal-container {
    max-width: 720px; left: 50%; right: auto; top: 50%;
    transform: translate(-50%, -50%); border-radius: var(--radius-xl);
    max-height: 90vh; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  }
  .modal-container.fullscreen { max-width: 920px; max-height: 92vh; }
  .modal-container.modal-fullheight {
    left: 50%; right: auto; top: 50%; bottom: auto;
    transform: translate(-50%, -50%) !important;
    width: 720px; max-width: 96vw;
    height: 88vh; height: 88dvh;
    border-radius: var(--radius-xl) !important;
  }

  /* Grid layouts for content */
  .stat-grid { grid-template-columns: repeat(4, 1fr) !important; }
  .desktop-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .desktop-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .desktop-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .desktop-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

  /* FAB hidden on desktop (use header buttons instead) */
  .btn-fab { bottom: 24px !important; right: 24px !important; }
}

@media (min-width: 1440px) {
  .page-content { padding: 28px 40px !important; }
  :root { --ds-sidebar-w: 264px; --ds-panel-w: 520px; }
}

/* Mobile retains original styles via main media query below */
@media (max-width: 1023px) {
  .desktop-sidebar { display: none !important; }
  .desktop-right-panel { display: none !important; }
  .top-bar-center { display: none !important; }
}

/* ======== UTILITY ======== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-600); }
.text-accent { color: var(--accent-500); }
.text-success { color: var(--success-500); }
.text-danger { color: var(--danger-500); }
.text-muted { color: var(--gray-400); }
.text-bold { font-weight: 600; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.hidden { display: none !important; }

/* ======== LIGHTBOX ======== */
.lightbox-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.95); z-index: 10000; display: none;
  align-items: center; justify-content: center; flex-direction: column;
}
.lightbox-img {
  max-width: 92vw; max-height: 80vh; object-fit: contain;
  border-radius: 4px; user-select: none;
}
.lightbox-close {
  position: absolute; top: 12px; right: 12px; background: none;
  border: none; color: white; cursor: pointer; z-index: 10001; padding: 8px;
}
.lightbox-close .material-icons-round { font-size: 28px; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.15); border: none; color: white;
  cursor: pointer; padding: 12px 6px; border-radius: 8px;
  display: flex; align-items: center;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-nav .material-icons-round { font-size: 32px; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-counter {
  position: absolute; bottom: 20px; color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

/* ======== UPLOAD PROGRESS ======== */
.upload-progress {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--gray-800); color: white; padding: 10px 20px;
  border-radius: 20px; font-size: 0.8rem; z-index: 9000;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-lg);
}
.upload-progress .material-icons-round { font-size: 16px; animation: spin 1s linear infinite; }

/* ======== AVATAR ======== */
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-lg { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-100); color: var(--primary-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
/* ======== PROJECT CARD WITH COVER ======== */
.project-card .project-card-body {
  display: flex; gap: 10px; align-items: center;
}
.project-cover {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--gray-200);
}
.project-card-info { flex: 1; min-width: 0; }
/* Deadline urgency highlights */
.deadline-soon { border-left: 3px solid #f59e0b !important; }
.deadline-urgent { border-left: 3px solid #ef4444 !important; }

/* ======== ATTENDANCE & SALARY ======== */
.att-session-btn { border: 2px solid var(--gray-200); border-radius: 10px; padding: 10px; cursor: pointer; text-align: center; transition: all 0.15s; }
.att-session-btn.selected, .att-session-btn:has(input:checked) { border-color: var(--primary-500); background: var(--primary-50); }
.salary-table th, .salary-table td { padding: 10px 8px; white-space: nowrap; }
.salary-table tfoot td { font-weight: 700; background: var(--gray-50); border-top: 2px solid var(--gray-200); }

/* ======== CAMERA OVERLAY ======== */
#camera-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000;
  z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.camera-container { position: relative; width: 100%; height: 100%; }
#camera-video { width: 100%; height: 100%; object-fit: cover; }
.camera-controls {
  position: absolute; bottom: 30px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 24px; align-items: center;
}
.camera-btn {
  width: 50px; height: 50px; border-radius: 50%; border: 2px solid white;
  background: rgba(255,255,255,0.2); color: white; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
}
.camera-btn.camera-capture { width: 68px; height: 68px; background: white; color: #333; border: 3px solid white; }
.camera-btn .material-icons-round { font-size: 28px; }

/* ======== BEFORE/AFTER COMPARISON ======== */
.compare-slider { position: relative; width: 100%; overflow: hidden; border-radius: 8px; cursor: col-resize; user-select: none; }
.compare-slider img { width: 100%; display: block; }
.compare-before { position: absolute; top: 0; left: 0; width: 50%; height: 100%; overflow: hidden; }
.compare-before img { position: absolute; top: 0; left: 0; width: 200%; max-width: none; }
.compare-handle {
  position: absolute; top: 0; width: 3px; height: 100%; background: white;
  box-shadow: 0 0 6px rgba(0,0,0,0.5); z-index: 2; left: 50%;
}
.compare-handle::after {
  content: '⟨⟩'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 32px; height: 32px; background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.compare-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.compare-labels span { font-size: 11px; color: var(--gray-500); font-weight: 600; }

/* ======== TIMELINE ======== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--primary-500); border: 2px solid white; box-shadow: 0 0 0 2px var(--primary-200);
}
.timeline-date { font-size: 11px; color: var(--gray-500); font-weight: 600; margin-bottom: 6px; }
.timeline-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.timeline-photos img { width: 100%; height: 70px; object-fit: cover; border-radius: 6px; cursor: pointer; }

.w-full { width: 100%; }
.flex-1 { flex: 1; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }

/* ========== Progress bar ========== */
.progress-mini { display: flex; align-items: center; gap: 6px; }
.progress-mini-track { flex: 1; height: 4px; background: var(--gray-200); border-radius: 2px; overflow: hidden; }
.progress-mini-track > div { height: 100%; background: var(--success-500); border-radius: 2px; transition: width 0.3s; }
.progress-mini-text { font-size: 11px; color: var(--gray-500); white-space: nowrap; }
.progress-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success-500); border-radius: 4px; transition: width 0.3s; }
.progress-section { padding: 0 var(--sp-2); }

/* ========== CEO Notes ========== */
.ceo-notes-section { background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: var(--radius-md); padding: var(--sp-3); }
.ceo-note-card { background: var(--white); border-left: 3px solid var(--primary-500); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); margin-bottom: var(--sp-2); }
.ceo-note-label { font-size: 11px; color: var(--gray-500); font-weight: 600; margin-bottom: 2px; }

/* ======== GANTT / TIMELINE ======== */
.gantt-container { margin: 0 -16px; }
.gantt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gantt-chart { position: relative; }
.gantt-header { position: sticky; top: 0; z-index: 2; background: var(--white); border-bottom: 1px solid var(--gray-200); }
.gantt-months { display: flex; position: relative; height: 24px; }
.gantt-month { position: absolute; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--gray-600); border-right: 1px solid var(--gray-200); }
.gantt-days { display: flex; position: relative; height: 24px; }
.gantt-day { position: absolute; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--gray-400); border-right: 1px solid var(--gray-100); }
.gantt-day.today { background: var(--primary-50); color: var(--primary-500); font-weight: 700; }
.gantt-day.weekend { background: var(--gray-50); }
.gantt-body { padding: 4px 0; }
.gantt-row { height: 32px; position: relative; border-bottom: 1px solid var(--gray-50); }
.gantt-bar { position: absolute; top: 4px; height: 24px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; padding: 0 8px; overflow: hidden; transition: opacity 0.2s; min-width: 28px; }
.gantt-bar:hover { opacity: 0.85; }
.gantt-bar-label { font-size: 10px; color: white; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-status-new { background: var(--primary-400); }
.gantt-status-in_progress { background: #3b82f6; }
.gantt-status-overdue { background: var(--danger-500); }
.gantt-status-completed { background: var(--success-500); }
.gantt-status-cancelled { background: var(--gray-400); }
.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger-500); z-index: 1; opacity: 0.5; }

/* ========== Photo Tags ========== */
.photo-tag-badge { position: absolute; bottom: 4px; left: 4px; font-size: 10px; padding: 1px 6px; border-radius: 3px; color: white; font-weight: 600; }
.photo-tag-before { background: var(--gray-500); }
.photo-tag-during { background: var(--primary-500); }
.photo-tag-after { background: var(--success-500); }
.photo-tag-select { position: absolute; bottom: 4px; right: 4px; font-size: 10px; padding: 1px 4px; border-radius: 3px; background: rgba(255,255,255,0.9); border: 1px solid var(--gray-200); }

/* ========== Log Entry ========== */
.log-entry { padding: var(--sp-3) 0; border-bottom: 1px solid var(--gray-100); }
.log-entry:last-child { border-bottom: none; }

/* ========== Task Type Chips ========== */
.task-type-chip { display:inline-block; font-size:0.65rem; padding:2px 8px; border-radius:10px; font-weight:500; }
.task-type-installation { background:#E3F2FD; color:#1565C0; }
.task-type-maintenance { background:#FFF3E0; color:#E65100; }
.task-type-repair { background:#FFEBEE; color:#C62828; }
.task-type-inspection { background:#E8F5E9; color:#2E7D32; }
.task-type-wiring { background:#F3E5F5; color:#7B1FA2; }
.task-type-configuration { background:#E0F7FA; color:#00695C; }

/* ========== Notification Panel ========== */
.notif-panel { position: fixed; top: 56px; right: 8px; width: min(340px, calc(100vw - 16px)); max-height: 72vh; background: var(--white); border-radius: var(--radius-xl); box-shadow: 0 8px 32px rgba(0,0,0,0.18); z-index: 1000; display: flex; flex-direction: column; overflow: hidden; }
.notif-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--gray-100); }
.notif-header-actions { display: flex; align-items: center; gap: 4px; }
.notif-mark-all { font-size: 0.72rem; color: var(--primary-500); background: none; border: none; cursor: pointer; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.notif-mark-all:hover { background: var(--primary-50, #EEF2FF); }
.notif-filter-bar { display: flex; gap: 5px; padding: 8px 12px; border-bottom: 1px solid var(--gray-100); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.notif-filter-bar::-webkit-scrollbar { display: none; }
.notif-filter-bar .chip { font-size: 0.7rem; padding: 3px 10px; white-space: nowrap; flex-shrink: 0; border-radius: 20px; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--gray-50); transition: background 0.15s; }
.notif-item:hover { background: var(--gray-50); }
.notif-item:active { background: var(--gray-100); }
.notif-item-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item-icon .material-icons-round { font-size: 16px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-500); flex-shrink: 0; margin-top: 5px; }
.notif-unread { background: var(--primary-50, #EEF2FF); }
.notif-unread:hover { background: #e4eaff; }
/* Toggle switch for preferences */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--gray-300); border-radius: var(--radius-full); transition: 0.3s; }
.toggle-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--white); border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary-500); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Warranty timeline */
.warranty-timeline { position: relative; padding-left: 20px; }
.warranty-timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot { position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gray-300); background: var(--white); }
.timeline-item.resolved .timeline-dot { border-color: var(--success-500); background: var(--success-500); }
.timeline-item.open .timeline-dot { border-color: var(--warning-500); background: var(--warning-100); }
.timeline-content { background: var(--gray-50); border-radius: var(--radius-md); padding: 10px 12px; border: 1px solid var(--gray-200); }
.text-danger { color: var(--danger-500, #EF4444) !important; }
.text-warning { color: var(--warning-500, #F59E0B) !important; }

/* ======== HOVER: only on devices that support hover (not touch) ======== */
@media (hover: none) {
  .card:hover, .stat-card:hover, .list-item:hover, .menu-item:hover,
  .btn-primary:hover, .btn-accent:hover, .btn-danger:hover, .btn-success:hover,
  .tab:hover, .chip:hover, .section-tab:hover, .checklist-item:hover,
  .btn-fab:hover { transform: none !important; box-shadow: inherit; }
  .stat-card:hover .stat-icon { transform: none !important; }
  .list-item:hover .project-cover { transform: none !important; }
}

/* ======== STAGGERED LIST ANIMATIONS ======== */
.list-item:nth-child(1) { animation-delay: 0ms; }
.list-item:nth-child(2) { animation-delay: 40ms; }
.list-item:nth-child(3) { animation-delay: 80ms; }
.list-item:nth-child(4) { animation-delay: 120ms; }
.list-item:nth-child(5) { animation-delay: 160ms; }
.list-item:nth-child(6) { animation-delay: 200ms; }
.list-item:nth-child(7) { animation-delay: 240ms; }
.list-item:nth-child(8) { animation-delay: 280ms; }
.list-item:nth-child(9) { animation-delay: 320ms; }
.list-item:nth-child(10) { animation-delay: 360ms; }

/* ======== ICON BUTTON HOVER ======== */
.icon-btn {
  transition: background 0.2s, transform 0.2s !important;
}
.icon-btn:hover { background: rgba(255,255,255,0.2) !important; transform: scale(1.08); }
.icon-btn:active { transform: scale(0.95) !important; }

/* ======== MODAL CLOSE BUTTON ======== */
.modal-close { transition: background 0.2s, transform 0.2s; }
.modal-close:hover { background: var(--gray-200); transform: rotate(90deg); }

/* ======== FORM INPUT FOCUS ANIMATION ======== */
.form-input, .form-select, .form-textarea {
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s !important;
}

/* ======== SECTION TAB HOVER ======== */
.section-tab:hover:not(.active) {
  color: var(--primary-500); background: var(--primary-50);
}

/* ======== CHIP HOVER ======== */
.chip:hover:not(.active) {
  border-color: var(--primary-300); color: var(--primary-600); background: var(--primary-50);
}

/* ======== CHECKLIST ITEM HOVER ======== */
.checklist-item { transition: background 0.2s, transform 0.15s; }
.checklist-item:hover { background: var(--gray-100); transform: translateX(2px); }

/* ======== SKELETON LOADING ======== */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ======== PULSE BADGE ANIMATION ======== */
.badge-pulse {
  animation: pulse-ring 2s ease infinite;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50% { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

/* ======== FAB BUTTON HOVER ======== */
.btn-fab { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease !important; }
.btn-fab:hover { transform: scale(1.1) !important; box-shadow: 0 8px 25px rgba(26,115,232,0.5) !important; }
.btn-fab:active { transform: scale(0.95) !important; }

/* ======== PROJECT CARD COVER ZOOM ======== */
.project-cover { transition: transform 0.3s ease; }
.list-item:hover .project-cover { transform: scale(1.05); }

/* ======== STAT ICON HOVER ======== */
.stat-card:hover .stat-icon { transform: scale(1.15) rotate(-5deg); }
.stat-icon { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
