/* =============================================================
   AVANZA Life OS 8.1 — Light-theme modal + icon polish
   Targets the last visual inconsistencies reported in V8.0.
   ============================================================= */

/* 1) Light modal surfaces: never inherit the old dark sticky footer. */
html[data-theme="light"] .modal-card{
  background:rgba(255,255,255,.985)!important;
  color:var(--light-text,#17233b)!important;
  border:1px solid color-mix(in srgb,var(--light-border,#d9e2f0) 92%,#fff)!important;
  box-shadow:0 24px 70px rgba(32,52,84,.18),inset 0 1px 0 #fff!important;
}
html[data-theme="light"] .modal-head h2,
html[data-theme="light"] .modal-card h2,
html[data-theme="light"] .modal-card h3,
html[data-theme="light"] .modal-card strong,
html[data-theme="light"] .modal-card label{
  color:var(--light-text,#17233b)!important;
}
html[data-theme="light"] .modal-head p,
html[data-theme="light"] .modal-card p,
html[data-theme="light"] .modal-card small,
html[data-theme="light"] .modal-card .field>label>span{
  color:var(--light-muted,#667894)!important;
}
html[data-theme="light"] .modal-actions{
  position:static!important;
  bottom:auto!important;
  background:transparent!important;
  border-top:1px solid var(--light-border,#d9e2f0)!important;
  padding-top:14px!important;
  margin-top:16px!important;
}
html[data-theme="dark"] .modal-actions{
  background:transparent!important;
}

/* Quick capture — compact, clean, and consistent in both themes. */
#quickCaptureModal .modal-card{width:min(560px,calc(100vw - 28px))!important;max-width:560px!important;padding:20px!important;overflow:hidden!important;}
#quickCaptureModal .modal-head{padding-right:54px!important;margin-bottom:14px!important;}
#quickCaptureModal .modal-head>.close-btn{top:0!important;right:0!important;}
#quickCaptureModal .segmented{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important;padding:4px!important;border-radius:12px!important;}
#quickCaptureModal .segmented label{min-width:0!important;}
#quickCaptureModal .segmented span{min-height:34px!important;display:flex!important;align-items:center!important;justify-content:center!important;border-radius:9px!important;font-size:11px!important;font-weight:700!important;}
#quickCaptureModal .field{margin-top:12px!important;}
#quickCaptureModal .field>label{display:flex!important;align-items:center!important;gap:4px!important;font-size:11px!important;font-weight:700!important;margin-bottom:6px!important;}
#quickCaptureModal .input,#quickCaptureModal .textarea{font-size:13px!important;line-height:1.45!important;}
#quickCaptureModal .textarea{min-height:108px!important;resize:vertical!important;}
#quickCaptureModal .modal-actions{display:flex!important;justify-content:flex-end!important;gap:9px!important;}
#quickCaptureModal .modal-actions .btn{min-width:0!important;}
html[data-theme="light"] #quickCaptureModal .segmented{background:#f4f7fb!important;border:1px solid #e3e9f2!important;box-shadow:inset 0 1px 2px rgba(20,38,68,.035)!important;}
html[data-theme="light"] #quickCaptureModal .segmented span{background:transparent!important;color:#667894!important;border:1px solid transparent!important;box-shadow:none!important;}
html[data-theme="light"] #quickCaptureModal .segmented input:checked+span{background:linear-gradient(var(--gradient-angle,135deg),var(--primary),var(--secondary))!important;color:#fff!important;border-color:transparent!important;box-shadow:0 6px 15px color-mix(in srgb,var(--primary) 20%,transparent)!important;}
html[data-theme="light"] #quickCaptureModal .input,
html[data-theme="light"] #quickCaptureModal .textarea{
  background:#fff!important;color:#17233b!important;border-color:#d5dfed!important;box-shadow:inset 0 1px 1px rgba(22,40,70,.025)!important;
}
html[data-theme="light"] #quickCaptureModal .input::placeholder,
html[data-theme="light"] #quickCaptureModal .textarea::placeholder{color:#9aa8bb!important;}
html[data-theme="light"] #quickCaptureModal .btn-ghost{background:#f7f9fc!important;color:#24334d!important;border-color:#d9e2ef!important;}

/* 2) Light icon chips: white/tinted, geometrically centred, never navy blocks. */
html[data-theme="light"] .info-help,
html[data-theme="light"] .label-help,
html[data-theme="light"] .tiny-btn:not(.sidebar .tiny-btn),
html[data-theme="light"] .icon-btn:not(.sidebar .icon-btn),
html[data-theme="light"] .calendar-howto-strip>div>i,
html[data-theme="light"] .theme-lock-icon,
html[data-theme="light"] .integration-brand>i,
html[data-theme="light"] .member-explainer>i,
html[data-theme="light"] .help-popover-head>i{
  display:inline-grid!important;place-items:center!important;
  background:color-mix(in srgb,var(--primary) 7%,#fff)!important;
  color:color-mix(in srgb,var(--primary) 88%,#203047)!important;
  border:1px solid color-mix(in srgb,var(--primary) 16%,var(--light-border,#d9e2f0))!important;
  box-shadow:0 3px 10px rgba(25,45,77,.035)!important;
}
html[data-theme="light"] .info-help:hover,
html[data-theme="light"] .label-help:hover,
html[data-theme="light"] .tiny-btn:not(.sidebar .tiny-btn):hover,
html[data-theme="light"] .icon-btn:not(.sidebar .icon-btn):hover{
  background:color-mix(in srgb,var(--primary) 13%,#fff)!important;
  color:color-mix(in srgb,var(--primary) 96%,#17233b)!important;
  border-color:color-mix(in srgb,var(--primary) 26%,var(--light-border,#d9e2f0))!important;
}
html[data-theme="light"] .info-help i,
html[data-theme="light"] .label-help i,
html[data-theme="light"] .tiny-btn i,
html[data-theme="light"] .icon-btn i{display:block!important;line-height:1!important;margin:0!important;}

/* 3) Project focus rule: readable on bright surfaces. */
html[data-theme="light"] .quote-card{
  background:linear-gradient(135deg,color-mix(in srgb,var(--primary) 8%,#fff),color-mix(in srgb,var(--secondary) 6%,#fff))!important;
  color:#42516a!important;
  border:1px solid color-mix(in srgb,var(--primary) 20%,var(--light-border,#d9e2f0))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85)!important;
}
html[data-theme="light"] .quote-card strong{color:#17233b!important;}

/* 4) Collapsed sidebar header: compact mark centred; collapse affordance sits cleanly. */
.sidebar.collapsed .brand{height:60px!important;justify-content:center!important;padding:0!important;margin-bottom:8px!important;}
.sidebar.collapsed .brand-mark{width:34px!important;height:34px!important;object-fit:contain!important;}
.sidebar.collapsed .sidebar-collapse{top:22px!important;right:-1px!important;width:24px!important;height:28px!important;border-radius:8px 0 0 8px!important;opacity:.92!important;}
.sidebar.collapsed .sidebar-collapse i{font-size:15px!important;}

/* 5) Notes: make checklist discoverable, not hidden behind a mystery icon. */
.note-format-bar .note-tool-labeled{width:auto!important;min-width:94px!important;padding:0 10px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;}
.note-format-bar .note-tool-labeled span{font-size:10px!important;font-weight:700!important;white-space:nowrap!important;}
.note-template-strip{display:flex!important;gap:7px!important;align-items:center!important;flex-wrap:wrap!important;padding:8px 0 0!important;}
.note-template-strip>span{font-size:10px!important;color:var(--muted)!important;font-weight:700!important;}
.note-template-btn{height:28px!important;padding:0 9px!important;border-radius:9px!important;border:1px solid var(--line)!important;background:var(--surface-input)!important;color:var(--ink-2)!important;font-size:10px!important;font-weight:700!important;cursor:pointer!important;display:inline-flex!important;align-items:center!important;gap:5px!important;}
.note-template-btn:hover{border-color:color-mix(in srgb,var(--primary) 30%,var(--line))!important;color:var(--ink)!important;}
html[data-theme="light"] .note-template-btn{background:#fff!important;color:#42516a!important;border-color:#dbe3ee!important;box-shadow:0 3px 10px rgba(25,45,77,.03)!important;}
html[data-theme="light"] .note-template-btn:hover{background:color-mix(in srgb,var(--primary) 5%,#fff)!important;color:#17233b!important;border-color:color-mix(in srgb,var(--primary) 22%,#dbe3ee)!important;}

/* On narrow screens keep quick capture and notes toolbar usable. */
@media(max-width:620px){
  #quickCaptureModal{padding:10px!important;}
  #quickCaptureModal .modal-card{padding:16px!important;border-radius:16px!important;}
  #quickCaptureModal .segmented{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  #quickCaptureModal .modal-actions{display:grid!important;grid-template-columns:1fr 1.35fr!important;}
  .note-format-bar .note-tool-labeled{min-width:42px!important;width:42px!important;padding:0!important;}
  .note-format-bar .note-tool-labeled span{display:none!important;}
}
