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

:root {
  --primary: #d64931;
  --primary-dark: #c13d27;
  --primary-light: #e55a42;
  --secondary: #1a237e;
  --secondary-light: #283593;

  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  --bg-main: #ffffff;
  --bg-sidebar: #fafafa;
  --bg-card: #ffffff;
  --bg-light: #f8f9fa;

  --text-dark: #171717;
  --text-gray: #525252;
  --text-light: #a3a3a3;

  --border: #e5e5e5;
  --shadow: rgba(0, 0, 0, 0.04);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  letter-spacing: -0.01em;
  background: var(--bg-main);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  letter-spacing: -0.02em;
}

/* Material Symbols */
.material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
  vertical-align: middle;
  line-height: 1;
}

.icon-inline {
  font-size: 18px;
  vertical-align: -3px;
  margin-right: 2px;
}

/* Icon sizes per context */
.login-logo-icon .material-symbols-outlined { font-size: 48px; }
.logo-icon .material-symbols-outlined { font-size: 28px; }
.nav-icon .material-symbols-outlined { font-size: 18px; }
.nav-item-level-2 .nav-icon .material-symbols-outlined { font-size: 16px; }
.expense-icon .material-symbols-outlined { font-size: 22px; color: var(--primary); }
.file-upload-icon .material-symbols-outlined { font-size: 32px; }
.empty-state-icon .material-symbols-outlined { font-size: 48px; }
.modal-close .material-symbols-outlined { font-size: 18px; }
.stat-icon .material-symbols-outlined { font-size: 48px; color: var(--primary); }
.stat-card-single .stat-icon .material-symbols-outlined { font-size: 56px; }
.btn .material-symbols-outlined { font-size: 18px; vertical-align: -3px; margin-right: 4px; }
.btn-sm .material-symbols-outlined { font-size: 16px; vertical-align: -3px; margin-right: 0; }

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--gray-100) 100%);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 30px var(--shadow);
}

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

.login-logo-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-logo-img {
  max-width: 180px;
  height: auto;
  margin-bottom: 16px;
}

.login-logo-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.login-logo-subtitle {
  font-size: 12px;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: center;
}

/* Sidebar */
.sidebar {
  width: 240px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  z-index: 100;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

.sidebar-header {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.logo-icon { font-size: 32px; margin-bottom: 8px; }

.sidebar-logo-img {
  max-width: 120px;
  height: auto;
  margin-bottom: 8px;
}

.logo-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-gray);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-section { padding: 24px 0; }

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--text-gray);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-left: 2px solid transparent;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.nav-item:hover { color: var(--text-dark); background: rgba(0, 0, 0, 0.02); }

.nav-item.active {
  color: var(--primary);
  background: rgba(214, 73, 49, 0.04);
  border-left-color: var(--primary);
  font-weight: 500;
}

.nav-icon { margin-right: 14px; font-size: 16px; }

.nav-item-level-2 {
  padding-left: 52px;
  font-size: 12px;
  opacity: 0.9;
}

.nav-item-level-2 .nav-icon {
  font-size: 14px;
  margin-right: 12px;
}

.nav-separator {
  height: 1px;
  background: var(--border);
  margin: 12px 16px;
  opacity: 0.6;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
}

/* Topbar */
.topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: fixed;
  top: 0;
  right: 0;
  left: 240px;
  z-index: 90;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-gray);
  transition: all 0.2s;
}
.mobile-menu-btn:hover { background: var(--bg-light); color: var(--text-dark); }

.topbar-welcome {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-welcome span { font-weight: 300; color: var(--text-gray); }

.topbar-right { display: flex; gap: 20px; align-items: center; }

.topbar-link {
  font-size: 12px;
  color: var(--text-gray);
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
}
.topbar-link:hover { color: var(--primary); }

.user-menu { display: flex; align-items: center; gap: 10px; cursor: pointer; }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
}

.user-name { font-size: 13px; color: var(--text-dark); }

/* Main Content */
.main-content {
  margin-left: 240px;
  margin-top: 64px;
  padding: 32px 40px;
  min-height: calc(100vh - 64px);
}

.page-header { margin-bottom: 32px; }

.page-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.page-subtitle { font-size: 13px; font-weight: 300; color: var(--text-gray); }

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
}

.stat-box:hover { transform: translateY(-2px); box-shadow: 0 4px 8px var(--shadow); }

.stat-box-number {
  font-family: 'Montserrat', sans-serif;
  font-size: 36px;
  font-weight: 200;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-box-label {
  font-size: 12px;
  color: var(--text-gray);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-box-link {
  font-size: 11px;
  color: var(--primary);
  margin-top: 12px;
  display: inline-block;
  cursor: pointer;
  transition: color 0.2s;
}
.stat-box-link:hover { color: var(--primary-dark); }

/* Action Bar */
.action-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
}
.action-left { display: flex; gap: 12px; }

.btn {
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dark);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  background: var(--bg-light);
  border-color: var(--gray-300);
}

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

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

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

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

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

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

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

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

/* Filter Bar */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.filter-group { display: flex; flex-direction: column; gap: 6px; }

.filter-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-input, .filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
}

.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 24px;
  overflow: hidden;
}

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

.card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dark);
}

.card-count {
  font-size: 12px;
  color: var(--text-gray);
  font-weight: 300;
}

.card-body { padding: 24px; }

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

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

.table thead th {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-light);
  white-space: nowrap;
}

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

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

.table tbody tr:hover {
  background: rgba(214, 73, 49, 0.02);
}

.table-compact tbody td,
.table-compact thead th {
  padding-top: 10px;
  padding-bottom: 10px;
}

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

.cell-strong {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}

/* Expense Table */
.expense-table { }

.expense-row {
  display: grid;
  grid-template-columns: 48px 2fr 1.5fr 1fr 1fr 120px;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}

.expense-row-km {
  grid-template-columns: 48px 2fr 1.3fr 0.9fr 1fr 0.9fr 120px;
}
.expense-row-aprobacion {
  grid-template-columns: 38px 2fr 1.4fr 1fr 1fr 120px 120px;
}
.expense-row-km-aprobacion {
  grid-template-columns: 38px 2fr 1.3fr 0.9fr 1fr 0.9fr 120px 120px;
}
.expense-row-selected {
  background: rgba(214, 73, 49, 0.06);
}

.expense-row:hover { background: rgba(214, 73, 49, 0.02); }
.expense-row:last-child { border-bottom: none; }

/* User-facing list grids (no icon column, factura column for gastos) */
.expense-row.expense-row-user { grid-template-columns: 2fr 1.5fr 1fr 1fr 80px 120px; }
.expense-row.expense-row-km-user { grid-template-columns: 2fr 1.5fr 1fr 1.3fr 1fr 120px; }

/* Column header row */
.expense-row-header {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 80px 120px;
  gap: 16px;
  padding: 6px 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}
.expense-row-header.expense-row-header-km { grid-template-columns: 2fr 1.5fr 1fr 1.3fr 1fr 120px; }
.expense-row-header.expense-row-header-aprobacion { grid-template-columns: 38px 2fr 1.4fr 1fr 1fr 120px 120px; }
.expense-row-header.expense-row-header-km-aprobacion { grid-template-columns: 38px 2fr 1.3fr 0.9fr 1fr 0.9fr 120px 120px; }
.req-star { color: #dc2626; }

.expense-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.expense-row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.expense-actions-inline {
  display: flex;
  justify-content: flex-end;
}

.bulk-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}

.bulk-toolbar-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dark);
  user-select: none;
}

.bulk-toolbar-meta {
  font-size: 12px;
  color: var(--text-gray);
}

.bulk-toolbar-actions {
  display: flex;
  gap: 8px;
}

.expense-row-form { background: var(--bg-light); cursor: default !important; }
.expense-row-form:hover { background: var(--bg-light) !important; }
.expense-row-editing { background: var(--bg-light); cursor: default !important; }
.expense-row-editing:hover { background: var(--bg-light) !important; }

.expense-mobile-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  padding: 14px;
  margin: 10px 10px 0;
}

.expense-mobile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expense-mobile-fields-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.expense-mobile-label {
  font-size: 11px;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.expense-mobile-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
}

.expense-mobile-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.expense-mobile-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.km-mobile-card .expense-category {
  margin-bottom: 4px;
}

.km-mobile-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.km-mobile-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.km-mobile-label {
  font-size: 11px;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.km-mobile-value {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.35;
  word-break: break-word;
}

.km-mobile-distance {
  font-size: 15px;
  line-height: 1.35;
}

.km-mobile-actions .badge {
  align-self: flex-start;
}

.km-mobile-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.km-mobile-buttons .btn {
  justify-content: center;
}

.expense-mobile-create-row {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}

.list-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}

.list-filters-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
}

.list-filters-grid-km {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.list-filters-box {
  margin: 14px 16px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}

.list-filters-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list-filters-box-header .material-symbols-outlined {
  font-size: 18px;
}

.list-create-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: rgba(16, 185, 129, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: #047857;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list-create-box-header .material-symbols-outlined {
  font-size: 18px;
}

.list-create-row {
  margin: 0 16px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 0 0 8px 8px;
  background: rgba(16, 185, 129, 0.04) !important;
}

.row-input {
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  background: white;
  color: var(--text-dark);
  font-family: inherit;
}
.row-input:focus { outline: none; border-color: var(--primary); }

.expense-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--border);
}

.expense-category { font-size: 14px; font-weight: 500; color: var(--text-dark); margin-bottom: 2px; }
.expense-description { font-size: 12px; color: var(--text-gray); font-weight: 300; }
.expense-center { font-size: 13px; color: var(--text-gray); }

.expense-amount {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-dark);
}

.expense-date { font-size: 12px; color: var(--text-gray); font-weight: 300; }

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pendiente {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-aprobado, .badge-aprobado_delegado, .badge-aprobado_gestion, .badge-aprobado_direccion {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cerrado {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-rechazado, .badge-devuelto_gestion {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-rechazados {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: #dc2626;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-rechazados .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }

.expense-row-rechazado { border-left: 3px solid #dc2626; }
.expense-motivo-rechazo {
  font-size: 12px;
  color: #dc2626;
  margin-top: 2px;
  font-style: italic;
}
.detail-motivo-rechazo {
  color: #dc2626;
  font-style: italic;
  background: rgba(239, 68, 68, 0.06);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #dc2626;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Badges de Roles */
.badge-admin {
  background: rgba(214, 73, 49, 0.1);
  color: #d64931;
  border: 1px solid rgba(214, 73, 49, 0.3);
}

.badge-direccion {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-control_gestion {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-delegado {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-comercial {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Usuario Inactivo */
.usuario-inactivo {
  opacity: 0.6;
}

.usuario-inactivo td {
  text-decoration: line-through;
  color: #9ca3af;
}

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

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

.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-label.required::after { content: '*'; color: var(--danger); margin-left: 4px; }

.form-input, .form-select, .form-textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 300;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

/* Searchable centro dropdown */
.centro-search-wrapper { position: relative; }
.centro-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.centro-search-dropdown.open { display: block; }
.centro-search-option {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
}
.centro-search-option:last-child { border-bottom: none; }
.centro-search-option:hover, .centro-search-option.focused { background: rgba(214,73,49,0.06); color: var(--primary); }
.centro-search-option .centro-delegacion { font-size: 11px; color: var(--text-gray); }

.file-upload-wrapper {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload-wrapper:hover {
  border-color: var(--primary);
  background: rgba(214, 73, 49, 0.02);
}

.file-upload-wrapper input[type="file"] {
  display: none;
}

.file-upload-icon { font-size: 32px; margin-bottom: 12px; color: var(--text-light); }
.file-upload-text { font-size: 13px; color: var(--text-gray); margin-bottom: 4px; }
.file-upload-hint { font-size: 11px; color: var(--text-light); }
.file-upload-name {
  font-size: 12px;
  color: var(--primary);
  margin-top: 8px;
  font-weight: 500;
}

.form-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-large {
  max-width: 640px;
  width: 95%;
}

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

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

.modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-dark);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-gray);
  transition: all 0.2s;
}
.modal-close:hover { background: var(--bg-light); color: var(--text-dark); }

.modal-body { padding: 24px; }

.detail-grid { display: grid; gap: 20px; }
.detail-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.detail-item { display: flex; flex-direction: column; gap: 6px; }

.detail-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value { font-size: 14px; font-weight: 400; color: var(--text-dark); }
.detail-value.large { font-family: 'Montserrat', sans-serif; font-size: 28px; font-weight: 300; }

.factura-preview {
  margin-top: 12px;
}

.factura-preview img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

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

/* Toasts */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 420px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--bg-card);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-dark);
  animation: slideToastIn 0.2s ease;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--info); }

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

/* Empty */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 48px; opacity: 0.2; margin-bottom: 16px; }
.empty-state-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.empty-state-text { font-size: 13px; color: var(--text-gray); font-weight: 300; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.38);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-240px); box-shadow: 0 20px 40px rgba(0,0,0,0.12); }
  .sidebar.open { transform: translateX(0); }

  .topbar { left: 0; padding: 0 16px; }
  .main-content { margin-left: 0; padding: 24px 18px; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .mobile-menu-btn { display: inline-flex; }
}

@media (max-width: 768px) {
  .stats-row { grid-template-columns: 1fr; }
  .expense-row { grid-template-columns: 1fr; gap: 12px; }
  .expense-row.expense-row-aprobacion { grid-template-columns: 1fr; }
  .expense-row.expense-row-km-aprobacion { grid-template-columns: 1fr; }
  .expense-row.expense-row-user,
  .expense-row.expense-row-km-user {
    grid-template-columns: 1fr !important;
    align-items: stretch;
  }
  .expense-row-header { display: none; }
  .bulk-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .bulk-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .expense-actions-inline { justify-content: flex-start; }
  .expense-select-cell { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: 1fr; }
  .form-actions { justify-content: stretch; flex-wrap: wrap; }
  .form-actions .btn { width: 100%; justify-content: center; }

  .mobile-fullscreen-form {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
  }

  .mobile-fullscreen-form .modal-header,
  .mobile-fullscreen-form .modal-actions {
    flex-shrink: 0;
  }

  .mobile-fullscreen-form .modal-body {
    flex: 1;
    overflow-y: auto;
  }

  .list-filters { display: none; }
  .list-filters-box { display: none; }
  .list-create-box-header { display: none; }
}

@media (max-width: 480px) {
  .expense-mobile-fields-two { grid-template-columns: 1fr; }
  .km-mobile-buttons { grid-template-columns: 1fr; }
}

/* Loading */
.loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
  font-size: 48px;
  opacity: 0.9;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 24px;
  }

  .stat-icon {
    font-size: 36px;
  }

  .stat-value {
    font-size: 24px;
  }
}

/* Single Stat Card */
.stat-card-single {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  max-width: 500px;
}

.stat-card-single .stat-icon {
  font-size: 56px;
  opacity: 0.9;
}

.stat-card-single .stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
}

/* File Size Styles */
.file-size-large {
  color: #dc2626 !important;
  font-weight: 600;
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

/* Link in table */
.table a {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.table a:hover {
  text-decoration: underline;
}
