:root{font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;color:#172033;background:#f5f7fb}body{margin:0;background:#f5f7fb}header{background:#111827;color:white;padding:18px 28px;display:flex;justify-content:space-between;gap:20px;align-items:center;box-shadow:0 8px 30px #0f172a26}header span{color:#aab4c5;margin-left:10px}nav a{color:white;text-decoration:none;margin-left:16px;font-weight:700}main{padding:28px;max-width:1280px;margin:auto}.hero{background:linear-gradient(135deg,#172554,#2563eb);color:white;border-radius:24px;padding:30px;margin-bottom:22px;display:flex;justify-content:space-between;gap:20px;align-items:center;box-shadow:0 18px 45px #1d4ed833}.hero.compact{padding:24px}.hero h1{margin:0 0 8px;font-size:34px}.hero .hint{color:#dbeafe}.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:12px;font-weight:800;color:#bfdbfe;margin:0 0 8px}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:20px 0}.cards div,.panel{background:white;border:1px solid #e2e8f0;border-radius:18px;padding:20px;box-shadow:0 8px 22px #00000008}.cards strong{font-size:34px;display:block}.cards span{color:#64748b}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}table{width:100%;border-collapse:collapse;background:white;border-radius:12px;overflow:hidden}th,td{padding:10px 12px;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:top}th{background:#eef2ff;color:#1e293b}button,.primary{background:#2563eb;color:white;border:0;border-radius:12px;padding:11px 18px;font-weight:800;cursor:pointer;text-decoration:none;display:inline-block}button:disabled{opacity:.65;cursor:not-allowed}.big{font-size:17px;padding:15px 22px;width:100%}input[type=file],input[type=text],.search input{padding:10px;border:1px solid #cbd5e1;border-radius:10px}.search{display:flex;gap:10px;margin:14px 0}.hint{color:#64748b}.flash{padding:12px;border-radius:10px;margin-bottom:10px}.success{background:#dcfce7}.warning{background:#fef3c7}.columns{columns:2}.columns li{break-inside:avoid;margin:3px 0}.columns span{display:inline-block;color:#64748b;width:30px}dl{display:grid;grid-template-columns:220px 1fr;gap:8px 14px}dt{font-weight:700;color:#475569}pre{white-space:pre-wrap;margin:0}code{font-size:12px}.actions{margin:12px 0 18px}.table-scroll{overflow:auto;background:white;border-radius:14px;border:1px solid #e2e8f0}.wide{min-width:1600px}.wide th{position:sticky;top:0}.wide td{max-width:260px;min-width:140px;font-size:13px}.compact-table{min-width:1100px}.button-link{display:inline-block;background:#2563eb;color:white;text-decoration:none;border-radius:10px;padding:8px 12px;margin-bottom:6px;font-weight:800}.button-link.small{font-size:12px;padding:6px 9px}.badge{display:block;background:#dcfce7;color:#166534;border-radius:999px;padding:3px 8px;font-size:12px}.edit-grid{display:grid;grid-template-columns:repeat(2,minmax(260px,1fr));gap:14px}.edit-grid label span{display:block;font-weight:700;color:#475569;margin-bottom:5px}.edit-grid input,.edit-grid textarea{width:100%;box-sizing:border-box;padding:10px;border:1px solid #cbd5e1;border-radius:10px;font:inherit}.form-actions{grid-column:1/-1;display:flex;gap:14px;align-items:center}.actions-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.actions-row form{margin:0}.upload-panel{max-width:860px;margin:auto}.dropzone{border:3px dashed #93c5fd;background:linear-gradient(180deg,#eff6ff,#fff);border-radius:22px;padding:46px 24px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;cursor:pointer;transition:.2s}.dropzone:hover,.dropzone.drag{border-color:#2563eb;background:#dbeafe;transform:translateY(-2px)}.dropzone input{display:none}.drop-icon{font-size:54px}.dropzone strong{font-size:24px}.dropzone small{color:#64748b}.file-summary{margin:18px 0;padding:16px;border:1px solid #dbeafe;border-radius:14px;background:#f8fafc}.file-summary.empty{color:#64748b}.file-summary strong{display:block;margin-bottom:5px}.file-summary ul{max-height:210px;overflow:auto;margin:12px 0 0;padding:0;list-style:none}.file-summary li{display:flex;justify-content:space-between;gap:16px;padding:9px 0;border-top:1px solid #e2e8f0}.progress-card{margin:18px 0;padding:16px;border-radius:14px;background:#eff6ff;border:1px solid #bfdbfe}.hidden{display:none}.progress-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.progress-track{height:13px;background:#dbeafe;border-radius:99px;overflow:hidden}.progress-track.tall{height:18px}.progress-bar{height:100%;background:linear-gradient(90deg,#2563eb,#22c55e);border-radius:99px;transition:width .35s ease}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:18px}.metrics div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:14px}.metrics strong{font-size:26px;display:block}.metrics span{color:#64748b}.status-pill{border-radius:999px;padding:6px 12px;font-size:13px}.status-pill.run{background:#dbeafe;color:#1d4ed8}.status-pill.ok{background:#dcfce7;color:#166534}.status-pill.warn{background:#fef3c7;color:#92400e}.status-pill.bad{background:#fee2e2;color:#991b1b}.file-status-list{display:flex;flex-direction:column;gap:10px;max-height:460px;overflow:auto}.doc-row{display:flex;justify-content:space-between;gap:14px;border-left:5px solid #93c5fd;background:#f8fafc;border-radius:12px;padding:12px}.doc-row small{display:block;color:#64748b;margin-top:3px}.doc-row span{font-weight:800}.doc-row.ok{border-color:#22c55e}.doc-row.warn{border-color:#f59e0b}.doc-row.bad{border-color:#ef4444}.doc-row.run{border-color:#3b82f6;animation:pulse 1.7s ease-in-out infinite}@keyframes pulse{0%,100%{box-shadow:0 0 0 #3b82f600}50%{box-shadow:0 0 0 5px #3b82f614}}.event-log{max-height:460px;overflow:auto;margin:0;padding-left:22px}.event-log li{padding:8px 0;border-bottom:1px solid #e5e7eb}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin:4px 0 18px}.tab-button{background:white;color:#1e293b;border:1px solid #cbd5e1}.tab-button.active{background:#2563eb;color:white;border-color:#2563eb}.tab-button small{background:#e2e8f0;color:#334155;border-radius:999px;padding:2px 7px;margin-left:4px}.tab-button.active small{background:#dbeafe;color:#1d4ed8}.tab-panel{display:none}.tab-panel.active{display:block}.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}.empty-state{text-align:center;padding:40px}@media(max-width:900px){header{display:block}nav{margin-top:12px}nav a{display:inline-block;margin:6px 10px 0 0}.grid2,.cards,.metrics{grid-template-columns:1fr}.hero,.section-head{display:block}.edit-grid{grid-template-columns:1fr}}

/* Excel-like compact CRUD table */
.table-scroll{overflow:auto;background:white;border-radius:14px;border:1px solid #e2e8f0}
.wide{min-width:3600px;table-layout:fixed;border-collapse:separate;border-spacing:0}
.wide th{position:sticky;top:0;z-index:2;white-space:nowrap}
.wide th,.wide td{padding:6px 8px;height:32px;max-height:32px;vertical-align:middle;border-right:1px solid #edf2f7}
.wide td{width:170px;max-width:170px;min-width:170px;font-size:12px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wide td:first-child,.wide th:first-child{position:sticky;left:0;z-index:3;background:#fff;width:92px;min-width:92px;max-width:92px}
.wide th:first-child{background:#eef2ff}
.wide tr:hover td{background:#f8fafc}
.wide td:hover{white-space:normal;overflow:auto;max-height:130px;position:relative;z-index:4;background:#fff;box-shadow:0 8px 24px #0f172a26}
.wide td:nth-child(1){white-space:normal}
.wide td:nth-child(n+14):nth-child(-n+16){width:260px;max-width:260px;min-width:260px}

/* Excel-like full-content widths: long text grows horizontally first, vertically only after a wide column. */
.wide{min-width:max-content;table-layout:auto;border-collapse:separate;border-spacing:0}
.wide th,.wide td{height:auto;max-height:none;vertical-align:top;border-right:1px solid #edf2f7}
.wide td{width:auto;max-width:none;min-width:120px;font-size:12px;line-height:1.22;white-space:normal;overflow:visible;text-overflow:clip}
.wide td:hover{white-space:normal;overflow:visible;max-height:none;position:static;box-shadow:none;background:#f8fafc}
.wide th.col-wide,.wide td.col-wide{min-width:280px;max-width:420px;width:360px;white-space:normal}
.wide th.col-long,.wide td.col-long{min-width:760px;max-width:980px;width:900px;white-space:normal}
.wide th:first-child,.wide td:first-child{width:92px;min-width:92px;max-width:92px;white-space:normal}

.email-panel{margin:12px 0 18px}.email-panel summary{cursor:pointer}.email-grid{display:grid;grid-template-columns:repeat(2,minmax(260px,1fr));gap:12px;margin-top:14px}.email-grid label span{display:block;font-weight:700;color:#475569;margin-bottom:5px}.email-grid input,.email-grid textarea{width:100%;box-sizing:border-box;padding:10px;border:1px solid #cbd5e1;border-radius:10px;font:inherit}.email-grid .full{grid-column:1/-1}
.email-status{border-radius:12px;padding:10px 12px;margin:12px 0 0}.email-status.sent{background:#dcfce7;color:#166534;border:1px solid #86efac}.email-status.pending{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}.sent-button,.sent-button:disabled{background:#16a34a;color:white;opacity:1;cursor:not-allowed}
.card{background:white;border:1px solid #e2e8f0;border-radius:18px;padding:20px;box-shadow:0 8px 22px #00000008;color:inherit;text-decoration:none;display:block}.card:hover{transform:translateY(-2px);box-shadow:0 14px 28px #00000012}.auth-panel{max-width:420px;margin:60px auto}.form-grid{display:grid;gap:14px}.form-grid.wide{grid-template-columns:repeat(2,minmax(240px,1fr))}.form-grid label{display:grid;gap:6px;font-weight:700;color:#475569}.form-grid input,.form-grid textarea,td input{box-sizing:border-box;width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:10px;font:inherit}.muted{color:#64748b}.button{background:#2563eb;color:white;border:0;border-radius:12px;padding:11px 18px;font-weight:800;cursor:pointer;text-decoration:none;display:inline-block}.table-wrap{overflow:auto;border:1px solid #e2e8f0;border-radius:14px;background:white}.actions{display:flex;gap:10px;flex-wrap:wrap}.flashes{margin-bottom:18px}
