/* Ulovo · shared workspace refinement. Presentation only; no business rules. */
@media screen {
  body { --workspace-accent: #245d67; --workspace-text: #183f47; }
  body:not(.locked) { background: #f4f7f7; }
  body:not(.locked) ::selection { background: #cce5e5; color: #143b42; }
  body:not(.locked) :is(input, textarea) { caret-color: #245d67; }
  body:not(.locked) :is(aside nav, .scroll, dialog) {
    scrollbar-width: thin;
    scrollbar-color: #91acb1 transparent;
    scrollbar-gutter: stable;
  }
  body > aside { padding: 24px 16px 16px; }
  body > aside .brand { margin: 0 12px 20px; }
  body > aside .brand-logo { width: 112px; }
  body > aside nav { gap: 3px; padding: 2px 5px 8px 0; }
  body > aside nav button {
    min-height: 42px; padding: 10px 12px; font-size: 14px;
    line-height: 1.4; border-radius: 8px; color: #e0eded;
    transition: background-color 120ms ease-out, color 120ms ease-out;
  }
  body > aside nav button:hover { background: #2a5660; filter: none; }
  body > aside nav button.active { background: #d9eef0; color: #173f48; font-weight: 700; }
  body > aside nav button:focus-visible { outline: 2px solid #f6d78d; outline-offset: -2px; }
  body > aside .sidefoot { padding: 14px 8px 0; border-top: 1px solid #47676d; }
  body > aside #logout { color: #e0eded; border-color: #658087; min-height: 36px; }
  body > main { padding: 24px 32px 48px; min-width: 0; }
  main .page-navigation { margin: 16px 0; }
  main > header {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px;
    background: #fff; color: var(--workspace-text); border: 1px solid #dce7e8;
    border-radius: 12px; padding: 24px; margin: 0 0 24px; box-shadow: none;
  }
  main > header .eyebrow { display: none; }
  main > header h1 { color: var(--workspace-text); font-size: 28px; line-height: 1.2; letter-spacing: -.5px; }
  main > header #subtitle { color: #526b72; font-size: 14px; line-height: 1.5; margin: 8px 0 0; }
  main > header .header-actions { display: flex; flex-wrap: wrap; gap: 8px; max-width: none; margin-left: auto; }
  main > header .header-actions button { min-height: 40px; background: #fff; border-color: #b6cbd0; color: #244e58; }
  main > header .header-actions .primary { color: #fff; background: #245d67; border-color: #245d67; }
  main > header .header-actions .primary:hover { background: #194a54; }
  main:not([data-section="economics"]):not([data-section="business_month"]) :is(.card, .panel) { min-width: 0; }
  main :is(.panel-head, .toolbar) { row-gap: 12px; }
  main :is(.panel-head, .toolbar) > * { min-width: 0; }
  main .toolbar label { margin-top: 0; }
  main :is(input, select, textarea), dialog :is(input, select, textarea) { min-height: 42px; border-color: #9fb9bf; }
  main input[type="checkbox"], dialog input[type="checkbox"] { min-height: auto; accent-color: #245d67; }
  main :is(input, textarea)::placeholder, dialog :is(input, textarea)::placeholder { color: #607379; opacity: 1; }
  main :is(button, input, select, textarea, a, summary):focus-visible,
  dialog :is(button, input, select, textarea, a, summary):focus-visible { outline: 3px solid #327786; outline-offset: 3px; }
  main button:disabled, dialog button:disabled { cursor: not-allowed; }
  main button[aria-busy="true"], dialog button[aria-busy="true"] { cursor: progress; }
  main .scroll { max-width: 100%; overscroll-behavior-x: contain; }
  main :is(td, .num, .card strong, .debt-amount) { font-variant-numeric: tabular-nums; }
  main table th { line-height: 1.4; }
  main table td { line-height: 1.5; }
  main:not([data-section="economics"]) .scroll tbody tr:hover { background: #edf5f5; }
  main :is(.small, .empty) { color: #526b72; }
  /* Stable section identity: heading + surface + line pattern, never hue alone. */
  main[data-section] #fishingSubscriptions {
    --block-surface: #dbeafa; --block-edge: #35628a; --block-line: solid;
  }
  main[data-section] .panel:has([data-expected-date]) {
    --block-surface: #ffedbc; --block-edge: #80601f; --block-line: double;
  }
  main[data-section] #shiftNotesPanel > .panel {
    --block-surface: #e8def4; --block-edge: #695080; --block-line: dashed;
  }
  main[data-section] #dailyTasksPanel > .panel {
    --block-surface: #d4dee5; --block-edge: #405766; --block-line: dotted;
  }
  main[data-section] :is(#fishingSubscriptions, .panel:has([data-expected-date]), #shiftNotesPanel > .panel, #dailyTasksPanel > .panel) {
    background: var(--block-surface) !important;
    border: 1px solid var(--block-edge) !important;
    border-top: 4px var(--block-line) var(--block-edge) !important;
    color: #182f3e;
  }
  main[data-section] :is(#fishingSubscriptions, .panel:has([data-expected-date]), #shiftNotesPanel, #dailyTasksPanel) :is(h2, h3, .small, .empty) {
    color: #263f50;
  }
  main[data-section] :is(#fishingSubscriptions, .panel:has([data-expected-date]), #shiftNotesPanel, #dailyTasksPanel) th {
    background: var(--block-surface); color: #263f50; border-bottom-color: #8295a0;
  }
  main details > summary { cursor: pointer; padding-block: 10px; text-underline-offset: 3px; }
  dialog { border-radius: 14px; padding: 24px; box-shadow: 0 18px 60px #173f4833; }
  dialog::backdrop { background: #16383e66; backdrop-filter: none; }
  dialog .dialog-head { gap: 16px; margin-bottom: 16px; }
  dialog .icon { min-width: 40px; min-height: 40px; }
  dialog #formError:not(:empty) { padding: 10px 12px; background: #fff0ed; color: #913622; border-radius: 6px; }
  @media (max-width: 1100px) and (min-width: 701px) {
    body > main { padding: 22px; }
    main > header .header-actions { width: 100%; justify-content: flex-start; margin-left: 0; }
  }
  @media (max-width: 700px) {
    body > aside { padding: 12px 16px; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px 16px; }
    body > aside .brand, body > aside .brand:has(.brand-logo) { margin: 0; }
    body > aside .brand-logo { width: 60px; }
    body > aside .brand span { display: none; }
    body > aside .sidefoot { grid-column: 2; grid-row: 1; padding: 0; border: 0; margin: 0; gap: 8px; flex-direction: row; }
    body > aside #currentUser { font-size: 12px; line-height: 1.4; }
    body > aside .sidefoot #logout { margin: 0; padding: 6px 10px; flex: 0 0 auto; width: auto; }
    body > aside nav { grid-column: 1 / -1; display: flex; overflow-x: auto; overflow-y: hidden; gap: 6px; padding: 2px 0 6px; }
    body > aside nav button { flex-shrink: 0; min-height: 44px; padding: 10px 12px; }
    body > main { margin-left: 0; padding: 16px; }
    main .app-topbar { padding-bottom: 10px; }
    main .page-navigation { margin: 12px 0; }
    main > header { padding: 18px; gap: 16px; margin-bottom: 18px; }
    main > header h1 { font-size: 25px; }
    main > header .header-actions { width: 100%; max-width: none; margin: 0; justify-content: flex-start; }
    main > header .header-actions button { flex: 1 1 140px; min-height: 44px; font-size: 13px; white-space: normal; }
    main > header .header-actions .primary { flex-basis: 100%; }
    main .toolbar :is(input, select) { max-width: 100%; min-height: 44px; }
    main :is(input, select, textarea), dialog :is(input, select, textarea) { font-size: 16px; }
    main .panel-head .actions { width: 100%; }
    main .panel-head .actions button { min-height: 44px; }
    main .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    main .card strong { overflow-wrap: anywhere; }
    dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: 92dvh; padding: 20px; }
    dialog .two { grid-template-columns: 1fr; gap: 4px; }
    dialog .form-actions { flex-wrap: wrap; }
    dialog .form-actions button { flex-basis: 140px; min-height: 44px; }
    #toast { left: 16px; right: 16px; bottom: 16px; max-width: calc(100vw - 32px); }
  }
  @media (prefers-reduced-motion: reduce) {
    body > aside nav button { transition: none; }
  }
}
