/* Complete the navy/cyan theme on legacy standalone screens.
   Screen-only rules preserve document, print, and signature presentation. */
@media screen {
  body:is(.console-dark-page, :has(.photo-logsheet-main), :has(.auth-page)) {
    --console-line: rgba(111, 190, 232, .25);
    --console-ink: #e9f7ff;
    --console-muted: #a4c4d9;
    --sp-bg: #071a2c;
    --sp-card: #0c2944;
    --sp-border: rgba(111, 190, 232, .25);
    --sp-text: #e9f7ff;
    --sp-muted: #a4c4d9;
    min-height: 100vh;
    margin: 0;
    color-scheme: dark;
    color: var(--console-ink);
    background: radial-gradient(circle at 85% 0, rgba(34, 104, 163, .2), transparent 36rem), linear-gradient(145deg, #07192c, #09223b 55%, #06162a) !important;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
  }
  body.console-dark-page { padding: 0; }
  body.console-dark-page *, .photo-logsheet-main * { box-sizing: border-box; }
  body.weekly-console .wrap, body.status-console .console-shell {
    width: 100%; max-width: 1680px; margin: 0 auto; padding: 28px 32px 48px;
  }
  body.ikp-console > .card { width: calc(100% - 56px); max-width: 1620px; margin: 24px auto; padding: 22px; min-width: 0; }
  body.console-dark-page :is(.card, .console-card, .pronia-panel, .summary-card, .metric),
  body:has(.photo-logsheet-main) .card, body:has(.auth-page) .auth-card {
    min-width: 0;
    border: 1px solid var(--console-line);
    border-radius: 13px;
    background: linear-gradient(145deg, #0d2d49, #09233b);
    color: var(--console-ink);
    box-shadow: 0 10px 24px rgba(0, 6, 18, .16);
  }
  body.console-dark-page :is(.console-card, .pronia-panel) { padding: 20px; margin: 18px 0; }
  body.console-dark-page h1 { margin: 0 0 8px; color: #f2fbff; font-size: clamp(23px, 2vw, 30px); line-height: 1.25; }
  body.console-dark-page :is(h2, h3), body:has(.photo-logsheet-main) :is(h1, h2, h3), body:has(.auth-page) h1 { color: #eefaff; }
  body.console-dark-page p, body.console-dark-page .muted { color: var(--console-muted); }
  body.console-dark-page .head { padding: 20px; border-bottom: 1px solid var(--console-line); background: linear-gradient(110deg, rgba(17, 66, 94, .65), rgba(8, 34, 56, .45)); }
  body.console-dark-page .body { padding: 20px; }
  body.console-dark-page label { color: #b6d4e7; font-size: 12px; font-weight: 700; }
  body.console-dark-page .grid { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; }
  body:is(.console-dark-page, :has(.photo-logsheet-main), :has(.auth-page)) :is(input, select, textarea) {
    max-width: 100%; border: 1px solid #2b5571; border-radius: 8px;
    background: #082137; color: #ecfaff; color-scheme: dark;
    padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 600;
  }
  body.console-dark-page :is(input, select, textarea) { width: 100%; }
  body:is(.console-dark-page, :has(.photo-logsheet-main), :has(.auth-page)) :is(input, select, textarea):focus {
    outline: none; border-color: #62cbd9; box-shadow: 0 0 0 3px rgba(61, 183, 198, .15);
  }
  body:is(.console-dark-page, :has(.photo-logsheet-main), :has(.auth-page)) :is(input, textarea)::placeholder { color: #8babbf; font-weight: 400; }
  body:is(.console-dark-page, :has(.photo-logsheet-main), :has(.auth-page)) select option { background: #082137; color: #ecfaff; }
  body:is(.console-dark-page, :has(.photo-logsheet-main), :has(.auth-page)) :is(input, select, textarea):disabled { background: #102b40; color: #9bb8c8; opacity: .8; }
  body.console-dark-page input::file-selector-button { margin-right: 12px; padding: 7px 10px; border: 1px solid #398bc1; border-radius: 5px; background: #18517d; color: #ecfaff; font: inherit; cursor: pointer; }
  body.console-dark-page :is(.btn, button[type="submit"]), body:has(.photo-logsheet-main) .btn, body:has(.auth-page) .btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
    padding: 9px 14px; border: 1px solid #398bc1; border-radius: 8px;
    background: linear-gradient(145deg, #246b9d, #18517d); color: #f2fbff;
    font: inherit; font-size: 12px; font-weight: 750; line-height: 1.4;
    text-decoration: none; cursor: pointer;
  }
  body.console-dark-page .btn:is(.btn-green, .btn-save), body:has(.photo-logsheet-main) .btn.success { border-color: #349e7d; background: linear-gradient(145deg, #217c60, #185b49); color: #effff7; }
  body.console-dark-page .btn:is(.btn-light, .btn-dark, .btn-secondary) { border-color: #326080; background: #103450; color: #dff3ff; }
  body.console-dark-page .toplink { display: inline-flex; color: #8edcff; font-size: 13px; }
  body.console-dark-page .btn:hover, body:has(.photo-logsheet-main) .btn:hover { filter: brightness(1.15); }
  body.console-dark-page :is(button, a):focus-visible { outline: 2px solid #7bd8ff; outline-offset: 3px; }
  body.console-dark-page .note { background: #103d57; border-color: #397b9d; color: #b8eaff; }
  body.console-dark-page .alert-success { background: #103c33; color: #a9f3ce; border-color: #377f64; }
  body.console-dark-page .alert-warning { background: #3d3324; color: #ffdd9f; border-color: #7a6238; }
  body.console-dark-page :is(.alert-danger, .alert-error) { background: #4b2937; color: #ffd4db; border-color: #9f5b68; }
  body.console-dark-page table { width: 100%; background: #082137; color: #ddecf5; border-collapse: collapse; font-variant-numeric: tabular-nums; }
  body.console-dark-page th { padding: 12px 10px; border-bottom: 1px solid #37617c; background: #123d59; color: #bfdeed; font-size: 11px; letter-spacing: .035em; white-space: nowrap; }
  body.console-dark-page td { padding: 11px 10px; border-color: rgba(111, 190, 232, .17); background: #09233b; color: #deedf5; font-size: 12px; }
  body.console-dark-page tbody tr:nth-child(even) td { background: #0b2a42; }
  body.console-dark-page tbody tr:hover td { background: #103950; }
  body.console-dark-page td:first-child, body.console-dark-page .kode { color: #8de9d0; font-weight: 750; }
  body.weekly-console .badge { min-width: 85px; text-align: center; font-size: 10px; padding: 6px 10px; }
  body.weekly-console .badge.ok { border: 1px solid #377f64; background: #103c33; color: #a9f3ce; }
  body.weekly-console .badge.bad { border: 1px solid #927037; background: #3d3324; color: #ffdd9f; }
  body.weekly-console .badge.empty { border: 1px solid #466177; background: #203b51; color: #bfd4e1; }
  body.weekly-console table { min-width: 1320px; }
  body.weekly-console td.indikator { color: #f0f9ff; line-height: 1.5; min-width: 260px; }
  body.weekly-console td.target { color: #bbd8e7; max-width: 180px; overflow-wrap: anywhere; }
  body.weekly-console td:nth-child(7) { color: #8fe5d2; font-weight: 750; }
  body.weekly-console .num input { min-width: 125px; }
  body.weekly-console .summary-card { flex: 1 1 260px; padding: 16px; }
  body.weekly-console .summary-card b { color: #9ce7df; }
  body.weekly-console .card:first-of-type { border-top: 3px solid #56bfc9; }
  body.ikp-console .metric small { color: #a4c4d9; }
  body.ikp-console .metric b { color: #86e3d1; font-variant-numeric: tabular-nums; }
  body.ikp-console .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body.ikp-console form { flex-wrap: wrap; }
  body.ikp-console .card:has(table) table { min-width: 1080px; }
  body.ikp-console table tr[style*="font-weight:900"] td { border-top: 1px solid #54a5b3; background: #124254; color: #a6f1d7; font-weight: 800; }
  body.status-console .status-entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  body.status-console .pronia-head p, body.status-console :is(.pronia-code, .pronia-time) { color: #a4c4d9; }
  body.status-console .pronia-sync { border: 1px solid #326080; background: #103450; color: #c7e3f1; }
  body.status-console .pronia-card { border-color: #365a73; background: #102f47; }
  body.status-console .pronia-card.run { border-left-color: #62d6a3; background: #113a37; }
  body.status-console .pronia-card.standby { border-left-color: #e3b65c; background: #37352a; }
  body.status-console .pronia-unit { color: #9adff1; }
  body.status-console .pronia-state { color: #f0faff; }
  body.status-console .pronia-card.run .pronia-state { color: #a9f3ce; }
  body.status-console .pronia-card.standby .pronia-state { color: #ffdd9f; }
  body.status-console .status-history table { min-width: 1100px; }

  body:has(.photo-logsheet-main) .topbar { min-height: 108px; padding: 20px 32px; border-bottom-color: var(--console-line); background: linear-gradient(110deg, #0e3351, #09223b); box-shadow: 0 12px 26px rgba(0, 5, 14, .2); }
  body:has(.photo-logsheet-main) .eyebrow { border-color: #346d72; background: #123e45; color: #91efcf; }
  body:has(.photo-logsheet-main) .userbox { border-color: #326080; border-radius: 10px; padding: 8px 10px; background: #103450; }
  body:has(.photo-logsheet-main) .userbox span { color: #d3eef2; }
  body:has(.photo-logsheet-main) .userbox .btn { min-height: 30px; padding: 6px 10px; border-color: #8f5264; background: #4e2b3b; color: #ffd5df; }
  body:has(.photo-logsheet-main) .photo-logsheet-main { width: min(1720px, calc(100% - 48px)); margin: 20px auto 48px; padding: 0; }
  body:has(.photo-logsheet-main) .card-head { border-bottom-color: var(--console-line); background: rgba(21, 65, 92, .45); }
  body:has(.photo-logsheet-main) .card-head span { color: #a4c4d9; }
  body:has(.photo-logsheet-main) .photo-logsheet-intro { padding: 20px; background: linear-gradient(110deg, #0d3b4f, #0b2942); }
  body:has(.photo-logsheet-main) :is(.photo-logsheet-intro p, .photo-scan-note, .photo-action-row span, .photo-save-row span, .photo-progress-wrap div:last-child) { color: #a4c4d9; }
  body:has(.photo-logsheet-main) .photo-logsheet-meta-grid { padding: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body:has(.photo-logsheet-main) label { color: #b6d4e7; }
  body:has(.photo-logsheet-main) .photo-scan-note { margin: 0; padding: 0 16px 16px; }
  body:has(.photo-logsheet-main) :is(.photo-logsheet-badge, .photo-logsheet-state, .photo-file-status) { border: 1px solid #326080; background: #153a51; color: #bfe5f2; }
  body:has(.photo-logsheet-main) :is(.photo-logsheet-badge, .photo-logsheet-state.done) { border-color: #377f64; background: #123b33; color: #a9f3ce; }
  body:has(.photo-logsheet-main) .photo-logsheet-state.busy { border-color: #927037; background: #3d3324; color: #ffdd9f; }
  body:has(.photo-logsheet-main) .photo-logsheet-state.error { border-color: #9f5b68; background: #4b2937; color: #ffd4db; }
  body:has(.photo-logsheet-main) .photo-file-picker { margin: 14px; border-color: #3d7e98; background: #082438; }
  body:has(.photo-logsheet-main) .photo-file-picker:hover { border-color: #75d3dc; background: #0d344b; }
  body:has(.photo-logsheet-main) .photo-file-picker strong { color: #b7f0f7; }
  body:has(.photo-logsheet-main) .photo-file-picker span { color: #91b6ca; }
  body:has(.photo-logsheet-main) .photo-action-card { padding: 16px; }
  body:has(.photo-logsheet-main) .photo-progress-track { background: #1a3c55; }
  body:has(.photo-logsheet-main) :is(.photo-result-groups, .photo-save-row, .photo-raw-details) { margin: 16px; }
  body:has(.photo-logsheet-main) .photo-result-groups h3 { color: #a4e4ef; font-size: 14px; }
  body:has(.photo-logsheet-main) .photo-result-grid label { border-color: #326080; background: #09263d; color: #b6d4e7; }
  body:has(.photo-logsheet-main) .photo-result-grid label > span { color: #d4e9f3; }
  body:has(.photo-logsheet-main) .photo-result-grid :is(em, small) { color: #9abed0; }
  body:has(.photo-logsheet-main) .photo-result-grid label.result-ok { border-color: #377f64; background: #10352f; }
  body:has(.photo-logsheet-main) .photo-result-grid label.result-warn { border-color: #927037; background: #343025; }
  body:has(.photo-logsheet-main) .photo-result-grid label.result-bad { border-color: #9f5b68; background: #382735; }
  body:has(.photo-logsheet-main) .photo-result-grid label.result-manual { border-color: #3d83ac; background: #103450; }
  body:has(.photo-logsheet-main) .photo-result-legend .ok { background: #103c33; color: #a9f3ce; }
  body:has(.photo-logsheet-main) .photo-result-legend .warn { background: #3d3324; color: #ffdd9f; }
  body:has(.photo-logsheet-main) .photo-result-legend .bad { background: #4b2937; color: #ffd4db; }
  body:has(.photo-logsheet-main) .photo-save-row { border-color: var(--console-line); }
  body:has(.photo-logsheet-main) .photo-raw-details summary { color: #9cdeee; }
  body:has(.photo-logsheet-main) #toast { border-color: #377f75; background: #103a4c; color: #e3fff6; }
  body:has(.auth-page) .auth-page { background: transparent; }
  body:has(.auth-page) .auth-card { border-top: 3px solid #5cc7bd; border-radius: 14px; padding: 30px; }
  body:has(.auth-page) :is(.muted, label) { color: #a4c4d9; }
  body:has(.auth-page) .eyebrow { color: #93e9cc; }
  body:has(.auth-page) .flash { border-color: #627f99; background: #103450; color: #e3f4fc; }
  body:has(.ops-time-chip) input[type="checkbox"] { color-scheme: dark; accent-color: #4dc8a7; }

  @media (max-width: 1250px) {
    body.weekly-console .head { align-items: flex-start; flex-direction: column; }
    body.weekly-console .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.ikp-console .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body:has(.photo-logsheet-main) .photo-logsheet-meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  @media (max-width: 760px) {
    body.weekly-console .wrap, body.status-console .console-shell { padding: 18px 14px 32px; }
    body.ikp-console > .card { width: calc(100% - 28px); margin: 16px auto; padding: 16px; }
    body.console-dark-page :is(.head, .body, .console-card, .pronia-panel) { padding: 16px; }
    body.console-dark-page .actions { width: 100%; }
    body.console-dark-page .actions .btn { flex: 1 1 170px; white-space: normal; }
    body.status-console .status-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.ikp-console .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.weekly-console form[action$="/import"] > div { flex-wrap: wrap; }
    body.weekly-console form[action$="/import"] input { min-width: 0; }
    body:has(.photo-logsheet-main) .photo-logsheet-main { width: calc(100% - 28px); }
    body:has(.photo-logsheet-main) .topbar { padding: 16px; }
    body:has(.photo-logsheet-main) .userbox { display: none; }
    body:has(.photo-logsheet-main) .photo-logsheet-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 480px) {
    body.weekly-console .grid, body.status-console .status-entry-grid { grid-template-columns: minmax(0, 1fr); }
    body:has(.photo-logsheet-main) .photo-logsheet-meta-grid { grid-template-columns: minmax(0, 1fr); }
    body.ikp-console form > label { width: 100%; }
  }
}
