/* ADAMARI AI — enterprise interface. Existing behavior preserved. */
:root { color-scheme: dark; --bg:#0b1019; --surface:#121b29; --text:#e5ebf5; --muted:#9baac0; --line:#28364b; --accent:#3879ed; --accent-text:#fff; --danger:#ff969c; --warn-bg:#3d301b; --warn-text:#f2ce84; --ok-bg:#15372e; --ok-text:#87d9b9; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { margin: 0; font-size: 24px; }
h2 { margin: 0; font-size: 19px; }
h3 { margin: 22px 0 4px; font-size: 16px; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.muted { color: var(--muted); margin: 2px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button, .file-btn { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: .6; cursor: progress; }
button:focus-visible, input:focus-visible, .file-btn:focus-within, tr:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 40px; width: 100%; }
input[type=checkbox] { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
#search { margin-bottom: 14px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.name { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.off { background: var(--line); color: var(--muted); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 14px; }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 500; }
.error { color: var(--danger); margin: 0; font-weight: 400; min-height: 0; }
dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dialog-head button { min-width: 40px; padding: 6px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wide { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 14px 0; }
legend { padding: 0; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400; cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 10px 0; }
.file-btn { display: inline-flex; align-items: center; font-weight: 500; font-size: 15px; }
.file-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.results { list-style: none; margin: 10px 0; padding: 0; font-size: 14px; }
.results .bad { color: var(--danger); }
.results .good { color: var(--ok-text); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button { position: absolute; top: 5px; right: 5px; min-height: 30px; padding: 2px 8px; font-size: 13px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); font-weight: 600; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
main:has(#camera-view:not([hidden])) { max-width: 1500px; }
.camera-note { margin: 0 0 12px; }
.tahlil-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.tahlil-bar .subtabs { margin: 0; }
#tahlil-day { width: auto; }
.tahlil-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0 4px; }
.tahlil-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tahlil-card strong { display: block; font-size: 22px; margin: 2px 0; }
.tahlil-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tahlil-event { display: flex; flex-direction: column; gap: 3px; color: inherit; text-decoration: none; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tahlil-event img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #0c0e0d; }
main:has(#tahlil-view:not([hidden])) { max-width: 1500px; }
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.subtab { min-height: 0; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font-size: 14px; font-weight: 600; }
.subtab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.camera { position: relative; display: block; width: 100%; min-height: 0; padding: 0; overflow: hidden; aspect-ratio: 16 / 9; background: #0c0e0d; border-radius: 8px; }
.camera img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; color: #fff; font-size: 14px; font-weight: 600; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.camera .state { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; color: #c8ceca; font-size: 13px; text-align: center; }
.live-dialog { width: min(1800px, calc(100vw - 32px)); }
.live-dialog p { margin: 0 0 8px; }
.live-dialog p:empty { display: none; }
.live-dialog img:not([src]) { visibility: hidden; }
.live-dialog img { display: block; color: transparent; width: 100%; min-height: 200px; max-height: calc(100vh - 130px); object-fit: contain; background: #0c0e0d; border-radius: 8px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } dialog { padding: 16px; } .camera-grid { grid-template-columns: 1fr; } }

body { font-size:14px; line-height:1.55; }
main, main:has(#camera-view:not([hidden])), main:has(#tahlil-view:not([hidden])) { max-width:none; margin:0 0 0 246px; padding:32px 36px 56px; }
.topbar { min-height:78px; margin-bottom:32px; padding-bottom:24px; border-bottom:1px solid var(--line); }
h1 { font-size:23px; font-weight:650; letter-spacing:-.6px; }
h2 { font-size:25px; letter-spacing:-.5px; }
h3 { margin:28px 0 12px; }
.eyebrow { margin:0 0 8px; font-size:10px; font-weight:700; letter-spacing:1.9px; color:var(--muted); }
.eyebrow span, .brand b { color:#75a5ff; }
.tabs { position:fixed; inset:0 auto 0 0; width:246px; padding:32px 16px; flex-direction:column; gap:8px; margin:0; border:0; border-right:1px solid var(--line); background:#0e1623; overflow-y:auto; }
.brand { display:flex; gap:12px; align-items:center; margin:0 8px 43px; font-size:18px; font-weight:750; letter-spacing:.6px; }
.brand small { display:block; margin-top:3px; color:var(--muted); font-size:9px; letter-spacing:1.5px; font-weight:500; }
.brand-mark { display:grid; place-items:center; width:36px; height:40px; border:1px solid #40669d; border-radius:8px; background:#172b48; color:#a9c9ff; font-size:24px; }
.nav-caption { font-size:10px; letter-spacing:1.7px; color:var(--muted); padding:0 12px; margin:0 0 10px; }
.tab { display:flex; gap:12px; align-items:center; text-align:left; min-height:48px; padding:12px; border:1px solid transparent; border-radius:7px; font-size:13px; }
.nav-icon { font-size:10px; font-variant-numeric:tabular-nums; color:var(--muted); }
.tab.active { background:#1b2d49; color:#dceaff; border-color:#304d74; }
.tab.active .nav-icon { color:#80b0ff; }
button:hover:not(:disabled), .file-btn:hover { border-color:#6187bd; }
button.primary:hover:not(:disabled) { background:#2868dc; }
.section-heading { display:flex; justify-content:space-between; gap:20px; align-items:center; margin-bottom:26px; }
.section-heading .muted { margin-top:8px; }
.section-tag { color:var(--muted); border:1px solid var(--line); padding:6px 10px; border-radius:5px; font-size:10px; letter-spacing:1px; white-space:nowrap; }
#search { max-width:540px; margin-bottom:20px; padding:12px 14px; }
th { padding:14px 18px; background:#172232; font-size:11px; letter-spacing:.4px; }
td { padding:18px; }
.badge { border-radius:5px; font-size:11px; padding:4px 9px; }
.table-wrap { border-radius:9px; }
.subtab { border-radius:6px; font-size:12px; padding:8px 13px; background:#121b29; }
.camera-grid { gap:18px; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); }
.camera { border:1px solid var(--line); }
.camera .label { padding:32px 15px 12px; }
.camera-note { padding:12px 15px; border-left:2px solid #426da7; background:#111c2b; font-size:12px; margin-bottom:20px; }
.tahlil-card { padding:20px; border-top:2px solid #426da7; }
.tahlil-card strong { font-size:30px; margin:10px 0; }
.tahlil-events { gap:16px; }
.tahlil-event { padding:12px; }
.login-card { width:min(420px,100%); padding:36px; border-top:3px solid var(--accent); box-shadow:0 24px 80px #0005; }
.login-card .eyebrow { margin-bottom:0; }
.login-card h1 { margin-bottom:14px; }
dialog { box-shadow:0 24px 100px #0008; }
dialog::backdrop { background:#030912bb; backdrop-filter:blur(4px); }
#summary { margin-top:6px; font-size:12px; }
@media(min-width:1600px) { main { padding-right:60px; padding-left:60px; } }
@media(max-width:1000px) { .tabs { width:210px; padding:24px 12px; } main, main:has(#camera-view:not([hidden])), main:has(#tahlil-view:not([hidden])) { margin-left:210px; padding:24px; } .section-tag { display:none; } .brand { font-size:15px; } }
@media(max-width:720px) { main, main:has(#camera-view:not([hidden])), main:has(#tahlil-view:not([hidden])) { margin:0; padding:20px 16px 40px; } .tabs { position:static; width:auto; flex-direction:row; flex-wrap:wrap; padding:0 0 18px; margin-bottom:22px; border:0; border-bottom:1px solid var(--line); background:none; overflow:visible; } .brand,.nav-caption,.nav-icon { display:none; } .tab { padding:10px; min-height:44px; font-size:12px; } .topbar { margin-bottom:18px; padding-bottom:18px; } .section-heading { margin-bottom:20px; } h1 { font-size:21px; } h2 { font-size:22px; } .camera-grid { grid-template-columns:1fr; } .login-card { padding:26px; } }
