/* Global Root Variables & Theme Definition */
:root {
  --font-heading: 'Outfit', 'Sarabun', sans-serif;
  --font-body: 'Inter', 'Sarabun', sans-serif;

  /* Color Palette - Premium Kasetsart Sriracha Theme (Nontri Green & Sand Gold) */
  --primary: #006633;          /* เขียวนนทรี */
  --primary-hover: #004d26;    /* เขียวเข้มจัด */
  --primary-light: #e6f5ec;    /* เขียวพาสเทลอ่อน */
  --secondary: #b6a35a;        /* สีทองทรายทะเล / สีทอง มก. */
  --secondary-hover: #a18e47;
  --accent: #2e7d32;           /* เขียวสว่าง */
  
  /* UI Colors */
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #0a1f13;       /* เขียวเข้มมากๆ สำหรับแถบเมนูข้าง */
  --border-color: #e2e8f0;
  
  /* Text Colors */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-on-dark: #f8fafc;
  
  /* Status Colors */
  --status-new-bg: #e6f2ff;
  --status-new-text: #0284c7;
  --status-process-bg: #fffbeb;
  --status-process-text: #d97706;
  --status-success-bg: #ecfdf5;
  --status-success-text: #059669;
  --status-danger-bg: #fef2f2;
  --status-danger-text: #dc2626;

  /* Priority Colors */
  --priority-normal-bg: #f1f5f9;
  --priority-normal-text: #475569;
  --priority-warn-bg: #fff7ed;
  --priority-warn-text: #ea580c;
  --priority-danger-bg: #fff1f2;
  --priority-danger-text: #e11d48;
  
  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 15px rgba(0, 102, 51, 0.15);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* Base Settings */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: #0f172a;
}

/* 1. LOGIN PAGE STYLING */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Deep green gradient transitioning to black and subtle gold */
  background: linear-gradient(135deg, #022c16 0%, #004d26 50%, #1e1b0c 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Decorative background circles for premium look */
.login-container::before,
.login-container::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  filter: blur(80px);
  opacity: 0.15;
}

.login-container::before {
  width: 400px;
  height: 400px;
  background-color: var(--secondary);
  top: -100px;
  left: -100px;
}

.login-container::after {
  width: 500px;
  height: 500px;
  background-color: var(--primary);
  bottom: -150px;
  right: -100px;
}

.login-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
  max-width: 450px;
  border-radius: var(--radius-lg);
  padding: 40px 35px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateY(0);
  animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.ku-logo {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0, 102, 51, 0.3);
  border: 2px solid var(--secondary);
}

.login-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.login-header p {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 600;
}

.login-header span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.login-error {
  display: none;
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--status-danger-text);
  text-align: left;
}

.login-error.show {
  display: flex;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.btn-login {
  padding: 12px;
  font-size: 1rem;
  margin-top: 10px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 2. APP CONTAINER LAYOUT GRID */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* 3. SIDEBAR STYLING */
.sidebar {
  background-color: var(--bg-sidebar);
  color: var(--text-on-dark);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 102, 51, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-icon i {
  color: white;
  font-size: 1.2rem;
}

.brand-text h1 {
  font-size: 1.2rem;
  color: white;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--secondary);
  letter-spacing: 0.5px;
  font-weight: 500;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #a3b8ac;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.menu-item:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.04);
}

.menu-item.active {
  color: white;
  background: linear-gradient(90deg, var(--primary), rgba(0, 102, 51, 0.6));
  box-shadow: var(--shadow-glow);
  border-left: 3px solid var(--secondary);
}

.menu-item i {
  font-size: 1.1rem;
  width: 24px;
}

.menu-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.08);
  margin: 12px 0;
}

.menu-item.logout {
  color: #f87171;
}

.menu-item.logout:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.sidebar-footer p {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-footer .version {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
  display: block;
}

/* 4. MAIN CONTENT AREA */
.main-content {
  padding: 36px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.header-title h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--primary-hover);
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-card);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.avatar {
  background-color: var(--primary-light);
  color: var(--primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 102, 51, 0.1);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info .name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.user-info .role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Stats Cards Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

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

.stat-details .stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-details .stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-top: 8px;
  color: #0f172a;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Card variations */
.stat-card.total { border-left: 4px solid var(--primary); }
.stat-card.total .stat-icon { background-color: var(--primary-light); color: var(--primary); }

.stat-card.in-progress { border-left: 4px solid var(--secondary); }
.stat-card.in-progress .stat-icon { background-color: #fffbeb; color: var(--secondary); }

.stat-card.success { border-left: 4px solid #10b981; }
.stat-card.success .stat-icon { background-color: #ecfdf5; color: #10b981; }

.stat-card.urgent { border-left: 4px solid #ef4444; }
.stat-card.urgent .stat-icon { background-color: #fef2f2; color: #ef4444; }

.fa-spin-slow {
  animation: fa-spin 3s linear infinite;
}

/* 5. FILTERS BAR */
.filters-container {
  background-color: var(--bg-card);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  min-width: 320px;
  flex-grow: 1;
  transition: var(--transition-fast);
}

.search-bar:focus-within {
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(0, 102, 51, 0.1);
}

.search-bar i {
  color: var(--text-light);
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  width: 100%;
  color: var(--text-main);
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 40px 10px 16px;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
}

.select-wrapper select:hover {
  border-color: var(--text-light);
}

.select-wrapper select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 51, 0.1);
}

.select-wrapper::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.8rem;
}

/* 6. DATA TABLE STYLING */
.table-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-hover);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-info {
  background-color: var(--primary-light);
  color: var(--primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.documents-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.documents-table th {
  background-color: #f8fafc;
  padding: 16px 24px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.documents-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.documents-table tbody tr {
  transition: var(--transition-fast);
}

.documents-table tbody tr:hover {
  background-color: #f8fafc;
}

.documents-table tbody tr:last-child td {
  border-bottom: none;
}

.doc-id {
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary);
  letter-spacing: -0.2px;
}

.title-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.title-cell .doc-title {
  font-weight: 600;
  color: #0f172a;
}

.title-cell .doc-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.title-cell .doc-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--text-light);
}

/* Status Badges */
.badge-status {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-status.new { background-color: var(--status-new-bg); color: var(--status-new-text); }
.badge-status.new::before { background-color: var(--status-new-text); }

.badge-status.processing { background-color: var(--status-process-bg); color: var(--status-process-text); }
.badge-status.processing::before { background-color: var(--status-process-text); }

.badge-status.success { background-color: var(--status-success-bg); color: var(--status-success-text); }
.badge-status.success::before { background-color: var(--status-success-text); }

.badge-status.danger { background-color: var(--status-danger-bg); color: var(--status-danger-text); }
.badge-status.danger::before { background-color: var(--status-danger-text); }

/* Priority Badges */
.badge-priority {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

.badge-priority.normal { background-color: var(--priority-normal-bg); color: var(--priority-normal-text); }
.badge-priority.warn { background-color: var(--priority-warn-bg); color: var(--priority-warn-text); }
.badge-priority.danger { background-color: var(--priority-danger-bg); color: var(--priority-danger-text); }

/* Loading / Empty States */
.loading-state, .empty-state {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
}

.loading-state i {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.empty-state i {
  font-size: 2.2rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

/* 7. BUTTON STYLING */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  outline: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 10px rgba(0, 102, 51, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 6px 15px rgba(0, 102, 51, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
  padding: 12px;
}

/* 8. MODALS STYLING */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 31, 19, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: var(--transition-smooth);
}

.modal.open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 650px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: var(--transition-smooth);
}

.modal.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8fafc;
}

.modal-header h2 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-hover);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 24px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: #f8fafc;
}

/* Form layout settings */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-group.col-12 {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.form-group label .required {
  color: #ef4444;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  background-color: white;
  transition: var(--transition-fast);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 51, 0.1);
}

.form-group textarea {
  resize: vertical;
}

/* 9. DRAWER (DETAIL PANEL) */
/* 9. DRAWER (DETAIL PANEL) - CONVERTED TO CENTERED MODAL */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 31, 19, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.drawer.open {
  opacity: 1;
  pointer-events: all;
}

.drawer-content {
  background-color: var(--bg-card);
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  overflow: hidden;
}

.drawer.open .drawer-content {
  transform: scale(1);
  opacity: 1;
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background-color: #f8fafc;
}

.drawer-header-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.doc-id-badge {
  background-color: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: inline-block;
  align-self: flex-start;
}

.drawer-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-hover);
  margin-top: 4px;
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex-grow: 1;
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item .meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-item .meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

.meta-item .text-highlight {
  color: var(--primary);
}

.drawer-divider {
  border: 0;
  height: 1px;
  background-color: var(--border-color);
  margin: 24px 0;
}

.timeline-section, 
.action-section {
  text-align: left;
}

.timeline-section h3, 
.action-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-hover);
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-desc, 
.action-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 20px;
}

/* 10. TIMELINE PATH & DOTS */
.timeline-container {
  position: relative;
  padding-left: 32px;
  margin-top: 10px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background-color: #cbd5e1;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #fff;
  border: 2px solid var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: var(--transition-smooth);
}

.timeline-dot i {
  font-size: 0.65rem;
  color: var(--text-light);
}

/* Timeline dot color styles */
.timeline-item.new .timeline-dot {
  border-color: var(--primary);
  background-color: var(--primary-light);
}
.timeline-item.new .timeline-dot i {
  color: var(--primary);
}

.timeline-item.process .timeline-dot {
  border-color: var(--secondary);
  background-color: #fffbeb;
}
.timeline-item.process .timeline-dot i {
  color: var(--secondary);
}

.timeline-item.success .timeline-dot {
  border-color: #10b981;
  background-color: #ecfdf5;
}
.timeline-item.success .timeline-dot i {
  color: #10b981;
}

.timeline-item.danger .timeline-dot {
  border-color: #ef4444;
  background-color: #fef2f2;
}
.timeline-item.danger .timeline-dot i {
  color: #ef4444;
}

.timeline-info {
  background-color: #f8fafc;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.timeline-item:first-child .timeline-info {
  border-color: var(--primary-light);
  background-color: #fbfdfc;
  box-shadow: 0 4px 10px rgba(0, 102, 51, 0.03);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.timeline-dept {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

.timeline-handler-status {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.timeline-handler {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-notes {
  font-size: 0.8rem;
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.7);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--text-light);
}

.timeline-item.new .timeline-notes { border-left-color: var(--primary); }
.timeline-item.process .timeline-notes { border-left-color: var(--secondary); }
.timeline-item.success .timeline-notes { border-left-color: #10b981; }
.timeline-item.danger .timeline-notes { border-left-color: #ef4444; }

/* Update status area styles */
.update-status-form {
  background-color: #f8fafc;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 10px;
}

.update-status-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.action-buttons {
  margin-top: 16px;
}



/* 11. RESPONSIVENESS */
@media (max-width: 992px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: none;
  }
  
  .main-content {
    padding: 20px;
  }
  
  /* Drawer media queries are now handled under 768px for full screen modal */
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .filters-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-bar {
    min-width: 100%;
  }
  
  .filters-group {
    width: 100%;
    justify-content: space-between;
  }
  
  .select-wrapper {
    flex-grow: 1;
  }
  
  .select-wrapper select {
    width: 100%;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.col-12 {
    grid-column: span 1;
  }

  .update-status-form .form-grid {
    grid-template-columns: 1fr;
  }

  .drawer-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

/* 12. USER ACCOUNT MANAGEMENT SYSTEM */
.user-profile-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Settings Dropdown Styles */
.dropdown-menu {
  display: none;
  animation: dropdownFadeIn 0.15s ease;
}

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

.dropdown-item:hover {
  background-color: #f8fafc;
  color: var(--primary) !important;
}

.user-profile:hover .name {
  color: var(--primary);
  transition: var(--transition-fast);
}

.action-buttons-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-role {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}
.badge-role.admin {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid rgba(153, 27, 27, 0.1);
}
.badge-role.user {
  background-color: #e0f2fe;
  color: #075985;
  border: 1px solid rgba(7, 89, 133, 0.1);
}

.dropdown-item.logout {
  color: #ef4444 !important;
}

.dropdown-item.logout:hover {
  background-color: rgba(239, 68, 68, 0.08) !important;
  color: #dc2626 !important;
}
