:root {
    --primary: #BF736A;
    --primary-700: #9F5B53;
    --primary-50: #F7EDEA;
    --soft: #FDF7F8;
    --bg: #F6F6F7;
    --sidebar: #ECECEF;
    --surface: #FFFFFF;
    --surface-soft: #FAFAFA;
    --text: #202223;
    --heading: #101112;
    --muted: #6D7175;
    --muted-2: #8C9196;
    --border: #DADBDD;
    --border-soft: #ECECEF;
    --success: #008060;
    --success-bg: #EAF7F1;
    --danger: #D72C0D;
    --danger-bg: #FFF0ED;
    --radius-xs: 7px;
    --radius-sm: 9px;
    --radius-md: 13px;
    --radius-lg: 18px;
    --shadow-card: 0 1px 1px rgba(0,0,0,.04), 0 12px 32px rgba(32,34,35,.06);
    --shadow-soft: 0 22px 70px rgba(120, 60, 55, .16);
    --focus: 0 0 0 3px rgba(191,115,106,.22);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: "Jost", "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-rendering: geometricPrecision;
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

svg,
.icon {
    display: block;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    fill: currentColor;
}

/* ---------- Login ---------- */
.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: var(--bg);
}

.login-card {
    width: min(392px, 100%);
    padding: 30px;
    border: 1px solid rgba(191,115,106,.22);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow-soft);
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--heading);
    font-weight: 750;
    letter-spacing: -.01em;
}

.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    color: #FFFFFF;
    background: var(--primary);
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 10px 20px rgba(191,115,106,.20);
}

.login-card h1 {
    margin: 0 0 22px;
    color: var(--heading);
    font-size: 24px;
    line-height: 1.15;
    text-align: center;
    letter-spacing: -.035em;
}

.login-form {
    display: grid;
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field label {
    color: var(--heading);
    font-size: 13px;
    font-weight: 500;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    color: var(--heading);
    border: 1px solid #C9CCCF;
    border-radius: var(--radius-sm);
    outline: 0;
    background: #FFFFFF;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.input-wrap input:hover { border-color: #AEB4B9; }
.input-wrap input:focus { border-color: var(--primary); box-shadow: var(--focus); }
.input-wrap input::placeholder { color: #9EA4AA; }

.password-input input { padding-right: 68px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    height: 34px;
    padding: 0 10px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    color: var(--primary-700);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
}
.password-toggle:hover { background: var(--primary-50); }

.primary-btn,
.logout-btn,
.setup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radius-sm);
    color: #FFFFFF;
    background: var(--primary);
    box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 12px 22px rgba(191,115,106,.22);
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.primary-btn { width: 100%; margin-top: 4px; }
.primary-btn:hover,
.logout-btn:hover,
.setup-btn:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 15px 28px rgba(191,115,106,.28);
}
.primary-btn:focus-visible,
.logout-btn:focus-visible,
.setup-btn:focus-visible,
.password-toggle:focus-visible,
.nav-link:focus-visible {
    outline: 0;
    box-shadow: var(--focus);
}

.alert {
    margin-bottom: 14px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.45;
}
.alert-info { color: #075E4A; border: 1px solid rgba(0,128,96,.20); background: var(--success-bg); }
.alert-error { color: #9A220B; border: 1px solid rgba(215,44,13,.20); background: var(--danger-bg); }

/* ---------- Admin dashboard ---------- */
.admin-page {
    min-height: 100vh;
    background: var(--bg);
}

.admin-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 12px;
    border-right: 1px solid var(--border);
    background: var(--sidebar);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 8px;
    color: var(--heading);
    text-decoration: none;
}

.sidebar-brand strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.015em;
}
.sidebar-brand span:not(.brand-mark) {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.sidebar-nav {
    display: grid;
    gap: 3px;
    margin-top: 22px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: #303234;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.nav-link:hover { background: rgba(255,255,255,.70); }
.nav-link.active {
    color: var(--heading);
    background: #FFFFFF;
    box-shadow: 0 1px 1px rgba(0,0,0,.05), 0 8px 18px rgba(32,34,35,.07);
}
.nav-link.active .icon { color: var(--primary); }

.sidebar-status {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid rgba(191,115,106,.18);
    border-radius: var(--radius-md);
    background: rgba(253,247,248,.74);
}
.sidebar-status small {
    display: block;
    margin-bottom: 4px;
    color: var(--primary-700);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.sidebar-status strong {
    color: var(--heading);
    font-size: 13px;
    font-weight: 500;
}

.sidebar-account {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.76);
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.avatar {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    color: #FFFFFF;
    background: var(--primary);
    font-size: 13px;
    font-weight: 500;
}
.avatar.small {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.account-copy { min-width: 0; }
.account-copy strong,
.profile-copy strong {
    display: block;
    overflow: hidden;
    color: var(--heading);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-copy span,
.profile-copy span {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(246,246,247,.92);
    backdrop-filter: blur(14px);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(560px, 100%);
    height: 38px;
    padding: 0 12px;
    border: 1px solid #CFD2D5;
    border-radius: var(--radius-sm);
    color: var(--muted);
    background: #FFFFFF;
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.search-box span { font-weight: 400; }
.search-box kbd {
    margin-left: auto;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--muted-2);
    background: #F7F7F7;
    font-family: inherit;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}
.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: #FFFFFF;
}
.logout-btn {
    min-height: 38px;
    box-shadow: none;
}

.content {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 28px 32px 54px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.page-kicker {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}
.page-head h1 {
    margin: 0;
    color: var(--heading);
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -.045em;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(0,128,96,.18);
    border-radius: 999px;
    color: #075E4A;
    background: var(--success-bg);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.status-pill::before,
.status-dot {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: currentColor;
}
.status-dot { display: inline-block; color: var(--success); }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr);
    gap: 16px;
}

.card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.welcome-card {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    padding: 24px;
    border-color: rgba(191,115,106,.22);
    background: #FFFFFF;
}
.welcome-card::after {
    content: "";
    position: absolute;
    right: -46px;
    bottom: -54px;
    width: 170px;
    height: 170px;
    border: 1px solid rgba(191,115,106,.18);
    border-radius: 34px;
    transform: rotate(10deg);
    background: rgba(191,115,106,.06);
}
.card-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}
.welcome-card h2 {
    max-width: 650px;
    margin: 28px 0 10px;
    color: var(--heading);
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.02;
    letter-spacing: -.06em;
}
.welcome-card p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.card-footer-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 32px;
    position: relative;
    z-index: 1;
}
.mini-info {
    padding: 13px;
    border: 1px solid rgba(218,219,221,.8);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.78);
}
.mini-info span,
.side-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}
.mini-info strong,
.side-card strong {
    display: block;
    color: var(--heading);
    font-size: 15px;
    font-weight: 500;
}

.side-stack {
    display: grid;
    gap: 16px;
}
.side-card {
    padding: 18px;
}
.side-card h3 {
    margin: 0 0 8px;
    color: var(--heading);
    font-size: 17px;
    letter-spacing: -.025em;
}
.side-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}
.shield-box {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 14px;
    color: #FFFFFF;
    background: var(--primary);
    box-shadow: 0 14px 28px rgba(191,115,106,.25);
}
.shield-box .icon { width: 22px !important; height: 22px !important; }

.ready-panel {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-top: 16px;
    padding: 18px;
}
.ready-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    color: var(--primary-700);
    background: var(--primary-50);
}
.ready-panel h3 {
    margin: 0 0 5px;
    color: var(--heading);
    font-size: 16px;
    letter-spacing: -.02em;
}
.ready-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

/* ---------- Setup page ---------- */
.setup-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: var(--soft);
}
.setup-card {
    width: min(560px, 100%);
    padding: 28px;
    border: 1px solid rgba(191,115,106,.22);
    border-radius: var(--radius-lg);
    background: #FFFFFF;
    box-shadow: var(--shadow-soft);
}
.setup-card h1 {
    margin: 20px 0 10px;
    color: var(--heading);
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -.04em;
}
.setup-card p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.65;
}
.setup-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    font-weight: 500;
}

@media (max-width: 980px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-brand { padding: 0; }
    .sidebar-nav { display: flex; margin: 0; flex: 1 1 auto; }
    .sidebar-status,
    .sidebar-account { display: none; }
    .topbar { padding: 0 18px; }
    .content { padding: 24px 18px 42px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .topbar {
        align-items: stretch;
        height: auto;
        min-height: 64px;
        flex-direction: column;
        padding: 12px;
    }
    .search-box { width: 100%; }
    .top-actions { justify-content: space-between; }
    .profile-chip { display: none; }
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .card-footer-row { grid-template-columns: 1fr; }
    .welcome-card h2 { font-size: 34px; }
}

@media (max-width: 480px) {
    .login-page,
    .setup-page { padding: 16px; }
    .login-card,
    .setup-card { padding: 22px; }
    .sidebar { align-items: stretch; flex-direction: column; }
    .sidebar-nav { width: 100%; }
    .nav-link { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* ---------- Master Panel ---------- */
.nav-section {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}
.nav-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: var(--heading);
    font-size: 13px;
    font-weight: 500;
    background: rgba(255,255,255,.52);
}
.nav-section.is-open .nav-section-title {
    background: #FFFFFF;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.nav-section-title .icon { color: var(--primary); }
.nav-submenu {
    display: grid;
    gap: 2px;
    padding-left: 11px;
}
.nav-sublink {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: #414447;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.nav-sublink:hover { background: rgba(255,255,255,.70); }
.nav-sublink.active {
    color: var(--primary-700);
    background: #FFFFFF;
    box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 8px 16px rgba(32,34,35,.05);
}
.nav-bullet {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    border: 1px solid currentColor;
    opacity: .55;
}
.nav-sublink.active .nav-bullet {
    border-color: var(--primary);
    background: var(--primary);
    opacity: 1;
}
.page-desc {
    max-width: 650px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}
.master-page .content {
    width: min(1280px, 100%);
}
.master-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.summary-card {
    padding: 18px;
}
.summary-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.summary-card strong {
    color: var(--heading);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.045em;
}
.summary-card.wide-note strong {
    font-size: 18px;
}
.master-form-card,
.master-table-card {
    padding: 20px;
    margin-bottom: 16px;
}
.master-card-head,
.master-table-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.master-card-head h2,
.master-table-head h2,
.master-form-card h2 {
    margin: 6px 0 0;
    color: var(--heading);
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -.03em;
}
.master-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 14px;
    align-items: end;
}
.master-field {
    display: grid;
    gap: 7px;
}
.master-field > span {
    color: var(--heading);
    font-size: 13px;
    font-weight: 500;
}
.master-input,
.master-filter-form input,
.master-filter-form select {
    width: 100%;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid #C9CCCF;
    border-radius: var(--radius-sm);
    outline: 0;
    color: var(--heading);
    background: #FFFFFF;
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.master-input:hover,
.master-filter-form input:hover,
.master-filter-form select:hover { border-color: #AEB4B9; }
.master-input:focus,
.master-filter-form input:focus,
.master-filter-form select:focus { border-color: var(--primary); box-shadow: var(--focus); }
.master-form-actions {
    display: flex;
    align-items: end;
}
.compact-btn {
    width: auto;
    min-width: 140px;
    margin: 0;
}
.master-table-card {
    overflow: hidden;
}
.master-table-head {
    align-items: center;
}
.master-filter-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.master-filter-form input { width: 210px; }
.master-filter-form select { width: 145px; }
.small-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: #FFFFFF;
    background: var(--primary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.small-btn:hover { background: var(--primary-700); transform: translateY(-1px); }
.small-btn.ghost {
    color: var(--heading);
    border-color: var(--border);
    background: #FFFFFF;
}
.small-btn.ghost:hover {
    color: var(--primary-700);
    border-color: rgba(191,115,106,.35);
    background: var(--primary-50);
}
.small-btn.danger {
    color: #9A220B;
    border-color: rgba(215,44,13,.20);
    background: var(--danger-bg);
}
.small-btn.danger:hover {
    color: #FFFFFF;
    background: var(--danger);
}
.small-btn.save {
    color: #FFFFFF;
    background: var(--success);
}
.small-btn.save:hover {
    background: #006E52;
}
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
}
.master-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    background: #FFFFFF;
}
.master-table th,
.master-table td {
    padding: 12px 13px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: middle;
}
.master-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--muted);
    background: #FAFAFA;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.master-table tbody tr:last-child td { border-bottom: 0; }
.master-table tbody tr:hover td { background: #FFFDFD; }
.row-id {
    color: var(--muted);
    font-weight: 500;
}
.cell-view {
    display: inline-block;
    max-width: 220px;
    color: var(--heading);
    font-weight: 400;
    overflow-wrap: anywhere;
}
.cell-edit {
    display: none;
    min-width: 128px;
    min-height: 34px;
    padding: 0 9px;
    font-size: 13px;
}
.master-row.is-editing .cell-view { display: none; }
.master-row.is-editing .cell-edit { display: block; }
.row-edit-action { display: none; }
.master-row.is-editing .row-view-action { display: none; }
.master-row.is-editing .row-edit-action { display: inline-flex; }
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.status-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}
.status-active {
    color: #075E4A;
    background: var(--success-bg);
}
.status-deactive {
    color: #7A321C;
    background: #FFF4E6;
}
.actions-col { width: 220px; }
.actions-cell { white-space: nowrap; }
.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}
.muted-date {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.pagination-info {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.pagination-info strong {
    color: var(--heading);
}
.pagination-info span {
    display: inline-flex;
    margin-left: 8px;
    color: var(--muted-2);
    font-weight: 500;
}
.pagination-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination-link,
.pagination-page,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--heading);
    background: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
}
.pagination-link:hover,
.pagination-page:hover {
    color: var(--primary-700);
    border-color: rgba(191,115,106,.35);
    background: var(--primary-50);
}
.pagination-page.is-active {
    color: #FFFFFF;
    border-color: var(--primary);
    background: var(--primary);
}
.pagination-link.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}
.pagination-ellipsis {
    min-width: 24px;
    padding: 0 4px;
    border-color: transparent;
    color: var(--muted);
    background: transparent;
}

.table-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}
.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 28px;
    border: 1px dashed rgba(191,115,106,.35);
    border-radius: var(--radius-md);
    color: var(--muted);
    background: var(--soft);
    text-align: center;
}
.empty-state strong {
    margin-bottom: 4px;
    color: var(--heading);
    font-size: 17px;
}
.muted-copy {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.master-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.master-shortcuts a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(191,115,106,.25);
    border-radius: 999px;
    color: var(--primary-700);
    background: var(--primary-50);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.master-shortcuts a:hover {
    color: #FFFFFF;
    background: var(--primary);
}

@media (max-width: 1180px) {
    .master-form { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
}

@media (max-width: 980px) {
    .nav-section {
        margin-top: 0;
        min-width: 220px;
    }
    .nav-submenu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-left: 0;
    }
    .master-summary { grid-template-columns: 1fr 1fr 1fr; }
    .master-form { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
    .master-table-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .master-filter-form {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 700px) {
    .master-summary { grid-template-columns: 1fr; }
    .master-form { grid-template-columns: 1fr; }
    .master-card-head { flex-direction: column; }
    .master-filter-form input,
    .master-filter-form select,
    .master-filter-form .small-btn {
        width: 100%;
    }
    .nav-submenu { grid-template-columns: 1fr; }
}

.admin-logo {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.login-logo {
    display: block;
    width: 170px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

.sidebar-brand {
    justify-content: center;
    padding: 18px 14px;
}

.login-brand {
    justify-content: center;
    text-align: center;
}

/* ---------- Sidebar/topbar layout fix ---------- */
:root {
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

.admin-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 35;
    display: flex;
    width: var(--sidebar-width);
    height: 100vh;
    min-height: 0;
    flex-direction: column;
    gap: 0;
    padding: 14px 12px;
    border-right: 1px solid rgba(218,219,221,.92);
    background: var(--sidebar);
    box-shadow: 8px 0 22px rgba(32,34,35,.04);
    overflow: hidden;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
    padding-bottom: 12px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 16px;
    background: rgba(255,255,255,.78);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.58), 0 1px 1px rgba(0,0,0,.035);
    text-decoration: none;
}

.admin-logo {
    display: block;
    width: 180px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.sidebar-close,
.sidebar-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    color: var(--heading);
    background: #FFFFFF;
    box-shadow: 0 1px 1px rgba(0,0,0,.035);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.sidebar-close:hover,
.sidebar-menu-btn:hover {
    border-color: rgba(191,115,106,.32);
    background: var(--primary-50);
    transform: translateY(-1px);
}

.sidebar-close {
    display: none;
}

.sidebar-nav {
    display: grid;
    align-content: start;
    gap: 7px;
    min-height: 0;
    flex: 1 1 auto;
    margin-top: 8px;
    padding: 2px 4px 14px 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(141,145,150,.42) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 7px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(141,145,150,.42);
}

.nav-primary-links {
    display: grid;
    gap: 6px;
}

.nav-link,
.nav-sublink,
.nav-section-title {
    -webkit-tap-highlight-color: transparent;
}

.nav-link {
    position: relative;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #303234;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    border-color: rgba(255,255,255,.80);
    background: rgba(255,255,255,.68);
}

.nav-link.active {
    border-color: rgba(191,115,106,.18);
    color: var(--heading);
    background: #FFFFFF;
    box-shadow: 0 1px 1px rgba(0,0,0,.045), 0 8px 18px rgba(32,34,35,.06);
}

.nav-link.active::before,
.nav-sublink.active::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: -4px;
    width: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.nav-section {
    display: grid;
    gap: 5px;
    margin-top: 2px;
}

.nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 10px 0 11px;
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 12px;
    color: var(--heading);
    background: rgba(255,255,255,.46);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.nav-section-title:hover {
    border-color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.78);
}

.nav-section.is-open .nav-section-title {
    border-color: rgba(191,115,106,.18);
    background: #FFFFFF;
    box-shadow: 0 1px 1px rgba(0,0,0,.045), 0 9px 16px rgba(32,34,35,.05);
}

.nav-section-left,
.nav-section-right {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.nav-section-left {
    gap: 10px;
}

.nav-section-right {
    margin-left: auto;
}

.nav-section-title .icon {
    color: var(--primary);
}

.nav-section-label {
    overflow: hidden;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-chevron {
    display: block;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    min-height: 16px;
    color: var(--muted);
    fill: currentColor;
    transition: transform .18s ease, color .15s ease;
}

.nav-section.is-open .nav-chevron {
    color: var(--primary-700);
    transform: rotate(180deg);
}

.nav-submenu {
    display: grid;
    gap: 3px;
    margin: 0 0 2px 14px;
    padding: 3px 0 5px 10px;
    border-left: 1px solid rgba(191,115,106,.20);
}

.nav-submenu[hidden],
.nav-section:not(.is-open) > .nav-submenu {
    display: none !important;
}

.nav-sublink {
    position: relative;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #414447;
    font-size: 13px;
    font-weight: 500;
}

.nav-sublink:hover {
    border-color: rgba(255,255,255,.78);
    background: rgba(255,255,255,.68);
}

.nav-sublink.active {
    border-color: rgba(191,115,106,.16);
    color: var(--primary-700);
    background: #FFFFFF;
    box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 7px 15px rgba(32,34,35,.045);
}

.nav-bullet {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    border: 1px solid currentColor;
    opacity: .52;
}

.nav-sublink.active .nav-bullet {
    border-color: var(--primary);
    background: var(--primary);
    opacity: 1;
}

.sidebar-footer,
.sidebar-status,
.sidebar-account {
    display: none !important;
}

.admin-main {
    grid-column: 2;
    display: flex;
    min-width: 0;
    min-height: 100vh;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(160px, auto) minmax(240px, 420px) auto;
    align-items: center;
    gap: 16px;
    min-height: var(--topbar-height);
    padding: 8px 28px;
    border-bottom: 1px solid rgba(218,219,221,.92);
    background: rgba(246,246,247,.92);
    backdrop-filter: blur(14px);
}

.topbar-left {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar-menu-btn {
    display: none;
}

.topbar-heading {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-heading span {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .09em;
    line-height: 1.1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.topbar-heading strong {
    overflow: hidden;
    color: var(--heading);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.025em;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 10px 0 12px;
    border: 1px solid #CFD2D5;
    border-radius: 12px;
    color: var(--muted);
    background: #FFFFFF;
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.global-search:focus-within {
    border-color: rgba(191,115,106,.55);
    box-shadow: var(--focus);
}

.global-search input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--heading);
    background: transparent;
    font: inherit;
    font-weight: 500;
}

.global-search input::placeholder {
    color: var(--muted-2);
}

.global-search kbd {
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--muted-2);
    background: #F7F7F7;
    font-family: inherit;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.global-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 50;
    max-height: 320px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 18px 50px rgba(32,34,35,.15);
}

.global-search-results[hidden] {
    display: none !important;
}

.global-search-item {
    display: grid;
    gap: 2px;
    padding: 10px 11px;
    border-radius: 10px;
    color: var(--heading);
    text-decoration: none;
}

.global-search-item:hover,
.global-search-item:focus-visible {
    outline: 0;
    background: var(--primary-50);
}

.global-search-item strong {
    font-size: 13px;
    font-weight: 500;
}

.global-search-item span,
.global-search-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.global-search-empty {
    padding: 11px;
}

.top-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.profile-chip {
    min-width: 0;
    max-width: 210px;
}

.top-action-link {
    display: none !important;
}

.sidebar-menu-btn:focus-visible,
.sidebar-close:focus-visible,
.nav-section-title:focus-visible,
.nav-link:focus-visible,
.nav-sublink:focus-visible,
.global-search input:focus-visible {
    outline: 0;
    box-shadow: var(--focus);
}

.content {
    width: 100%;
    max-width: 1440px;
    margin: 0;
    padding: 28px 32px 54px;
}

.master-page .content,
.product-page .content,
.customer-page .content,
.product-elements-page .content {
    margin: 0;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 1180px) {
    .topbar {
        grid-template-columns: minmax(145px, auto) minmax(210px, 1fr) auto;
        gap: 12px;
    }
}

@media (max-width: 980px) {
    .admin-shell {
        display: block;
        grid-template-columns: 1fr;
    }

    .admin-main {
        grid-column: auto;
    }

    .sidebar {
        z-index: 80;
        width: min(310px, calc(100vw - 40px));
        transform: translateX(-106%);
        transition: transform .22s ease;
        box-shadow: 22px 0 60px rgba(32,34,35,.18);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close,
    .sidebar-menu-btn {
        display: inline-flex;
    }

    .sidebar-head {
        gap: 8px;
    }

    .sidebar-brand {
        min-height: 64px;
    }

    .admin-logo {
        width: 166px;
    }

    .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 64px;
        padding: 10px 16px;
    }

    .topbar-left {
        min-width: 0;
    }

    .global-search {
        grid-column: 1 / -1;
        order: 3;
        width: 100%;
        max-width: none;
    }

    .profile-chip {
        display: none;
    }

    .content {
        padding: 24px 16px 42px;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 70;
        display: block;
        background: rgba(32,34,35,.36);
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay[hidden] {
        display: none !important;
    }
}

@media (max-width: 700px) {
    .topbar {
        gap: 10px;
        min-height: 0;
        padding: 10px 12px;
    }

    .topbar-heading strong {
        max-width: 48vw;
    }

    .logout-btn {
        min-height: 36px;
        padding: 0 12px;
    }

    .global-search {
        height: 38px;
    }

    .global-search input {
        height: 36px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: min(304px, calc(100vw - 24px));
        padding: 12px;
    }

    .admin-logo {
        width: 154px;
    }

    .nav-link {
        width: auto;
    }
}

/* ---------- Clean Anura admin refresh ---------- */
:root {
    --primary: #BF736A;
    --primary-700: #96564F;
    --primary-600: #AA645C;
    --primary-50: #FDF1F0;
    --accent: #7A5D63;
    --accent-700: #5B4449;
    --accent-50: #F7F2F4;
    --ink: #1B1718;
    --bg: #F6F6F7;
    --sidebar: #FFFFFF;
    --surface: #FFFFFF;
    --surface-soft: #FAFAFB;
    --text: #252122;
    --heading: #171314;
    --muted: #696264;
    --muted-2: #8A8385;
    --border: #E3E0E1;
    --border-soft: #EEECEC;
    --shadow-card: 0 1px 1px rgba(23, 19, 20, .035), 0 12px 30px rgba(23, 19, 20, .055);
    --shadow-soft: 0 18px 44px rgba(23, 19, 20, .08);
    --shadow-premium: var(--shadow-soft);
    --focus: 0 0 0 3px rgba(191, 115, 106, .20);
}

body {
    color: var(--text);
    background: var(--bg);
}

.admin-page,
.login-page,
.setup-page {
    background: var(--bg) !important;
}

.card,
.login-card,
.setup-card,
.preloader-card {
    border-color: var(--border-soft) !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-card);
}

.primary-btn,
.logout-btn,
.setup-btn,
.small-btn {
    color: #FFFFFF;
    background: var(--primary) !important;
    box-shadow: none;
}

.primary-btn:hover,
.logout-btn:hover,
.setup-btn:hover,
.small-btn:hover {
    background: var(--primary-700) !important;
    box-shadow: none;
}

.small-btn.ghost {
    color: var(--heading);
    border-color: var(--border);
    background: #FFFFFF !important;
}

.small-btn.ghost:hover {
    color: var(--primary-700);
    border-color: rgba(191, 115, 106, .32);
    background: var(--primary-50) !important;
}

.small-btn.save {
    background: var(--success) !important;
}

.small-btn.save:hover {
    background: #006E52 !important;
}

.small-btn.danger {
    color: #9A220B;
    border-color: rgba(215, 44, 13, .20);
    background: var(--danger-bg) !important;
}

.small-btn.danger:hover {
    color: #FFFFFF;
    background: var(--danger) !important;
}

.avatar,
.brand-mark,
.shield-box {
    background: var(--primary) !important;
    box-shadow: none;
}

.input-wrap input:focus,
.master-filter-form input:focus,
.master-filter-form select:focus,
.global-search:focus-within {
    border-color: var(--primary) !important;
    box-shadow: var(--focus) !important;
}

.sidebar {
    border-right: 1px solid var(--border-soft);
    background: #FFFFFF !important;
    box-shadow: 4px 0 18px rgba(23, 19, 20, .045);
}

.sidebar-head {
    padding-bottom: 14px;
}

.sidebar-brand {
    min-height: 68px;
    border-color: var(--border-soft);
    background: var(--surface-soft) !important;
    box-shadow: none;
}

.admin-logo {
    width: 162px;
}

.sidebar-close,
.sidebar-menu-btn,
.global-search,
.profile-chip {
    border-color: var(--border);
    background: #FFFFFF !important;
    box-shadow: none;
}

.sidebar-close:hover,
.sidebar-menu-btn:hover,
.global-search-item:hover,
.global-search-item:focus-visible {
    background: var(--primary-50) !important;
}

.sidebar-nav {
    gap: 6px;
    padding-right: 2px;
}

.nav-link,
.nav-section-title,
.nav-sublink {
    color: #342F30;
    background: transparent !important;
    box-shadow: none;
}

.nav-link:hover,
.nav-section-title:hover,
.nav-sublink:hover {
    border-color: rgba(191, 115, 106, .16);
    background: var(--surface-soft) !important;
}

.nav-link.active,
.nav-section.is-open .nav-section-title,
.nav-sublink.active {
    border-color: rgba(191, 115, 106, .22) !important;
    color: var(--primary-700) !important;
    background: var(--primary-50) !important;
    box-shadow: none !important;
}

.nav-link.active .icon,
.nav-section-title .icon,
.nav-section.is-open .nav-chevron,
.nav-sublink.active {
    color: var(--primary-700) !important;
}

.nav-link.active::before,
.nav-sublink.active::before {
    background: var(--primary) !important;
}

.nav-submenu {
    border-left-color: rgba(191, 115, 106, .18);
}

.nav-sublink.active .nav-bullet {
    border-color: var(--primary);
    background: var(--primary);
}

.topbar {
    border-bottom-color: var(--border-soft);
    background: #FFFFFF !important;
    box-shadow: none;
    backdrop-filter: none;
}

.content {
    position: relative;
}

/* Preloader */
body.has-preloader:not(.preloader-done) .admin-shell,
body.has-preloader:not(.preloader-done) .login-card {
    opacity: 0;
    transform: translateY(6px);
}

body.preloader-done .admin-shell,
body.preloader-done .login-card {
    opacity: 1;
    transform: none;
    transition: opacity .28s ease, transform .28s ease;
}

.app-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg) !important;
    transition: opacity .3s ease, visibility .3s ease;
}

.app-preloader.is-hiding,
body.preloader-done .app-preloader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-card {
    display: grid;
    justify-items: center;
    width: min(310px, calc(100vw - 42px));
    padding: 28px 24px 22px;
    border-radius: 22px;
}

.preloader-orbit {
    position: relative;
    width: 86px;
    height: 86px;
    margin-bottom: 16px;
}

.preloader-diamond {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary) !important;
    box-shadow: 0 10px 22px rgba(191, 115, 106, .22);
    transform: rotate(45deg);
    animation: preloaderGem 1.45s ease-in-out infinite;
}

.preloader-ring {
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(191, 115, 106, .18);
    border-top-color: var(--primary);
    border-radius: 999px;
    animation: preloaderSpin 1.1s linear infinite;
}

.preloader-ring.ring-two {
    inset: 0;
    border-color: rgba(122, 93, 99, .14);
    border-bottom-color: var(--accent);
    animation-duration: 1.65s;
    animation-direction: reverse;
}

.preloader-spark {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: none;
    animation: preloaderSpark 1.2s ease-in-out infinite;
}

.spark-one { top: 9px; right: 20px; }
.spark-two { right: 8px; bottom: 24px; animation-delay: .18s; }
.spark-three { bottom: 12px; left: 18px; animation-delay: .34s; }

.preloader-copy {
    display: grid;
    gap: 4px;
    text-align: center;
}

.preloader-copy strong {
    color: var(--heading);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.045em;
}

.preloader-copy span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
}

.preloader-progress {
    overflow: hidden;
    width: 100%;
    height: 6px;
    margin-top: 20px;
    border-radius: 999px;
    background: var(--primary-50);
}

.preloader-progress span {
    display: block;
    width: 44%;
    height: 100%;
    border-radius: inherit;
    background: var(--primary) !important;
    animation: preloaderProgress 1.05s ease-in-out infinite;
}

@keyframes preloaderSpin {
    to { transform: rotate(360deg); }
}

@keyframes preloaderGem {
    0%, 100% { transform: rotate(45deg) scale(.94); }
    50% { transform: rotate(45deg) scale(1.06); }
}

@keyframes preloaderSpark {
    0%, 100% { opacity: .38; transform: scale(.75); }
    50% { opacity: 1; transform: scale(1.16); }
}

@keyframes preloaderProgress {
    0% { transform: translateX(-100%); }
    55%, 100% { transform: translateX(230%); }
}

/* Dashboard */
.dashboard-page .content {
    max-width: 1480px;
    padding-top: 24px;
}

.erp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.erp-kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 116px;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.erp-kpi-card:hover {
    border-color: rgba(191, 115, 106, .24) !important;
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.metric-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(191, 115, 106, .16);
    border-radius: 15px;
    color: var(--primary-700);
    background: var(--primary-50) !important;
    box-shadow: none !important;
    font-size: 18px;
    font-weight: 620;
}

.kpi-mint .metric-icon,
.kpi-gold .metric-icon,
.kpi-violet .metric-icon,
.kpi-rose .metric-icon {
    color: var(--primary-700);
    background: var(--primary-50) !important;
}

.metric-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.metric-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 530;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.metric-copy strong {
    overflow: hidden;
    color: var(--heading);
    font-size: clamp(24px, 2.3vw, 32px);
    line-height: 1;
    letter-spacing: -.05em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-copy em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    font-weight: 550;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
    gap: 18px;
    margin-bottom: 22px;
}

.dashboard-chart-card,
.inventory-pulse-card,
.module-card {
    padding: 22px;
}

.dashboard-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-card-head.compact {
    margin-bottom: 16px;
}

.dashboard-card-head h2,
.module-suite-head h2 {
    margin: 7px 0 0;
    color: var(--heading);
    font-size: 23px;
    line-height: 1.1;
    letter-spacing: -.035em;
}

.dashboard-card-head p,
.module-suite-head p,
.module-card p,
.dashboard-note {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.dashboard-eyebrow,
.card-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    color: var(--primary-700);
    font-size: 12px;
    font-weight: 520;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.dashboard-eyebrow {
    padding: 0 10px;
    border: 1px solid rgba(191, 115, 106, .16);
    border-radius: 999px;
    background: var(--primary-50) !important;
}

.dashboard-eyebrow .status-dot,
.card-label .status-dot {
    color: var(--primary);
}

.dashboard-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(191, 115, 106, .18);
    border-radius: 999px;
    color: var(--primary-700);
    background: var(--primary-50) !important;
    font-size: 12px;
    font-weight: 520;
    white-space: nowrap;
}

.module-bar-chart {
    display: grid;
    gap: 16px;
}

.module-bar-row {
    display: grid;
    grid-template-columns: minmax(160px, .8fr) minmax(160px, 1.4fr) minmax(54px, auto);
    align-items: center;
    gap: 14px;
}

.module-bar-meta {
    display: grid;
    gap: 3px;
}

.module-bar-meta strong {
    color: var(--heading);
    font-size: 14px;
    font-weight: 550;
}

.module-bar-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 520;
}

.module-bar-track {
    overflow: hidden;
    height: 12px;
    border-radius: 999px;
    background: #F0EEEE;
}

.module-bar-track span {
    display: block;
    width: max(var(--bar-size), 2px);
    height: 100%;
    border-radius: inherit;
    background: var(--primary) !important;
    box-shadow: none;
}

.module-bar-row b {
    color: var(--heading);
    font-size: 15px;
    font-weight: 580;
    text-align: right;
}

.stock-total {
    display: grid;
    min-height: 126px;
    place-items: center;
    margin-bottom: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    background: var(--surface-soft) !important;
    text-align: center;
}

.stock-total span,
.stock-list span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 590;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.stock-total strong {
    display: block;
    margin-top: 6px;
    color: var(--heading);
    font-size: clamp(34px, 4vw, 50px);
    line-height: 1;
    letter-spacing: -.06em;
}

.stock-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stock-list div {
    min-height: 82px;
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 15px;
    background: var(--surface-soft) !important;
}

.stock-list strong {
    display: block;
    margin-top: 8px;
    color: var(--heading);
    font-size: 23px;
    line-height: 1;
    letter-spacing: -.04em;
}

.module-suite {
    margin-top: 4px;
}

.module-suite-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.module-suite-head p {
    max-width: 360px;
    text-align: right;
}

.module-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.module-card {
    display: flex;
    min-height: 350px;
    flex-direction: column;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.module-card:hover {
    border-color: rgba(191, 115, 106, .24) !important;
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.module-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.module-card-top div {
    display: grid;
    gap: 4px;
}

.module-card-top span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.module-card-top strong {
    color: var(--heading);
    font-size: 32px;
    line-height: 1;
    letter-spacing: -.055em;
}

.module-card-top a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0 11px;
    border: 1px solid rgba(191, 115, 106, .18);
    border-radius: 999px;
    color: var(--primary-700);
    background: var(--primary-50) !important;
    font-size: 12px;
    font-weight: 520;
    text-decoration: none;
    white-space: nowrap;
}

.module-card-top a:hover {
    border-color: rgba(191, 115, 106, .34);
    background: #FFFFFF !important;
}

.module-mini-list {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
}

.module-mini-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-soft);
    border-radius: 13px;
    color: inherit;
    background: var(--surface-soft) !important;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.module-mini-list a:hover {
    border-color: rgba(191, 115, 106, .22);
    background: #FFFFFF !important;
    transform: translateX(2px);
}

.module-mini-list span {
    color: #4F494B;
    font-size: 13px;
    font-weight: 510;
}

.module-mini-list strong {
    color: var(--heading);
    font-size: 13px;
    font-weight: 660;
}

@media (max-width: 1280px) {
    .erp-kpi-grid,
    .module-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1040px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .module-suite-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-suite-head p {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 760px) {
    .dashboard-page .content {
        padding-top: 18px;
    }

    .erp-kpi-grid,
    .module-card-grid,
    .stock-list {
        grid-template-columns: 1fr;
    }

    .module-bar-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .module-bar-row b {
        text-align: left;
    }

    .dashboard-card-head {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .erp-kpi-card {
        min-height: 108px;
    }

    .metric-copy strong {
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .preloader-diamond,
    .preloader-ring,
    .preloader-spark,
    .preloader-progress span {
        animation: none !important;
    }
}
