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

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --g:   #2e7d32;
  --gd:  #1b5e20;
  --gl:  #e8f5e9;
  --gol: #f9a825;
  --txt: #1a1a2e;
  --mu:  #6b7280;
  --bdr: #e2e8f0;
  --bg:  #f8fafc;
  --wh:  #ffffff;
  --red: #dc2626;
  --r:   8px;
  --sh:  0 2px 8px rgba(0,0,0,.08);
  --shl: 0 8px 32px rgba(0,0,0,.12);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
.lat-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.lat-wrap { font-family: 'DM Sans', system-ui, sans-serif; color: var(--txt); line-height: 1.6; }
.lat-wrap a { color: var(--g); }

/* ── Spinner ────────────────────────────────────────────────────────────── */
@keyframes lat-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════ */
#lat-dashboard { max-width: 1100px; margin: 0 auto; }

.lat-dh {
  background: var(--g);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}
.lat-logo { font-size: 1.5rem; font-weight: 700; color: #fff; letter-spacing: -.5px; }
.lat-logo span { color: var(--gol); }
.lat-dh-right { display: flex; align-items: center; gap: 16px; color: rgba(255,255,255,.85); font-size: .875rem; }
.lat-logout { color: rgba(255,255,255,.7); text-decoration: none; transition: color .2s; }
.lat-logout:hover { color: #fff; }

.lat-db-body {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  background: var(--wh);
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shl);
  overflow: hidden;
}
.lat-panel {}
.lat-ph {
  background: var(--g);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  padding: 10px 24px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.lat-pb { padding: 24px; }
.lat-sh { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--bdr); }

/* Begin buttons */
.lat-bb {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 13px 16px;
  background: var(--wh);
  border: 1.5px solid var(--bdr);
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  gap: 12px;
  margin-bottom: 10px;
  transition: all .2s;
  font-family: inherit;
  font-size: .95rem;
  color: var(--txt);
}
.lat-bb:hover { border-color: var(--g); background: var(--gl); transform: translateX(3px); }
.lat-bi { font-size: 1.2rem; flex-shrink: 0; }
.lat-bl { flex: 1; font-weight: 500; }
.lat-ba { color: var(--g); font-size: 1.2rem; font-weight: 700; }

/* Application list */
.lat-al { display: flex; flex-direction: column; gap: 8px; }
.lat-ai {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--bdr);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--txt);
  transition: all .2s;
}
.lat-ai:hover { border-color: var(--g); background: var(--gl); }
.lat-ai-title { flex: 1; font-weight: 500; }
.lat-ai-title small { display: block; font-size: .75rem; color: var(--mu); }

/* Status badges */
.lat-st { padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.lat-st--in-progress  { color: #1565c0; background: #e3f2fd; }
.lat-st--submitted    { color: #e65100; background: #fff3e0; }
.lat-st--under-review { color: #6a1b9a; background: #f3e5f5; }
.lat-st--approved     { color: #1b5e20; background: var(--gl); }
.lat-st--declined     { color: #b71c1c; background: #ffebee; }
.lat-st--withdrawn    { color: #424242; background: #f5f5f5; }

/* ══════════════════════════════════════════════════════
   MULTI-STEP FORM
═══════════════════════════════════════════════════════ */
.lat-fw { max-width: 1200px; margin: 0 auto; background: var(--wh); border-radius: 12px; box-shadow: var(--shl); overflow: hidden; }

.lat-fh {
  background: var(--g);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lat-fb { display: flex; min-height: 600px; }

/* Sidebar */
.lat-fsb {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--bdr);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}
.lat-san { padding: 0 20px 20px; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--bdr); margin-bottom: 16px; }
.lat-san small { display: block; font-size: .75rem; color: var(--mu); font-weight: 400; }

.lat-snav { flex: 1; overflow-y: auto; }
.lat-sni { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: .875rem; color: var(--mu); text-decoration: none; transition: all .2s; border-left: 3px solid transparent; }
.lat-sni:hover { background: var(--gl); color: var(--g); }
.lat-sni--a { color: var(--g); background: var(--gl); border-left-color: var(--g); font-weight: 600; }
.lat-sni--d .lat-sni-num { background: var(--gol); color: #fff; }
.lat-sni--l { opacity: .4; pointer-events: none; }
.lat-sni-num { width: 24px; height: 24px; border-radius: 50%; background: var(--bdr); color: var(--mu); font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lat-sni--a .lat-sni-num { background: var(--g); color: #fff; }

.lat-opts { padding: 20px; border-top: 1px solid var(--bdr); }
.lat-ob { width: 40px; height: 40px; border: 1.5px solid var(--bdr); border-radius: var(--r); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; transition: all .2s; text-decoration: none; }
.lat-ob:hover { border-color: var(--g); background: var(--gl); }

/* Main content */
.lat-fc { flex: 1; padding: 32px 40px; overflow-y: auto; max-height: calc(100vh - 60px); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.lat-btn { display: inline-flex; align-items: center; justify-content: center; padding: 11px 26px; border-radius: var(--r); font-family: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; transition: all .2s; border: none; text-decoration: none; }
.lat-btn--pri  { background: var(--g);  color: #fff; }
.lat-btn--pri:hover  { background: var(--gd); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46,125,50,.3); }
.lat-btn--sec  { background: var(--wh); color: var(--txt); border: 1.5px solid var(--bdr); }
.lat-btn--sec:hover  { border-color: var(--g); color: var(--g); }
.lat-btn--grn  { background: #1b5e20; color: #fff; }
.lat-btn--grn:hover  { background: #154a1a; transform: translateY(-1px); }
.lat-btn--outline { background: transparent; color: var(--g); border: 1.5px solid var(--g); }
.lat-btn--outline:hover { background: var(--gl); }

/* ── Form fields ────────────────────────────────────────────────────────── */
.lat-fs { margin-bottom: 30px; }
.lat-fs h3 { font-size: 1rem; font-weight: 700; color: var(--gd); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--gl); }

.lat-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lat-g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.lat-c2 { grid-column: span 2; }

.lat-fi { display: flex; flex-direction: column; gap: 6px; }
.lat-lbl { font-size: .85rem; font-weight: 600; color: var(--txt); }
.lat-req::after { content: ' *'; color: var(--red); }

.lat-in, .lat-sel, .lat-ta {
  padding: 10px 14px;
  border: 1.5px solid var(--bdr);
  border-radius: var(--r);
  font-family: inherit;
  font-size: .9rem;
  color: var(--txt);
  background: var(--wh);
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.lat-in:focus, .lat-sel:focus, .lat-ta:focus { outline: none; border-color: var(--g); box-shadow: 0 0 0 3px rgba(46,125,50,.12); }
.lat-in:disabled, .lat-sel:disabled, .lat-ta:disabled { background: var(--bg); opacity: .7; cursor: not-allowed; }
.lat-ta { resize: vertical; min-height: 90px; }

.lat-pre { display: flex; align-items: center; border: 1.5px solid var(--bdr); border-radius: var(--r); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.lat-pre:focus-within { border-color: var(--g); box-shadow: 0 0 0 3px rgba(46,125,50,.12); }
.lat-pre > span { padding: 0 12px; background: var(--bg); color: var(--mu); font-weight: 600; border-right: 1.5px solid var(--bdr); white-space: nowrap; line-height: 42px; }
.lat-pre .lat-in { border: none !important; box-shadow: none !important; border-radius: 0; }

.lat-chk { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .9rem; line-height: 1.4; }
.lat-chk input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--g); cursor: pointer; }

/* Repeating rows */
.lat-rr { background: var(--bg); border: 1.5px solid var(--bdr); border-radius: 10px; padding: 18px; margin-bottom: 14px; }
.lat-rr-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.lat-rr-hdr span { font-weight: 700; font-size: .875rem; color: var(--mu); }
.lat-rm, .lat-rmre { background: none; border: none; cursor: pointer; color: var(--red); font-size: 1rem; padding: 4px 8px; border-radius: 4px; transition: background .2s; }
.lat-rm:hover, .lat-rmre:hover { background: #ffebee; }

/* Step 1 */
.lat-step-intro { max-width: 760px; }
.lat-info-list { list-style: none; margin: 16px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.lat-info-list li { padding: 12px 16px; background: var(--bg); border-radius: var(--r); font-size: .9rem; }
.lat-consent-box { background: #fffde7; border: 1.5px solid var(--gol); border-radius: 12px; padding: 20px 24px; margin-bottom: 24px; font-size: .9rem; line-height: 1.7; }
.lat-consent-box p { margin-bottom: 12px; }
.lat-summary-box { background: var(--gl); border-radius: 12px; padding: 20px 24px; }
.lat-summary-box h3 { font-size: 1rem; font-weight: 700; color: var(--gd); margin-bottom: 14px; }
.lat-sg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lat-sg > div { }
.lat-sg label { display: block; font-size: .78rem; color: var(--mu); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.lat-sg span { font-weight: 600; }

/* Step 9 review */
.lat-review {}
.lat-rb { background: var(--bg); border: 1.5px solid var(--bdr); border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; }
.lat-rb h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.lat-rg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.lat-rg > div label { display: block; font-size: .78rem; color: var(--mu); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.lat-rg > div span { font-weight: 600; font-size: .9rem; }

/* Notices */
.lat-notice { padding: 14px 18px; border-radius: var(--r); margin-bottom: 20px; font-size: .9rem; border-left: 4px solid; }
.lat-notice--success { background: var(--gl); border-color: var(--g); color: #1b5e20; }
.lat-notice--error   { background: #ffebee; border-color: var(--red); color: #b71c1c; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .lat-db-body, .lat-fb { flex-direction: column; }
  .lat-fsb { width: 100%; border-right: none; border-bottom: 1px solid var(--bdr); }
  .lat-snav { display: flex; flex-wrap: wrap; padding: 8px 12px; gap: 4px; }
  .lat-sni { border-left: none; border-bottom: 3px solid transparent; padding: 6px 10px; font-size: .8rem; }
  .lat-sni--a { border-left: none; border-bottom-color: var(--g); }
  .lat-fc { padding: 20px; }
  .lat-g2, .lat-g3 { grid-template-columns: 1fr; }
  .lat-c2 { grid-column: span 1; }
  .lat-rg, .lat-sg { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .lat-form-nav { flex-direction: column; gap: 12px; }
  .lat-btn { width: 100%; }
}
@media print {
  .lat-fsb, .lat-fh, .lat-opts, #lat-toast { display: none !important; }
  .lat-fc { padding: 0; }
}
