* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--font-size);
    line-height: 1.5;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-light); }
h1, h2, h3, legend {
    font-family: "Cormorant Garamond", Georgia, serif;
    color: var(--heading);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.15;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); margin: 0.2em 0; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0; }
h3 { margin: 0 0 0.8rem; font-size: 1.6rem; }
p { font-family: var(--font-text); }
.skip-link {
    position: absolute; left: 1rem; top: -4rem; background: var(--gold); color: #111; padding: 0.5rem 0.8rem; z-index: 20;
}
.skip-link:focus { top: 0.5rem; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.site-header {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 1rem;
    padding: 0.7rem 1.2rem;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--menu-border);
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--menu-text); min-width: 220px; }
.brand img { height: 64px; width: auto; }
.brand strong { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.7rem; letter-spacing: 0.04em; }
.brand small { color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.68rem; }
.site-nav { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.site-nav a, .nav-sub-toggle {
    color: var(--menu-text);
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.site-nav a:hover, .nav-sub-toggle:hover { background: var(--menu-hover-bg); color: var(--menu-hover-text); }
.site-nav a.is-active { background: var(--menu-active-bg); color: var(--menu-active-text); box-shadow: inset 0 -2px 0 var(--gold); }
.nav-sub-toggle svg, .nav-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-item { position: relative; }
.submenu {
    display: none;
    position: absolute; top: calc(100% + 0.4rem); left: 0; min-width: 240px;
    background: var(--submenu-bg);
    border: 1px solid var(--menu-border);
    border-radius: var(--radius);
    padding: 0.4rem;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.submenu a { display: block; border-radius: 8px; }
.has-sub.open > .submenu { display: block; }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--menu-border); border-radius: 8px; padding: 0.4rem 0.55rem; color: var(--menu-text); }
.nav-toggle svg { width: 22px; height: 22px; }

#app-content { min-height: calc(100vh - 160px); }
.page { width: min(1200px, calc(100% - 2rem)); margin: 0 auto 3rem; }
.page-head, .panel-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin: 1.5rem 0; }
.page-head p, .fine-print { color: var(--muted); }
.hero {
    min-height: 78vh;
    margin: 1rem auto 1.5rem;
    border-radius: calc(var(--radius) + 8px);
    overflow: hidden;
    display: grid;
    align-items: end;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.78)),
        url("../images/saree/bridal.jpg") center/cover no-repeat;
    border: 1px solid var(--border);
}
.hero-copy { padding: clamp(1.5rem, 4vw, 3.5rem); max-width: 760px; }
.hero-logo { width: min(420px, 86vw); height: auto; margin-bottom: 0.5rem; }
.eyebrow { letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-light); font-size: 0.78rem; }
.hero-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }

.btn, .icon-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    border-radius: var(--btn-radius);
    padding: 0.7rem 1.1rem;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--btn-hover); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--gold-light); border-color: var(--border); }
.btn-ghost:hover { background: rgba(212, 175, 55, 0.12); }
.btn-tiny, .linkish { background: transparent; border: 0; color: var(--gold-light); padding: 0.2rem 0.35rem; text-decoration: underline; }
.btn-danger { color: var(--error); }
.icon-btn { width: 2.2rem; height: 2.2rem; padding: 0; line-height: 1; font-size: 1.4rem; }

.carousel { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 420px; }
.slides { position: relative; min-height: 420px; }
.slide { display: none; min-height: 420px; position: relative; }
.slide.is-active { display: block; }
.slide img { width: 100%; height: 520px; object-fit: cover; }
.slide-copy {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 3rem 1.4rem 1.4rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.82));
}
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--gold); background: rgba(0,0,0,0.55); color: var(--gold-light); font-size: 1.6rem;
}
.carousel-btn.prev { left: 0.8rem; }
.carousel-btn.next { right: 0.8rem; }
.dots { position: absolute; right: 1rem; bottom: 1rem; display: flex; gap: 0.4rem; }
.dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.45); padding: 0; }
.dots button.is-active { background: var(--gold); }

.card-grid, .chart-grid, .theme-grid { display: grid; gap: 1rem; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.chart-grid, .split, .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1rem; }
.stat, .panel, fieldset, .preview-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}
.stat span { display: block; color: var(--muted); font-size: 0.92rem; }
.stat strong { display: block; margin-top: 0.35rem; color: var(--gold); font-size: 1.45rem; }
.stat em { display: block; color: var(--muted); font-style: normal; font-size: 0.82rem; margin-top: 0.35rem; }
.stat.warn strong { color: var(--warning); }
fieldset { margin: 0; }
legend { padding: 0 0.4rem; }

.toolbar, .filters, .inline-form { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: end; margin-bottom: 10px;}
label { display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.92rem; }
input, select, textarea {
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.75rem;
    min-height: 44px;
    width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
input[readonly] { color: var(--gold-light); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem 1rem; }
.span-2 { grid-column: span 2; }
.field-error { color: var(--error); min-height: 1em; }
.callout { background: rgba(212,175,55,0.08); border-left: 3px solid var(--gold); padding: 0.8rem 1rem; color: var(--gold-light); }
.summary-bar { margin-bottom: 0.8rem; }
.summary-bar strong, .money { color: var(--gold); font-variant-numeric: tabular-nums; }
.negative { color: var(--error); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 0.75rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--gold-light); font-weight: 600; background: rgba(212,175,55,0.05); }
th button { background: none; border: 0; color: inherit; padding: 0; font-weight: 700; }
tr:hover td { background: rgba(255,255,255,0.02); }
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; white-space: nowrap; }
.badge { display: inline-block; border-radius: 999px; padding: 0.15rem 0.55rem; border: 1px solid var(--border); font-size: 0.82rem; }
.badge.low { color: var(--warning); }
.badge.out { color: var(--error); }
.badge.ok { color: var(--success); }
.empty, .loading { padding: 1.4rem; color: var(--muted); }
.pagination { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin: 0.8rem 0 1.2rem; }
.pagination button[aria-current="page"] { background: var(--menu-active-bg); color: var(--gold-light); border-color: var(--gold); }

.modal { width: min(680px, calc(100vw - 1.5rem)); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); background: var(--card); color: var(--text); padding: 1rem 1.1rem 1.2rem; }
.modal-wide { width: min(920px, calc(100vw - 1.5rem)); }
.modal-small { width: min(460px, calc(100vw - 1.5rem)); }
.modal::backdrop { background: rgba(0,0,0,0.72); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.detail-list { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 0.45rem 0.8rem; }
.detail-list dt { color: var(--muted); }
.banner { width: min(1200px, calc(100% - 2rem)); margin: 1rem auto; padding: 0.8rem 1rem; border-radius: var(--radius); }
.banner-error { background: #3a1717; color: var(--error); border: 1px solid #8d3a3a; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: 0.5rem; z-index: 50; }
.toast { background: #14281d; color: var(--success); border: 1px solid #246846; padding: 0.75rem 0.9rem; border-radius: 10px; max-width: 320px; }
.toast.error { background: #3a1717; color: var(--error); border-color: #8d3a3a; }
.site-footer { display: flex; gap: 0.8rem; align-items: center; justify-content: center; padding: 1.5rem; color: var(--muted); border-top: 1px solid var(--border); }
.site-footer img { height: 48px; width: auto; }
.color-row { display: grid; grid-template-columns: 1fr 92px 52px; gap: 0.4rem; align-items: center; margin-bottom: 0.55rem; }
.color-row input[type="color"] { padding: 0.2rem; min-height: 44px; }
.preview-row { margin-top: 0.8rem; }
.muted { color: var(--muted); }
.category-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }
.category-list button { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 999px; padding: 0.35rem 0.7rem; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--card) 92%, black); padding: 0.8rem 0; }
