/* Iron Ledger per-guild theme engine - the SOLE canonical source for every
   guild-theme-driven color/border/background/shadow/gradient declaration on
   shared UI components. Loaded after styles.css so guild colors win.

   Architecture note (CSS consolidation pass): this file used to be one of
   THREE competing "theme override" layers - itself, styles.css's own
   hardcoded per-component colors, and a near-duplicate block inline in
   base.html that (being later in the document) actually won every tie.
   That duplication is why fixes made here alone did not always show up
   rendered. All of base.html's duplicate color/border/shadow/gradient rules
   for shared components have been removed; base.html now keeps only the
   per-request :root token block and rules with no equivalent here. Every
   value below was verified against what was ACTUALLY rendering before this
   consolidation (i.e., whichever of the old competing layers was winning),
   so this pass changes no color - only where each one is defined. */
:root{
 --theme-primary:var(--guild-primary,#3d5a80);--theme-accent:var(--guild-accent,#8fa6c4);
 --theme-bg:var(--guild-background,#0a0b0d);--theme-panel:var(--guild-panel,#15171a);
 --theme-nav:var(--guild-navigation,#0d0e10);--theme-text:var(--guild-text,#eef1f4);--theme-muted:var(--guild-muted,#9aa3ad);
 --theme-border:color-mix(in srgb,var(--theme-primary) 38%,transparent);
 --theme-soft:color-mix(in srgb,var(--theme-primary) 14%,var(--theme-panel));
 --theme-shadow:color-mix(in srgb,var(--theme-primary) 24%,transparent);

 /* Guild Manager branding/theme hotfix: the full named token set, all
    aliased onto the canonical --guild-*/--theme-* sources above rather than
    a second parallel system - "prefer existing canonical names and extend
    only where coverage is missing." Computed *-contrast values come from
    ledger/color_utils.py via base.html's inline style (per-request, since
    contrast depends on the active organization's freeform hex colors). */
 --theme-page-bg:var(--theme-bg);
 --theme-surface:var(--theme-panel);
 --theme-surface-raised:color-mix(in srgb,var(--theme-panel) 88%,var(--theme-primary) 12%);
 --theme-surface-muted:color-mix(in srgb,var(--theme-panel) 92%,var(--theme-bg) 8%);

 --theme-heading:var(--theme-text);
 --theme-primary-hover:color-mix(in srgb,var(--theme-primary) 82%,white 18%);
 --theme-primary-contrast:var(--guild-primary-contrast,#ffffff);
 --theme-accent-contrast:var(--guild-accent-contrast,#161310);

 --theme-border-strong:color-mix(in srgb,var(--theme-primary) 62%,transparent);
 --theme-focus-ring:color-mix(in srgb,var(--theme-primary) 45%,transparent);

 --theme-input-bg:color-mix(in srgb,var(--theme-panel) 84%,black);
 --theme-input-border:color-mix(in srgb,var(--theme-primary) 40%,transparent);
 --theme-input-text:var(--theme-text);
 --theme-input-placeholder:var(--theme-muted);

 --theme-nav-bg:var(--theme-nav);
 --theme-nav-border:var(--theme-border);
 --theme-nav-text:var(--theme-text);
 --theme-nav-active-bg:color-mix(in srgb,var(--theme-primary) 30%,var(--theme-nav));

 --theme-card-bg:var(--theme-panel);
 --theme-card-border:var(--theme-border);

 --theme-table-header-bg:color-mix(in srgb,var(--theme-nav) 76%,var(--theme-primary) 24%);
 --theme-table-row-bg:var(--theme-panel);
 --theme-table-border:color-mix(in srgb,var(--theme-primary) 18%,transparent);

 --theme-button-bg:var(--theme-primary);
 --theme-button-hover-bg:var(--theme-primary-hover);
 --theme-button-text:var(--theme-primary-contrast);
 --theme-button-secondary-bg:color-mix(in srgb,var(--theme-panel) 76%,var(--theme-primary) 24%);
 --theme-button-secondary-text:var(--theme-text);

 --theme-tab-bg:color-mix(in srgb,var(--theme-panel) 92%,transparent);
 --theme-tab-border:var(--theme-border);
 --theme-tab-text:var(--theme-muted);

 --theme-hero-bg:linear-gradient(145deg,color-mix(in srgb,var(--theme-panel) 94%,var(--theme-primary) 6%),color-mix(in srgb,var(--theme-panel) 88%,var(--theme-bg) 12%));
 --theme-hero-border:var(--theme-border);

 /* Guild Notice Card semantic variants alias the platform's fixed status
    tokens (styles.css :root) - never guild-theme-derived, same as
    --status-success/-warning/-danger. --theme-info is a new alias (no
    --theme-*-namespaced "info" token existed before); the other three
    already map cleanly (--warn/--danger) so are referenced directly. */
 --theme-info:var(--status-info,#8fc7ff);
}
html,body{background:var(--theme-bg)!important;color:var(--theme-text)!important}
body{background-image:radial-gradient(circle at 12% 0%,color-mix(in srgb,var(--theme-primary) 22%,transparent),transparent 34rem),linear-gradient(145deg,var(--theme-bg),color-mix(in srgb,var(--theme-bg) 82%,#1b1b1b))!important}

/* Site chrome. .site-header/.current-price-bar previously had a second,
   slightly different (94% vs 96%) copy of this background inline in
   base.html that won the cascade - merged here at the value that was
   actually rendering. */
.site-header{background:color-mix(in srgb,var(--theme-nav) 94%,transparent)!important;border-color:var(--theme-border)!important;border-bottom-color:color-mix(in srgb,var(--theme-primary) 42%,transparent)!important}
.current-price-bar{background:color-mix(in srgb,var(--theme-nav) 94%,transparent)!important;box-shadow:inset 0 -1px 0 var(--theme-border),0 .55rem 1.6rem color-mix(in srgb,var(--theme-bg) 40%,transparent)!important}
.brand,.brand strong,.nav-links a,.logout-form button,.organization-switcher select{color:var(--theme-text)!important}
.nav-links a,.logout-form button,.organization-switcher select{background:color-mix(in srgb,var(--theme-nav) 88%,var(--theme-panel))!important;border-color:color-mix(in srgb,var(--theme-primary) 26%,transparent)!important}
.nav-links a:hover,.nav-links a.active,.logout-form button:hover{background:color-mix(in srgb,var(--theme-primary) 32%,var(--theme-nav))!important;border-color:var(--theme-accent)!important;color:var(--theme-text)!important}

/* Card family. .hero (the login/dashboard hero banner) is a DIFFERENT,
   never-overridden-by-base.html selector from .hero-card/.panel/.card/
   .admin-list-card, so it kept a different gradient than the rest of the
   "elevated card" family even before this consolidation - preserved as-is
   rather than unified, since picking one would change a rendered color.
   .stat-card also nets out to its own gradient (a second base.html block
   used to override it specifically) but shares the same border/text/shadow
   as the rest of the family. Dead classes that were previously grouped in
   here (.dashboard-hero, .page-hero, .guild-hero, .dashboard-card,
   .table-card, .form-card, .metric-card, .summary-card, .dashboard-stat,
   .admin-card, .settings-card, .content-card) are not used by any template
   and have been dropped rather than carried forward as dead weight. */
.hero,.admin-category-card,.hero-card,.panel,.card,.admin-list-card,.stat-card{
 border-color:var(--theme-border)!important;color:var(--theme-text)!important;
 box-shadow:0 .75rem 2rem color-mix(in srgb,var(--theme-bg) 70%,transparent),inset 0 1px 0 color-mix(in srgb,var(--theme-text) 7%,transparent)!important
}
.hero,.admin-category-card{background:linear-gradient(145deg,color-mix(in srgb,var(--theme-panel) 94%,var(--theme-primary) 6%),color-mix(in srgb,var(--theme-panel) 96%,var(--theme-bg) 4%))!important}
.hero-card,.panel,.card,.admin-list-card{background:linear-gradient(145deg,color-mix(in srgb,var(--theme-panel) 96%,var(--theme-primary) 4%),color-mix(in srgb,var(--theme-panel) 90%,var(--theme-bg) 10%))!important}
.stat-card{background:linear-gradient(145deg,color-mix(in srgb,var(--theme-panel) 86%,var(--theme-primary) 14%),color-mix(in srgb,var(--theme-panel) 94%,var(--theme-primary) 6%))!important}
.stat-card strong,.admin-stats strong{color:var(--theme-primary)!important}
.stat-card span,.stat-card small,.admin-stats span,.muted,.helptext,small{color:var(--theme-muted)!important}
.stat-card *{color:inherit}
.hero-card p,.panel p,.card p{color:var(--theme-muted)}

/* "Flat tint" card family - a visually distinct, lighter treatment that
   (via a base.html block that named this specific subset of selectors) was
   already winning over the "elevated card" gradient above for exactly
   these five components + table/tbody row. Kept distinct rather than
   folded into the family above, since merging them would change what
   currently renders. */
.admin-grid a,.admin-stats article,.current-price-chip,.current-price-label,table,tbody tr{
 background:color-mix(in srgb,var(--theme-panel) 94%,transparent)!important;
 border-color:color-mix(in srgb,var(--theme-primary) 35%,transparent)!important;
 color:var(--theme-text)!important
}

h1,h2,h3,h4,h5,h6,strong,label{color:var(--theme-text)}
.eyebrow,.kicker,.stat-label,.meta-label{color:var(--theme-accent)!important}
a{color:color-mix(in srgb,var(--theme-accent) 76%,var(--theme-text))}
thead th{background:color-mix(in srgb,var(--theme-nav) 76%,var(--theme-primary) 24%)!important;border-color:var(--theme-border)!important;color:var(--theme-muted)!important}
tbody tr,tbody td{background:color-mix(in srgb,var(--theme-panel) 97%,transparent)!important;color:var(--theme-text)!important;border-color:color-mix(in srgb,var(--theme-primary) 18%,transparent)!important}
tbody tr:nth-child(even) td{background:color-mix(in srgb,var(--theme-panel) 91%,var(--theme-primary) 9%)!important}
tbody tr:hover td{background:color-mix(in srgb,var(--theme-panel) 80%,var(--theme-primary) 20%)!important}
input,select,textarea{background:color-mix(in srgb,var(--theme-panel) 88%,black)!important;color:var(--theme-text)!important;border-color:color-mix(in srgb,var(--theme-primary) 35%,transparent)!important}
input:focus,select:focus,textarea:focus{border-color:var(--theme-primary)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-primary) 22%,transparent)!important}

/* Buttons. .btn as a literal class is not used anywhere in the codebase
   (only the button[type=submit]/input[type=submit] attribute selectors in
   this group are live) - kept for forward-compatibility since it costs
   nothing, but documented here so it is not mistaken for dead-code bloat. */
.button,.btn,button[type=submit],input[type=submit],a.primary-action,.primary-button{background:linear-gradient(180deg,color-mix(in srgb,var(--theme-primary) 74%,white),var(--theme-primary))!important;border-color:var(--theme-primary)!important;color:var(--theme-text)!important}
.button.secondary,.button-secondary,.btn-secondary,.secondary-button,a.secondary-action{background:color-mix(in srgb,var(--theme-panel) 82%,var(--theme-primary) 18%)!important;border-color:color-mix(in srgb,var(--theme-primary) 55%,transparent)!important;color:var(--theme-text)!important}
.button-danger{background:color-mix(in srgb,#8b1e1e 80%,var(--theme-panel))!important;border-color:#dc5454!important;color:#fff!important}
.status-active{background:color-mix(in srgb,var(--theme-primary) 25%,transparent)!important;color:var(--theme-primary)!important;border-color:color-mix(in srgb,var(--theme-primary) 55%,transparent)!important}
.status-disabled{background:color-mix(in srgb,var(--theme-muted) 14%,transparent)!important;color:var(--theme-muted)!important}
.guild-crest,.hero-card img,.brand img,.logo-mark{background:color-mix(in srgb,var(--theme-nav) 82%,transparent)!important;border-color:var(--theme-border)!important}
.messages .message,.message{background:color-mix(in srgb,var(--theme-panel) 88%,var(--theme-primary) 12%)!important;border-color:color-mix(in srgb,var(--theme-primary) 42%,transparent)!important;color:var(--theme-text)!important}
code{background:color-mix(in srgb,var(--theme-nav) 78%,var(--theme-panel))!important;color:var(--theme-accent)!important;border:1px solid color-mix(in srgb,var(--theme-primary) 30%,transparent)}
/* Guild admin control center */
.guild-admin-shell{width:min(1500px,calc(100% - 2rem));margin:2rem auto;display:grid;grid-template-columns:260px minmax(0,1fr);gap:1.25rem;align-items:start}
.guild-admin-sidebar{position:sticky;top:1rem;padding:1rem;border:1px solid var(--theme-border);border-radius:1.1rem;background:linear-gradient(160deg,color-mix(in srgb,var(--theme-nav) 92%,var(--theme-primary) 8%),var(--theme-panel));box-shadow:0 1rem 2.5rem color-mix(in srgb,var(--theme-bg) 65%,transparent)}
.guild-admin-sidebar-brand{display:flex;gap:.75rem;align-items:center;padding:.35rem .35rem 1rem;border-bottom:1px solid var(--theme-border)}
.guild-admin-sidebar-brand img{width:42px;height:42px;object-fit:contain;border-radius:.65rem}.guild-admin-sidebar-brand span{display:block;color:var(--theme-muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.06em}.guild-admin-sidebar-brand strong{display:block;margin-top:.15rem}
.guild-admin-sidebar nav{display:grid;gap:.35rem;padding:1rem 0}.guild-admin-sidebar nav a,.guild-admin-back{display:block;padding:.72rem .8rem;border:1px solid transparent;border-radius:.65rem;text-decoration:none;color:var(--theme-text)}.guild-admin-sidebar nav a:hover{background:color-mix(in srgb,var(--theme-primary) 22%,transparent);border-color:var(--theme-border)}.guild-admin-back{border-top:1px solid var(--theme-border);border-radius:0;color:var(--theme-muted)}
.guild-admin-content{min-width:0}.admin-category-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:1rem}.admin-category-card{display:flex;flex-direction:column;justify-content:space-between;gap:1rem;padding:1rem;border:1px solid var(--theme-border);border-radius:1rem}.empty-state{padding:2rem;text-align:center;border:1px dashed var(--theme-border);border-radius:1rem}
.theme-preset.is-selected{outline:3px solid color-mix(in srgb,var(--theme-primary) 35%,transparent);border-color:var(--theme-accent)!important}
@media(max-width:900px){.guild-admin-shell{grid-template-columns:1fr;margin-top:1rem}.guild-admin-sidebar{position:static}.guild-admin-sidebar nav{display:flex;overflow-x:auto}.guild-admin-sidebar nav a{white-space:nowrap}.guild-admin-back{border-top:0}.guild-admin-content{width:100%}}

/* v0.3 unified item categories - also the canonical reusable grouped
   table-section-row style (e.g. "Legacy Resources"). Fallback colors match
   the neutral platform theme (never Iron Ledger Guild's specific orange),
   for the rare case this renders before --guild-* is defined at all.
   Typography is deliberately restrained - a grouping row needs to read as
   a sub-heading, not shout: moderate letter-spacing, semibold rather than
   the excessive tracking/weight legacy CSS used to apply here. */
.item-category-row td, .table-section-row td {
    background: color-mix(in srgb, var(--guild-primary, #3d5a80) 16%, var(--guild-panel, #15171a));
    color: var(--guild-accent, #8fa6c4);
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: .78rem;
    font-weight: 700;
    border-top: 1px solid color-mix(in srgb, var(--guild-primary, #3d5a80) 55%, transparent);
}

/* Guild Manager branding/theme hotfix: Bulk Product Sale tabs, sale-batch
   total, and a themed scrollbar - previously only "themed" by accident via
   two now-deleted dead legacy CSS blocks in styles.css. Active-tab text
   uses --theme-primary-contrast (computed per-organization), never a fixed
   white/black assumption. */
.sale-tabs .sale-tab{background:var(--theme-tab-bg)!important;border-color:var(--theme-tab-border)!important;color:var(--theme-tab-text)!important}
.sale-tabs .sale-tab span{color:var(--theme-muted)!important}
.sale-tabs .sale-tab.active{background:linear-gradient(145deg,color-mix(in srgb,var(--theme-primary) 78%,white 22%),var(--theme-primary))!important;border-color:var(--theme-primary)!important;color:var(--theme-primary-contrast)!important;box-shadow:0 .75rem 2rem color-mix(in srgb,var(--theme-primary) 22%,transparent)!important}
.sale-tabs .sale-tab.active span{color:color-mix(in srgb,var(--theme-primary-contrast) 82%,transparent)!important}
.total-bar,.price-display{background:var(--theme-surface-raised)!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important;box-shadow:0 .5rem 1.5rem var(--theme-shadow)!important}
.total-bar strong,.price-display{color:var(--theme-primary)!important}

/* A guild's chosen colors should be visible in the scrollbar too, not just
   the page content - this replaces the hardcoded orange/brown scrollbar
   that used to live in the same dead legacy blocks referenced above. */
::-webkit-scrollbar{width:11px;height:11px}
::-webkit-scrollbar-track{background:var(--theme-nav)}
::-webkit-scrollbar-thumb{background:linear-gradient(var(--theme-primary),color-mix(in srgb,var(--theme-primary) 55%,black));border:2px solid var(--theme-nav);border-radius:999px}
::-webkit-scrollbar-thumb:hover{background:linear-gradient(var(--theme-primary-hover),var(--theme-primary))}

/* Reusable themed notice banner - replaces the one-off hardcoded inline
   style previously used on the oversight dashboard's warning callout. */
.notice-banner{background:color-mix(in srgb,var(--theme-panel) 82%,var(--theme-primary) 18%);border:1px solid var(--theme-primary);padding:.75rem 1rem;margin-bottom:1rem;border-radius:.5rem;color:var(--theme-text)}

/* Guild Notice Card - general-purpose configurable dashboard notice
   (renamed from .guild-supply-card/.supply-card-icon/.supply-card-copy,
   the harvesting-specific "Guild Supplies" predecessor - no template
   references the old names anymore, confirmed before removal). The
   "standard" variant is the direct successor of the old always-neutral
   treatment; the four semantic variants are new, each keyed to a fixed
   platform status token so they read correctly under every guild theme. */
.notice-card-icon-default{font-size:1.35rem}
.notice-card-standard{background:var(--theme-hero-bg)!important;border:1px solid var(--theme-hero-border)!important;color:var(--theme-text)!important}
.notice-card-standard .notice-card-icon{background:color-mix(in srgb,var(--theme-surface-raised) 88%,var(--theme-primary) 12%)!important;border-color:var(--theme-border)!important;box-shadow:inset 0 0 1.2rem color-mix(in srgb,var(--theme-primary) 10%,transparent)!important}
.notice-card-standard .notice-card-copy h2{color:var(--theme-heading)!important}
.notice-card-standard .notice-card-copy p:last-child{color:var(--theme-muted)!important}

.notice-card-information,.notice-card-success,.notice-card-warning,.notice-card-urgent{color:var(--theme-text)!important}
.notice-card-information .notice-card-copy h2,.notice-card-success .notice-card-copy h2,.notice-card-warning .notice-card-copy h2,.notice-card-urgent .notice-card-copy h2{color:var(--theme-heading)!important}
.notice-card-information .notice-card-copy p:last-child,.notice-card-success .notice-card-copy p:last-child,.notice-card-warning .notice-card-copy p:last-child,.notice-card-urgent .notice-card-copy p:last-child{color:var(--theme-text)!important}

.notice-card-information{background:color-mix(in srgb,var(--theme-panel) 84%,var(--theme-info) 16%)!important;border:1px solid var(--theme-info)!important}
.notice-card-information .notice-card-icon{background:color-mix(in srgb,var(--theme-surface-raised) 84%,var(--theme-info) 16%)!important;border-color:var(--theme-info)!important}

.notice-card-success{background:color-mix(in srgb,var(--theme-panel) 84%,var(--status-success) 16%)!important;border:1px solid var(--status-success)!important}
.notice-card-success .notice-card-icon{background:color-mix(in srgb,var(--theme-surface-raised) 84%,var(--status-success) 16%)!important;border-color:var(--status-success)!important}

.notice-card-warning{background:color-mix(in srgb,var(--theme-panel) 84%,var(--status-warning) 16%)!important;border:1px solid var(--status-warning)!important}
.notice-card-warning .notice-card-icon{background:color-mix(in srgb,var(--theme-surface-raised) 84%,var(--status-warning) 16%)!important;border-color:var(--status-warning)!important}

.notice-card-urgent{background:color-mix(in srgb,var(--theme-panel) 84%,var(--status-danger) 16%)!important;border:1px solid var(--status-danger)!important}
.notice-card-urgent .notice-card-icon{background:color-mix(in srgb,var(--theme-surface-raised) 84%,var(--status-danger) 16%)!important;border-color:var(--status-danger)!important}
/* The crest itself may be a transparent-background image - a neutral,
   theme-derived (not pure-black/pure-white) backdrop keeps it readable
   against any guild's chosen colors without recoloring the uploaded art. */
.guild-logo-card{background:radial-gradient(circle at center,color-mix(in srgb,var(--theme-nav) 60%,transparent),color-mix(in srgb,var(--theme-nav) 92%,transparent))!important;border-color:var(--theme-border)!important;box-shadow:inset 0 0 2rem color-mix(in srgb,var(--theme-text) 4%,transparent),0 1rem 3rem var(--theme-shadow)!important}
