:root {
    --black: #080808;
    --gold: #d7a529;
    --gold-soft: #fff6df;
    --white: #ffffff;
    --muted: #756f64;
    --line: #e9e2d4;
    --panel: #fbfaf7;
    --danger: #a82424;
    --ok: #176f34;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--white);
    color: var(--black);
}
a { color: inherit; }
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(145deg, #fff 0, #fff 58%, #fbf6e8 58%, #fbf6e8 100%);
}
.login-card {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 22px 70px rgba(0,0,0,.1);
    overflow: hidden;
    background: #fff;
}
.login-head, .topbar {
    background: var(--black);
    color: #fff;
}
.login-head { padding: 28px; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 900;
}
.brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}
.brand img.brand-wide {
    width: min(210px, 100%);
    height: auto;
    max-height: 72px;
    border-radius: 0;
}
.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--gold);
    color: #080808;
    font-weight: 900;
}
.brand small { color: #f4dda6; display: block; font-size: 12px; margin-top: 2px; }
.login-body { padding: 26px; }
.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr;
}
.sidebar {
    border-right: 1px solid var(--line);
    background: #fff;
    padding: 22px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.nav { display: grid; gap: 6px; margin-top: 28px; }
.nav a {
    text-decoration: none;
    padding: 12px 13px;
    border-radius: 11px;
    color: #2a2926;
    font-weight: 700;
}
.nav a.active, .nav a:hover { background: var(--gold-soft); color: #000; }
.content { background: #fff; }
.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}
.main { padding: 28px; max-width: 1280px; }
h1 { font-size: 28px; margin: 0 0 18px; }
h2 { font-size: 20px; margin: 26px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.stat {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    background: var(--panel);
}
.stat strong { display: block; font-size: 28px; margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; }
.panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 18px;
    margin-bottom: 18px;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: #fff; min-width: 760px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--panel); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.badge {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
    background: #eee;
}
.badge.approved, .badge.active { background: #e8f8ee; color: var(--ok); }
.badge.pending, .badge.pending_review, .badge.hold { background: #fff4d5; color: #8a6000; }
.badge.blocked, .badge.inactive, .badge.sold, .badge.rejected { background: #ffe7e7; color: var(--danger); }
form.inline { display: inline; }
label { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 800; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
}
textarea { min-height: 92px; resize: vertical; }
button, .btn {
    border: 0;
    border-radius: 999px;
    background: var(--gold);
    color: #070707;
    min-height: 38px;
    padding: 0 15px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.btn.black, button.black { background: var(--black); color: #fff; }
.btn.light, button.light { background: #f0ece3; color: #111; }
.btn.danger, button.danger { background: #ffe4e4; color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.form-actions { align-items: end; padding-top: 28px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; font-weight: 700; }
.flash.ok { background: #eaf8ef; color: var(--ok); border: 1px solid #bde8c5; }
.flash.err { background: #fff0f0; color: var(--danger); border: 1px solid #ffd0d0; }
.muted { color: var(--muted); }
.secret-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.thumb { width: 58px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f8f8f8; }
.message-list { display: grid; gap: 10px; }
.message {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}
.message.bot, .message.system { background: var(--gold-soft); }
.message.customer { background: #f8f8f8; }
@media (max-width: 920px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
    .nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .grid, .two, .three { grid-template-columns: 1fr; }
    .topbar { padding: 16px 20px; display: grid; gap: 10px; }
    .main { padding: 20px; }
}
