:root {
    --brand-primary: #3f37b8;
    --brand-primary-dark: #2f278c;
    --brand-accent: #ffbe27;
    --brand-soft: #eef0ff;
    --text-main: #29224f;
    --text-muted: #716b9c;
    --surface: #ffffff;
    --surface-border: rgba(63, 55, 184, 0.12);
    --success: #1f8f5f;
    --warning: #d18a00;
    --danger: #c0395a;
    --shadow: 0 24px 60px rgba(45, 38, 131, 0.12);
    --radius-xl: 32px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --container: 1180px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--text-main);
    background:
        radial-gradient(circle at top right, rgba(255, 190, 39, 0.18), transparent 22%),
        linear-gradient(180deg, #f7f6ff 0%, #ecefff 60%, #f9f9ff 100%);
    font-family: "Poppins", "Segoe UI", sans-serif;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.container { width: min(var(--container), calc(100% - 2rem)); margin: 0 auto; }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; padding-bottom: 3rem; }
.site-header { padding: 1rem 0 0; }
.header-bar, .site-footer {
    background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-primary));
    color: #fff;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow);
}
.header-bar { padding: 1.4rem 0 1.2rem; }
.header-inner, .footer-inner { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 1rem; align-items: center; }
.brand-logo {
    width: min(100%, 332px);
    height: auto;
    display: block;
}
.brand-mark {
    width: 64px; height: 64px; border-radius: 50%; position: relative;
    background: radial-gradient(circle at 30% 30%, #ffbe27, #ff6f61 60%, #4336c3 100%);
    box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.2);
}
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: rgba(255, 255, 255, 0.95); border-radius: 999px; }
.brand-mark::before { width: 38px; height: 8px; top: 16px; left: 13px; }
.brand-mark::after { width: 12px; height: 12px; top: 7px; left: 26px; }
.brand-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2rem; line-height: 1; }
.brand-subtitle { letter-spacing: 0.45rem; font-size: 0.68rem; text-transform: uppercase; opacity: 0.8; }
.nav-toggle { display: none; }
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.site-nav a, .site-nav button.link-button {
    padding: 0.45rem 0.9rem; border-radius: 999px; font-weight: 600; color: #fff;
    opacity: 0.92; border: 0; background: transparent; cursor: pointer;
}
.site-nav a:hover, .site-nav button.link-button:hover, .site-nav a.is-active { background: rgba(255, 255, 255, 0.12); opacity: 1; }
.hero, .section { padding: 2rem 0; }
.hero-grid, .grid-2, .grid-3, .grid-4, .split-layout, .stats-row, .field-grid, .admin-layout {
    display: grid; gap: 1.25rem;
}
.hero-grid { grid-template-columns: 1.15fr 0.85fr; align-items: center; padding-top: 2rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split-layout { grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr); align-items: start; }
.stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.8rem; border-radius: 999px;
    background: rgba(255, 190, 39, 0.18); color: var(--brand-primary); font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
}
.page-title, .hero h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(2.6rem, 5vw, 4.5rem); line-height: 0.98; margin: 1rem 0; }
.page-subtitle, .hero p, .muted { color: var(--text-muted); }
.card, .auth-card, .admin-card, .metric-card, .hero-card {
    background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.5rem;
}
.hero-card { padding: 2rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading h2, .card h2, .card h3, .auth-card h2, .admin-card h2, .admin-card h3 { margin: 0 0 0.5rem; font-family: "Cormorant Garamond", Georgia, serif; color: var(--brand-primary-dark); }
.metric-card strong { display: block; font-size: 2rem; color: var(--brand-primary); }
.btn, .btn-secondary, .btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border-radius: 999px;
    padding: 0.85rem 1.2rem; font-weight: 700; border: 0; cursor: pointer;
}
.btn { background: linear-gradient(135deg, var(--brand-accent), #ff9f1c); color: #2d2267; box-shadow: 0 16px 30px rgba(255, 190, 39, 0.28); }
.btn-secondary { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark)); color: #fff; }
.btn-ghost { background: rgba(63, 55, 184, 0.08); color: var(--brand-primary); }
.hero-actions, .inline-actions, .product-meta, .footer-links { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.form-stack { display: grid; gap: 1rem; }
.form-label { display: block; margin-bottom: 0.4rem; font-weight: 700; }
.field-help { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }
.input, .select, .textarea {
    width: 100%; border: 1px solid rgba(63, 55, 184, 0.2); background: #fcfcff; border-radius: 16px; padding: 0.9rem 1rem; font: inherit; color: var(--text-main);
}
.textarea { min-height: 130px; resize: vertical; }
.checkbox-group, .radio-group, .checkbox { display: grid; gap: 0.6rem; }
.checkline { display: flex; gap: 0.65rem; align-items: flex-start; }
.checkline input { margin-top: 0.25rem; }
.flash, .errors { margin: 1rem auto 0; width: min(var(--container), calc(100% - 2rem)); }
.flash-message, .errors-box { border-radius: var(--radius-md); padding: 1rem 1.15rem; box-shadow: var(--shadow); }
.flash-message { background: rgba(31, 143, 95, 0.12); color: var(--success); }
.errors-box { background: rgba(192, 57, 90, 0.1); color: var(--danger); }
.product-card, .module-card { overflow: hidden; }
.product-card .cover, .module-card .cover { height: 120px; background: linear-gradient(135deg, rgba(63, 55, 184, 0.94), rgba(255, 190, 39, 0.9)); position: relative; }
.product-card .content, .module-card .content { padding: 1.4rem; }
.product-card .cover, .product-card .icon-badge, .product-card .icon-badge img { pointer-events: none; }
.product-card .content { position: relative; z-index: 2; }
.product-card .icon-badge, .module-card .icon-badge {
    width: 88px; height: 88px; border-radius: 30px; background: #fff; border: 8px solid rgba(255,255,255,0.55);
    position: absolute; left: 1.25rem; bottom: -26px; display: grid; place-items: center; box-shadow: var(--shadow); font-size: 1.8rem; overflow: hidden;
}
.product-card .icon-badge img, .module-card .icon-badge img {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}
.product-card h3, .module-card h3 { margin-top: 1.8rem; }
.tag, .status-badge {
    display: inline-flex; align-items: center; gap: 0.35rem; border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.82rem; font-weight: 700;
}
.tag { background: rgba(63, 55, 184, 0.1); color: var(--brand-primary); }
.status-pending { background: rgba(255, 190, 39, 0.2); color: var(--warning); }
.status-approved, .status-answered, .status-fulfilled, .status-closed { background: rgba(31, 143, 95, 0.16); color: var(--success); }
.status-rejected { background: rgba(192, 57, 90, 0.14); color: var(--danger); }
.status-in_review { background: rgba(63, 55, 184, 0.16); color: var(--brand-primary); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.95rem 0.85rem; text-align: left; border-bottom: 1px solid rgba(63, 55, 184, 0.1); vertical-align: top; }
th { color: var(--brand-primary); font-size: 0.9rem; }
.admin-layout { grid-template-columns: 260px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 1rem; align-self: start; }
.admin-sidebar .card a { display: block; padding: 0.7rem 0.9rem; border-radius: 14px; margin-bottom: 0.35rem; font-weight: 600; }
.admin-sidebar .card a:hover, .admin-sidebar .card a.is-active { background: rgba(63, 55, 184, 0.1); color: var(--brand-primary); }
.site-footer { margin-top: 3rem; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 2rem 0; }
.footer-brand { display: inline-flex; align-items: center; }
.footer-brand-logo {
    width: min(100%, 300px);
    height: auto;
    display: block;
}
.footer-links { justify-content: flex-end; }
.auth-wrapper { width: min(660px, calc(100% - 2rem)); margin: 2rem auto 0; }
.auth-meta { text-align: center; color: var(--text-muted); }
.empty-state { padding: 2rem; text-align: center; color: var(--text-muted); border: 2px dashed rgba(63,55,184,0.14); border-radius: var(--radius-lg); }
.pagination { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
@media (max-width: 960px) {
    .hero-grid, .grid-2, .grid-3, .grid-4, .split-layout, .stats-row, .field-grid, .admin-layout { grid-template-columns: 1fr; }
    .field-span-2 { grid-column: auto; }
    .nav-toggle { display: inline-flex; background: rgba(255,255,255,0.14); color: #fff; border: 0; border-radius: 999px; padding: 0.7rem 1rem; font-weight: 700; }
    .site-nav { display: none; margin-top: 1rem; flex-direction: column; align-items: stretch; }
    .site-nav.is-open { display: flex; }
    .header-inner, .footer-inner { align-items: flex-start; flex-direction: column; }
    .brand-logo { width: min(100%, 280px); }
    .footer-brand-logo { width: min(100%, 260px); }
    .footer-links { justify-content: flex-start; }
}
