/* ============================================================
   app.css — Order Document Management System
   Design System: Modern Dark Sidebar + Clean Content
   ============================================================ */

/* ──────────────────────────────────────────────────────────
   1. CSS VARIABLES (Design Tokens)
────────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --sidebar-bg:       #0F172A;
  --sidebar-border:   #1E293B;
  --sidebar-text:     #94A3B8;
  --sidebar-active-bg:#6366F120;
  --sidebar-active:   #818CF8;
  --sidebar-hover:    #1E293B;

  --primary:          #6366F1;
  --primary-dark:     #4F46E5;
  --primary-light:    #818CF8;
  --primary-glow:     #6366F140;

  --success:          #10B981;
  --success-light:    #D1FAE5;
  --warning:          #F59E0B;
  --warning-light:    #FEF3C7;
  --danger:           #EF4444;
  --danger-light:     #FEE2E2;
  --info:             #3B82F6;
  --info-light:       #DBEAFE;

  --bg-main:          #F1F5F9;
  --bg-card:          #FFFFFF;
  --bg-input:         #F8FAFC;

  --text-primary:     #1E293B;
  --text-secondary:   #64748B;
  --text-muted:       #94A3B8;

  --border:           #E2E8F0;
  --border-focus:     #6366F1;

  --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
  --shadow-md:        0 4px 16px rgba(0,0,0,.1);
  --shadow-lg:        0 10px 40px rgba(0,0,0,.15);
  --shadow-primary:   0 4px 20px rgba(99,102,241,.3);

  /* Layout */
  --sidebar-w:        260px;
  --topbar-h:         64px;

  /* Typography */
  --font-main:        'Sarabun', 'Inter', system-ui, sans-serif;
  --font-mono:        'Courier New', monospace;

  /* Radius */
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        16px;
  --radius-xl:        24px;
  --radius-full:      9999px;

  /* Transitions */
  --transition:       all 0.2s ease;
  --transition-slow:  all 0.35s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

/* ──────────────────────────────────────────────────────────
   3. LAYOUT
────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ──────────────────────────────────────────────────────────
   4. SIDEBAR
────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: var(--transition-slow);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.logo-icon {
  font-size: 1.75rem;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-glow);
  border-radius: var(--radius-md);
  border: 1px solid var(--primary)40;
}

.logo-text { display: flex; flex-direction: column; }
.logo-title {
  font-size: 1rem; font-weight: 700;
  color: #F1F5F9; letter-spacing: -.01em;
}
.logo-sub {
  font-size: .7rem; color: var(--sidebar-text);
  white-space: nowrap;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1E293B transparent;
}

.nav-section { margin-bottom: .5rem; }

.nav-section-title {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  padding: .75rem 1.25rem .35rem;
  opacity: .7;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.25rem;
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 400;
  border-radius: 0;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  margin: 1px .5rem;
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #E2E8F0;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--primary-light);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--sidebar-border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  background: #1E293B;
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: .8rem; font-weight: 600;
  color: #E2E8F0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role {
  font-size: .65rem; color: var(--sidebar-text);
}

.logout-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { background: var(--danger)20; color: var(--danger); }

/* ──────────────────────────────────────────────────────────
   5. MAIN WRAPPER
────────────────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition-slow);
  min-width: 0;
}

/* ──────────────────────────────────────────────────────────
   6. TOPBAR
────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: .3rem;
}

.topbar-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-time {
  font-size: .8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ──────────────────────────────────────────────────────────
   7. MAIN CONTENT
────────────────────────────────────────────────────────── */
.flash-container { padding: 1rem 1.5rem 0; }

.main-content {
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
}

.app-footer {
  padding: .75rem 1.5rem;
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ──────────────────────────────────────────────────────────
   8. CARDS
────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-body { padding: 1.5rem; }

/* ──────────────────────────────────────────────────────────
   9. STAT CARDS (Dashboard)
────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--primary));
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: var(--stat-bg, var(--primary-glow));
  flex-shrink: 0;
}

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }

/* ──────────────────────────────────────────────────────────
   10. PAGE HEADER
────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header-left p {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { opacity: .5; }

/* ──────────────────────────────────────────────────────────
   11. BUTTONS
────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: white; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; color: white; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #D97706; color: white; }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-input); }

.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-icon { padding: .5rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; justify-content: center; }

/* ──────────────────────────────────────────────────────────
   12. FORMS
────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: .4rem;
}

.form-label .required { color: var(--danger); margin-left: .2rem; }

.form-control {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: .9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .3rem;
}

.form-error {
  font-size: .78rem;
  color: var(--danger);
  margin-top: .3rem;
  display: flex; align-items: center; gap: .3rem;
}

.form-row {
  display: grid;
  gap: 1rem;
}
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ──────────────────────────────────────────────────────────
   13. TABLE
────────────────────────────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.table th {
  padding: .75rem 1rem;
  background: var(--bg-main);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #F8FAFF; }

.table-striped tr:nth-child(even) td { background: var(--bg-main); }
.table-striped tr:nth-child(even):hover td { background: #F0F4FF; }

/* ──────────────────────────────────────────────────────────
   14. ALERTS / FLASH MESSAGES
────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  animation: slideDown .3s ease;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-light); color: #065F46; border-color: #A7F3D0; }
.alert-error   { background: var(--danger-light);  color: #991B1B; border-color: #FECACA; }
.alert-warning { background: var(--warning-light); color: #92400E; border-color: #FDE68A; }
.alert-info    { background: var(--info-light);    color: #1E40AF; border-color: #BFDBFE; }

.alert-icon { font-size: 1.1rem; flex-shrink: 0; }
.alert-text { flex: 1; }
.alert-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; opacity: .6; padding: 0 .25rem;
  transition: var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ──────────────────────────────────────────────────────────
   15. BADGE
────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-success { background: var(--success-light); color: #065F46; }
.badge-danger  { background: var(--danger-light);  color: #991B1B; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-gray    { background: #F1F5F9; color: var(--text-secondary); }

/* ──────────────────────────────────────────────────────────
   16. SEARCH BAR
────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: .85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.search-input {
  width: 100%;
  padding: .6rem .9rem .6rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: .9rem;
  background: var(--bg-input);
  transition: var(--transition);
  outline: none;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* ──────────────────────────────────────────────────────────
   17. PAGINATION
────────────────────────────────────────────────────────── */
.pagination-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.pagination {
  list-style: none;
  display: flex;
  gap: .25rem;
}

.pagination li a, .pagination li.active a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.pagination li a:hover { background: var(--primary-glow); color: var(--primary); border-color: var(--primary); }
.pagination li.active a { background: var(--primary); color: white; border-color: var(--primary); }
.pagination li.dots a { border: none; cursor: default; }
.pagination-info { font-size: .8rem; color: var(--text-muted); }

/* ──────────────────────────────────────────────────────────
   18. DYNAMIC COMMITTEE FORM
────────────────────────────────────────────────────────── */
.committee-builder {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.committee-builder-header {
  padding: 1rem 1.25rem;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.position-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: .75rem;
  transition: var(--transition);
  animation: fadeIn .3s ease;
}

.position-block:hover { border-color: var(--primary)60; }

.position-block-header {
  padding: .75rem 1rem;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: calc(var(--radius-md) - 1.5px);
  border-top-right-radius: calc(var(--radius-md) - 1.5px);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.position-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: .1rem;
}

.position-number {
  width: 24px; height: 24px;
  background: var(--primary-glow);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.position-name-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-main);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}
.position-name-input::placeholder { color: var(--text-muted); font-weight: 400; }

.position-block-body { padding: 1rem; }

.members-list { display: flex; flex-direction: column; gap: .5rem; }

.member-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: fadeIn .25s ease;
}

.member-row .person-select,
.member-row .person-search-input {
  flex: 1;
  width: 100%;
  padding: .5rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: .875rem;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.member-row .person-select:focus,
.member-row .person-search-input:focus { border-color: var(--primary); }

.add-member-btn {
  width: 100%;
  padding: .4rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: .8rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: .5rem;
  font-family: var(--font-main);
}
.add-member-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }

.add-position-btn {
  width: 100%;
  padding: .75rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-main);
  margin-top: .75rem;
}
.add-position-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }

/* ──────────────────────────────────────────────────────────
   19. TRACKING / TIMELINE
────────────────────────────────────────────────────────── */
.tracking-card {
  display: flex;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.tracking-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--track-color, var(--primary));
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.tracking-card:hover { box-shadow: var(--shadow-md); transform: translateX(2px); }

.tracking-timeline {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* Person profile card */
.person-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--primary)08, var(--primary-light)08);
  border: 1px solid var(--primary)20;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.person-avatar {
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────
   20. FILE UPLOAD
────────────────────────────────────────────────────────── */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.file-drop-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}

.file-drop-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.file-drop-text { color: var(--text-secondary); font-size: .875rem; }
.file-drop-hint { color: var(--text-muted); font-size: .75rem; margin-top: .35rem; }

.file-preview {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: .75rem;
}

.file-preview-icon { font-size: 1.5rem; }
.file-preview-name { flex: 1; font-size: .875rem; color: var(--text-primary); font-weight: 500; }
.file-preview-size { font-size: .75rem; color: var(--text-muted); }

/* ──────────────────────────────────────────────────────────
   21. AUTOCOMPLETE
────────────────────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }

.autocomplete-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: .6rem .9rem;
  cursor: pointer;
  font-size: .875rem;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.selected { background: var(--primary-glow); color: var(--primary); }
.autocomplete-item .person-dept { font-size: .72rem; color: var(--text-muted); }

/* ──────────────────────────────────────────────────────────
   22. MODAL
────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.3rem; color: var(--text-muted); padding: .1rem; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .75rem; }

/* ──────────────────────────────────────────────────────────
   23. EMPTY STATE
────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: .6; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: .5rem; }
.empty-state p { font-size: .875rem; }

/* ──────────────────────────────────────────────────────────
   24. LOGIN PAGE
────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #1E1B4B 100%);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--primary)20 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, #7C3AED20 0%, transparent 70%);
  bottom: -150px; left: -150px;
  border-radius: 50%;
}

.login-card {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  box-shadow: 0 25px 60px rgba(0,0,0,.4);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-lg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.login-title {
  font-size: 1.5rem; font-weight: 700;
  color: white; margin-bottom: .25rem;
}
.login-sub { color: rgba(255,255,255,.5); font-size: .875rem; }

.login-card .form-label { color: rgba(255,255,255,.8); }

.login-card .form-control {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
  color: white;
}
.login-card .form-control:focus {
  background: rgba(255,255,255,.12);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary)30;
}
.login-card .form-control::placeholder { color: rgba(255,255,255,.35); }

/* ──────────────────────────────────────────────────────────
   25. UTILITIES
────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .35rem; }
.gap-2 { gap: .75rem; }
.gap-3 { gap: 1rem; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: .8rem; }
.text-xs { font-size: .72rem; }
.text-muted { color: var(--text-muted); }
.text-primary-c { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.p-0 { padding: 0 !important; }
.d-none { display: none !important; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ──────────────────────────────────────────────────────────
   26. ANIMATIONS
────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ──────────────────────────────────────────────────────────
   27. RESPONSIVE
────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .menu-toggle { display: flex; }
  .form-row.cols-2 { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .card-body { padding: 1rem; }
  .main-content { padding: 1rem; }
}
