/* ============================================================
   International Sales Travel Management System
   Modern, Clean, Card-based UI
   ============================================================ */

/* --- CSS Variables (Theme System) --- */
:root {
  --primary: #2563EB;
  --secondary: #3B82F6;
  --primary-light: #EFF6FF;
  --primary-dark: #1D4ED8;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-sidebar: #0F172A;
  --bg-header: #FFFFFF;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-sidebar: #CBD5E1;
  --text-sidebar-active: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  --header-height: 60px;
  --transition: 0.2s ease;
  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #2563EB;
}

/* Dark theme overrides */
[data-theme="dark"] {
  --primary: #3B82F6;
  --secondary: #60A5FA;
  --primary-light: #1E3A5F;
  --primary-dark: #2563EB;
  --bg: #171717;
  --bg-card: #1E1E1E;
  --bg-sidebar: #0A0A0A;
  --bg-header: #1A1A1A;
  --text: #E5E5E5;
  --text-secondary: #A3A3A3;
  --text-muted: #737373;
  --text-sidebar: #A3A3A3;
  --text-sidebar-active: #FFFFFF;
  --border: #2E2E2E;
  --border-light: #262626;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

img { max-width: 100%; height: auto; }

/* --- Layout --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: var(--header-height);
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-sidebar);
  font-size: 13.5px;
  transition: all var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-sidebar-active);
}

.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: var(--text-sidebar-active);
  border-left-color: var(--primary);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

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

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 900;
}

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

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme Selector */
.theme-selector {
  display: flex;
  gap: 6px;
  align-items: center;
}

.theme-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg); }

.lang-toggle {
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition);
}

.lang-toggle:hover { background: var(--primary-light); color: var(--primary); }

.notification-bell {
  position: relative;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.notification-bell:hover { color: var(--primary); }

.notification-bell .badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.header-user:hover { background: var(--border-light); }

.header-user .avatar {
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.header-user .user-name {
  font-size: 13px;
  font-weight: 500;
}

.page-content {
  flex: 1;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

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

.card-header h3, .card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px; }
.card-accent { border-left: 4px solid var(--primary); }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-light); }

/* --- Stat Cards --- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
}

.stat-info { flex: 1; }

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- Tables --- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--border-light);
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
}

tr:hover td { background: rgba(0,0,0,0.015); }
[data-theme="dark"] tr:hover td { background: rgba(255,255,255,0.03); }

/* Alternating row colors */
tr:nth-child(even) td { background: rgba(0,0,0,0.01); }
[data-theme="dark"] tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
tr:nth-child(even):hover td { background: rgba(0,0,0,0.025); }
[data-theme="dark"] tr:nth-child(even):hover td { background: rgba(255,255,255,0.04); }

tr:last-child td { border-bottom: none; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.6;
}

.badge-draft { background: #F1F5F9; color: #475569; }
.badge-pending_approval { background: #FEF3C7; color: #92400E; }
.badge-approved { background: #D1FAE5; color: #065F46; }
.badge-rejected { background: #FEE2E2; color: #991B1B; }
.badge-booking { background: #DBEAFE; color: #1E40AF; }
.badge-reporting { background: #EDE9FE; color: #5B21B6; }
.badge-completed { background: #F1F5F9; color: #0F172A; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-bidding { background: #DBEAFE; color: #1E40AF; }
.badge-comparing { background: #E0E7FF; color: #3730A3; }
.badge-confirmed { background: #D1FAE5; color: #065F46; }
.badge-winner { background: #D1FAE5; color: #065F46; }
.badge-loser { background: #FEE2E2; color: #991B1B; }
.badge-pending_manager { background: #FEF3C7; color: #92400E; }
.badge-pending_gm { background: #FEF3C7; color: #92400E; }
.badge-manager_approved { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }
.badge-suspended { background: #FEF3C7; color: #92400E; }
.badge-closed { background: #F1F5F9; color: #475569; }
.badge-timeout { background: #F1F5F9; color: #475569; }

.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(37,99,235,0.3); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border-light); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: #B91C1C; box-shadow: 0 2px 8px rgba(220,38,38,0.3); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover:not(:disabled) { background: #047857; }

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) { background: #B45309; }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--primary-light); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px 8px; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

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

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  transition: all var(--transition);
  font-family: inherit;
  line-height: 1.5;
}

.form-control:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

select.form-control {
  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 fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.input-group {
  display: flex;
  align-items: center;
}

.input-group .form-control {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group-text {
  padding: 8px 12px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

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

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 0;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: toastIn 0.3s ease;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Loading Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: var(--radius);
}

[data-theme="dark"] .loading-overlay {
  background: rgba(23,23,23,0.8);
}

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.page-header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* --- Charts --- */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.chart-container .chart-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.chart-box {
  width: 100%;
  height: 300px;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-card);
}

.timeline-item.completed::before { background: var(--success); }
.timeline-item.pending::before { background: var(--warning); }
.timeline-item.rejected::before { background: var(--danger); }

.timeline-time {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-content {
  font-size: 13px;
  color: var(--text);
  margin-top: 2px;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state .empty-text {
  font-size: 14px;
}

/* --- Tag/Pill --- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--border-light);
  color: var(--text-secondary);
}

/* --- Dropdown --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 1100;
  display: none;
  padding: 4px;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}

.dropdown-item:hover { background: var(--border-light); color: var(--text); }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination .page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.pagination .page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Section Divider --- */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .section-icon {
  color: var(--primary);
}

/* --- Welcome Card --- */
.welcome-card {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.welcome-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.welcome-card p {
  opacity: 0.9;
  font-size: 14px;
}

/* --- Trip Card (for grid views) --- */
.trip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  cursor: pointer;
  border-left: 4px solid var(--primary);
}

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

.trip-card .trip-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  font-family: monospace;
}

.trip-card .trip-dest {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0;
}

.trip-card .trip-dates {
  font-size: 12px;
  color: var(--text-secondary);
}

.trip-card .trip-status {
  margin-top: 8px;
}

/* Status border colors */
.trip-card[data-status="draft"] { border-left-color: #94A3B8; }
.trip-card[data-status="pending_approval"] { border-left-color: #F59E0B; }
.trip-card[data-status="approved"] { border-left-color: #10B981; }
.trip-card[data-status="rejected"] { border-left-color: #EF4444; }
.trip-card[data-status="booking"] { border-left-color: #3B82F6; }
.trip-card[data-status="reporting"] { border-left-color: #8B5CF6; }
.trip-card[data-status="completed"] { border-left-color: #475569; }

/* --- Employee Card --- */
.employee-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  cursor: pointer;
  text-align: center;
}

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

.employee-card .emp-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  margin: 0 auto 12px;
}

.employee-card .emp-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.employee-card .emp-role {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.employee-card .emp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.employee-card .emp-stat-item {
  text-align: center;
}

.employee-card .emp-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.employee-card .emp-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-card .login-logo .logo-circle {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 24px;
  color: #fff;
}

.login-card .login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.login-card .login-logo p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.login-card .login-error {
  background: #FEF2F2;
  color: #991B1B;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  border: 1px solid #FECACA;
}

.login-card .login-error.show { display: block; }

.login-card .theme-preview {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: block;
  }

  .page-content {
    padding: 16px;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

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

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right .theme-selector {
    display: none;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
  }

  .welcome-card {
    padding: 20px;
  }

  .welcome-card h2 {
    font-size: 18px;
  }
}

/* --- Utility Classes --- */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.d-flex { display: flex; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.border { border: 1px solid var(--border); }
.shadow { box-shadow: var(--shadow); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.relative { position: relative; }
.pointer { cursor: pointer; }
.opacity-50 { opacity: 0.5; }

/* --- Notification Page --- */
.notification-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background var(--transition);
  cursor: pointer;
}

.notification-item:hover { background: var(--border-light); }
.notification-item.unread { background: var(--primary-light); }

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notification-icon.info { background: #DBEAFE; color: #2563EB; }
.notification-icon.warning { background: #FEF3C7; color: #D97706; }
.notification-icon.success { background: #D1FAE5; color: #059669; }
.notification-icon.approval { background: #EDE9FE; color: #7C3AED; }
.notification-icon.booking { background: #E0E7FF; color: #4F46E5; }
.notification-icon.report { background: #FCE7F3; color: #DB2777; }

.notification-content { flex: 1; }

.notification-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.notification-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Countdown Timer --- */
.countdown {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
  padding: 8px 16px;
  background: #FEF2F2;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.countdown.ended {
  color: var(--text-muted);
  background: var(--border-light);
}

/* --- Profile Page --- */
.profile-section {
  max-width: 600px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* --- Dynamic Form Rows --- */
.dynamic-rows .dynamic-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dynamic-rows .dynamic-row .form-control {
  flex: 1;
  min-width: 120px;
}

.dynamic-row .remove-row {
  flex-shrink: 0;
}

/* --- Budget Preview --- */
.budget-preview {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}

.budget-preview .budget-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.budget-preview .budget-total {
  font-weight: 700;
  font-size: 15px;
  border-top: 1px solid var(--primary);
  margin-top: 8px;
  padding-top: 8px;
}

/* --- Expense Table --- */
.expense-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.expense-total-bar .total-amount {
  font-size: 18px;
  font-weight: 700;
}

.expense-total-bar .budget-status {
  font-size: 13px;
  font-weight: 500;
}

.budget-ok { color: var(--success); }
.budget-over { color: var(--danger); }

/* --- Admin Tabs --- */
.admin-tabs .tab-content {
  min-height: 400px;
}

/* --- Quote Compare --- */
.quote-table td.winner {
  background: #D1FAE5;
  font-weight: 600;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.card { animation: fadeIn 0.3s ease; }
.stat-card { animation: slideUp 0.3s ease; }

/* --- Better Dark Theme Shadows --- */
[data-theme="dark"] .card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
}
[data-theme="dark"] .card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .stat-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
}
[data-theme="dark"] .stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .modal {
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}
[data-theme="dark"] .toast {
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
[data-theme="dark"] .dropdown-menu {
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* Dark theme button hover shadows */
[data-theme="dark"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 2px 12px rgba(59,130,246,0.4);
}
[data-theme="dark"] .btn-danger:hover:not(:disabled) {
  box-shadow: 0 2px 12px rgba(220,38,38,0.4);
}

/* Dark theme badge overrides */
[data-theme="dark"] .badge-pending_manager { background: #78350F; color: #FEF3C7; }
[data-theme="dark"] .badge-pending_gm { background: #78350F; color: #FEF3C7; }
[data-theme="dark"] .badge-manager_approved { background: #064E3B; color: #D1FAE5; }
[data-theme="dark"] .badge-cancelled { background: #7F1D1D; color: #FEE2E2; }
[data-theme="dark"] .badge-suspended { background: #78350F; color: #FEF3C7; }
[data-theme="dark"] .badge-closed { background: #1E293B; color: #94A3B8; }
[data-theme="dark"] .badge-timeout { background: #1E293B; color: #94A3B8; }

/* Dark theme file upload overrides */
[data-theme="dark"] .file-upload-zone {
  background: #262626;
  border-color: #404040;
}
[data-theme="dark"] .file-upload-zone:hover,
[data-theme="dark"] .file-upload-zone.dragover {
  border-color: var(--primary);
  background: #1E3A5F;
}
[data-theme="dark"] .file-thumb {
  border-color: #404040;
}
[data-theme="dark"] .quote-thumb {
  border-color: #404040;
}

/* --- File Upload --- */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--border-light);
}
.file-upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.file-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.file-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition);
}
.file-thumb:hover {
  transform: scale(1.05);
}
.quote-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.quote-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}
