/* LilyJoTracker v0.2.7n37c — Unified Maritime Dashboard / Tracker Palette
   Maritime theme: Dashboard now follows the same LIGHT maritime surfaces as Tracker.
   Classic theme: existing dashboard instrument palette remains untouched.
*/

html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content{
  --u37-bg:var(--lj-bg,#dcecf2);
  --u37-surface:var(--lj-surface,#f2f8fa);
  --u37-surface-2:var(--lj-surface-2,#e7f2f6);
  --u37-surface-3:var(--lj-surface-3,#dcecf2);
  --u37-border:var(--lj-border,#b8d3de);
  --u37-border-strong:var(--lj-border-strong,#92b8c8);
  --u37-text:var(--lj-text,#102b39);
  --u37-muted:var(--lj-muted,#607987);
  --u37-ocean:var(--lj-ocean,#0b789f);
  --u37-teal:var(--lj-teal,#168e9f);
  --u37-success:var(--lj-success,#15975f);
  --u37-warning:var(--lj-warning,#d99a23);
}

/* Remove the old dark "bridge console" slab in Maritime.
   The card hierarchy now sits directly on the same page background as Tracker. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-shell{
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  color:var(--u37-text)!important;
}

/* Existing major dashboard groups should not introduce a second dark background. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content
:is(.db37c-instrument-grid,.db37c-lower-grid){
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  color:var(--u37-text)!important;
}

/* Instrument cards become the dashboard equivalent of Tracker metric tiles. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card{
  background:
    linear-gradient(145deg,
      color-mix(in srgb,var(--u37-surface) 96%,white 4%),
      color-mix(in srgb,var(--u37-surface-2) 78%,white 22%))!important;
  border:1px solid var(--u37-border)!important;
  color:var(--u37-text)!important;
  box-shadow:0 8px 24px rgba(8,52,75,.065)!important;
}

/* Labels and values mirror n37b Tracker hierarchy. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card
:is(h2,h3,h4,.title,.label,small){
  color:var(--u37-muted)!important;
}
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card
:is(strong,b,.value,.big,.number){
  color:var(--u37-ocean)!important;
}

/* Most dashboard values are ordinary div/span text. Keep them readable even when
   legacy dashboard CSS previously forced white. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card{
  --dash-text:var(--u37-text);
  --dash-muted:var(--u37-muted);
}
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card
:is(div,span,p){
  text-shadow:none;
}

/* Compass/gauge SVGs keep their colored needles, but white labels are recolored. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card svg text{
  fill:var(--u37-text)!important;
}
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card svg
:is(circle,line,path)[stroke="white"],
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card svg
:is(circle,line,path)[stroke="#fff"],
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card svg
:is(circle,line,path)[stroke="#ffffff"]{
  stroke:var(--u37-border-strong)!important;
}

/* Bottom cards (travel statistics, data quality, route context) now use the same
   surface, border and text system as Tracker cards. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-info-card{
  background:
    linear-gradient(145deg,
      color-mix(in srgb,var(--u37-surface) 96%,white 4%),
      color-mix(in srgb,var(--u37-surface-2) 70%,white 30%))!important;
  border:1px solid var(--u37-border)!important;
  color:var(--u37-text)!important;
  box-shadow:0 8px 24px rgba(8,52,75,.065)!important;
}
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-info-card
:is(h2,h3,h4,strong,b){
  color:var(--u37-text)!important;
}
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-info-card
:is(span,small,p){
  color:var(--u37-muted);
}

/* Nested statistic tiles use exactly the same family as Tracker metric tiles. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-info-card
:is(.metric,.stat,.stat-card,.tile,.context-row){
  background:color-mix(in srgb,var(--u37-surface-2) 78%,white 22%)!important;
  border-color:var(--u37-border)!important;
  color:var(--u37-text)!important;
}

/* The dashboard's last-position card should visually match Tracker's
   "Laatste bekende positie" rather than a dark instrument screen. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-position-card{
  background:
    linear-gradient(145deg,
      color-mix(in srgb,var(--u37-surface) 96%,white 4%),
      color-mix(in srgb,var(--u37-surface-2) 78%,white 22%))!important;
  border-color:var(--u37-border)!important;
  color:var(--u37-text)!important;
}
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-position-card
:is(strong,b,.value){
  color:var(--u37-ocean)!important;
}
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37c-position-card
:is(span,small,p){
  color:var(--u37-muted)!important;
}

/* Keep the live strip identical to n37a / Tracker surfaces. */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content .db37-live-strip{
  background:
    linear-gradient(90deg,
      color-mix(in srgb,var(--u37-surface-2) 90%,white 10%),
      color-mix(in srgb,var(--u37-surface) 96%,white 4%))!important;
  border-color:var(--u37-border)!important;
  color:var(--u37-text)!important;
}

/* Optional headings inside legacy dashboard classes */
html[data-tracker-theme="maritime"] body.lilyjo-dashboard-n37a #content
:is(.db37c-instrument-grid,.db37c-lower-grid,.db37c-shell) > :is(h2,h3,h4){
  color:var(--u37-text)!important;
}

/* Classic deliberately keeps the original dark bridge look. */
html[data-tracker-theme="classic"] body.lilyjo-dashboard-n37a #content .db37c-shell,
html[data-tracker-theme="classic"] body.lilyjo-dashboard-n37a #content .db37c-instrument-card,
html[data-tracker-theme="classic"] body.lilyjo-dashboard-n37a #content .db37c-info-card{
  /* no forced palette */
}
