:root {
  color-scheme: light;
  --ink: #172338;
  --muted: #7d899b;
  --line: #e8edf3;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --navy: #101c2e;
  --navy-soft: #1b2a40;
  --blue: #4388f5;
  --green: #14a875;
  --violet: #8a68e8;
  --orange: #e9913c;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.panel-body { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column; padding: 27px 18px 18px; background: var(--navy); color: #e9eff7; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 34px; }
.brand-mark, .login-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: #293c58; color: #82b4ff; font-size: 28px; font-weight: 700; }
.brand strong { display: block; font: 700 15px Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.2px; }
.brand small { display: block; margin-top: 3px; color: #9baabd; font-size: 11px; }
.nav-list { display: grid; gap: 7px; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 45px; padding: 0 13px; border-radius: 10px; color: #aebbd0; font-size: 13px; font-weight: 600; transition: .18s ease; }
.nav-link span { display: grid; place-items: center; width: 20px; color: #8293aa; font-size: 19px; }
.nav-link:hover { color: #fff; background: #1a2a40; }
.nav-link.active { color: #fff; background: #263b58; box-shadow: inset 3px 0 #66a3ff; }
.nav-link.active span { color: #80b5ff; }
.sidebar-bottom { margin-top: auto; padding: 17px 9px 3px; border-top: 1px solid #29384d; }
.secure-label { display: flex; align-items: center; gap: 8px; color: #9baabd; font-size: 11px; }
.secure-dot, .topbar-dot { width: 7px; height: 7px; border-radius: 50%; background: #25c48c; box-shadow: 0 0 0 4px #25c48c22; }
.logout-button { margin-top: 17px; padding: 6px 0; border: 0; background: transparent; color: #bfcbdb; cursor: pointer; font-size: 12px; }
.logout-button:hover { color: #fff; }
.main-area { min-height: 100vh; margin-left: 248px; }
.topbar { height: 98px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; background: var(--surface); border-bottom: 1px solid var(--line); }
.eyebrow { color: #8c99ab; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.topbar h1 { margin: 4px 0 0; font: 800 23px Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.6px; }
.topbar-label { display: flex; align-items: center; gap: 10px; color: #68758a; font-size: 12px; font-weight: 600; }
.page-content { max-width: 1500px; margin: 0 auto; padding: 32px 42px 50px; }
.welcome-row, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
h2 { margin: 0; font: 700 17px Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.25px; }
.muted { color: var(--muted); }
.welcome-row p, .section-heading p { margin: 6px 0 0; font-size: 12px; }
.status-pill, .status-tag { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; }
.status-pill.online, .status-tag.answered { color: #14835d; background: #e9f8f1; }
.status-pill.online span { background: #17b17b; }
.status-pill.offline, .status-tag.closed { color: #b35454; background: #fff0ef; }
.status-pill.offline span { background: #d76767; }
.status-tag.open { color: #92651e; background: #fff5df; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 24px 0 27px; }
.metric-card, .panel-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 18px #14243a05; }
.metric-card { min-height: 158px; padding: 18px 19px; }
.metric-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; background: #f1f5fb; color: #6f85a3; font-size: 18px; }
.metric-card p { margin: 14px 0 3px; color: #7e8a9c; font-size: 11px; font-weight: 600; }
.metric-card strong { display: block; font: 800 25px Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.6px; }
.metric-card small { display: block; margin-top: 5px; color: #98a3b1; font-size: 10px; }
.accent-blue .metric-icon { background: #edf4ff; color: var(--blue); }
.accent-green .metric-icon { background: #e9f8f2; color: var(--green); }
.accent-violet .metric-icon { background: #f2efff; color: var(--violet); }
.accent-orange .metric-icon { background: #fff4e8; color: var(--orange); }
.panel-card { padding: 22px; }
.flush-card { padding: 0; overflow: hidden; }
.section-heading { margin-bottom: 16px; }
.section-heading .text-link { white-space: nowrap; }
.text-link { color: #397add; font-size: 11px; font-weight: 700; }
.text-link:hover { color: #1f5fb9; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 13px 17px; background: #f8fafc; color: #8b97a8; font-size: 9px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 17px; border-top: 1px solid #edf1f5; color: #526176; font-size: 11px; vertical-align: middle; }
td strong { color: #25344a; font-size: 11px; }
.cell-sub { display: block; margin-top: 4px; color: #98a3b1; font-size: 9px; }
.details-cell { max-width: 320px; overflow-wrap: anywhere; }
.date-cell { color: #8491a2; white-space: nowrap; font-size: 10px; }
.mono { color: #63738a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.coin-value { color: #956818; font-weight: 700; white-space: nowrap; }
.empty-state { padding: 45px 20px; color: #8c99aa; text-align: center; font-size: 12px; }
.page-heading { margin-bottom: 21px; }
.search-form { display: flex; gap: 8px; }
.search-form input, .login-form input, textarea { min-width: 240px; padding: 10px 12px; border: 1px solid #dfe6ee; border-radius: 8px; outline: none; background: #fff; color: var(--ink); font-size: 11px; }
.search-form input:focus, .login-form input:focus, textarea:focus { border-color: #79a8f2; box-shadow: 0 0 0 3px #4f8ff21a; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 37px; padding: 0 14px; border: 0; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 700; transition: .18s ease; }
.primary-button { background: #367ce1; color: white; box-shadow: 0 5px 12px #367ce122; }
.primary-button:hover { background: #2569ca; transform: translateY(-1px); }
.secondary-button { border: 1px solid #e0e7ef; background: #fff; color: #59697f; }
.secondary-button:hover { border-color: #b9c9dd; color: #263b58; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; color: #8793a3; font-size: 10px; }
.pagination div { display: flex; gap: 7px; }
.filter-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.filter-tab { padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; color: #77859a; font-size: 10px; font-weight: 700; }
.filter-tab:hover { background: #eaf0f7; }
.filter-tab.selected { border-color: #dce8fa; background: #eaf2ff; color: #3573cc; }
.placeholder-card { min-height: 295px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.placeholder-icon { display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 17px; border-radius: 16px; background: #edf4ff; color: #4b87dd; font-size: 26px; }
.placeholder-card h2 { margin-top: 9px; }
.placeholder-card p { max-width: 370px; margin: 8px 0 0; font-size: 12px; line-height: 1.7; }
.back-link { display: inline-block; margin-bottom: 14px; color: #64809f; font-size: 11px; font-weight: 600; }
.ticket-summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ticket-summary h2 { margin-top: 6px; }
.ticket-summary p { margin: 6px 0 0; font-size: 10px; }
.conversation-card { margin-bottom: 14px; }
.conversation-card h2, .reply-card h2 { margin-bottom: 16px; }
.message-bubble { max-width: 760px; margin: 0 0 12px; padding: 14px 15px; border: 1px solid #e6edf4; border-radius: 12px; background: #f8fafc; }
.message-bubble.admin { margin-left: auto; border-color: #d9e8fb; background: #f0f6ff; }
.message-meta { display: flex; justify-content: space-between; gap: 15px; color: #65758a; font-size: 10px; }
.message-meta time { color: #9aa5b2; font-size: 9px; }
.message-bubble p { margin: 10px 0 0; color: #304158; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea { display: block; width: 100%; min-width: 0; resize: vertical; line-height: 1.5; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 12px; font-size: 10px; }
.ticket-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.flash-stack { display: grid; gap: 8px; margin-bottom: 15px; }
.flash { padding: 11px 13px; border-radius: 8px; font-size: 11px; }
.flash.error { background: #fff0ef; color: #a94040; }
.flash.success { background: #eaf8f1; color: #19714f; }
.service-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.service-state { color: #8491a2; font-size: 10px; }
.service-actions { display: flex; gap: 6px; }
.service-actions .primary-button, .service-actions .secondary-button { min-height: 32px; padding: 0 10px; font-size: 10px; }

.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(ellipse at 15% 10%, #e8f1ff 0, transparent 35%), #f3f6fa; }
.login-card { width: min(100%, 390px); padding: 35px; border: 1px solid #e7edf4; border-radius: 18px; background: #fff; box-shadow: 0 22px 70px #20365312; }
.login-mark { width: 48px; height: 48px; margin-bottom: 24px; background: #edf4ff; color: #367ce1; }
.login-card h1 { margin: 6px 0; font: 800 24px Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.7px; }
.login-card > .muted { margin: 0 0 22px; font-size: 12px; }
.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 4px; color: #526176; font-size: 10px; font-weight: 700; }
.login-form input { min-width: 0; height: 42px; font-size: 13px; }
.login-form .primary-button { height: 42px; margin-top: 8px; }
.login-form .primary-button span { margin-left: auto; font-size: 17px; }
.login-foot { margin: 25px 0 0; color: #9aa5b2; text-align: center; font-size: 9px; }

@media (max-width: 1050px) {
  .sidebar { width: 205px; }
  .main-area { margin-left: 205px; }
  .topbar { padding: 0 28px; }
  .page-content { padding: 28px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .sidebar { position: static; width: auto; padding: 12px; }
  .brand { padding: 0 6px 12px; }
  .nav-list { display: flex; overflow-x: auto; gap: 4px; }
  .nav-link { min-height: 39px; padding: 0 10px; white-space: nowrap; }
  .nav-link span { display: none; }
  .sidebar-bottom { display: none; }
  .main-area { margin-left: 0; }
  .topbar { height: 75px; padding: 0 18px; }
  .topbar h1 { font-size: 19px; }
  .topbar-label { font-size: 10px; }
  .page-content { padding: 22px 14px 35px; }
  .metrics-grid { gap: 9px; margin: 17px 0 20px; }
  .metric-card { min-height: 139px; padding: 13px; }
  .metric-card strong { font-size: 21px; }
  .panel-card { padding: 16px; }
  .flush-card { padding: 0; }
  .welcome-row, .section-heading { align-items: flex-start; }
  .service-tools { justify-content: flex-start; }
  .page-heading { flex-direction: column; }
  .search-form { width: 100%; }
  .search-form input { min-width: 0; flex: 1; }
  .ticket-summary { gap: 10px; }
  .date-cell { white-space: normal; }
}

/* Black and red admin theme */
:root {
  color-scheme: dark;
  --ink: #f3eeee;
  --muted: #9e9295;
  --line: #302326;
  --surface: #151012;
  --canvas: #0b090a;
  --navy: #080708;
  --navy-soft: #1b1012;
  --blue: #f04450;
  --green: #e5525b;
  --violet: #f0646c;
  --orange: #d94a53;
}
body { color: var(--ink); background: var(--canvas); }
.sidebar { background: #070607; border-right: 1px solid #28171a; }
.brand-mark, .login-mark { background: #190b0d; }
.nav-link { color: #b4a5a8; }
.nav-link:hover { background: #1c1012; }
.nav-link.active { background: #291013; box-shadow: inset 3px 0 #f04450; }
.nav-link.active span { color: #ff737b; }
.sidebar-bottom { border-color: #28171a; }
.topbar { background: #100d0e; border-color: var(--line); }
.eyebrow, .topbar-label { color: #ad999d; }
.topbar-dot, .secure-dot { background: #ef444f; box-shadow: 0 0 0 4px #ef444f24; }
.metric-card, .panel-card { background: #151012; border-color: #302326; box-shadow: 0 8px 24px #0005; }
.metric-icon { background: #241316; color: #f46a72; }
.metric-card p, .metric-card small { color: #a79699; }
.status-pill.online, .status-tag.answered { color: #ff858a; background: #2b1215; }
.status-pill.online span { background: #ef444f; }
.status-pill.offline, .status-tag.closed { color: #ff858a; background: #2b1215; }
.status-pill.offline span { background: #d74a54; }
.status-tag.open { color: #f4b7bb; background: #2a1a17; }
th { background: #1d1416; color: #bd9da1; }
td { color: #c7b9bb; border-color: #302326; }
td strong { color: #f5eeee; }
.cell-sub, .date-cell, .empty-state { color: #a79598; }
.mono { color: #d6bfc2; }
.coin-value { color: #ff737b; }
.text-link { color: #ff6871; }
.text-link:hover { color: #ff9ca2; }
.search-form input, .login-form input, textarea, .coin-form input, .coin-form select {
  border-color: #493035; background: #0e0b0c; color: #f4eeee;
}
.search-form input:focus, .login-form input:focus, textarea:focus, .coin-form input:focus, .coin-form select:focus {
  border-color: #df424d; box-shadow: 0 0 0 3px #ef444f25;
}
.primary-button { background: #d92f3a; color: #fff; box-shadow: 0 5px 12px #d92f3a30; }
.primary-button:hover { background: #ef3b47; }
.secondary-button { border-color: #493035; background: #1c1416; color: #e3d5d7; }
.secondary-button:hover { border-color: #a6444c; color: #fff; }
.danger-button { display: inline-flex; justify-content: center; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid #8d3038; border-radius: 8px; background: #351216; color: #ff9299; cursor: pointer; font-size: 10px; font-weight: 700; }
.danger-button:hover { border-color: #e34852; background: #48171c; }
.filter-tab { color: #b8a8aa; }
.filter-tab:hover, .filter-tab.selected { border-color: #49272c; background: #2a1216; color: #ff7a82; }
.placeholder-icon { background: #281216; color: #f36a72; }
.message-bubble { border-color: #352629; background: #1b1416; }
.message-bubble.admin { border-color: #4b252b; background: #261316; }
.message-meta { color: #c0adaf; }
.message-meta time { color: #9e898d; }
.message-bubble p { color: #e2d5d7; }
.flash.error { background: #351518; color: #ff9da2; }
.flash.success { background: #281417; color: #ff9da2; }
.service-state { color: #ad999d; }
.login-body { background: radial-gradient(ellipse at 15% 10%, #351216 0, transparent 38%), #0b090a; }
.login-card { border-color: #302326; background: #151012; box-shadow: 0 22px 70px #0008; }
.login-mark { background: transparent; }
.login-form label { color: #c4b2b5; }
.login-foot { color: #9e898d; }
.user-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 270px; }
.user-controls form { display: flex; align-items: center; gap: 5px; }
.coin-form input, .coin-form select { min-height: 32px; border: 1px solid #493035; border-radius: 7px; padding: 0 8px; font-size: 10px; }
.coin-form input { width: 65px; }
.user-status { display: inline-block; border-radius: 999px; padding: 5px 8px; font-size: 9px; font-weight: 700; }
.user-status.active { background: #211719; color: #e48a90; }
.user-status.banned { background: #411419; color: #ff858c; }
.metrics-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.accent-storage .metric-icon { background: #2b1215; color: #ff737b; }
.users-search select { min-width: 155px; padding: 10px 12px; border: 1px solid #493035; border-radius: 8px; background: #0e0b0c; color: #f4eeee; font-size: 11px; }
.logs-actions { display: flex; align-items: center; gap: 8px; }
.logs-actions .search-form { flex: 1; }
.logs-actions .search-form input { min-width: 200px; }

@media (max-width: 1300px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .logs-actions { width: 100%; flex-wrap: wrap; }
  .logs-actions .search-form { min-width: 100%; }
  .logs-actions .search-form input { min-width: 0; }
  .users-search { flex-wrap: wrap; }
  .users-search select { flex: 1; }
}
