/* ============================================================
   Facturar — hoja de estilos de la SPA
   Sidebar azul marino, contenido claro, acento #2563EB
   ============================================================ */

:root {
  --navy: #0F172A;
  --navy-2: #1E293B;
  --navy-3: #334155;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --accent: #2563EB;
  --accent-600: #1D4ED8;
  --accent-soft: #EFF6FF;
  --text: #0F172A;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --border: #E2E8F0;
  --border-soft: #EDF2F7;
  --green: #16A34A;
  --green-soft: #F0FDF4;
  --amber: #B45309;
  --amber-soft: #FFFBEB;
  --amber-border: #FDE68A;
  --red: #DC2626;
  --red-soft: #FEF2F2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .18);
  --ring: 0 0 0 3px rgba(37, 99, 235, .22);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

svg { display: block; flex-shrink: 0; }

/* ---------- Layout general ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--navy);
  color: #E2E8F0;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  user-select: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #1E40AF);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .4);
}

.logo-name { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }

.nav a.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}

.side-foot {
  padding: 0 8px;
  font-size: 12px;
  color: var(--navy-3);
  line-height: 1.5;
}

.main-wrap { flex: 1; min-width: 0; }

main {
  max-width: 1420px;
  margin: 0 auto;
  padding: 30px 32px 90px;
}

.view { display: flex; flex-direction: column; gap: 18px; animation: view-in .18s ease; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Cabecera de vista ---------- */

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.view-head h1 { font-size: 24px; }
.subtitle { color: var(--muted); font-size: 14px; margin-top: 3px; }

.view-head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.period-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  box-shadow: var(--shadow);
}

.period-label {
  min-width: 148px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  padding: 0 6px;
  user-select: none;
}

.save-ind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-width: 110px;
  transition: opacity .25s ease;
}

.save-ind.ok { color: var(--green); }
.save-ind.fade { opacity: 0; }

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-head h2 { font-size: 17px; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; display: block; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .3); }
.btn-primary:hover:not([disabled]) { background: var(--accent-600); }

.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not([disabled]) { background: #F1F5F9; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not([disabled]) { background: #F1F5F9; color: var(--text); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not([disabled]) { background: #B91C1C; }

.btn-danger-ghost { background: transparent; color: var(--red); }
.btn-danger-ghost:hover:not([disabled]) { background: var(--red-soft); }

.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.icon-btn:hover { background: #EEF2F7; color: var(--text); text-decoration: none; }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn.icon-danger:hover { background: var(--red-soft); color: var(--red); }
.icon-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- Formularios ---------- */

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }

.field input, .field select, .field textarea, .filters input, .filters select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus, .field select:focus, .field textarea:focus,
.filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.field textarea { resize: vertical; min-height: 74px; }

.field .hint { font-size: 12px; color: var(--muted-2); font-weight: 400; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }

.check-field { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }

/* Inputs inline dentro de tablas */
.inp {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.inp:hover { border-color: var(--border); background: #fff; }
.inp:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: var(--ring); }
.inp.input-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }

.inp-num { width: 52px; text-align: right; }
.inp-money { width: 68px; text-align: right; }
.inp-pct { width: 52px; text-align: right; }
.inp-date { width: 118px; }
.inp-concepto { min-width: 150px; }
.inp-email { min-width: 128px; }

.tbl-edit { font-size: 13.5px; }
.tbl-edit th, .tbl-edit td { padding-left: 4px; padding-right: 4px; }
.tbl-edit .t-name { max-width: 130px; }
.tbl-edit .t-mote { font-size: 13.5px; }

input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Interruptor (activo/inactivo) */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0;
  background: #CBD5E1;
  border-radius: 999px;
  transition: background .18s ease;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }

/* ---------- Tablas ---------- */

.tbl-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }

.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted-2);
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tbl td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: #F8FAFC; }
.tbl tbody tr:last-child td { border-bottom: none; }

.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.num { text-align: right; }

.tbl tfoot td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  font-weight: 700;
  padding-top: 10px;
}

.cell-num { white-space: nowrap; }
.cell-num .prefix { font-weight: 700; color: var(--accent); margin-right: 2px; }

.t-mote { font-weight: 600; white-space: nowrap; }
.t-name { font-size: 12px; color: var(--muted); max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.trunc { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-inactive { opacity: .55; }
.row-inactive:hover { opacity: .8; }

/* ---------- Chips, badges y estados ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-draft { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip svg { width: 13px; height: 13px; }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-muted { color: var(--muted-2); }

/* ---------- Alertas / banners ---------- */

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid;
}

.alert-body { display: flex; align-items: center; gap: 10px; }
.alert-amber { background: var(--amber-soft); border-color: var(--amber-border); color: var(--amber); }
.alert-info { background: var(--accent-soft); border-color: #BFDBFE; color: #1E40AF; }
.alert-red { background: var(--red-soft); border-color: #FECACA; color: var(--red); }

/* ---------- Barra fija de emisión ---------- */

.issue-bar {
  position: sticky;
  bottom: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(15, 23, 42, .05), var(--shadow-lg);
}

.issue-info { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }

.sum-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.sum-chip b { color: var(--text); font-variant-numeric: tabular-nums; }

.sum-total { font-size: 15px; }
.sum-total b { color: var(--accent); font-size: 17px; font-variant-numeric: tabular-nums; }

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

/* ---------- Filtros historial ---------- */

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select { min-width: 130px; }

.search {
  position: relative;
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
}

.search svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.search input { width: 100%; padding-left: 34px; }

/* ---------- Estados vacíos ---------- */

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

.empty .empty-icon {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}

.empty .empty-icon svg { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty p { font-size: 14px; max-width: 420px; margin: 0 auto 14px; }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--navy);
  color: #F1F5F9;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show { opacity: 1; transform: none; }
.toast-ic { display: flex; margin-top: 1px; }
.toast-ic svg { width: 16px; height: 16px; }
.toast-success .toast-ic { color: #4ADE80; }
.toast-error { background: var(--red); color: #fff; }
.toast-error .toast-ic { color: #fff; }
.toast-warn { background: #92400E; color: #FEF3C7; }
.toast-warn .toast-ic { color: #FCD34D; }

/* ---------- Modales ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in .15s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-overlay.closing { opacity: 0; transition: opacity .15s ease; }

.modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modal-in .18s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-head h3 { font-size: 17px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border-soft);
}

.modal-foot .foot-left { margin-right: auto; }

.modal-msg { color: var(--muted); font-size: 14px; margin-bottom: 12px; }

/* Filas del modal de emisión */
.issue-list { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; }
.issue-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.issue-row:last-child { border-bottom: none; }
.issue-row:nth-child(odd) { background: #FBFDFF; }
.issue-row .in { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issue-row .no { font-weight: 700; color: var(--accent); min-width: 44px; }
.issue-row .tt { font-weight: 600; font-variant-numeric: tabular-nums; }
.issue-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 4px 0;
  font-weight: 700;
  font-size: 15px;
}

/* Filas del modal de email */
.em-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.em-row:hover { background: #FBFDFF; }
.em-row.disabled { cursor: default; background: var(--bg); }
.em-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.em-row .em-num { font-weight: 700; color: var(--accent); min-width: 42px; }
.em-row .em-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.em-row .em-mail { color: var(--muted); font-size: 13px; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-row .em-status { min-width: 96px; display: flex; justify-content: flex-end; }

/* ---------- Chips de placeholders (ajustes) ---------- */

.ph-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

.ph-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 3px 9px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #BFDBFE;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease;
}

.ph-chip:hover { background: #DBEAFE; }
.ph-chip:focus-visible { outline: none; box-shadow: var(--ring); }

/* Estado del sistema */
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}
.status-row:last-child { border-bottom: none; }
.status-row .grow { flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.dot-amber { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
.dot-red { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(700px 400px at 80% -10%, rgba(37, 99, 235, .12), transparent),
    radial-gradient(600px 400px at 10% 110%, rgba(37, 99, 235, .08), transparent),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 34px 30px 30px;
  text-align: center;
}

.login-card .logo-mark { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; margin: 0 auto 14px; }
.login-card h1 { font-size: 24px; }
.login-sub { color: var(--muted); font-size: 14px; margin: 4px 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }

.login-error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- Spinner y confeti ---------- */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(100, 116, 139, .3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

.btn-primary .spinner, .btn-danger .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

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

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px;
  color: var(--muted);
  font-size: 14px;
}

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: .95;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(600deg); opacity: .4; }
}

/* ---------- Utilidades ---------- */

.mt-8 { margin-top: 8px; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .app { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .logo { padding: 0; }
  .logo-name { display: none; }

  .nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 8px 11px; font-size: 13px; white-space: nowrap; }
  .nav a svg { width: 15px; height: 15px; }

  .side-foot { display: none; }

  main { padding: 18px 14px 80px; }

  .view-head h1 { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }

  .issue-bar { flex-direction: column; align-items: stretch; bottom: 8px; }
  .issue-actions { flex-direction: column; align-items: stretch; }
  .issue-actions .btn { width: 100%; }

  .card { padding: 14px; }
  .card-actions { width: 100%; }
  .card-actions .btn { flex: 1; }

  .period-label { min-width: 118px; font-size: 14px; }
  .save-ind { min-width: 0; }

  .em-row .em-mail { display: none; }
}
