@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ──────────────────────────────────────────────────────────────────────────── */
/* DESIGN TOKENS                                                                 */
/* ──────────────────────────────────────────────────────────────────────────── */
:root {
  --primary: #1E3A5F;
  --primary-light: #2A5298;
  --primary-dark: #0F1F35;
  --accent: #00897B;
  --accent-light: #00BFA5;
  --highlight: #FF6B35;
  --success: #2D9A63;
  --warning: #E8A020;
  --danger: #C0392B;
  --info: #2980B9;

  --bg: #F6F4F0;
  --bg-card: #FFFFFF;
  --bg-sidebar: #4C0A1B;
  --bg-sidebar-2: #380713;

  --text-primary: #1A2035;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --text-white: #FFFFFF;
  --text-sidebar: rgba(255, 255, 255, 0.85);

  --border: #E2E8F0;
  --border-light: #F7FAFC;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.18);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --sidebar-w: 260px;
  --header-h: 64px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  height: 100%;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

button {
  cursor: pointer;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

ul {
  list-style: none;
}

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-sidebar) 0%, var(--bg-sidebar-2) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #B38E5D, #D5C39E);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(179, 142, 93, 0.25);
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-sidebar);
  opacity: 0.7;
}

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

.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: #D5C39E;
  margin-top: 2px;
}

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

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  padding: 12px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-sidebar);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(179, 142, 93, 0.25), rgba(179, 142, 93, 0.08));
  color: #D5C39E;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #B38E5D;
  border-radius: 0 2px 2px 0;
}

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

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

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

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: rgba(192, 57, 43, 0.15);
  color: #FF8A80;
  border: 1px solid rgba(192, 57, 43, 0.3);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(192, 57, 43, 0.3);
  color: #FF5252;
}

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

/* Top header */
.top-header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 2px solid #B38E5D;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Page content */
.page-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

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

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #FAFBFC;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

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

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

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

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

.stat-icon.blue {
  background: rgba(30, 58, 95, 0.12);
  color: var(--primary-light);
}

.stat-icon.green {
  background: rgba(45, 154, 99, 0.12);
  color: var(--success);
}

.stat-icon.orange {
  background: rgba(255, 107, 53, 0.12);
  color: var(--highlight);
}

.stat-icon.teal {
  background: rgba(0, 137, 123, 0.12);
  color: var(--accent);
}

.stat-icon.red {
  background: rgba(192, 57, 43, 0.12);
  color: var(--danger);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* BUTTONS                                                                       */
/* ──────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

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

.btn-primary {
  background: var(--primary-light);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

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

.btn-success:hover:not(:disabled) {
  background: #248a55;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 154, 99, 0.3);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover:not(:disabled) {
  background: #00796B;
  transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
  background: #A93226;
  transform: translateY(-1px);
}

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

.btn-warning:hover:not(:disabled) {
  background: #d48e1a;
}

.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 1.5px solid var(--primary-light);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-light);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg);
  border-color: #cbd5e0;
}

.btn-sm {
  padding: 6px 13px;
  font-size: 12px;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 15px;
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  justify-content: center;
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* FORMS                                                                         */
/* ──────────────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

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

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.12);
}

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

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

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

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

.input-group {
  display: flex;
  gap: 0;
}

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

.input-group .input-addon {
  padding: 10px 13px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* TABLE                                                                         */
/* ──────────────────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 13px 16px;
  text-align: left;
  white-space: nowrap;
}

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

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

.table tbody tr:hover {
  background: #F7FAFC;
}

.table tbody tr.highlighted {
  background: #FFFDE7;
}

.table tfoot td {
  background: #EEF2FF;
  font-weight: 700;
  border-top: 2px solid var(--border);
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* BADGES & STATUS                                                               */
/* ──────────────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary {
  background: rgba(42, 82, 152, 0.12);
  color: var(--primary-light);
}

.badge-success {
  background: rgba(45, 154, 99, 0.12);
  color: var(--success);
}

.badge-warning {
  background: rgba(232, 160, 32, 0.12);
  color: var(--warning);
}

.badge-danger {
  background: rgba(192, 57, 43, 0.12);
  color: var(--danger);
}

.badge-info {
  background: rgba(41, 128, 185, 0.12);
  color: var(--info);
}

.badge-gray {
  background: rgba(74, 85, 104, 0.10);
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.green {
  background: var(--success);
}

.status-dot.yellow {
  background: var(--warning);
}

.status-dot.red {
  background: var(--danger);
}

.status-dot.blue {
  background: var(--info);
}

.status-dot.gray {
  background: var(--text-muted);
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* MODAL                                                                         */
/* ──────────────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 20px;
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 85%;
  max-width: 85vw;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}

.modal.modal-compact {
  width: 650px;
  max-width: 90vw;
  height: auto;
  max-height: 85vh;
}

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

.modal-sm,
.modal-md,
.modal-lg,
.modal-xl {
  max-width: 85vw;
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 3px solid #B38E5D;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, #7E102F 0%, #4C0A1B 100%);
  color: white;
  z-index: 2;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header .btn-ghost {
  color: white;
  border-color: rgba(255, 255, 255, 0.25);
}

.modal-header .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #EFE7DC;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #FAF8F5;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* MAP                                                                           */
/* ──────────────────────────────────────────────────────────────────────────── */
#project-map,
.map-container {
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  position: relative;
}

.map-info-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.map-info-item strong {
  color: var(--primary-light);
}

.map-waypoints {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.waypoint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 7px 10px;
  border: 1px solid var(--border);
  font-size: 12.5px;
}

.waypoint-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.waypoint-badge.origin {
  background: var(--primary-light);
  color: white;
}

.waypoint-badge.dest {
  background: var(--danger);
  color: white;
}

.waypoint-name {
  flex: 1;
}

.waypoint-remove {
  padding: 2px 7px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
}

.waypoint-remove:hover {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.08);
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* ALERTS & TOAST                                                                */
/* ──────────────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success {
  background: rgba(45, 154, 99, 0.1);
  color: var(--success);
  border: 1px solid rgba(45, 154, 99, 0.2);
}

.alert-warning {
  background: rgba(232, 160, 32, 0.1);
  color: #9A6800;
  border: 1px solid rgba(232, 160, 32, 0.3);
}

.alert-danger {
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger);
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.alert-info {
  background: rgba(41, 128, 185, 0.1);
  color: var(--info);
  border: 1px solid rgba(41, 128, 185, 0.2);
}

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(110%);
    opacity: 0;
  }
}

.toast.hide {
  animation: slideOut 0.3s ease forwards;
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* LOGIN PAGE                                                                    */
/* ──────────────────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #380713 0%, #7E102F 50%, #B38E5D 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(179, 142, 93, 0.15) 0%, transparent 70%);
  top: -150px;
  right: -150px;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(126, 16, 47, 0.18) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
}

.login-card {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #B38E5D, #D5C39E);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(179, 142, 93, 0.35);
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.role-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
}

.role-tab {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  border: none;
  background: transparent;
}

.role-tab.active {
  background: var(--primary-light);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* MISC                                                                          */
/* ──────────────────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

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

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 16px;
}

.mb-4 {
  margin-bottom: 24px;
}

.mt-3 {
  margin-top: 16px;
}

.p-0 {
  padding: 0 !important;
}

.fw-700 {
  font-weight: 700;
}

.fs-12 {
  font-size: 12px;
}

.fs-13 {
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

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

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

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

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Quincena section divider */
.quincena-header {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius);
  margin: 12px 0 6px;
  letter-spacing: 0.5px;
}

/* Budget summary bar */
.budget-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.budget-item {
  text-align: center;
}

.budget-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-light);
}

.budget-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Print report styles */
@media print {

  .sidebar,
  .top-header,
  .header-actions,
  .btn,
  .no-print {
    display: none !important;
  }

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

  .page-content {
    padding: 0 !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

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

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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