* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #302414;
    background: #f6f3ec;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255, 218, 37, .95), rgba(255, 187, 37, .86) 44%, #f6f3ec 44%),
        #f6f3ec;
}

.login-box {
    width: min(420px, 100%);
    padding: 32px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(65, 43, 12, .18);
}

.login-brand {
    margin-bottom: 26px;
}

.login-brand strong,
.brand-word {
    display: block;
    font-size: 34px;
    line-height: 1;
    letter-spacing: 0;
    font-weight: 900;
}

.login-brand span {
    display: block;
    margin-top: 8px;
    color: #7d6141;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: #1e160d;
    color: #fff7dd;
}

.brand-block {
    padding: 10px 8px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand-block small {
    display: block;
    margin-top: 7px;
    color: #f5cf65;
}

.nav {
    display: grid;
    gap: 8px;
    margin-top: 24px;
}

.nav a {
    padding: 12px 14px;
    border-radius: 8px;
    color: #f7e8bd;
}

.nav a.active,
.nav a:hover {
    color: #1e160d;
    background: #ffd51f;
}

.main {
    min-width: 0;
    padding: 26px 32px 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 26px;
}

.admin-pill {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: #6d5a42;
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

.card {
    padding: 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(79, 55, 22, .07);
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

.stat span,
.muted {
    color: #806d53;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 14px;
}

.section-title h2 {
    margin: 0;
    font-size: 20px;
}

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

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

.form-row label {
    font-weight: 700;
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid #e4dacb;
    border-radius: 8px;
    padding: 11px 12px;
    color: #302414;
    background: #fffdfa;
    font: inherit;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    color: #1f170c;
    background: #ffd51f;
    font-weight: 800;
    cursor: pointer;
}

.btn.secondary {
    background: #efe7d8;
    color: #443623;
}

.btn.danger {
    color: #fff;
    background: #d92d20;
}

.btn.small {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
}

.table-wrap {
    overflow: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(79, 55, 22, .07);
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

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

th {
    color: #7b674d;
    background: #fff8de;
    font-size: 13px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #5e491f;
    background: #fff2bf;
    font-size: 12px;
    font-weight: 800;
}

.tag.green {
    color: #12643a;
    background: #dcfce7;
}

.tag.red {
    color: #9f1239;
    background: #ffe4e6;
}

.tag.gray {
    color: #4b5563;
    background: #eef0f2;
}

.notice {
    padding: 14px 16px;
    border-radius: 8px;
    background: #fff7d1;
    color: #694f1f;
}

.notice.ok {
    background: #e5f9ed;
    color: #166534;
}

.notice.error {
    background: #ffe4e6;
    color: #9f1239;
}

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

.filter {
    display: grid;
    grid-template-columns: 1fr 160px auto;
    gap: 12px;
    margin-bottom: 16px;
}

.coupon-preview {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 16px;
    border: 1px dashed #d8c7a7;
    border-radius: 8px;
    background: #fffdf4;
}

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

    .sidebar {
        position: static;
        height: auto;
    }

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

    .main {
        padding: 22px 16px 36px;
    }

    .grid-4,
    .grid-2,
    .form-grid,
    .filter {
        grid-template-columns: 1fr;
    }
}
