:root {
  color-scheme: light;
  --red: #e2001a;
  --red-dark: #b3001b;
  --red-soft: #f8dde1;
  --red-soft-border: #f7c8ce;
  --bg: #fdf8f6;
  --card: #ffffff;
  --card-alt: #fbeae6;
  --card-alt-hover: #f5d9d2;
  --chrome: #fdf1ee;
  --chrome-border: #f6e0da;
  --border: #f1e2dd;
  --border-strong: #e9cec7;
  --border-hover: #ddb8b0;
  --text: #211e1c;
  --text-soft: #35312c;
  --nav-text: #6f665d;
  --muted: #9c9088;
  --placeholder: #b3a89f;
  --disabled-bg: #f7ece9;
  --row-hover: #fbf0ed;
  --badge-off-bg: #f1ddd6;
  --success-bg: #eafaf1;
  --success-border: #c3ecd6;
  --success-text: #1e9e5a;
  --warn-bg: #fff9ec;
  --warn-text: #b57900;
  --note-bg: #fbf0ed;
  --note-border: #f0d9d2;
  --note-text: #4a4030;
  --note-code-bg: #f3ddd6;
  --chip-text: #7a5c53;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgba(120, 40, 30, 0.04);
  --shadow-sm: 0 1px 2px rgba(120, 40, 30, 0.04), 0 10px 26px rgba(120, 40, 30, 0.07);
  --shadow-red: 0 4px 14px rgba(226, 0, 26, 0.22);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --red: #ff3b52;
  --red-dark: #ff6b7d;
  --red-soft: rgba(255, 59, 82, 0.16);
  --red-soft-border: rgba(255, 59, 82, 0.35);
  --bg: #16130f;
  --card: #201b16;
  --card-alt: #2a231c;
  --card-alt-hover: #362c22;
  --chrome: #241a19;
  --chrome-border: #3d2a26;
  --border: #392f24;
  --border-strong: #4c4030;
  --border-hover: #5c4d3a;
  --text: #f1e7d9;
  --text-soft: #e6dac4;
  --nav-text: #c9bba2;
  --muted: #a1907a;
  --placeholder: #6e6151;
  --disabled-bg: #292219;
  --row-hover: #292014;
  --badge-off-bg: #392f24;
  --success-bg: rgba(52, 211, 153, 0.13);
  --success-border: rgba(52, 211, 153, 0.35);
  --success-text: #4ade80;
  --warn-bg: rgba(245, 185, 66, 0.13);
  --warn-text: #f5b942;
  --note-bg: #241e15;
  --note-border: #3d3322;
  --note-text: #d9cbb0;
  --note-code-bg: #332a1e;
  --chip-text: #cbbc9f;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-red: 0 3px 12px rgba(255, 59, 82, 0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  right: -70px;
  bottom: -70px;
  width: 420px;
  height: 420px;
  background-image: url("/public/img/logo-192.png");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: -1;
}
:root[data-theme="dark"] body::after { opacity: 0.08; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sidebar */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--chrome);
  border-right: 1px solid var(--chrome-border);
  display: flex;
  flex-direction: column;
}
/* The nav links scroll in their own box; .sidebar-fab-space is a real sibling (not padding
   inside the scroll area), so it's always empty screen space, however much the menu grows —
   the floating Telegram button (fixed, bottom-left) can never end up on top of a menu item. */
.sidebar-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.sidebar-fab-space { flex: 0 0 96px; }
@media (min-width: 769px) {
  .sidebar { position: sticky; top: 0; height: 100vh; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 58px; /* matches .topbar's height so their bottom borders line up at the sidebar seam */
  padding: 0 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--chrome-border);
  text-decoration: none;
  color: inherit;
}
.brand img { width: 34px; height: 34px; }
.brand span { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.brand .red { color: var(--red); }
a.brand:hover { opacity: 0.85; }

.nav-group { padding: 4px 10px; }
.nav-group + .nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--chrome-border); }
.nav-group-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 4px 12px 7px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--nav-text);
  font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.6; transition: opacity 0.12s ease; }
.nav-link:hover { background: var(--red-soft); text-decoration: none; }
.nav-link:hover svg { opacity: 0.9; }
.nav-link.active { background: var(--red-soft); color: var(--red-dark); border-left-color: var(--red); font-weight: 600; }
.nav-link.active svg { opacity: 1; }
.nav-link .badge-count {
  margin-left: auto;
  background: var(--red-soft);
  color: var(--red-dark);
  font-weight: 700;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
}

.sidebar-footer { margin-top: auto; padding: 14px 20px 0; border-top: 1px solid var(--chrome-border); }

/* Small "email us" caption under the support links — plain selectable text, not a menu row. */
.sidebar-contact { margin: 10px 12px 0; padding: 12px 12px 14px; border-top: 1px solid var(--chrome-border); }
.sidebar-contact-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sidebar-contact a { display: block; font-size: 13px; color: var(--text-soft); word-break: break-all; }
.sidebar-contact a:hover { color: var(--red); }

/* Topbar */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px;
  border-bottom: 1px solid var(--chrome-border);
  background: var(--chrome);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 0 28px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-xs);
}
.topbar .balance {
  font-weight: 700;
  color: var(--red-dark);
  background: var(--card);
  border: 1.5px solid var(--red);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  transition: background-color 0.12s ease;
}
.topbar .balance:hover { background: var(--red-soft); }
.lang-switch a { color: var(--muted); font-size: 13px; padding: 2px 4px; }
.lang-switch a.active { color: var(--red); font-weight: 700; }
.theme-switch { display: flex; align-items: center; gap: 2px; }
.theme-switch a {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px; color: var(--muted);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.theme-switch a svg { width: 15px; height: 15px; }
.theme-switch a:hover { text-decoration: none; background: var(--card-alt); color: var(--text); }
.theme-switch a.active { background: var(--red-soft); color: var(--red-dark); }
.topbar form { display: inline; }
.topbar button.link-btn {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0;
  transition: color 0.12s ease;
}
.topbar button.link-btn:hover { color: var(--red); text-decoration: underline; }

.content { flex: 1; padding: 32px; max-width: 1080px; width: 100%; }
.content.content-wide { max-width: none; }

h1 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 22px;
  padding: 9px 20px 9px 15px;
  letter-spacing: -0.01em;
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}
h1::before {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-image: url("/public/img/logo-96.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.auth-card h1 { background: none; padding: 0; box-shadow: none; }
.auth-card h1::before { content: none; }
h2 { font-size: 15px; font-weight: 700; margin: 30px 0 14px; letter-spacing: -0.005em; }
.card > h2:first-child {
  margin: -26px -28px 20px;
  padding: 15px 28px;
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.field .hint { display: block; margin-top: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

input[type="text"], input[type="url"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
textarea { max-width: 100%; min-height: 100px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 0, 26, 0.1);
}
input:disabled, input[readonly] { background: var(--disabled-bg); color: var(--muted); box-shadow: none; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }

select:required:invalid { color: var(--placeholder); }
select option { color: var(--text); }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2393867a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
:root[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23c9bba2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.radio-group { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-group label { display: flex; align-items: center; gap: 7px; font-weight: 400; font-size: 14px; cursor: pointer; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--red); width: 15px; height: 15px; cursor: pointer; }

.actions { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }

button, .btn {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 1px 2px rgba(226, 0, 26, 0.15); }
.btn-primary:hover { background: var(--red-dark); box-shadow: var(--shadow-red); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--card-alt); color: var(--text); }
.btn-secondary:hover { background: var(--card-alt-hover); }
a.btn { display: inline-block; }
a.btn:hover { text-decoration: none; }
.btn-send { display: inline-flex; align-items: center; gap: 9px; }
.btn-send svg { width: 15px; height: 15px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: var(--row-hover); }

/* Denser variant for data-heavy admin tables (many columns) */
.table-compact th, .table-compact td { padding: 7px 7px; font-size: 12.5px; white-space: nowrap; }
.table-compact th:last-child, .table-compact td:last-child { white-space: normal; }
.table-compact .row-actions-toggle { padding: 6px 10px; font-size: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-ok { background: var(--success-bg); color: var(--success-text); }
.badge-pending { background: var(--warn-bg); color: var(--warn-text); }
.badge-err { background: var(--red-soft); color: var(--red-dark); }
.badge-off { background: var(--badge-off-bg); color: var(--muted); }

.error-box {
  background: var(--red-soft);
  border: 1px solid var(--red-soft-border);
  color: var(--red-dark);
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
}
.success-box {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
}
.note-box {
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  color: var(--note-text);
  padding: 15px 17px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.6;
}
.note-box code { background: var(--note-code-bg); padding: 2px 6px; border-radius: 4px; }

code { background: var(--card-alt); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; }

/* Read-only "copy the full value" field: looks like plain truncated text
   (no border, blends into the row) until focused/hovered -- a click selects
   everything at once (see footer.ejs), so copying works regardless of what's
   actually visible in the narrow column. */
.link-copy {
  display: block; width: 100%; max-width: 100%;
  border: 1px solid transparent; background: transparent;
  color: inherit; font: inherit; padding: 2px 5px; margin: -2px -5px;
  border-radius: 5px; cursor: text;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-copy:hover { background: var(--card-alt); }
.link-copy:focus { outline: none; background: var(--card-alt); border-color: var(--border-hover); }
pre.code-block {
  background: var(--card-alt); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto;
  font-size: 12.5px; line-height: 1.6; margin: 0 0 4px;
}
pre.code-block code { background: none; padding: 0; }
.api-action { margin-bottom: 22px; }
.api-action h3 { margin: 0 0 4px; font-size: 15px; }
.api-action .api-desc { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.api-action table { margin-bottom: 14px; }
.api-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 10px 0 6px; }

.code-reveal { margin: 0 0 4px; }
.code-reveal summary { cursor: pointer; list-style: none; display: inline-block; }
.code-reveal summary::-webkit-details-marker { display: none; }
.code-reveal[open] summary { margin-bottom: 12px; }
.code-reveal pre.code-block { margin: 0; }

.toolbar { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.status-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.status-tabs a {
  color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 5px 12px;
  border-radius: 999px; white-space: nowrap;
}
.status-tabs a:hover { background: var(--card-alt); text-decoration: none; }
.status-tabs a.active { background: var(--red-soft); color: var(--red-dark); }

.pagination { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.pagination a, .pagination .page-ellipsis {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-soft);
}
.pagination a:hover { background: var(--card-alt); text-decoration: none; }
.pagination a.active { background: var(--red); color: #fff; }
.pagination .page-ellipsis { color: var(--muted); }

.row-actions { position: relative; display: inline-block; }
.row-actions-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); padding: 10px; min-width: 240px;
  flex-direction: column; gap: 8px;
}
.row-actions.open .row-actions-menu { display: flex; }
.row-actions-menu form { display: flex; gap: 6px; align-items: center; margin: 0; }
.row-actions-menu select, .row-actions-menu input[type="number"] {
  flex: 1; min-width: 0; max-width: none; padding: 6px 8px; font-size: 12px; box-shadow: none;
}
.row-actions-menu button { font-size: 12px; padding: 6px 10px; white-space: nowrap; flex-shrink: 0; }

.field-error { color: var(--red-dark); font-size: 12.5px; margin-top: 7px; }
.visually-hidden-field {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Service picker: a styled searchable list standing in for a native <select>
   (which can't show a price/badges per row, and looks different per OS/browser). */
.svc-picker { position: relative; }
.svc-picker input[type="text"] { max-width: 100%; }
.svc-picker-panel {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); max-height: 320px; overflow-y: auto; padding: 6px;
}
.svc-picker-panel.open { display: block; }
.svc-picker-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.svc-picker-row:hover { background: var(--card-alt); }
.svc-picker-row.active { background: var(--red-soft); }
.svc-picker-main { min-width: 0; flex: 1 1 auto; }
.svc-picker-name { font-size: 12.5px; color: var(--text); line-height: 1.4; }
.svc-picker-row.active .svc-picker-name { color: var(--red-dark); font-weight: 600; }
.svc-picker-badges { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.svc-picker-badges .badge { padding: 2px 7px; font-size: 10px; font-weight: 600; }
.svc-picker-rate { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--red-dark); white-space: nowrap; }
.svc-picker-empty { padding: 16px 12px; font-size: 13px; color: var(--muted); text-align: center; }
.svc-picker-none { border-bottom: 1px solid var(--border); margin-bottom: 4px; border-radius: 10px 10px 0 0; }
.svc-picker-none .svc-picker-name { color: var(--muted); font-style: italic; white-space: normal; }

/* Service ID badge: a solid pill on the left of each row, like a product tag.
   Kept small on purpose -- it's competing with the service name for width. */
.svc-id-badge {
  flex-shrink: 0; align-self: flex-start;
  background: var(--red); color: #fff; font-weight: 700; font-size: 10px;
  border-radius: 6px; padding: 2px 5px; white-space: nowrap; letter-spacing: -0.01em;
}

/* Category trigger: a button styled exactly like our inputs/selects, just
   standing in for a native <select> so its options can open in the same
   kind of panel as the service picker below/above it. */
.cat-trigger {
  width: 100%; max-width: 100%; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 14px; color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: border-color 0.12s ease, box-shadow 0.12s ease; text-align: left;
}
.cat-trigger:hover { border-color: var(--border-hover); }
.cat-trigger.open { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 0, 26, 0.1); }
.cat-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-trigger-chevron { width: 10px; height: 6px; color: var(--muted); flex-shrink: 0; transition: transform 0.15s ease; }
.cat-trigger.open .cat-trigger-chevron { transform: rotate(180deg); }
.cat-row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

/* Service trigger: the same row layout as a picked-list row (id badge, name
   + badges, price), just as a clickable button that opens that category's
   service list instead of being a row inside it. */
.svc-trigger {
  width: 100%; max-width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 12px; color: var(--text); font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: border-color 0.12s ease, box-shadow 0.12s ease; text-align: left;
}
.svc-trigger:hover { border-color: var(--border-hover); }
.svc-trigger.open { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 0, 26, 0.1); }
.svc-trigger .cat-trigger-chevron { flex-shrink: 0; }
.svc-trigger.open .cat-trigger-chevron { transform: rotate(180deg); }
.svc-trigger.empty .svc-picker-name { color: var(--placeholder); }

.meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--card-alt); color: var(--chip-text); font-size: 12px;
  padding: 4px 11px; border-radius: 999px; font-weight: 500;
}
.meta-chip b { color: var(--text); font-weight: 600; }

/* New order layout: form + side panel */
.order-layout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.order-layout > .card:first-child { flex: 1 1 380px; min-width: 0; }
.side-panel { width: 340px; flex: 0 0 340px; }
.side-panel h2 { margin-top: 0; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.side-panel h2::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; }
.news-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; padding-bottom: 0; }
.news-item:first-child { padding-top: 0; }
.news-item .news-date { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.news-item .news-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.news-item .news-body { font-size: 12.5px; color: var(--nav-text); line-height: 1.5; }

/* Charge summary (New order) */
.charge-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--red-soft);
  border: 1px solid var(--red-soft-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 4px;
}
.charge-summary .label { font-size: 13px; color: var(--red-dark); font-weight: 600; }
.charge-summary .value { font-size: 20px; font-weight: 700; color: var(--red-dark); letter-spacing: -0.01em; }

/* Guest top bar (login/register/forgot/reset): body is flex-row for the dashboard's
   sidebar+main layout, but these pages stack the bar above the content instead. */
body.guest-page { flex-direction: column; }
.guest-topbar {
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-border);
}
.guest-topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.guest-topbar .brand { padding: 0; margin: 0; height: auto; border-bottom: none; }
.guest-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.guest-nav a { color: var(--nav-text); font-size: 14px; font-weight: 500; }
.guest-nav a:hover { color: var(--red); text-decoration: none; }
.guest-nav a.active { color: var(--red-dark); font-weight: 700; }

/* Auth pages */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  background: var(--bg);
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow-sm);
}
.auth-card h1 { text-align: center; font-size: 19px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-card {
  flex: 1; min-width: 150px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.stat-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-size: 22px; font-weight: 700; margin-top: 4px; color: var(--red-dark); }

.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.thread-msg { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 15px; background: var(--card); box-shadow: var(--shadow-xs); }
.thread-msg.admin { background: var(--red-soft); border-color: var(--red-soft-border); }
.thread-msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

/* Responsive */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
  background: var(--card-alt);
  color: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-right: auto;
}
.menu-toggle svg { width: 19px; height: 19px; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .content { padding: 26px 20px; }
}

@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 82vw;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-sm); }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 10, 0.35);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

  .topbar {
    height: auto;
    min-height: 58px;
    padding: 10px 16px;
    gap: 10px 14px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .topbar .balance { order: 1; font-size: 12px; padding: 4px 11px; }
  .topbar-email { display: none; }
  .content { padding: 20px 16px; }

  h1 { font-size: 18px; padding: 7px 16px 7px 11px; margin-bottom: 16px; }
  h1::before { width: 18px; height: 18px; }

  .card { padding: 20px; }
  .card > h2:first-child { margin: -20px -20px 16px; padding: 13px 20px; }

  .order-layout { flex-direction: column; }
  .order-layout > .card:first-child { flex-basis: auto; width: 100%; }
  .side-panel { width: 100%; flex-basis: auto; }

  table { display: block; overflow-x: auto; white-space: nowrap; }

  .auth-card { padding: 24px; }

  .guest-topbar-inner { height: auto; min-height: 56px; padding: 10px 16px; flex-wrap: wrap; gap: 8px 16px; }
  .guest-nav { gap: 8px 14px; margin-left: 0; }
  .guest-nav a { font-size: 13px; }
  .auth-wrap { min-height: calc(100vh - 56px); }
}

/* Category-grouped service lists */
.cat-row td { background: var(--red-soft); border-bottom: 1px solid var(--red-soft-border); padding: 9px 10px; }
tr.cat-row:hover td { background: var(--red-soft); }
.cat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-name { font-size: 14px; color: var(--red-dark); }
.cat-toggle { background: none; padding: 0 4px; font-size: 15px; color: var(--red-dark); }
.cat-tools { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat-tools .btn-secondary, .cat-tools button { padding: 5px 10px; font-size: 12px; }
.cat-group.collapsed .svc-row { display: none; }
.svc-desc-row td { background: var(--card-alt); white-space: pre-wrap; font-size: 13px; color: var(--muted); }
.drag-handle { cursor: grab; color: var(--muted); font-size: 16px; user-select: none; padding-right: 4px; }
.drag-handle:active { cursor: grabbing; }
.mv { background: none; color: var(--muted); padding: 1px 4px; font-size: 10px; line-height: 1; }
.mv:hover { color: var(--red-dark); background: var(--card-alt); }
.svc-row.dragging td { opacity: 0.4; }

/* Floating "message us on Telegram" button (support / forgot password) */
.support-fab {
  position: fixed;
  left: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  box-shadow: 0 6px 18px rgba(226, 0, 26, 0.32), 0 2px 6px rgba(0, 0, 0, 0.18);
  z-index: 80;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.support-fab svg { width: 28px; height: 28px; margin-left: -2px; }
.support-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 24px rgba(226, 0, 26, 0.4), 0 3px 8px rgba(0, 0, 0, 0.2); text-decoration: none; }
.support-fab:active { transform: translateY(0) scale(1); }
@media (max-width: 768px) {
  .support-fab { left: 16px; bottom: 16px; width: 54px; height: 54px; }
}

/* ---- New order form: one width, one rhythm ---- */
#order-form .field { margin-bottom: 18px; }
#order-form input[type="text"],
#order-form input[type="number"],
#order-form select { width: 100%; max-width: 100%; height: 46px; padding-top: 0; padding-bottom: 0; }
#order-form label { font-size: 12.5px; letter-spacing: 0.01em; }

/* magnifier inside the search box */
#service-search {
  padding-left: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393867a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 15px center;
}
:root[data-theme="dark"] #service-search {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c9bba2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
}

/* no browser spinner arrows: they make the number box look different from the others */
#order-form input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
#order-form input[type="number"]::-webkit-outer-spin-button,
#order-form input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

#order-form .charge-summary { margin-top: 4px; padding: 14px 18px; }
#order-form .actions { margin-top: 20px; padding-top: 20px; }
#order-form .actions .btn-send { width: 100%; justify-content: center; height: 48px; font-size: 14px; }

/* Phones: the sidebar is a drawer, so the floating support button sits over the
   content — leave room under the last element so it never covers a button. */
@media (max-width: 768px) {
  .content { padding-bottom: 96px; }
  .auth-wrap { padding-bottom: 84px; }
}
