/* =========================================================
   Admin-specific styles (extends app.css)
   ========================================================= */

/* Section header */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-12) 0 var(--space-5);
}
.section-head:first-of-type { margin-top: var(--space-8); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: 32px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1;
}
.section-head .sub {
  color: var(--fg-2); font-size: 13px; margin: 6px 0 0;
}
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Rates table */
.rates-table { width: 100%; border-collapse: collapse; }
.rates-table th, .rates-table td {
  padding: 14px var(--space-5);
  border-bottom: 1px solid var(--divider);
  text-align: left; vertical-align: middle;
}
.rates-table thead th {
  background: var(--surface-2);
  font-size: 11px; font-weight: 700;
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--fg-2);
}
.rates-table tbody tr:last-child td { border-bottom: none; }
.rates-table input.cell-input {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  width: 100%;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.rates-table input.cell-input:hover { background: var(--neutral-50); }
.rates-table input.cell-input:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--mer);
  box-shadow: 0 0 0 3px rgba(43,168,214,0.18);
}
.rates-table .cell-rate {
  font-family: var(--font-mono); font-weight: 600;
  text-align: right; font-variant-numeric: tabular-nums;
}
.rates-table .col-rate { width: 140px; }
.rates-table .col-actions { width: 60px; }
.rates-table .col-pill { width: 160px; }

.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { color: var(--rock); background: var(--neutral-100); border-color: var(--border); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: #FDEEEC; }
.icon-btn svg { width: 16px; height: 16px; }

/* Add-row form (inline at bottom of rates table) */
.add-row {
  display: grid; grid-template-columns: 1fr 140px auto; gap: 10px;
  padding: var(--space-4) var(--space-5);
  background: var(--mer-foam);
  border-top: 1px dashed rgba(43,168,214,0.5);
}
.add-row input { width: 100%; }

/* Entries admin list */
.adm-entries {
  width: 100%; border-collapse: collapse;
}
.adm-entries th, .adm-entries td {
  padding: 12px var(--space-5);
  border-bottom: 1px solid var(--divider);
  text-align: left; vertical-align: middle;
}
.adm-entries thead th {
  background: var(--surface-2);
  font-size: 11px; font-weight: 700;
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
}
.adm-entries td.td-date { font-variant-numeric: tabular-nums; color: var(--fg-2); white-space: nowrap; }
.adm-entries td.td-date strong { color: var(--rock); font-weight: 600; }
.adm-entries td.td-name { font-weight: 600; }
.adm-entries td.td-action .small-comment {
  color: var(--fg-2); font-size: 12px; line-height: 1.35; margin-top: 2px;
}
.adm-entries td.td-time { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.adm-entries td.td-actions { white-space: nowrap; text-align: right; }
.adm-entries tbody tr:hover { background: var(--surface-2); }
.adm-entries tbody tr:last-child td { border-bottom: none; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(14,20,24,0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 60;
  padding: var(--space-6);
  animation: overlay-in 160ms var(--ease-out);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--paper);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  width: 100%; max-width: 540px;
  max-height: calc(100vh - 64px);
  overflow: auto;
  animation: modal-in 220ms var(--ease-out);
}
.modal-head {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 20px; }
.modal-body { padding: var(--space-6) var(--space-8); }
.modal-foot {
  padding: var(--space-4) var(--space-8) var(--space-6);
  display: flex; gap: 10px; align-items: center;
}
.modal-foot .spacer { flex: 1; }

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

/* Confirm danger button */
.btn-danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn-danger:hover { background: #A8341F; border-color: #A8341F; box-shadow: 0 8px 24px rgba(200,65,46,0.28); transform: translateY(-1px); }

/* Tabs (top of admin page) */
.tabs {
  display: inline-flex; gap: 4px;
  background: var(--neutral-100);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: var(--space-6);
}
.tabs button {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 700;
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: transparent; color: var(--fg-2);
  border: none; cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.tabs button.active { background: var(--rock); color: #fff; }
.tabs button:hover:not(.active) { color: var(--rock); }

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

/* Inline editable label */
.editable-label {
  font-weight: 600; cursor: text;
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  margin: -4px -6px;
}
.editable-label:hover { background: var(--neutral-100); }

/* Export card */
.export-card {
  display: flex; gap: var(--space-6); align-items: center;
  padding: var(--space-6) var(--space-8);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.export-card .icon-wrap {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--mer-foam); color: var(--mer-deep);
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.export-card .icon-wrap svg { width: 26px; height: 26px; }
.export-card .info { flex: 1; }
.export-card .info h4 { margin: 0 0 4px; font-size: 16px; }
.export-card .info p { margin: 0; color: var(--fg-2); font-size: 13px; }
