:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #e6e9ef;
  --text: #1d2330;
  --muted: #6b7385;
  --accent: #f26b21;
  --accent-hover: #e25d14;
  --accent-soft: #fdeee5;
  --accent-text: #c4500f;
  --green: #22a06b;
  --green-soft: #e3f6ee;
  --red: #dc3545;
  --red-soft: #fdecee;
  --yellow: #e5a50a;
  --yellow-soft: #fdf5e1;
  --blue-soft: #e8f0fe;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1117; --surface: #161a22; --surface-2: #1b2029; --border: #272d38;
    --text: #e7e9ee; --muted: #9098a9; --accent-soft: #3a2316; --accent-text: #ff9d63;
    --green-soft: #12301f; --red-soft: #3a1619; --yellow-soft: #3a2f10; --blue-soft: #18263d;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1117; --surface: #161a22; --surface-2: #1b2029; --border: #272d38;
  --text: #e7e9ee; --muted: #9098a9; --accent-soft: #3a2316; --accent-text: #ff9d63;
  --green-soft: #12301f; --red-soft: #3a1619; --yellow-soft: #3a2f10; --blue-soft: #18263d;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1 { font-size: 26px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
h2, h3 { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.icon { flex-shrink: 0; }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; text-decoration: none; color: var(--accent); padding: 0 8px; }
.collapse-btn .icon { transition: transform .2s; }
.nav-group { padding: 14px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.sidebar { transition: width .2s; overflow-y: auto; overflow-x: hidden; }
.nav a span, .brand span, .sidebar-foot { white-space: nowrap; }

/* collapsed sidebar: icons only */
.sb-collapsed .sidebar { width: 72px; padding-left: 10px; padding-right: 10px; }
.sb-collapsed .brand span, .sb-collapsed .nav a > span, .sb-collapsed .sidebar-foot { display: none; }
.sb-collapsed .sidebar-head { flex-direction: column; }
.sb-collapsed .brand { padding: 0; }
.sb-collapsed .collapse-btn .icon { transform: rotate(180deg); }
.sb-collapsed .nav a { justify-content: center; padding: 10px; }
.sb-collapsed .nav-group { padding: 10px 0 2px; height: 1px; overflow: hidden; border-top: 1px solid var(--border); margin: 8px 6px 4px; }
.sb-collapsed .nav-group span { display: none; }
.brand-center { justify-content: center; padding-bottom: 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav-soon { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active .icon { color: var(--accent); }
.nav .icon { color: var(--muted); }
.nav-soon { color: var(--muted); cursor: default; }
.nav-soon em { margin-left: auto; font-style: normal; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 0 7px; }
.sidebar-foot { margin-top: auto; padding: 8px 12px; font-size: 12px; color: var(--muted); word-break: break-all; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.search { flex: 0 1 480px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; color: var(--muted); }
.search input:not([type=checkbox]):not([type=radio]) { flex: 1; border: 0; background: transparent; height: 40px; outline: 0; color: var(--text); font: inherit; }
.search kbd { font-family: var(--font); font-size: 11px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 1px 6px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.theme-switch { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.theme-switch button { border: 0; background: transparent; color: var(--muted); width: 32px; height: 28px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; }
.theme-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-weight: 650; display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; font-size: 14px; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; cursor: default; }
.user-menu { position: relative; }
.menu { position: absolute; right: 0; top: 46px; width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.menu-head span { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; font: inherit; color: var(--text); text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu form { margin: 0; }
.content { padding: 32px 40px 48px; max-width: 1400px; width: 100%; }
.impersonate-bar { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 40px; background: var(--yellow-soft); border-bottom: 1px solid var(--border); }

/* page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; box-shadow: var(--shadow); min-height: 132px; }
a.stat:hover { border-color: #d5dae3; }
.stat-warn { border-color: #f1c57a; }
.stat-label { font-weight: 500; }
.stat strong { font-size: 20px; font-weight: 650; }
.stat-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.yellow { background: var(--yellow-soft); color: var(--yellow); }
.progress { display: block; height: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: 5px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-flush { padding: 0; overflow: hidden; }
.card-success { border-color: var(--green); background: linear-gradient(var(--green-soft), var(--surface) 90px); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; }
.grid-2 .card { margin-bottom: 20px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); }
.activity li:last-child { border-bottom: 0; }
.activity time { margin-left: auto; white-space: nowrap; font-size: 12.5px; }
.empty { text-align: center; padding: 48px 20px; }
.empty h1, .empty h3 { margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* toolbar + table */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.spacer { flex: 1; }
.filter { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; color: var(--muted); background: var(--surface-2); width: 280px; max-width: 100%; }
.filter input:not([type=checkbox]):not([type=radio]) { border: 0; background: transparent; height: 42px; outline: 0; flex: 1; font: inherit; font-size: 15px; color: var(--text); min-width: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.card:not(.card-flush) .table th, .card:not(.card-flush) .table td { padding-left: 0; }
.actions { text-align: right; white-space: nowrap; }
.actions > * { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.actions form { margin: 0; }
.site-cell { display: flex; align-items: center; gap: 14px; }
.site-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.site-name { font-size: 16px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.site-name .icon { color: var(--muted); }
.site-name:hover { color: var(--accent); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; background: var(--blue-soft); font-size: 12.5px; font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--muted); }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.gray { background: #b7bdc8; }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; text-decoration: none; cursor: pointer; box-shadow: var(--shadow); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; height: 44px; padding: 0 22px; font-size: 15px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #c22d3c; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); box-shadow: none; }
.btn-soft:hover { background: var(--accent-soft); filter: brightness(.97); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.busy { opacity: .7; pointer-events: none; }
.btn.busy::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.busy .icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-soft); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 550; font-size: 13.5px; }
input:not([type=checkbox]):not([type=radio]), select { height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.code-input { letter-spacing: .3em; font-size: 20px !important; text-align: center; max-width: 220px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.input-prefix span { padding: 0 4px 0 12px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.input-prefix input:not([type=checkbox]):not([type=radio]) { border: 0; border-radius: 0; padding-left: 2px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.steps { padding-left: 18px; margin: 0 0 12px; color: var(--muted); }
.qr { background: #fff; padding: 12px; border-radius: 10px; width: fit-content; border: 1px solid var(--border); margin-bottom: 10px; }
.qr img, .qr svg { display: block; width: 180px; height: 180px; }
.link-muted { color: var(--muted); text-align: center; font-size: 13px; }
.forgot-link { align-self: flex-end; margin-top: -6px; }

/* flash */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash button { margin-left: auto; border: 0; background: none; color: inherit; cursor: pointer; opacity: .6; }
.flash-success { background: var(--green-soft); border-color: #a9e2c8; }
.flash-error { background: var(--red-soft); border-color: #f4b7be; }
:root[data-theme="dark"] .flash-success { border-color: #1f5c3d; }
:root[data-theme="dark"] .flash-error { border-color: #6b2830; }

/* modal */
.modal { border: 0; padding: 0; border-radius: 16px; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(15, 18, 25, .45); backdrop-filter: blur(2px); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.modal-body h3 { font-size: 18px; }
.modal-body p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.modal-actions .btn-primary { height: 38px; font-size: 14px; }

/* guest */
body.guest { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 45%), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-title { font-size: 22px; text-align: center; }
.auth-sub { text-align: center; margin: 6px 0 22px; }
.auth-foot { color: var(--muted); font-size: 12.5px; }

/* mobile */
.mobile-only { display: none; }
@media (max-width: 900px) {
  .collapse-btn { display: none; }
  .sb-collapsed .sidebar { width: 248px; }
  .sb-collapsed .brand span, .sb-collapsed .nav a > span, .sb-collapsed .sidebar-foot { display: initial; }
  .sb-collapsed .nav a { justify-content: flex-start; padding: 10px 12px; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .mobile-only { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .search { display: none; }
  .topbar-right { margin-left: auto; }
  .content { padding: 20px 16px 40px; }
  .impersonate-bar { padding: 10px 16px; }
  .kv { grid-template-columns: 90px 1fr; }
  .filter { width: 100%; }
  .toolbar .spacer { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { min-height: 0; padding: 14px; }
  .page-head .btn-primary { width: 100%; }
}

/* sections added with mail / FTP / server pages */
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 6px; }
.back:hover { color: var(--accent); }
.link-plain { text-decoration: none; color: inherit; }
.link-plain:hover .site-name, a.link-plain:hover strong { color: var(--accent); }
.card-title.flush { margin: 0; }
.top-gap { margin-top: 14px; }
.push { margin-left: auto; }
.nowrap { white-space: nowrap; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px 16px; }
.input-suffix span { padding: 0 12px 0 4px; white-space: nowrap; }
.input-suffix input:not([type=checkbox]):not([type=radio]) { text-align: right; padding-right: 2px; }
.input-suffix input:disabled { opacity: .4; }
.danger-zone { border-color: #f4b7be; }
.dns-table td { vertical-align: top; }
.dns-value code { word-break: break-all; display: inline-block; max-width: 520px; }
.tabs { display: flex; gap: 6px; margin: -8px 0 18px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-weight: 500; font-size: 13px; }
.tabs a:hover { border-color: var(--accent); color: var(--accent); }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal-wide { width: min(720px, calc(100vw - 32px)); }
.usage { margin-bottom: 14px; }
.usage-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.progress-yellow span { background: var(--yellow); }
.progress-red span { background: var(--red); }
.progress span { transition: width .6s ease; }
.progress-red span { background: var(--red); }
details summary { cursor: pointer; color: var(--accent-text); font-weight: 550; }
.activity form { margin: 0; }
.actions form { display: inline-flex; }
@media (max-width: 900px) {
  .sb-collapsed .nav-group { height: auto; border: 0; margin: 0; padding: 14px 12px 4px; }
  .sb-collapsed .nav-group span { display: initial; }
}
.dns-table { table-layout: fixed; }
.dns-table th:nth-child(1) { width: 80px; }
.dns-table th:nth-child(2) { width: 30%; }
.dns-table th:nth-child(4) { width: 110px; }
.dns-value code { overflow-wrap: anywhere; word-break: break-all; white-space: normal; max-width: none; }
.dns-table td code { overflow-wrap: anywhere; }

.flash-info { background: var(--blue-soft); border-color: #bcd2f7; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
.badge-web { background: var(--accent-soft); }
.badge-db { background: var(--blue-soft); }
.badge-mail { background: var(--green-soft); }
td .badge { margin: 1px 2px 1px 0; }

.radio { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio input { accent-color: var(--accent); margin: 3px 0 0; width: 18px; height: 18px; flex: 0 0 18px; }
.radio > span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; text-align: left; }
.php-switch select { height: 34px; width: auto; padding: 0 28px 0 10px; font-size: 14px; }
.php-versions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.php-version { border: 1px dashed var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.php-version.installed { border-style: solid; background: var(--surface-2); }

textarea { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); width: 100%; resize: vertical; }
textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field-wide { grid-column: 1 / -1; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; }

.icon-btn-sm { width: 26px; height: 26px; vertical-align: middle; }
select.auto-width { width: auto; min-width: 110px; }
.site-cell .icon-btn-sm { margin-left: 2px; }

.tabs a.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.pre { white-space: pre-line; }
.right { text-align: right; }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.badge-paid { background: var(--green-soft); color: var(--green); font-weight: 650; }
.badge-unpaid { background: var(--red-soft); color: var(--red); font-weight: 650; }
.auth-card .activity li { justify-content: space-between; }
@media print {
  .sidebar, .topbar, .no-print, .flash, .impersonate-bar { display: none !important; }
  body, .card { background: #fff !important; box-shadow: none !important; }
  .content { padding: 0; }
  .invoice { border: 0; }
}

.lang-switch { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin: 0; }
.lang-switch button { border: 0; background: transparent; color: var(--muted); height: 28px; padding: 0 8px; border-radius: 7px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.lang-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; position: relative; }
.plan-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plan-card input { position: absolute; top: 16px; right: 16px; accent-color: var(--accent); width: 18px; height: 18px; }
.plan-card strong { font-size: 17px; }
.plan-price { font-size: 20px; font-weight: 650; }
.plan-card ul { margin: 4px 0 0; padding-left: 18px; }

.pad { padding: 0 18px; }
.access-list { display: flex; flex-direction: column; gap: 10px; }
.access-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(200px, 1.4fr); gap: 8px 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.access-row .privs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* cron */
.cron-last small, .cron-when small { display: block; margin-top: 2px; }
.cron-last .status { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.cron-cmd { white-space: pre-wrap; word-break: break-all; max-width: 460px; display: inline-block; }
.cron-log summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.cron-log pre { max-width: 460px; max-height: 260px; overflow: auto; font-size: 12px; background: var(--bg); padding: 8px; border-radius: 6px; white-space: pre-wrap; word-break: break-all; }
.help-list { margin: 0; padding-left: 18px; line-height: 1.9; }
.help-list code { font-size: 12.5px; }

/* file manager */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; word-break: break-all; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--muted); }
.fm-toolbar { gap: 8px; flex-wrap: wrap; }
.fm-selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; background: var(--accent-soft); border-bottom: 1px solid var(--border); font-size: 14px; }
.fm-selbar[hidden] { display: none; }
.fm-selbar span { margin-right: auto; font-weight: 600; }
.fm-table td, .fm-table th { padding-top: 7px; padding-bottom: 7px; }
.fm-check { width: 36px; }
.fm-check input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.fm-num { text-align: right; white-space: nowrap; }
.fm-name { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; word-break: break-all; }
.fm-name svg { flex-shrink: 0; color: var(--muted); }
.fm-name.is-dir { font-weight: 600; }
.fm-name.is-dir svg { color: var(--accent); }
.fm-name:hover span { text-decoration: underline; }
.fm-table small { display: block; margin-left: 24px; word-break: break-all; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; text-decoration: underline dotted; }
.link-btn:hover { color: var(--accent); }
.fm-drop.dragging { outline: 2px dashed var(--accent); outline-offset: -6px; }
.fm-editor { padding: 0; overflow: hidden; }
.fm-editor textarea { display: block; width: 100%; min-height: calc(100vh - 290px); border: 0; border-radius: 0; resize: vertical; padding: 16px; tab-size: 4; line-height: 1.5; background: var(--surface); color: var(--text); outline: none; }
.fm-editor-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; }

/* statistics and logs */
.stats-periods { padding: 0; margin-bottom: 16px; gap: 6px; }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; margin: 0; }
.stat-card strong { font-size: 26px; font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 6px; }
.bars.dense { gap: 1px; }
.bars.hours { height: 90px; }
.bar { flex: 1; height: 100%; position: relative; border-radius: 3px 3px 0 0; }
.bar:hover { background: var(--accent-soft); }
.bar span { position: absolute; bottom: 0; border-radius: 3px 3px 0 0; }
.bar .b { left: 0; right: 0; background: var(--blue-soft); }
.bar .a { left: 18%; right: 18%; background: var(--accent); }
.bars.hours .bar .a { left: 0; right: 0; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }
.legend { margin-left: auto; font-size: 12.5px; font-weight: 400; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.legend .lg-a { background: var(--accent); }
.legend .lg-b { background: var(--blue-soft); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 0 20px; }
.stats-table td { position: relative; word-break: break-all; }
.stats-table .share { position: absolute; left: 0; top: 4px; bottom: 4px; width: var(--w); background: var(--accent-soft); border-radius: 4px; z-index: 0; }
.stats-table td > code, .stats-table td { z-index: 1; }
.stats-table code { position: relative; background: none; }
.pad { padding: 16px 20px; margin: 0; }
.logs-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.logs-form .field { margin: 0; min-width: 160px; }
.logs-form .grow { flex: 1; min-width: 220px; }
.logs-actions { display: flex; gap: 8px; }
.log-view { margin: 0; padding: 16px 20px; max-height: 70vh; overflow: auto; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.log-view .bad { color: var(--red); }
.log-view .warn { color: #b7791f; }
@media (max-width: 640px) { .stats-grid { grid-template-columns: 1fr; } }

.text-red { color: var(--red); }

.dot.yellow { background: #d69e2e; }
.nowrap { white-space: nowrap; }
.monitor-banner { display: flex; gap: 10px; align-items: center; text-decoration: none; margin-bottom: 18px; flex-wrap: wrap; }

/* notifications */
.bell-btn { position: relative; }
.bell-count { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell-menu { width: 340px; max-width: calc(100vw - 24px); }
.bell-head { flex-direction: row; justify-content: space-between; align-items: center; }
.bell-head form { margin: 0; }
.menu .bell-item { align-items: flex-start; font-size: 13.5px; line-height: 1.4; }
.bell-item .dot { margin-top: 6px; }
.bell-item small { display: block; font-size: 12px; }
.bell-item.unread { font-weight: 600; }
.bell-item.unread small { font-weight: 400; }
.menu .bell-all { justify-content: center; color: var(--accent); font-weight: 500; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; }
.bell-empty { padding: 10px; margin: 0; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--border); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list a { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; color: var(--text); text-decoration: none; }
.notif-list a:hover { background: var(--surface-2); }
.notif-list .dot { margin-top: 7px; }
.notif-list li.unread { background: var(--accent-soft); }
.notif-list li.unread strong { font-weight: 700; }
.notif-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.notif-body { color: var(--muted); font-size: 13.5px; }
.notif-list li:not(.unread) strong { font-weight: 500; }
.tile-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 8px 0 4px; }
@media (max-width: 520px) { .tile-choices { grid-template-columns: 1fr; } }

/* servers */
.servers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 18px; margin-bottom: 18px; }
.server-card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.server-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.server-meters { display: grid; gap: 8px; margin: 6px 0; }
.server-meters > div { display: flex; flex-direction: column; gap: 3px; }
.copy-line { display: flex; gap: 8px; align-items: center; }
.copy-line code { word-break: break-all; }
.steps li { margin-bottom: 14px; }
.danger-text { color: var(--red); }
.server-switch { align-items: center; margin-top: -8px; }
.server-switch a { display: inline-flex; align-items: center; gap: 6px; }

/* dashboard: servers */
.dash-servers { margin-bottom: 18px; }
.dash-servers-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dash-servers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.dash-server { margin: 0; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); padding: 16px 18px; }
.dash-server:hover { border-color: var(--accent); }
.dash-meter { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 8px; }
.dash-meter .progress { margin: 0; }
.dash-meter .small:last-child { text-align: right; }

/* Support tickets */
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 650; text-align: center; }
.ticket-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.ticket-msg { margin: 0; max-width: 860px; }
.ticket-staff { border-left: 3px solid var(--accent); margin-left: auto; width: 100%; }
.ticket-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.ticket-body { overflow-wrap: anywhere; line-height: 1.55; }
.ticket-files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ticket-file { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; font-size: 13px; max-width: 100%; }
.ticket-file img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }

/* "Generate" button inside a password field */
.gen-wrap { display: flex; gap: 8px; align-items: stretch; width: 100%; }
.gen-wrap input { flex: 1; min-width: 0; }
.gen-wrap .gen-btn { flex: none; white-space: nowrap; }

/* Phones: a long button wraps its text instead of running off the screen; forms in a row stay inside the card. */
@media (max-width: 600px) {
  .btn { white-space: normal; height: auto; min-height: 38px; padding-top: 8px; padding-bottom: 8px; text-align: center; max-width: 100%; }
  .inline-form { max-width: 100%; }
  .inline-form > form { max-width: 100%; }
}
@media (max-width: 600px) { .access-row { grid-template-columns: 1fr; } }

/* First steps of a new client (dashboard) */
.first-steps { margin-bottom: 18px; }
.start-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.start-steps li { display: flex; gap: 12px; align-items: flex-start; }
.start-steps .step-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; margin-top: 1px; }
.start-steps li.done .step-mark { background: var(--green, #1f9d55); border-color: var(--green, #1f9d55); color: #fff; }
.start-steps li.done strong { color: var(--muted); text-decoration: line-through; }

/* Requests from website forms */
.form-entry.unread { border-left: 3px solid var(--accent, #f26b21); }
.form-entry .card-title .muted { margin-left: 8px; font-weight: 400; }

/* File manager upload: files or a folder, progress */
.fm-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 12px; }
.fm-pick label.btn { cursor: pointer; }
.fm-progress { margin: 6px 0 12px; }
.fm-progress .progress { height: 8px; }
.fm-dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; margin: 6px 0 12px; border: 2px dashed var(--border); border-radius: 12px; color: var(--muted); text-align: center; }
#fm-upload-form.dragging .fm-dropzone { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }

/* Help */
.help-search { max-width: none; margin-bottom: 14px; }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.help-list li a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
.help-list li a:hover { background: var(--surface-2); }
.help-article { line-height: 1.65; }
.help-article h3 { margin: 22px 0 8px; font-size: 16px; }
.help-steps { padding-left: 22px; }
.help-steps li { margin-bottom: 10px; }
.help-table { border-collapse: collapse; margin: 10px 0 14px; width: 100%; max-width: 680px; }
.help-table th, .help-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.help-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
@media (max-width: 480px) {
  .topbar-right { gap: 6px; }
  .help-table { display: block; overflow-x: auto; }
  .help-table code { word-break: break-all; }
}
.badge-red { background: var(--red-soft, #fde8e8); color: var(--red, #c0392b); margin-left: 6px; }
.activity li > span { min-width: 0; overflow-wrap: anywhere; }
.wrap-any { overflow-wrap: anywhere; word-break: break-all; }
form.inline { display: inline; }

/* Ticket: the AI draft of an answer */
.ai-draft { border-color: var(--accent-soft); }
.ai-draft .card-title .badge { margin-left: 6px; font-weight: 500; }
.ai-draft .draft-text { background: var(--bg); min-height: 140px; }
.draft-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.draft-actions form { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.draft-actions input[name=hint] { min-width: 260px; }
