/* assets/css/style.css */
:root {
  --primary: #1a3a5c;
  --primary-light: #2563a8;
  --primary-dark: #0f2540;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --sidebar-w: 240px;
  --navbar-h: 56px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

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

html { font-size: 15px; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }

/* NAVBAR */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--navbar-h);
  background: var(--primary); color: #fff; z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 16px; max-width: 1400px; margin: 0 auto;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 700; color: #fff; text-decoration: none; }
.nav-brand i { color: var(--accent); font-size: 1.2rem; }
.brand-text { letter-spacing: .3px; }
.nav-right { display: flex; align-items: center; gap: 8px; }

/* USER MENU */
.user-menu { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 10px; border-radius: 8px; transition: background .2s; position: relative; }
.user-menu:hover { background: rgba(255,255,255,.12); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.user-name-nav { font-size: .85rem; color: rgba(255,255,255,.9); }
.dropdown-menu { position: absolute; top: calc(var(--navbar-h) + 2px); right: 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 200px; overflow: hidden; display: none; z-index: 999; border: 1px solid var(--border); }
.dropdown-menu.show { display: block; }
.dropdown-header { padding: 14px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.dropdown-header strong { display: block; color: var(--text); }
.dropdown-header small { color: var(--text-muted); font-size: .75rem; }
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 16px; color: var(--text); text-decoration: none; font-size: .88rem; transition: background .15s; }
.dropdown-menu a:hover { background: var(--bg); }
.dropdown-menu a.text-danger { color: var(--danger); }
.dropdown-menu a i { width: 16px; text-align: center; }

/* LAYOUT */
.app-container { display: flex; padding-top: var(--navbar-h); min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--border);
  position: fixed; top: var(--navbar-h); bottom: 0; left: 0; overflow-y: auto;
  z-index: 500; transition: transform .3s ease;
}
.sidebar-header { padding: 20px 16px; background: var(--primary); color: #fff; text-align: center; }
.company-logo { margin-bottom: 6px; opacity: .85; }
.company-name { font-size: .78rem; font-weight: 600; opacity: .9; line-height: 1.3; }
.sidebar-nav { padding: 10px 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: var(--text-muted); text-decoration: none; font-size: .88rem; transition: all .15s; }
.nav-item:hover, .nav-item.active { background: rgba(37, 99, 168, .08); color: var(--primary-light); border-right: 3px solid var(--primary-light); }
.nav-item.active { font-weight: 600; }
.nav-item i { width: 18px; text-align: center; }
.nav-section { padding: 14px 20px 6px; font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; }

/* MAIN CONTENT */
.main-content { flex: 1; margin-left: var(--sidebar-w); padding: 24px; max-width: 100%; overflow-x: hidden; }

/* PAGE HEADER */
.page-header { margin-bottom: 20px; }
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.page-subtitle { color: var(--text-muted); font-size: .88rem; margin-top: 2px; }

/* CARDS */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fafbfc; }
.card-title { font-size: .95rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-icon.blue { background: rgba(37,99,168,.12); color: var(--primary-light); }
.stat-icon.green { background: rgba(16,185,129,.12); color: var(--success); }
.stat-icon.orange { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.red { background: rgba(239,68,68,.12); color: var(--danger); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: .77rem; color: var(--text-muted); margin-top: 3px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: .875rem; font-weight: 500; text-decoration: none; transition: all .15s; white-space: nowrap; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 22px; font-size: .95rem; }
.btn-primary { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .83rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 8px; font-size: .9rem; color: var(--text); background: #fff; transition: border-color .15s; outline: none; }
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,168,.1); }
.form-select { appearance: none; 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 d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-hint { font-size: .77rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { background: #f8fafc; color: var(--text); font-weight: 600; padding: 11px 14px; text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-success { background: rgba(16,185,129,.12); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.12); color: #b45309; }
.badge-danger { background: rgba(239,68,68,.12); color: var(--danger); }
.badge-info { background: rgba(59,130,246,.12); color: var(--info); }
.badge-secondary { background: var(--bg); color: var(--text-muted); }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.alert-success { background: rgba(16,185,129,.1); color: #065f46; border: 1px solid rgba(16,185,129,.3); }
.alert-danger { background: rgba(239,68,68,.1); color: #991b1b; border: 1px solid rgba(239,68,68,.3); }
.alert-warning { background: rgba(245,158,11,.1); color: #92400e; border: 1px solid rgba(245,158,11,.3); }
.alert-info { background: rgba(59,130,246,.1); color: #1e40af; border: 1px solid rgba(59,130,246,.3); }

/* SCORE COLORS */
.score-excellent { color: var(--success); }
.score-good { color: var(--info); }
.score-average { color: var(--warning); }
.score-poor { color: var(--danger); }

/* PROGRESS BAR */
.progress { background: var(--bg); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--primary-light); transition: width .4s; }
.progress-bar.excellent { background: var(--success); }
.progress-bar.good { background: var(--info); }
.progress-bar.average { background: var(--warning); }
.progress-bar.poor { background: var(--danger); }

/* AUDIT SCORE DISPLAY */
.score-circle { display: flex; flex-direction: column; align-items: center; }
.score-number { font-size: 3rem; font-weight: 800; line-height: 1; }
.score-label { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* CHECKLIST ITEMS */
.checklist-category { margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.category-header { padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; color: #fff; font-weight: 700; font-size: .92rem; }
.category-sort { background: linear-gradient(135deg, #1a3a5c, #2563a8); }
.category-straighten { background: linear-gradient(135deg, #0f5132, #198754); }
.category-shine { background: linear-gradient(135deg, #533b00, #d97706); }
.category-standardize { background: linear-gradient(135deg, #1e1b4b, #4f46e5); }
.category-sustain { background: linear-gradient(135deg, #6b0000, #dc2626); }
.category-score-badge { background: rgba(255,255,255,.25); padding: 3px 12px; border-radius: 20px; font-size: .82rem; }
.checklist-item { padding: 14px 18px; border-bottom: 1px solid var(--border); background: #fff; }
.checklist-item:last-child { border-bottom: none; }
.item-question { font-size: .9rem; color: var(--text); margin-bottom: 4px; font-weight: 500; }
.item-question-id { font-size: .82rem; color: var(--text-muted); margin-bottom: 10px; }
.score-options { display: flex; gap: 8px; flex-wrap: wrap; }
.score-btn { flex: 1; min-width: 60px; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--border); background: #fff; cursor: pointer; text-align: center; transition: all .15s; font-size: .88rem; font-weight: 600; color: var(--text-muted); }
.score-btn:hover { border-color: var(--primary-light); color: var(--primary-light); }
.score-btn.selected-0 { border-color: var(--danger); background: rgba(239,68,68,.1); color: var(--danger); }
.score-btn.selected-2 { border-color: var(--warning); background: rgba(245,158,11,.1); color: #92400e; }
.score-btn.selected-4 { border-color: var(--success); background: rgba(16,185,129,.1); color: var(--success); }
.score-btn .score-desc { display: block; font-size: .7rem; font-weight: 400; margin-top: 2px; }
.notes-input { margin-top: 8px; }

/* SCORE SUMMARY */
.score-summary-card { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; border-radius: var(--radius); padding: 24px; margin-bottom: 20px; text-align: center; }
.score-summary-card .big-score { font-size: 4rem; font-weight: 800; line-height: 1; }
.score-summary-card .score-of { font-size: 1rem; opacity: .8; }
.score-summary-card .score-pct { font-size: 1.4rem; font-weight: 600; margin-top: 4px; }
.score-summary-card .score-grade { font-size: .9rem; margin-top: 8px; opacity: .9; }

/* CATEGORY SCORES */
.category-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.cat-score-item { background: #fff; border-radius: 10px; padding: 14px; text-align: center; border: 1px solid var(--border); box-shadow: var(--shadow); }
.cat-score-name { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px; }
.cat-score-val { font-size: 1.5rem; font-weight: 800; }
.cat-score-max { font-size: .78rem; color: var(--text-muted); }

/* LOGIN */
.login-page { min-height: 100vh; background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px 28px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo i { font-size: 2.5rem; color: var(--primary); }
.login-title { font-size: 1.3rem; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 4px; }
.login-subtitle { font-size: .85rem; color: var(--text-muted); text-align: center; margin-bottom: 28px; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-weight: 700; font-size: 1rem; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.1rem; padding: 4px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: .9rem; }

/* SIDEBAR OVERLAY (mobile) */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 499; }

/* Hamburger button */
.hamburger { display: none; background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; }

/* MOBILE MENU TOGGLE */
.mobile-menu-btn { display: none; background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 1rem; cursor: pointer; padding: 7px 10px; border-radius: 7px; }

/* UTILITIES */
.d-none-sm { display: inline; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.fw-bold { font-weight: 700; }

/* =====================
   RESPONSIVE / MOBILE
   ===================== */
@media (max-width: 768px) {
  html { font-size: 14px; }
  
  .main-content { margin-left: 0; padding: 16px; }
  
  .sidebar {
    transform: translateX(-100%);
    z-index: 900;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  
  .mobile-menu-btn { display: flex; align-items: center; gap: 6px; }
  
  .d-none-sm { display: none; }
  
  .form-row { grid-template-columns: 1fr; }
  
  .stats-grid { grid-template-columns: 1fr 1fr; }
  
  .score-btn { min-width: unset; padding: 8px 6px; font-size: .82rem; }
  
  .category-scores { grid-template-columns: 1fr 1fr; }
  
  .modal { max-width: 100%; }
  
  .flex-between { flex-wrap: wrap; gap: 10px; }

  table th, table td { padding: 9px 10px; font-size: .82rem; }
  
  .page-title { font-size: 1.2rem; }
}
