/* Iron Ledger per-guild theme engine. Loaded last so guild colors win. */
:root{
 --theme-primary:var(--guild-primary,#a85f2a);--theme-accent:var(--guild-accent,#d79b57);
 --theme-bg:var(--guild-background,#050505);--theme-panel:var(--guild-panel,#151311);
 --theme-nav:var(--guild-navigation,#080706);--theme-text:var(--guild-text,#f1ece6);--theme-muted:var(--guild-muted,#aaa19a);
 --theme-border:color-mix(in srgb,var(--theme-accent) 38%,transparent);
 --theme-soft:color-mix(in srgb,var(--theme-primary) 14%,var(--theme-panel));
 --theme-soft-2:color-mix(in srgb,var(--theme-accent) 9%,var(--theme-panel));
 --theme-shadow:color-mix(in srgb,var(--theme-primary) 24%,transparent);
}
html,body{background:var(--theme-bg)!important;color:var(--theme-text)!important}
body{background-image:radial-gradient(circle at 10% -10%,color-mix(in srgb,var(--theme-primary) 20%,transparent),transparent 34rem),linear-gradient(145deg,var(--theme-bg),color-mix(in srgb,var(--theme-bg) 88%,var(--theme-panel)))!important}
.site-header,.top-nav,.current-price-bar,.resource-timer-bar{background:color-mix(in srgb,var(--theme-nav) 96%,transparent)!important;border-color:var(--theme-border)!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-accent) 26%,transparent)!important}
.nav-links a:hover,.nav-links a.active,.logout-form button:hover{background:color-mix(in srgb,var(--theme-primary) 30%,var(--theme-nav))!important;border-color:var(--theme-accent)!important}
.hero,.hero-card,.dashboard-hero,.page-hero,.guild-hero,.panel,.card,.dashboard-card,.table-card,.form-card,.metric-card,.summary-card,.stat-card,.dashboard-stat,.admin-card,.admin-list-card,.settings-card,.content-card,.admin-stats article,.admin-grid a,.admin-category-card,.current-price-chip,.current-price-label{
 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;
 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
}
.stat-card,.metric-card,.summary-card,.dashboard-stat,.admin-stats article{background:linear-gradient(145deg,color-mix(in srgb,var(--theme-panel) 78%,var(--theme-primary) 22%),color-mix(in srgb,var(--theme-panel) 90%,var(--theme-accent) 10%))!important}
.stat-card strong,.metric-card strong,.summary-card strong,.dashboard-stat strong,.admin-stats strong{color:var(--theme-accent)!important}
.stat-card span,.metric-card span,.summary-card span,.dashboard-stat span,.muted,.helptext,small{color:var(--theme-muted)!important}
h1,h2,h3,h4,h5,h6,strong,label{color:var(--theme-text)}
.eyebrow,.kicker,.stat-label,.meta-label,thead th{color:var(--theme-accent)!important}
a{color:color-mix(in srgb,var(--theme-accent) 76%,var(--theme-text))}
table{background:var(--theme-panel)!important;border-color:var(--theme-border)!important}
thead th{background:color-mix(in srgb,var(--theme-nav) 76%,var(--theme-primary) 24%)!important;border-color:var(--theme-border)!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-accent) 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) 84%,black)!important;color:var(--theme-text)!important;border-color:color-mix(in srgb,var(--theme-accent) 40%,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) 24%,transparent)!important}
.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-accent)!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) 76%,var(--theme-primary) 24%)!important;border-color:color-mix(in srgb,var(--theme-accent) 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-accent)!important;border-color:color-mix(in srgb,var(--theme-accent) 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}
.current-price-bar,.resource-timer-bar{box-shadow:inset 0 -1px 0 var(--theme-border),0 .55rem 1.6rem color-mix(in srgb,var(--theme-bg) 40%,transparent)!important}
.resource-timer-heading,.resource-timer-card{background:linear-gradient(145deg,color-mix(in srgb,var(--theme-panel) 92%,var(--timer-accent,var(--theme-primary)) 8%),var(--theme-panel))!important}
.messages .message,.message{background:color-mix(in srgb,var(--theme-panel) 75%,var(--theme-primary) 25%)!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
code{background:color-mix(in srgb,var(--theme-nav) 82%,var(--theme-panel))!important;color:var(--theme-accent)!important;border:1px solid var(--theme-border)}
/* 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:.09em}.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 */
.item-category-row td {
    background: color-mix(in srgb, var(--guild-primary, #c87832) 16%, var(--guild-panel, #151311));
    color: var(--guild-accent, #e2b36f);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .78rem;
    border-top: 1px solid color-mix(in srgb, var(--guild-primary, #c87832) 55%, transparent);
}
