@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  --white:#ffffff; --cream:#FFF9F4; --sand:#FCEFE3;
  --orange-50:#FFF3E8; --orange-100:#FFE1C2; --orange-300:#FFB25E;
  --orange-500:#EE7B1D; --orange-600:#D9660D; --orange-700:#B14E08;
  --ink:#2B1B12; --ink-soft:#6B5546; --line:#F0DFCB;
  --green:#3F8F5F; --green-bg:#E8F5EC; --amber:#C98A12; --amber-bg:#FDF3DC;
  --red:#C1462F; --red-bg:#FCEAE5;
  --shadow: 0 8px 24px -8px rgba(180,90,10,0.18);
}
*{box-sizing:border-box; margin:0; padding:0;}
body{ font-family:'Inter',sans-serif; color:var(--ink);
  background: linear-gradient(160deg, var(--white) 0%, var(--cream) 45%, var(--orange-50) 100%); min-height:100vh; }
h1,h2,h3{ font-family:'Fraunces', serif; letter-spacing:-0.01em; }
.mono{ font-family:'IBM Plex Mono', monospace; }
a{ color:inherit; }
button{ font-family:inherit; cursor:pointer; border:none; }
input, select, textarea{ font-family:inherit; }

/* LOGIN */
.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
  background: radial-gradient(circle at 15% 20%, var(--orange-100) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, var(--orange-300) 0%, transparent 40%),
    linear-gradient(160deg, #ffffff 0%, var(--cream) 55%, var(--orange-50) 100%); }
.login-card{ width:100%; max-width:920px; display:grid; grid-template-columns:1.1fr 1fr; background:var(--white);
  border-radius:24px; overflow:hidden; box-shadow:var(--shadow); border:1px solid var(--line); }
.login-side{ background: linear-gradient(155deg, var(--orange-600), var(--orange-500) 55%, var(--orange-300));
  color:var(--white); padding:48px 40px; display:flex; flex-direction:column; justify-content:space-between;
  position:relative; overflow:hidden; }
.login-side::after{ content:""; position:absolute; right:-60px; bottom:-80px; width:260px; height:260px;
  border-radius:50%; background:rgba(255,255,255,0.12); }
.login-side .eyebrow{ font-size:12px; letter-spacing:.14em; text-transform:uppercase; opacity:.85; margin-bottom:14px; font-weight:600;}
.login-side h1{ font-size:32px; line-height:1.15; margin-bottom:14px; }
.login-side p{ font-size:14.5px; line-height:1.6; opacity:.92; max-width:340px;}
.flow-mini{ display:flex; align-items:center; gap:8px; margin-top:34px; position:relative; z-index:1;}
.flow-mini .dot{ width:9px; height:9px; border-radius:50%; background:rgba(255,255,255,.55);}
.flow-mini .dot.on{ background:#fff; }
.flow-mini .seg{ height:2px; width:26px; background:rgba(255,255,255,.35); }
.flow-labels{ display:flex; gap:24px; margin-top:8px; }
.flow-labels span{ font-size:11.5px; opacity:.85; }
.login-form{ padding:48px 42px; display:flex; flex-direction:column; justify-content:center; }
.login-form h2{ font-size:24px; margin-bottom:6px;}
.login-form .sub{ font-size:13.5px; color:var(--ink-soft); margin-bottom:28px;}
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:12.5px; font-weight:600; color:var(--ink-soft); margin-bottom:6px; }
.field input, .field select, .field textarea{ width:100%; padding:11px 13px; border:1.5px solid var(--line);
  border-radius:10px; font-size:14.5px; background:var(--cream); color:var(--ink); transition:border-color .15s, background .15s; }
.field input:focus, .field select:focus, .field textarea:focus{ outline:none; border-color:var(--orange-500); background:var(--white); }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px 20px; border-radius:10px;
  font-size:14px; font-weight:700; transition:transform .12s, box-shadow .12s, opacity .12s; }
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:linear-gradient(135deg, var(--orange-600), var(--orange-500)); color:#fff;
  box-shadow:0 6px 16px -4px rgba(217,102,13,0.45);}
.btn-primary:hover{ box-shadow:0 8px 20px -4px rgba(217,102,13,0.6); }
.btn-outline{ background:transparent; border:1.5px solid var(--line); color:var(--ink-soft); }
.btn-outline:hover{ border-color:var(--orange-300); color:var(--orange-700); }
.btn-danger{ background:var(--red-bg); color:var(--red); }
.btn-block{ width:100%; }
.error-box{ background:var(--red-bg); color:var(--red); font-size:13px; padding:10px 13px; border-radius:9px; margin-bottom:16px; font-weight:500;}
.flash-success{ background:var(--green-bg); color:var(--green); font-size:13px; padding:10px 13px; border-radius:9px; margin-bottom:16px; font-weight:600;}
.flash-error{ background:var(--red-bg); color:var(--red); font-size:13px; padding:10px 13px; border-radius:9px; margin-bottom:16px; font-weight:600;}
.demo-box{ margin-top:22px; background:var(--orange-50); border:1px dashed var(--orange-300); border-radius:12px; padding:14px 16px; font-size:12px; color:var(--ink-soft); line-height:1.7;}
.demo-box b{ color:var(--orange-700); }

/* SHELL */
.shell{ display:grid; grid-template-columns:248px 1fr; min-height:100vh; }
.sidebar{ background:linear-gradient(180deg, var(--orange-700), var(--orange-600) 55%, var(--orange-500));
  color:#fff; padding:26px 18px; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; }
.brand{ display:flex; align-items:center; gap:10px; margin-bottom:6px; padding:0 6px;}
.brand .mark{ width:34px; height:34px; border-radius:9px; background:rgba(255,255,255,.18); display:flex;
  align-items:center; justify-content:center; font-family:'Fraunces',serif; font-weight:700; font-size:16px;}
.brand .txt{ font-size:13.5px; font-weight:700; line-height:1.25; }
.brand .txt small{ display:block; font-weight:500; opacity:.75; font-size:10.5px; letter-spacing:.04em; text-transform:uppercase; margin-top:2px;}
.nav{ margin-top:30px; display:flex; flex-direction:column; gap:3px; flex:1; }
.nav-item{ display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:10px; font-size:13.5px;
  font-weight:600; color:rgba(255,255,255,.82); background:transparent; text-align:left; width:100%; text-decoration:none; }
.nav-item .ic{ width:18px; text-align:center; font-size:15px; }
.nav-item:hover{ background:rgba(255,255,255,.1); color:#fff; }
.nav-item.active{ background:rgba(255,255,255,.95); color:var(--orange-700); }
.side-foot{ border-top:1px solid rgba(255,255,255,.18); padding-top:14px; margin-top:10px;}
.user-chip{ display:flex; align-items:center; gap:10px; padding:8px 8px; border-radius:10px; }
.user-chip .av{ width:32px; height:32px; border-radius:50%; background:rgba(255,255,255,.2); display:flex;
  align-items:center; justify-content:center; font-weight:700; font-size:13px;}
.user-chip .info{ line-height:1.3; }
.user-chip .info .n{ font-size:12.5px; font-weight:700; }
.user-chip .info .r{ font-size:10.5px; opacity:.75; text-transform:uppercase; letter-spacing:.05em;}
.logout-btn{ width:100%; margin-top:10px; background:rgba(0,0,0,.15); color:#fff; font-size:12.5px; padding:8px;
  border-radius:9px; font-weight:600; text-align:center; display:block; text-decoration:none; }
.logout-btn:hover{ background:rgba(0,0,0,.28); }
.main{ padding:30px 38px 60px; }
.topbar{ display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:26px; flex-wrap:wrap; gap:14px;}
.topbar h1{ font-size:26px; }
.topbar .desc{ font-size:13.5px; color:var(--ink-soft); margin-top:4px; }
.pill{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; padding:5px 11px; border-radius:99px; }
.pill-orange{ background:var(--orange-100); color:var(--orange-700); }

/* CARDS */
.grid-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:26px;}
.stat-card{ background:var(--white); border:1px solid var(--line); border-radius:16px; padding:20px; box-shadow:0 2px 10px -6px rgba(120,70,20,.15);}
.stat-card .lbl{ font-size:12px; color:var(--ink-soft); font-weight:600; margin-bottom:10px; }
.stat-card .val{ font-family:'Fraunces',serif; font-size:34px; font-weight:600; }
.stat-card .sub{ font-size:11.5px; color:var(--ink-soft); margin-top:6px;}
.stat-card.accent{ background:linear-gradient(135deg, var(--orange-600), var(--orange-500)); border:none; color:#fff;}
.stat-card.accent .lbl, .stat-card.accent .sub{ color:rgba(255,255,255,.85); }
.panel{ background:var(--white); border:1px solid var(--line); border-radius:16px; padding:22px; margin-bottom:22px; box-shadow:0 2px 10px -6px rgba(120,70,20,.1);}
.panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.panel-head h3{ font-size:16.5px; }
.grid-2{ display:grid; grid-template-columns:1.3fr 1fr; gap:18px; }

/* STEPPER */
.stepper{ display:flex; align-items:center; }
.step{ display:flex; flex-direction:column; align-items:center; gap:5px; position:relative; flex:1; }
.step .node{ width:22px; height:22px; border-radius:50%; background:var(--sand); border:2px solid var(--orange-300);
  display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; color:var(--orange-600); z-index:1;}
.step.done .node{ background:var(--orange-500); border-color:var(--orange-500); color:#fff; }
.step.current .node{ background:#fff; border-color:var(--orange-600); color:var(--orange-600); box-shadow:0 0 0 4px var(--orange-100);}
.step .lbl{ font-size:10px; font-weight:700; color:var(--ink-soft); text-align:center; }
.step.done .lbl{ color:var(--orange-700); }
.step-line{ position:absolute; top:11px; left:calc(-50% + 11px); right:calc(50% + 11px); height:2px; background:var(--line); z-index:0;}
.step.done .step-line{ background:var(--orange-300); }
.step:first-child .step-line{ display:none; }

/* TABLE */
.table-wrap{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; font-size:13px; }
th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-soft);
  padding:10px 12px; border-bottom:2px solid var(--line); white-space:nowrap;}
td{ padding:12px; border-bottom:1px solid var(--line); vertical-align:middle; white-space:nowrap;}
tr:hover td{ background:var(--cream); }
.badge{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:4px 10px; border-radius:99px; white-space:nowrap;}
.badge-pending{ background:var(--amber-bg); color:var(--amber); }
.badge-done-same{ background:var(--green-bg); color:var(--green); }
.badge-done-changed{ background:var(--orange-100); color:var(--orange-700); }
.row-link{ background:none; color:var(--orange-600); font-weight:700; font-size:12.5px; text-decoration:underline; text-underline-offset:2px;}
.toolbar{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; align-items:center; }
.toolbar input, .toolbar select{ padding:9px 12px; border:1.5px solid var(--line); border-radius:9px; font-size:13px; background:var(--cream); }
.toolbar input{ min-width:220px; }
.empty{ text-align:center; padding:50px 20px; color:var(--ink-soft); }
.empty .big{ font-size:38px; margin-bottom:10px; }

/* FORM */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px 20px; }
.form-grid .full{ grid-column:1/-1; }
.section-title{ font-size:12.5px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:var(--orange-700); margin:22px 0 12px; display:flex; align-items:center; gap:8px;}
.section-title::after{ content:""; flex:1; height:1px; background:var(--line); }
.readonly-box{ background:var(--cream); border:1.5px dashed var(--line); border-radius:10px; padding:12px 14px; font-size:13.5px; }
.key-hint{ font-size:11px; color:var(--orange-600); font-weight:600; margin-top:5px;}
.compare-flag{ font-size:10.5px; font-weight:700; color:var(--orange-600); background:var(--orange-50); padding:2px 7px; border-radius:6px; margin-left:6px; }
.form-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:26px; border-top:1px solid var(--line); padding-top:20px;}
.detail-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px 24px; font-size:13.5px; }
.detail-grid .k{ color:var(--ink-soft); font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; margin-bottom:2px;}
.detail-grid .v{ font-weight:600; }
.modal-bg{ position:fixed; inset:0; background:rgba(43,27,18,.45); display:flex; align-items:center; justify-content:center; z-index:900; padding:20px;}
.modal{ background:#fff; border-radius:18px; padding:26px; width:100%; max-width:420px; box-shadow:var(--shadow);}
.modal h3{ font-size:18px; margin-bottom:16px;}

@media (max-width:920px){
  .login-card{ grid-template-columns:1fr; } .login-side{ display:none; }
  .shell{ grid-template-columns:1fr; } .sidebar{ position:relative; height:auto; }
  .grid-stats{ grid-template-columns:1fr 1fr; } .grid-2{ grid-template-columns:1fr; }
  .form-grid{ grid-template-columns:1fr; } .detail-grid{ grid-template-columns:1fr; }
}
