:root {
    --ink: #18201e;
    --muted: #6d7774;
    --line: #e4e9e6;
    --paper: #f5f7f4;
    --white: #ffffff;
    --navy: #152420;
    --navy-soft: #20352f;
    --green: #216957;
    --green-dark: #164f41;
    --mint: #dff2e9;
    --amber: #d99735;
    --amber-soft: #fbefd9;
    --red: #bd4e4e;
    --red-soft: #f9e6e6;
    --blue-soft: #e4eef7;
    --shadow: 0 16px 42px rgba(28, 50, 43, 0.08);
    --radius: 18px;
}

/* DZ Tavern premium admin theme */
:root {
    --ink: #321a0c;
    --muted: #8a7461;
    --line: #eadcc8;
    --paper: #fbf4ea;
    --white: #fffdf8;
    --navy: #2a1306;
    --navy-soft: #4c240d;
    --green: #7a4319;
    --green-dark: #4b250e;
    --mint: #f5e4c5;
    --amber: #c78a32;
    --amber-soft: #fff0d2;
    --red: #b75237;
    --red-soft: #fae7df;
    --blue-soft: #f1e6d8;
    --shadow: 0 20px 50px rgba(77, 43, 18, 0.1);
    --radius: 18px;
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 16% 4%, rgba(224, 181, 112, 0.2), transparent 26%),
        linear-gradient(120deg, #fffaf3 0%, #f5eadb 100%);
}

.app-shell {
    min-height: 100vh;
    background:
        linear-gradient(90deg, #2a1306 0 250px, transparent 250px),
        radial-gradient(circle at 84% 6%, rgba(206, 151, 74, 0.16), transparent 24%),
        linear-gradient(135deg, #fffaf3 0%, #f6ead8 100%);
}

.sidebar {
    overflow: hidden;
    border-right: 1px solid rgba(231, 180, 102, 0.22);
    color: #f9e7c5;
    background:
        radial-gradient(circle at 18% 8%, rgba(219, 159, 75, 0.24), transparent 24%),
        radial-gradient(circle at 84% 92%, rgba(156, 83, 31, 0.26), transparent 28%),
        linear-gradient(180deg, #351905 0%, #211006 58%, #160a04 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.sidebar::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
        linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.08) 75%);
    background-position: 0 0, 12px 12px;
    background-size: 24px 24px;
    content: "";
    opacity: 0.25;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-head {
    align-items: flex-start;
    padding-bottom: 28px;
}

.sidebar-head .brand-mark.small {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border-color: rgba(231, 188, 116, 0.58);
    color: #f7d795;
    background:
        radial-gradient(circle, rgba(229, 181, 100, 0.22), transparent 58%),
        rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 8px rgba(195, 123, 43, 0.08);
}

.sidebar-head strong {
    color: #ffe7b1;
    font-family: Georgia, "Songti SC", serif;
    font-size: 20px;
    letter-spacing: 0.02em;
}

.sidebar-head span,
.sidebar-user span {
    color: rgba(255, 230, 190, 0.62);
}

.nav-group {
    color: rgba(242, 209, 154, 0.62);
}

.nav-item {
    min-height: 46px;
    border: 1px solid transparent;
    color: rgba(255, 236, 205, 0.78);
}

.nav-item:hover {
    border-color: rgba(239, 191, 110, 0.18);
    color: #fff6dd;
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
    border-color: rgba(246, 203, 126, 0.28);
    color: #fff8e4;
    background: linear-gradient(135deg, rgba(183, 121, 42, 0.82), rgba(100, 50, 15, 0.78));
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nav-icon {
    border-color: rgba(237, 196, 124, 0.34);
    color: #f5d99b;
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active .nav-icon {
    border-color: rgba(255, 237, 188, 0.28);
    color: #4a2209;
    background: linear-gradient(135deg, #f8d48a, #b4772f);
}

.sidebar-user {
    border-top-color: rgba(242, 202, 132, 0.16);
}

.avatar {
    color: #3a1a07;
    background: linear-gradient(135deg, #ffe2a5, #b87933);
}

.logout-button {
    color: #d9b470;
}

.main-content {
    min-height: 100vh;
    background:
        radial-gradient(circle at 95% 0, rgba(207, 158, 89, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(255, 253, 249, 0.84), rgba(248, 237, 221, 0.76));
}

.app-shell[data-view="dashboard"] .topbar {
    display: none;
}

.topbar {
    min-height: 96px;
}

.topbar h2,
.dashboard-welcome h1,
.panel-head h3 {
    font-family: Georgia, "Songti SC", serif;
}

.topbar h2 {
    color: #2f170a;
    font-size: 30px;
}

.eyebrow.dark,
.panel-kicker {
    color: #a87533;
}

.global-store-field,
.date-chip,
.secondary-button {
    border-color: #ead9bf;
    color: #6e4a2b;
    background: rgba(255, 253, 247, 0.86);
    box-shadow: 0 8px 22px rgba(90, 48, 16, 0.05);
}

.primary-button {
    color: #fff4d6;
    background: linear-gradient(135deg, #7b3a14, #4a200b);
    box-shadow: 0 12px 24px rgba(80, 36, 11, 0.18);
}

.primary-button:hover {
    background: linear-gradient(135deg, #8c461a, #55270e);
}

.table-button.primary {
    color: #fff3d3;
    background: #6f3513;
}

.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 32px 2px 24px;
}

.dashboard-welcome h1 {
    margin: 0;
    color: #2b1307;
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 500;
    letter-spacing: -0.03em;
}

.dashboard-welcome p {
    margin: 10px 0 0;
    color: #8b715c;
    font-size: 15px;
}

.dashboard-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.tavern-hero {
    position: relative;
    display: grid;
    min-height: 210px;
    overflow: hidden;
    align-items: center;
    gap: 28px;
    grid-template-columns: minmax(280px, 0.9fr) minmax(460px, 1.4fr) 180px;
    border: 1px solid rgba(229, 187, 119, 0.28);
    border-radius: 16px;
    padding: 34px 40px;
    color: #fff5dc;
    background:
        linear-gradient(90deg, rgba(45, 19, 5, 0.82), rgba(45, 19, 5, 0.78)),
        radial-gradient(circle at 72% 35%, rgba(220, 156, 67, 0.28), transparent 30%),
        linear-gradient(135deg, #321405, #130803);
    box-shadow: 0 18px 45px rgba(66, 31, 9, 0.2);
}

.tavern-hero::before {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(255, 255, 255, 0.07), transparent 34%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 96px);
    content: "";
    pointer-events: none;
}

.tavern-hero > * {
    position: relative;
    z-index: 1;
}

.tavern-hero__quote p {
    margin: 0 0 12px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 25px;
    line-height: 1.45;
}

.tavern-hero__quote span {
    color: #f1c777;
    font-family: Georgia, serif;
}

.hero-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-left: 1px solid rgba(236, 195, 128, 0.22);
}

.hero-metric-grid article {
    min-height: 106px;
    border-right: 1px solid rgba(236, 195, 128, 0.22);
    padding: 16px 28px;
}

.hero-metric-grid span,
.hero-metric-grid small {
    display: block;
    color: rgba(255, 229, 190, 0.72);
}

.hero-metric-grid strong {
    display: block;
    margin: 12px 0 8px;
    color: #fff8e7;
    font-family: Georgia, serif;
    font-size: 34px;
    font-weight: 500;
}

.tavern-hero__seal {
    display: grid;
    width: 132px;
    height: 132px;
    place-items: center;
    justify-self: end;
    border: 1px solid rgba(229, 185, 105, 0.24);
    border-radius: 50%;
    color: rgba(250, 211, 132, 0.72);
    background: radial-gradient(circle, rgba(189, 115, 33, 0.2), transparent 62%);
    font-family: Georgia, serif;
    font-size: 42px;
    line-height: 0.9;
    text-align: center;
}

.tavern-hero__seal span {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 0.16em;
}

.tavern-stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 20px 0;
}

.stat-card,
.panel,
.toolbar,
.table-wrap,
.metric-card,
.notice-card,
.coupon-template-card,
.coupon-admin-guide {
    border-color: rgba(232, 211, 182, 0.9);
    background:
        linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 249, 240, 0.95));
    box-shadow: 0 14px 34px rgba(85, 49, 20, 0.08);
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
}

.stat-card::after {
    position: absolute;
    width: 110px;
    height: 110px;
    right: -44px;
    top: -38px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 141, 52, 0.16), transparent 66%);
    content: "";
}

.stat-card .stat-top {
    color: #9a7a60;
}

.stat-symbol {
    color: #7b3e16;
    background: linear-gradient(135deg, #fff4dc, #ead0a7);
}

.stat-card strong {
    color: #2d1307;
    font-size: 29px;
}

.stat-card small,
.table-sub {
    color: #9b8978;
}

.dashboard-analytics-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.78fr) minmax(260px, 0.6fr);
}

.dashboard-bottom-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
    grid-template-columns: minmax(0, 1.2fr) minmax(440px, 0.8fr);
}

.panel {
    padding: 22px 24px;
}

.panel-head {
    gap: 16px;
}

.panel-head h3 {
    color: #2f170a;
    font-size: 22px;
}

.panel-tabs {
    display: flex;
    gap: 8px;
    padding: 5px;
    border-radius: 999px;
    background: #f6ebd9;
}

.panel-tabs button {
    padding: 7px 12px;
    border: 0;
    border-radius: 999px;
    color: #8b7056;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
}

.panel-tabs button:hover {
    color: #6f340f;
}

.panel-tabs .active {
    color: #6f340f;
    background: #fff8ea;
    box-shadow: 0 6px 14px rgba(83, 45, 14, 0.08);
}

.sales-chart {
    display: flex;
    min-height: 238px;
    align-items: end;
    gap: 14px;
    padding: 18px 4px 0;
}

.sales-chart__bar {
    display: grid;
    flex: 1;
    min-width: 34px;
    height: 214px;
    align-items: end;
    gap: 8px;
    text-align: center;
}

.sales-chart__bar span {
    color: #7a6048;
    font-size: 11px;
}

.sales-chart__bar i {
    display: block;
    height: var(--height);
    min-height: 16px;
    border-radius: 14px 14px 6px 6px;
    background:
        linear-gradient(180deg, #e7b35f, #8a4417),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    box-shadow: 0 10px 20px rgba(118, 62, 22, 0.18);
}

.sales-chart__bar small {
    color: #9a8675;
}

.coupon-usage {
    display: grid;
    min-height: 238px;
    align-items: center;
    gap: 20px;
    grid-template-columns: 150px 1fr;
}

.coupon-donut {
    display: grid;
    width: 148px;
    height: 148px;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fffaf1 0 45%, transparent 46%),
        conic-gradient(#8a3f15 0 42%, #d59743 42% 70%, #edd2a0 70% 88%, #b86f3c 88% 100%);
    box-shadow: inset 0 0 0 1px rgba(121, 67, 25, 0.08), 0 14px 26px rgba(91, 48, 15, 0.12);
    text-align: center;
}

.coupon-donut strong,
.coupon-donut span {
    grid-area: 1 / 1;
}

.coupon-donut strong {
    margin-bottom: 16px;
    font-family: Georgia, serif;
    font-size: 26px;
}

.coupon-donut span {
    margin-top: 38px;
    color: #9b8067;
    font-size: 12px;
}

.coupon-legend {
    display: grid;
    gap: 11px;
}

.coupon-legend div,
.status-list div {
    display: grid;
    align-items: center;
    gap: 10px;
    grid-template-columns: 1fr auto auto;
    color: #6f5845;
}

.coupon-legend span,
.status-list span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coupon-legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #8a3f15;
}

.coupon-legend div:nth-child(2) i { background: #d59743; }
.coupon-legend div:nth-child(3) i { background: #edd2a0; }
.coupon-legend div:nth-child(4) i { background: #b86f3c; }
.coupon-legend div:nth-child(5) i { background: #d4aa72; }

.coupon-legend em {
    color: #9d8065;
    font-style: normal;
}

.status-list {
    display: grid;
    min-height: 238px;
    align-content: center;
    gap: 18px;
}

.status-list div {
    grid-template-columns: 1fr auto;
}

.status-list strong {
    color: #357748;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #d99735;
}

.status-dot.ok {
    background: #3a9b62;
    box-shadow: 0 0 0 4px rgba(58, 155, 98, 0.1);
}

.status-dot.mock {
    background: #d99735;
    box-shadow: 0 0 0 4px rgba(217, 151, 53, 0.14);
}

.recent-orders {
    display: grid;
    gap: 8px;
}

.recent-order-row {
    display: grid;
    align-items: center;
    gap: 14px;
    grid-template-columns: 42px minmax(180px, 1fr) minmax(100px, 0.7fr) minmax(100px, 0.6fr) auto minmax(128px, 0.8fr);
    border-bottom: 1px solid #efe3d2;
    padding: 12px 0;
}

.recent-order-row:last-child {
    border-bottom: 0;
}

.recent-order-row strong,
.recent-order-row span {
    display: block;
}

.recent-order-row span,
.recent-order-row time,
.recent-order-product {
    color: #927a65;
    font-size: 12px;
}

.recent-order-user {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    color: #f6d897;
    background: #2a1306;
    font-family: Georgia, serif;
    font-weight: 700;
}

.text-link {
    border: 0;
    color: #7b451e;
    background: transparent;
    font-weight: 700;
}

.tavern-quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
}

.tavern-quick-grid button,
.quick-grid button {
    border: 1px solid #ead8bf;
    border-radius: 14px;
    color: #4a2a16;
    background:
        radial-gradient(circle at 50% 10%, rgba(219, 164, 88, 0.16), transparent 38%),
        #fffaf1;
    box-shadow: 0 10px 22px rgba(86, 48, 17, 0.06);
}

.tavern-quick-grid button:hover,
.quick-grid button:hover {
    border-color: #d7a35e;
    background: #fff3df;
}

.tavern-quick-grid button span {
    font-weight: 800;
}

.tavern-quick-grid button small {
    color: #997a5f;
}

.dashboard-empty {
    display: grid;
    min-height: 160px;
    place-items: center;
    color: #9b8067;
    text-align: center;
}

.dashboard-empty strong,
.dashboard-empty span {
    display: block;
}

.dashboard-empty strong {
    color: #4a2814;
    font-size: 16px;
}

input,
select,
textarea {
    border-color: #eadbc4;
    color: #3b2011;
    background: #fffdf7;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #c8903c;
    box-shadow: 0 0 0 3px rgba(196, 137, 55, 0.13);
}

.field > span,
.login-card label > span {
    color: #65452e;
}

table th {
    color: #7d614a;
    background: #f5ead9;
}

table td {
    border-bottom-color: #efe3d2;
}

.badge.success {
    color: #327143;
    background: #e9f4e7;
}

.badge.warning {
    color: #9a6317;
    background: #fff0d8;
}

.badge.danger {
    color: #b94c34;
    background: #fae4dc;
}

.login-brand {
    background:
        radial-gradient(circle at 74% 22%, rgba(224, 158, 64, 0.22), transparent 28%),
        linear-gradient(145deg, #2f1506 0%, #50260d 58%, #1b0b03 100%);
}

.brand-mark {
    border-color: rgba(240, 195, 121, 0.58);
    color: #f9dc9b;
    background: rgba(255, 255, 255, 0.08);
}

.brand-copy,
.brand-foot {
    color: rgba(255, 229, 190, 0.72);
}

.brand-foot span::before {
    background: #d69c4b;
}

@media (max-width: 1280px) {
    .tavern-hero {
        grid-template-columns: 1fr;
    }

    .hero-metric-grid {
        border-left: 0;
    }

    .tavern-hero__seal {
        display: none;
    }

    .tavern-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-analytics-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-shell {
        background: linear-gradient(180deg, #fffaf3, #f5eadb);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0 18px 28px;
    }

    .dashboard-welcome,
    .dashboard-controls {
        align-items: flex-start;
        justify-content: flex-start;
        flex-direction: column;
    }

    .hero-metric-grid,
    .tavern-stat-grid,
    .tavern-quick-grid,
    .coupon-usage,
    .recent-order-row {
        grid-template-columns: 1fr;
    }

    .hero-metric-grid article {
        border-right: 0;
        border-bottom: 1px solid rgba(236, 195, 128, 0.22);
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--ink);
    background: var(--paper);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 14px;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.eyebrow,
.panel-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.eyebrow {
    color: #b9cfc6;
}

.eyebrow.dark,
.panel-kicker {
    color: var(--green);
}

.eyebrow.light {
    color: #b7d7cc;
}

.muted {
    color: var(--muted);
}

.login-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 1.05fr) minmax(420px, 0.95fr);
}

.login-brand {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 54px 64px;
    color: #fff;
    background:
        radial-gradient(circle at 78% 20%, rgba(95, 156, 129, 0.36), transparent 31%),
        linear-gradient(145deg, #10241e 0%, #173e32 56%, #235747 100%);
}

.login-brand::before,
.login-brand::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
}

.login-brand::before {
    width: 440px;
    height: 440px;
    right: -210px;
    bottom: -140px;
}

.login-brand::after {
    width: 260px;
    height: 260px;
    right: -120px;
    bottom: -50px;
}

.brand-mark {
    display: grid;
    width: 60px;
    height: 60px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: 18px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    font-family: Georgia, serif;
    font-size: 23px;
    letter-spacing: 0.08em;
}

.brand-mark.small {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    border-radius: 13px;
    font-size: 17px;
}

.login-brand h1 {
    max-width: 650px;
    margin: 16px 0 24px;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(42px, 5vw, 72px);
    font-weight: 500;
    line-height: 1.16;
    letter-spacing: -0.04em;
}

.brand-copy {
    max-width: 480px;
    color: #c9d9d3;
    font-size: 16px;
    line-height: 1.9;
}

.brand-foot {
    display: flex;
    position: relative;
    z-index: 1;
    gap: 28px;
    color: #b7cbc4;
    font-size: 12px;
}

.brand-foot span::before {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 8px;
    border-radius: 50%;
    background: #79b89f;
    content: "";
    vertical-align: 2px;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 42px;
    background: #fbfcfa;
}

.login-card {
    width: min(410px, 100%);
}

.login-card h2 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.login-card > .muted {
    margin: 10px 0 34px;
}

.login-card label,
.field {
    display: grid;
    gap: 8px;
}

.login-card label {
    margin-top: 20px;
}

.login-card label > span,
.field > span {
    color: #3e4946;
    font-size: 13px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #dce3df;
    border-radius: 11px;
    outline: none;
    padding: 10px 12px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #5d9a85;
    box-shadow: 0 0 0 3px rgba(51, 120, 96, 0.11);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 62px;
}

.text-button {
    position: absolute;
    right: 6px;
    top: 50%;
    border: 0;
    padding: 7px 8px;
    color: var(--green);
    background: transparent;
    transform: translateY(-50%);
}

.primary-button,
.secondary-button,
.danger-button,
.table-button {
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    padding: 9px 15px;
    font-weight: 600;
    transition: transform 0.15s, background 0.15s, opacity 0.15s;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.table-button:hover {
    transform: translateY(-1px);
}

.primary-button {
    color: #fff;
    background: var(--green);
}

.primary-button:hover {
    background: var(--green-dark);
}

.secondary-button {
    border: 1px solid var(--line);
    color: #3f4c48;
    background: #fff;
}

.danger-button {
    color: #fff;
    background: var(--red);
}

.login-button {
    width: 100%;
    min-height: 48px;
    margin-top: 28px;
}

button:disabled {
    cursor: wait;
    opacity: 0.55;
    transform: none !important;
}

.form-error {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--red);
    text-align: center;
}

.login-note {
    margin-top: 22px;
    color: #9aa29f;
    font-size: 12px;
    text-align: center;
}

.mobile-brand {
    display: none;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 250px;
    flex-direction: column;
    padding: 24px 16px 16px;
    color: #eaf1ee;
    background: var(--navy);
}

.sidebar-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 20px;
}

.sidebar-head strong,
.sidebar-head span {
    display: block;
}

.sidebar-head strong {
    font-size: 15px;
}

.sidebar-head span {
    margin-top: 3px;
    color: #93aaa2;
    font-size: 11px;
}

.nav-list {
    overflow-y: auto;
    padding: 6px 0 12px;
    scrollbar-width: thin;
}

.nav-group {
    margin: 22px 12px 8px;
    color: #718b82;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.nav-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 11px;
    padding: 10px 12px;
    color: #adc0b9;
    background: transparent;
    text-align: left;
    transition: color 0.18s, background 0.18s;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: var(--navy-soft);
}

.nav-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #c6d7d1;
    font-size: 11px;
}

.nav-item.active .nav-icon {
    border-color: rgba(255, 255, 255, 0.18);
    background: #2d594b;
}

.sidebar-user {
    display: grid;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 6px 2px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
}

.avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    color: #17352c;
    background: #cfe6dd;
    font-weight: 700;
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user strong {
    font-size: 12px;
}

.sidebar-user span {
    margin-top: 3px;
    color: #7e978f;
    font-size: 10px;
}

.logout-button {
    border: 0;
    padding: 6px 3px;
    color: #91a69f;
    background: transparent;
    font-size: 11px;
}

.main-content {
    width: calc(100% - 250px);
    min-width: 0;
    margin-left: 250px;
    padding: 0 32px 42px;
}

.topbar {
    display: flex;
    min-height: 108px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar h2 {
    margin: 0;
    font-size: 25px;
    letter-spacing: -0.035em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.global-store-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    max-width: 320px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.76);
    font-size: 12px;
    cursor: pointer;
}

.global-store-field span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.global-store-field select {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}

.dashboard-store-field {
    min-width: 210px;
    padding: 10px 13px;
}

.app-shell[data-view="dashboard"] #globalStoreField {
    display: none;
}

.date-chip {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 13px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.view {
    display: none;
    animation: fade-in 0.24s ease;
}

.view.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-card {
    display: flex;
    min-height: 205px;
    overflow: hidden;
    position: relative;
    align-items: center;
    justify-content: space-between;
    border-radius: 22px;
    padding: 38px 44px;
    color: #fff;
    background:
        radial-gradient(circle at 79% 26%, rgba(119, 185, 157, 0.32), transparent 28%),
        linear-gradient(128deg, #163b30, #24604e);
    box-shadow: var(--shadow);
}

.hero-card::after {
    position: absolute;
    width: 320px;
    height: 320px;
    right: -140px;
    bottom: -210px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    content: "";
}

.hero-card h3 {
    margin: 10px 0 10px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 34px;
    font-weight: 500;
}

.hero-card p:last-child {
    margin: 0;
    color: #c9ddd5;
}

.hero-date {
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 118px;
    text-align: center;
}

.hero-date strong {
    font-family: Georgia, serif;
    font-size: 76px;
    font-weight: 400;
    line-height: 0.9;
}

.hero-date span {
    margin-top: 12px;
    color: #c4d8d0;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

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

.stat-card {
    min-height: 145px;
    border: 1px solid #e9edeb;
    border-radius: var(--radius);
    padding: 22px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(39, 63, 55, 0.04);
}

.stat-card .stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

.stat-symbol {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    color: var(--green);
    background: var(--mint);
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin-top: 17px;
    font-family: Georgia, serif;
    font-size: 31px;
    font-weight: 500;
}

.stat-card small {
    display: block;
    margin-top: 5px;
    color: #9aa29f;
}

.loading-card {
    background: linear-gradient(100deg, #fff 20%, #f2f5f3 40%, #fff 60%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to { background-position-x: -200%; }
}

.dashboard-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 1.35fr 0.65fr;
}

.panel {
    border: 1px solid #e7ece9;
    border-radius: var(--radius);
    padding: 22px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(39, 63, 55, 0.035);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.panel-head h3 {
    margin: 0;
    font-size: 17px;
}

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

.quick-grid button {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 16px;
    background: #fbfcfb;
    text-align: left;
}

.quick-grid button:hover {
    border-color: #b9d1c8;
    background: #f3f8f6;
}

.quick-grid span {
    font-weight: 700;
}

.quick-grid small {
    color: var(--muted);
}

.status-list {
    display: grid;
    gap: 4px;
}

.status-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf0ee;
    padding: 14px 2px;
}

.status-list > div:last-child {
    border: 0;
}

.status-list strong {
    color: #5e6966;
    font-size: 12px;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 9px;
    border-radius: 50%;
}

.status-dot.ok {
    background: #4ca681;
    box-shadow: 0 0 0 4px rgba(76, 166, 129, 0.12);
}

.status-dot.mock {
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(217, 151, 53, 0.12);
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    min-height: 124px;
    border: 1px solid rgba(232, 211, 182, 0.86);
    border-radius: 16px;
    padding: 24px 22px 34px;
    background:
        linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 248, 238, 0.94));
    box-shadow: 0 12px 28px rgba(85, 49, 20, 0.07);
}

.filters {
    display: grid;
    flex: 1;
    align-items: end;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.filters .field {
    min-width: 0;
    gap: 5px;
}

.filters .field.wide {
    min-width: 0;
    grid-column: span 2;
}

.filters .field > span {
    color: #7d614a;
    font-size: 11px;
    font-weight: 700;
}

.filters input,
.filters select {
    min-height: 40px;
    border-radius: 12px;
    background: #fffdf8;
}

.filters > button {
    min-height: 40px;
    align-self: end;
    border-radius: 12px;
}

.toolbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    align-self: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-filter-toolbar {
    min-height: 116px;
    align-items: center;
    margin-bottom: 16px;
    padding: 22px 18px 26px;
}

.product-filter-toolbar .filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.product-filter-toolbar .filters .field {
    flex: 0 0 180px;
}

.product-filter-toolbar .filters .field.wide {
    flex-basis: 260px;
    grid-column: auto;
}

.product-filter-toolbar .toolbar-actions {
    align-items: flex-end;
    align-self: center;
    padding-bottom: 0;
}

.product-filter-toolbar + .table-wrap {
    margin-top: 16px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #e7ece9;
    border-radius: 15px;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th,
td {
    border-bottom: 1px solid #edf0ee;
    padding: 14px 16px;
    text-align: left;
}

th {
    color: #74807c;
    background: #fafbf9;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

td {
    color: #3b4643;
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #fbfcfb;
}

.table-main {
    color: var(--ink);
    font-weight: 600;
}

.product-cell {
    display: flex;
    min-width: 220px;
    align-items: center;
    gap: 12px;
}

.product-thumb {
    display: grid;
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    overflow: hidden;
    place-items: center;
    border-radius: 14px;
    color: #929b98;
    background: #edf1ef;
    font-size: 11px;
}

.product-thumb img,
.product-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.table-sub {
    display: block;
    margin-top: 4px;
    color: #929b98;
    font-size: 11px;
}

.money {
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 20px;
    padding: 4px 9px;
    color: #56615e;
    background: #edf1ef;
    font-size: 11px;
    font-weight: 600;
}

.badge.success {
    color: #24684f;
    background: var(--mint);
}

.badge.warning {
    color: #9b661c;
    background: var(--amber-soft);
}

.badge.danger {
    color: #9c3e3e;
    background: var(--red-soft);
}

.badge.info {
    color: #355f83;
    background: var(--blue-soft);
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.table-button {
    min-height: 30px;
    border: 1px solid #dfe6e2;
    padding: 5px 9px;
    color: #4b5b56;
    background: #fff;
    font-size: 11px;
}

.table-button.primary {
    border-color: #c1dacf;
    color: var(--green);
    background: #f1f8f5;
}

.table-button.danger {
    border-color: #efd0d0;
    color: var(--red);
    background: #fff8f8;
}

.points-link-button {
    min-width: 88px;
    border: 1px solid rgba(199, 138, 50, 0.36);
    border-radius: 10px;
    padding: 7px 11px;
    color: #6b300f;
    background: #fff6e2;
    font-weight: 700;
    text-align: left;
}

.points-link-button:hover {
    border-color: rgba(122, 67, 25, 0.42);
    background: #ffecc1;
}

.points-link-button.compact {
    min-width: 64px;
    padding: 6px 9px;
    text-align: center;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 15px;
}

.pager span {
    color: var(--muted);
    font-size: 12px;
}

.empty-state {
    display: grid;
    min-height: 260px;
    place-items: center;
    color: #929b98;
    text-align: center;
}

.empty-state strong {
    display: block;
    margin-bottom: 7px;
    color: #5c6763;
}

.section-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 4px;
    background: #fff;
}

.section-tabs button {
    border: 0;
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--muted);
    background: transparent;
}

.section-tabs button.active {
    color: #fff;
    background: var(--green);
}

.dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 44px);
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    padding: 0;
    background: #fff;
    box-shadow: 0 26px 80px rgba(13, 36, 28, 0.26);
}

.dialog::backdrop {
    background: rgba(13, 29, 24, 0.58);
    backdrop-filter: blur(3px);
}

.dialog form {
    display: flex;
    max-height: calc(100vh - 44px);
    flex-direction: column;
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 21px 24px 17px;
}

.dialog-head h3 {
    margin: 0;
    font-size: 19px;
}

.icon-button {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: #61706b;
    background: #fff;
    font-size: 18px;
}

.dialog-body {
    overflow-y: auto;
    padding: 22px 24px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    border-top: 1px solid var(--line);
    padding: 16px 24px;
    background: #fbfcfb;
}

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

.field.full {
    grid-column: 1 / -1;
}

.field-note {
    color: #929b98;
    font-size: 11px;
    line-height: 1.5;
}

.product-image-editor {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin-top: 8px;
}

.product-image-preview {
    display: grid;
    width: 180px;
    height: 180px;
    flex: 0 0 auto;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: #929b98;
    background: #f3f5f2;
    font-size: 12px;
}

.image-upload-button {
    display: flex;
    min-height: 180px;
    flex: 1;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px dashed #9fb2a9;
    border-radius: 20px;
    color: var(--green);
    background: #f5f9f6;
    cursor: pointer;
}

.image-upload-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.image-upload-button strong {
    font-size: 15px;
}

.image-upload-button small {
    margin-top: 8px;
    color: #929b98;
}

.operation-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr);
}

.operation-config .field textarea {
    min-height: 110px;
}

.panel-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.panel-note {
    color: var(--muted);
    font-size: 11px;
}

.managed-image-row {
    display: flex;
    gap: 14px;
}

.managed-image-preview {
    display: grid;
    width: 148px;
    height: 98px;
    flex: 0 0 auto;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--muted);
    background: #f2f5f2;
    font-size: 11px;
}

.managed-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.managed-image-controls {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 9px;
}

.compact-upload {
    display: inline-flex;
    width: fit-content;
    min-height: 34px;
    align-items: center;
    border: 1px dashed #9fb2a9;
    border-radius: 9px;
    padding: 6px 13px;
    color: var(--green);
    background: #f5f9f6;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.compact-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.top-gap {
    margin-top: 16px;
}

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

.metric-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 19px;
    background:
        radial-gradient(circle at 90% 10%, rgba(210, 171, 95, .12), transparent 42%),
        #fff;
}

.metric-card span,
.metric-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.metric-card strong {
    display: block;
    margin: 10px 0 7px;
    color: var(--green);
    font-family: Georgia, serif;
    font-size: 28px;
}

.statistics-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(340px, .8fr) minmax(520px, 1.2fr);
}

.detail-grid {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    grid-template-columns: repeat(2, 1fr);
}

.detail-item {
    min-width: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 13px 15px;
}

.detail-item:nth-child(2n) {
    border-right: 0;
}

.detail-item span,
.detail-item strong {
    display: block;
}

.detail-item span {
    margin-bottom: 6px;
    color: #8a9490;
    font-size: 11px;
}

.detail-item strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.json-view {
    overflow: auto;
    max-height: 440px;
    border-radius: 12px;
    margin: 0;
    padding: 16px;
    color: #d7e8e1;
    background: #182923;
    font-family: Consolas, monospace;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.sku-editor {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.sku-editor-row {
    display: grid;
    align-items: end;
    gap: 10px;
    grid-template-columns: minmax(120px, 1.2fr) repeat(3, minmax(96px, 1fr)) auto;
}

.sku-editor-row label,
.sku-editor-row span {
    display: block;
}

.sku-editor-row span {
    margin-bottom: 6px;
    color: #8a6b52;
    font-size: 11px;
}

.sku-editor-row input {
    width: 100%;
    border: 1px solid #ead5b8;
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.78);
    font: inherit;
}

.notice-card {
    border: 1px solid #d8e6e0;
    border-radius: 14px;
    padding: 18px;
    background: #f5faf8;
}

.notice-card h4 {
    margin: 0 0 9px;
}

.notice-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.notice-card.danger-note {
    border-color: rgba(183, 82, 55, 0.34);
    background: #fff3ec;
}

.halving-warning,
.halving-rule-banner {
    display: flex;
    gap: 10px;
    border: 1px solid rgba(183, 82, 55, 0.34);
    color: #743116;
    background: #fff3d8;
    box-shadow: 0 10px 24px rgba(183, 82, 55, 0.08);
}

.halving-warning {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 14px;
    padding: 14px 16px;
}

.halving-rule-banner {
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-radius: 15px;
    padding: 14px 18px;
}

.halving-warning strong,
.halving-rule-banner strong {
    color: #9d351f;
    font-size: 13px;
}

.halving-warning span,
.halving-rule-banner span {
    color: #743116;
    line-height: 1.6;
}

.coupon-admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 150px;
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid rgba(207, 154, 76, 0.28);
    border-radius: 22px;
    padding: 26px 30px;
    color: #fff4df;
    background:
        radial-gradient(circle at 86% 20%, rgba(231, 173, 85, 0.28), transparent 27%),
        linear-gradient(135deg, #3b1c0b, #160b05);
    box-shadow: 0 18px 40px rgba(58, 27, 9, 0.14);
}

.coupon-admin-hero p {
    margin: 0 0 8px;
    color: #d8aa63;
    font-family: Georgia, serif;
    font-size: 12px;
    letter-spacing: 4px;
}

.coupon-admin-hero h3 {
    margin: 0;
    font-family: Georgia, "Microsoft YaHei", serif;
    font-size: 28px;
}

.coupon-admin-hero span {
    display: block;
    margin-top: 10px;
    color: rgba(255, 244, 223, 0.7);
}

.coupon-admin-hero__mark {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    border: 1px solid rgba(242, 202, 133, 0.45);
    border-radius: 24px;
    color: #ffe0a5;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 24%),
        linear-gradient(145deg, #b16f29, #5a2b0e);
    box-shadow:
        inset 0 0 0 4px rgba(255, 230, 181, 0.08),
        0 14px 30px rgba(0, 0, 0, 0.24);
    font-size: 28px;
    font-weight: 800;
    transform: rotate(5deg);
}

.coupon-admin-tabs {
    margin-bottom: 18px;
    border-color: rgba(176, 111, 39, 0.2);
    background: #fffaf2;
}

.coupon-admin-tabs button.active {
    background: linear-gradient(145deg, #7a451d, #462109);
}

.coupon-admin-guide {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    border: 1px solid rgba(203, 149, 72, 0.26);
    border-radius: 14px;
    padding: 16px 18px;
    color: #80664f;
    background: linear-gradient(135deg, #fffaf1, #f9eedf);
}

.coupon-admin-guide strong {
    flex: 0 0 auto;
    color: #663b19;
}

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

.coupon-template-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    min-height: 262px;
    overflow: hidden;
    border: 1px solid rgba(191, 135, 68, 0.22);
    border-radius: 20px;
    background: linear-gradient(145deg, #fffdfa, #fff7ec);
    box-shadow: 0 14px 34px rgba(70, 37, 17, 0.08);
}

.coupon-template-card__visual {
    display: flex;
    align-items: flex-end;
    position: relative;
    min-height: 100%;
    overflow: hidden;
    padding: 20px;
    color: #f5cf88;
    background: linear-gradient(145deg, #351607, #100805);
}

.coupon-template-card__visual img,
.coupon-template-card__shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.coupon-template-card__visual img {
    object-fit: cover;
}

.coupon-template-card__shade {
    background: linear-gradient(180deg, rgba(20, 8, 2, 0.1), rgba(20, 8, 2, 0.82));
}

.coupon-template-card__visual strong,
.coupon-template-card__visual > span {
    position: relative;
    z-index: 1;
    font-family: Georgia, serif;
    letter-spacing: 2px;
}

.coupon-template-card__body {
    padding: 22px;
}

.coupon-template-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.coupon-template-card__tag {
    border-radius: 8px;
    padding: 5px 10px;
    color: #955b1d;
    background: #f5dfbb;
    font-size: 12px;
    font-weight: 700;
}

.coupon-template-card h4 {
    margin: 16px 0 0;
    color: #321b0d;
    font-family: Georgia, "Microsoft YaHei", serif;
    font-size: 22px;
}

.coupon-template-card p {
    min-height: 42px;
    margin: 9px 0 0;
    color: #846c57;
    line-height: 1.55;
}

.coupon-template-card dl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(103, 58, 25, 0.1);
}

.coupon-template-card dl div {
    min-width: 0;
}

.coupon-template-card dt {
    color: #9a8878;
    font-size: 11px;
}

.coupon-template-card dd {
    margin: 5px 0 0;
    color: #55331c;
    font-size: 13px;
    font-weight: 700;
}

.coupon-template-card__actions {
    margin-top: 18px;
}

@media (max-width: 1180px) {
    .coupon-template-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .coupon-admin-guide {
        align-items: flex-start;
        flex-direction: column;
    }

    .coupon-template-card {
        grid-template-columns: 130px minmax(0, 1fr);
    }
}

.reconcile-card {
    display: grid;
    min-height: 360px;
    place-items: center;
    border: 1px solid #e2e9e5;
    border-radius: 22px;
    padding: 38px;
    background:
        radial-gradient(circle at 50% 0, rgba(66, 133, 107, 0.12), transparent 42%),
        #fff;
    text-align: center;
}

.reconcile-card h3 {
    margin: 16px 0 9px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 28px;
    font-weight: 500;
}

.reconcile-card p {
    max-width: 530px;
    margin: 0 auto 24px;
    color: var(--muted);
    line-height: 1.8;
}

.reconcile-form {
    display: flex;
    justify-content: center;
    gap: 9px;
}

.reconcile-form input {
    width: 180px;
}

.result-box {
    width: min(610px, 100%);
    margin-top: 22px;
    text-align: left;
}

.toast-area {
    position: fixed;
    z-index: 100;
    right: 24px;
    bottom: 24px;
    display: grid;
    gap: 9px;
}

.toast {
    min-width: 260px;
    max-width: 390px;
    border: 1px solid #d9e6e1;
    border-radius: 12px;
    padding: 13px 16px;
    color: #31433d;
    background: #fff;
    box-shadow: var(--shadow);
    animation: toast-in 0.22s ease;
}

.toast.error {
    border-color: #efd1d1;
    color: #8f3636;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

.loading-mask {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 12px;
    color: #fff;
    background: rgba(14, 32, 26, 0.5);
    text-align: center;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: auto;
    border: 3px solid rgba(255, 255, 255, 0.28);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.mobile-only {
    display: none;
}

@media (max-width: 1120px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid,
    .operation-grid,
    .statistics-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 28px;
    }

    .mobile-brand {
        display: grid;
        width: 54px;
        height: 54px;
        place-items: center;
        margin-bottom: 42px;
        border-radius: 16px;
        color: #fff;
        background: var(--navy);
        font-family: Georgia, serif;
        font-size: 19px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(9, 25, 19, 0.25);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0 18px 30px;
    }

    .mobile-only {
        display: grid;
    }

    .sidebar-head .mobile-only {
        margin-left: auto;
        border-color: rgba(255, 255, 255, 0.12);
        color: #fff;
        background: transparent;
    }

    .topbar {
        min-height: 92px;
        justify-content: flex-start;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .global-store-field {
        min-width: 0;
        max-width: calc(100vw - 142px);
    }

    .date-chip {
        display: none;
    }

    .hero-card {
        min-height: 185px;
        padding: 30px;
    }

    .hero-date {
        display: none;
    }

    .hero-card h3 {
        font-size: 27px;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filters {
        align-items: stretch;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters .field,
    .filters .field.wide {
        min-width: calc(50% - 5px);
        grid-column: auto;
    }

    .product-filter-toolbar {
        min-height: auto;
        padding: 20px 18px 26px;
    }

    .product-filter-toolbar .filters {
        width: 100%;
    }

    .product-filter-toolbar .filters .field,
    .product-filter-toolbar .filters .field.wide {
        flex: 1 1 calc(50% - 6px);
    }

    .product-filter-toolbar .toolbar-actions {
        width: 100%;
        align-self: stretch;
    }
}

@media (max-width: 560px) {
    .topbar h2 {
        font-size: 20px;
    }

    .topbar .secondary-button {
        padding: 8px 10px;
        font-size: 12px;
    }

    .stat-grid,
    .quick-grid,
    .metric-grid,
    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-item {
        border-right: 0;
    }

    .hero-card {
        padding: 26px 22px;
    }

    .hero-card h3 {
        font-size: 24px;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .filters .field,
    .filters .field.wide {
        min-width: 100%;
        grid-column: auto;
    }

    .product-filter-toolbar .filters .field,
    .product-filter-toolbar .filters .field.wide {
        flex-basis: 100%;
    }

    .toolbar-actions > button {
        flex: 1;
    }

    .reconcile-form {
        align-items: stretch;
        flex-direction: column;
    }

    .reconcile-form input {
        width: 100%;
    }

    .toast-area {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .toast {
        min-width: 0;
    }

    .product-image-editor {
        flex-direction: column;
    }

    .product-image-preview {
        width: 100%;
        height: 220px;
    }

    .sku-editor-row {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .managed-image-row {
        flex-direction: column;
    }

    .managed-image-preview {
        width: 100%;
        height: 180px;
    }
}

/* Final tavern theme overrides: keep these rules at the end. */
body {
    color: var(--ink);
    background:
        radial-gradient(circle at 16% 4%, rgba(224, 181, 112, 0.2), transparent 26%),
        linear-gradient(120deg, #fffaf3 0%, #f5eadb 100%);
}

.app-shell {
    min-height: 100vh;
    background:
        linear-gradient(90deg, #2a1306 0 250px, transparent 250px),
        radial-gradient(circle at 84% 6%, rgba(206, 151, 74, 0.16), transparent 24%),
        linear-gradient(135deg, #fffaf3 0%, #f6ead8 100%);
}

.app-shell[data-view="dashboard"] .topbar {
    display: none;
}

.sidebar {
    overflow: hidden;
    border-right: 1px solid rgba(231, 180, 102, 0.22);
    color: #f9e7c5;
    background:
        radial-gradient(circle at 18% 8%, rgba(219, 159, 75, 0.24), transparent 24%),
        radial-gradient(circle at 84% 92%, rgba(156, 83, 31, 0.26), transparent 28%),
        linear-gradient(180deg, #351905 0%, #211006 58%, #160a04 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.sidebar::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
        linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.08) 75%);
    background-position: 0 0, 12px 12px;
    background-size: 24px 24px;
    content: "";
    opacity: 0.25;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-head strong {
    color: #ffe7b1;
    font-family: Georgia, "Songti SC", serif;
    font-size: 20px;
}

.sidebar-head span,
.sidebar-user span {
    color: rgba(255, 230, 190, 0.62);
}

.brand-mark.small,
.sidebar-head .brand-mark.small {
    width: 58px;
    height: 58px;
    border-color: rgba(231, 188, 116, 0.58);
    border-radius: 50%;
    color: #f7d795;
    background:
        radial-gradient(circle, rgba(229, 181, 100, 0.22), transparent 58%),
        rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 8px rgba(195, 123, 43, 0.08);
}

.nav-group {
    color: rgba(242, 209, 154, 0.62);
}

.nav-item {
    min-height: 46px;
    border: 1px solid transparent;
    color: rgba(255, 236, 205, 0.78);
    background: transparent;
}

.nav-item:hover {
    border-color: rgba(239, 191, 110, 0.18);
    color: #fff6dd;
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
    border-color: rgba(246, 203, 126, 0.28);
    color: #fff8e4;
    background: linear-gradient(135deg, rgba(183, 121, 42, 0.82), rgba(100, 50, 15, 0.78));
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nav-icon {
    border-color: rgba(237, 196, 124, 0.34);
    color: #f5d99b;
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active .nav-icon {
    border-color: rgba(255, 237, 188, 0.28);
    color: #4a2209;
    background: linear-gradient(135deg, #f8d48a, #b4772f);
}

.main-content {
    min-height: 100vh;
    background:
        radial-gradient(circle at 95% 0, rgba(207, 158, 89, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(255, 253, 249, 0.84), rgba(248, 237, 221, 0.76));
}

.topbar {
    min-height: 96px;
}

.topbar h2,
.dashboard-welcome h1,
.panel-head h3 {
    color: #2f170a;
    font-family: Georgia, "Songti SC", serif;
}

.eyebrow.dark,
.panel-kicker {
    color: #a87533;
}

.date-chip,
.secondary-button {
    border-color: #ead9bf;
    color: #6e4a2b;
    background: rgba(255, 253, 247, 0.86);
    box-shadow: 0 8px 22px rgba(90, 48, 16, 0.05);
}

.primary-button {
    color: #fff4d6;
    background: linear-gradient(135deg, #7b3a14, #4a200b);
    box-shadow: 0 12px 24px rgba(80, 36, 11, 0.18);
}

.primary-button:hover {
    background: linear-gradient(135deg, #8c461a, #55270e);
}

.stat-card,
.panel,
.toolbar,
.table-wrap,
.metric-card,
.notice-card,
.coupon-template-card,
.coupon-admin-guide {
    border-color: rgba(232, 211, 182, 0.9);
    background:
        linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 249, 240, 0.95));
    box-shadow: 0 14px 34px rgba(85, 49, 20, 0.08);
}

.tavern-stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-symbol {
    color: #7b3e16;
    background: linear-gradient(135deg, #fff4dc, #ead0a7);
}

input,
select,
textarea {
    border-color: #eadbc4;
    color: #3b2011;
    background: #fffdf7;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #c8903c;
    box-shadow: 0 0 0 3px rgba(196, 137, 55, 0.13);
}

table th {
    color: #7d614a;
    background: #f5ead9;
}

table td {
    border-bottom-color: #efe3d2;
}

.badge.success {
    color: #327143;
    background: #e9f4e7;
}

.badge.warning {
    color: #9a6317;
    background: #fff0d8;
}

.badge.danger {
    color: #b94c34;
    background: #fae4dc;
}

@media (max-width: 1280px) {
    .tavern-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .app-shell {
        background: linear-gradient(180deg, #fffaf3, #f5eadb);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0 18px 28px;
    }

    .tavern-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin visual fix 2026-06-13: final layout lock. */
html,
body {
    overflow-x: hidden;
}

body {
    background: #fbf4ea;
}

.login-page {
    grid-template-columns: minmax(640px, 1.18fr) minmax(520px, 0.82fr);
    background: #fffaf4;
}

.login-brand {
    isolation: isolate;
    padding: 62px 70px;
    background:
        radial-gradient(circle at 73% 30%, rgba(245, 198, 118, 0.2), transparent 18%),
        radial-gradient(circle at 64% 58%, rgba(255, 228, 166, 0.1), transparent 24%),
        linear-gradient(135deg, rgba(25, 9, 2, 0.16), transparent 42%),
        linear-gradient(145deg, #351605 0%, #4a2109 46%, #1b0b03 100%);
}

.login-brand::before {
    width: 520px;
    height: 520px;
    right: -180px;
    bottom: -210px;
    border-color: rgba(245, 203, 130, 0.16);
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 238, 196, 0.14), transparent 22%),
        radial-gradient(circle at center, rgba(203, 133, 45, 0.18), transparent 58%);
}

.login-brand::after {
    width: 410px;
    height: 410px;
    right: 6%;
    top: 18%;
    border: 0;
    border-radius: 42%;
    background:
        radial-gradient(circle at 50% 16%, rgba(255, 226, 164, 0.22), transparent 10%),
        linear-gradient(90deg, transparent 0 42%, rgba(255, 227, 177, 0.08) 42% 58%, transparent 58%),
        radial-gradient(ellipse at center, rgba(119, 63, 20, 0.28), transparent 58%);
    filter: blur(1px);
    transform: rotate(-12deg);
}

.login-brand > * {
    position: relative;
    z-index: 1;
}

.login-brand .brand-mark {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    border-color: rgba(245, 210, 146, 0.64);
    color: #ffe2a4;
    background: rgba(255, 255, 255, 0.06);
}

.login-brand h1 {
    max-width: 760px;
    margin-top: 18px;
    color: #fff8e8;
    font-size: clamp(58px, 5vw, 78px);
    letter-spacing: -0.06em;
}

.brand-copy {
    max-width: 560px;
    color: rgba(255, 241, 217, 0.82);
}

.brand-foot,
.eyebrow {
    color: rgba(255, 226, 177, 0.76);
}

.login-panel {
    background:
        radial-gradient(circle at 8% 0, rgba(213, 159, 82, 0.12), transparent 24%),
        #fffaf4;
}

.login-card {
    width: min(420px, 100%);
}

.login-card h2 {
    color: #321505;
    font-family: Georgia, "Songti SC", serif;
    font-size: 34px;
}

.login-button {
    border-radius: 12px;
    background: linear-gradient(135deg, #873d13, #562107);
    box-shadow: 0 18px 34px rgba(94, 41, 11, 0.22);
}

.app-shell {
    background:
        linear-gradient(90deg, #2a1306 0 250px, transparent 250px),
        radial-gradient(circle at 86% 0, rgba(206, 151, 74, 0.13), transparent 22%),
        linear-gradient(135deg, #fffaf4 0%, #f5e9d7 100%);
}

.sidebar {
    width: 250px;
    padding: 22px 14px 16px;
}

.sidebar-head {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px 24px;
    text-align: center;
}

.sidebar-head .brand-mark.small {
    width: 66px;
    height: 66px;
    flex-basis: 66px;
    border-radius: 50%;
    font-size: 21px;
    box-shadow:
        0 0 0 1px rgba(255, 223, 166, 0.12),
        0 0 0 10px rgba(185, 113, 36, 0.08),
        inset 0 0 30px rgba(255, 220, 150, 0.08);
}

.sidebar-head strong {
    color: #ffe1a4;
    font-size: 18px;
    line-height: 1.15;
}

.sidebar-head span {
    margin-top: 4px;
    color: rgba(255, 228, 185, 0.58);
}

.nav-list {
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(229, 181, 100, 0.34) transparent;
}

.nav-list::-webkit-scrollbar {
    width: 4px;
}

.nav-list::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: rgba(229, 181, 100, 0.34);
}

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

.nav-group {
    margin: 20px 8px 8px;
}

.nav-item {
    border-radius: 10px;
    padding: 9px 11px;
}

.main-content {
    width: auto;
    min-width: 0;
    margin-left: 250px;
    padding: 0 32px 36px;
    overflow-x: hidden;
}

#view-dashboard {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-welcome {
    padding: 30px 0 22px;
}

.dashboard-welcome h1 {
    font-size: clamp(30px, 2.45vw, 38px);
    letter-spacing: -0.04em;
}

.dashboard-controls {
    max-width: 540px;
}

.date-chip {
    white-space: nowrap;
}

.tavern-hero {
    min-height: 198px;
    grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
    gap: 24px;
    padding: 32px 36px;
}

.tavern-hero__quote p {
    font-size: 24px;
}

.hero-metric-grid {
    min-width: 0;
    border-left: 1px solid rgba(236, 195, 128, 0.18);
}

.hero-metric-grid article {
    min-width: 0;
    padding: 14px 22px;
}

.hero-metric-grid strong {
    font-size: clamp(26px, 2vw, 34px);
    white-space: nowrap;
}

.tavern-hero__seal {
    position: absolute;
    right: 28px;
    bottom: 22px;
    width: 108px;
    height: 108px;
    opacity: 0.48;
}

.tavern-stat-grid {
    grid-template-columns: repeat(5, minmax(176px, 1fr));
    gap: 16px;
}

.stat-card {
    min-width: 0;
    min-height: 124px;
    padding: 20px;
}

.stat-card strong {
    font-size: clamp(26px, 2.1vw, 31px);
    white-space: nowrap;
}

.dashboard-analytics-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.78fr) minmax(238px, 0.58fr);
}

.dashboard-bottom-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(400px, 0.82fr);
}

.panel {
    min-width: 0;
}

.recent-order-row {
    grid-template-columns: 42px minmax(150px, 1fr) minmax(86px, 0.55fr) minmax(96px, 0.55fr) auto minmax(108px, 0.65fr);
}

@media (max-width: 1500px) {
    .dashboard-analytics-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1320px) {
    .tavern-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tavern-hero {
        grid-template-columns: 1fr;
    }

    .hero-metric-grid {
        border-left: 0;
    }

    .tavern-hero__seal {
        display: none;
    }
}
