/* Reseller panel: light dashboard with a side menu, Hot Ibo colors. */
:root {
  color-scheme: light;
  --bg: #f3f4f7;
  --card: #fff;
  --line: #e4e6ec;
  --text: #1c2233;
  --muted: #6b7286;
  --yellow: #ff973f;
  --yellow-soft: #fff0e3;
  --accent: #f07a1a;
  --dark: #0c0f18;
  --ok: #1f9d55;
  --err: #d93a2b;
  --blue: #3a6ff0;
  --soon: #fff1e0;
  --late: #fde8e6;
  --radius: 10px;
  --side: 250px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* Inter (SIL Open Font License, /assets/fonts/Inter-LICENSE.txt) */
@font-face {
  font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/Inter.woff2") format("woff2");
}
body { background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.02em; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.35rem; }
.brand > span { line-height: 1.05; letter-spacing: -0.02em; }
.brand img { width: 40px; height: 40px; }
.brand .hot { color: var(--yellow); }
.brand small { display: block; font-size: 0.5em; font-weight: 600; letter-spacing: 0.35em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

/* Forms and buttons */
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 14px 0 6px; }
label .muted { font-weight: 400; }
input[type="text"], input[type="password"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--yellow); outline-offset: 0; border-color: var(--accent); }
input.mac { font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: 0.06em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-yellow { background: var(--yellow); color: var(--dark); }
.btn-yellow:hover { filter: brightness(0.96); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { filter: brightness(1.2); }
.btn-light { background: #fff; border-color: var(--line); color: var(--text); }
.btn-light:hover { background: #f6f7fa; }
.btn-red { background: var(--err); color: #fff; }
.btn[disabled] { opacity: 0.55; cursor: wait; }
.icon-btn { width: 34px; height: 34px; padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1; }

/* Login */
.login-top { background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: center; padding: 12px; }
.login { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 26px 26px; position: relative; }
.login-card .badge { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); }
.login-card .btn { width: 100%; margin-top: 18px; }
.login-lang { display: flex; justify-content: center; margin-top: 14px; }

/* Layout */
.side {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); background: #fff; border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; z-index: 20;
}
.side .brand { padding: 4px 8px 18px; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-block: 1px solid var(--line); margin-bottom: 12px; }
.who .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow-soft); font-weight: 800; color: var(--accent); flex: none; }
.who b, .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who div { min-width: 0; }
.menu a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px; border-radius: 8px;
  color: var(--text); text-decoration: none; border-inline-start: 3px solid transparent;
}
.menu a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.menu a:hover { background: #f6f7fa; }
.menu a[aria-current="page"] { background: #f0f1f5; border-inline-start-color: var(--accent); font-weight: 600; }
.side-foot { margin-top: auto; padding: 12px 8px 0; display: grid; gap: 10px; }
.side-foot a { color: var(--muted); font-size: 0.85rem; }

.main { margin-inline-start: var(--side); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.credits { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-weight: 700; font-size: 0.85rem; }
.credits span { padding: 7px 10px; }
.credits span + span { border-inline-start: 1px solid var(--line); background: var(--yellow-soft); }
.lang { width: auto; padding: 7px 8px; }
.menu-toggle { display: none; }
.content { padding: 22px 24px 40px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.card-body { padding: 18px; }
.grid2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.info { background: #e8efff; color: #24418f; border-radius: 8px; padding: 10px 14px; font-size: 0.9rem; }
.badge { display: inline-block; background: var(--yellow); color: var(--dark); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.04em; padding: 6px 16px; border-radius: 999px; text-transform: uppercase; }
.mac-badge { display: inline-block; background: var(--yellow-soft); border: 1px solid var(--yellow); border-radius: 6px; padding: 4px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }

/* Clients table */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; }
.toolbar form { display: flex; gap: 8px; align-items: center; }
.toolbar input[type="search"] { width: 220px; }
.filters { display: flex; flex-wrap: wrap; gap: 18px; padding: 0 18px 12px; font-size: 0.85rem; font-weight: 600; }
.filters label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.85rem; cursor: pointer; }
.swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: start; font-weight: 600; color: var(--muted); padding: 10px 12px; border-block: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover { background: #fafbff; }
tr.soon { background: var(--soon); }
tr.late { background: var(--late); }
td.empty { text-align: center; color: var(--muted); padding: 30px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.pill.sys { background: var(--blue); color: #fff; }
.pill.active { background: var(--yellow); color: var(--dark); }
.pill.lifetime { background: var(--accent); color: #fff; }
.pill.trial { background: var(--ok); color: #fff; }
.pill.expired { background: var(--err); color: #fff; }
.pill.lock { background: var(--dark); color: #fff; }
.note-btn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 2px 4px; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; }
.note-btn span { overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.note-btn svg { width: 14px; height: 14px; flex: none; }
.plus { color: var(--ok); font-weight: 700; } .minus { color: var(--err); font-weight: 700; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 12px 18px; font-size: 0.85rem; color: var(--muted); }
.pager .btn { padding: 4px 9px; }

/* Dialogs */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgb(0 0 0 / 0.25); color: var(--text); }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(20 24 36 / 0.45); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 1.05rem; }
.dlg-head .close { margin-inline-start: auto; background: #f0f1f5; border: 0; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 1.1rem; }
.dlg-body { padding: 6px 20px 20px; }
.dlg-body .btn { margin-top: 16px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }
.choice label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; cursor: pointer; }
.actions-list { display: grid; gap: 8px; margin-top: 14px; }
.actions-list .btn { margin: 0; justify-content: flex-start; }
.pl-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pl-item b { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.pl-form { display: grid; gap: 10px; grid-template-columns: 140px 1fr; margin-top: 12px; }
.pl-form .full { grid-column: 1 / -1; }
.pl-form label { margin: 0 0 4px; font-size: 0.8rem; color: var(--muted); }
.xt { display: grid; gap: 10px; grid-template-columns: 2fr 1fr 1fr; }

/* Check MAC, store preview, downloads */
.narrow { max-width: 640px; margin-inline: auto; display: grid; gap: 16px; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; font-weight: 600; }
.preview { background: #0a1022; color: #f5f7ff; border-radius: 8px; padding: 26px; text-align: center; min-height: 160px; }
.preview h3 { margin: 0 0 8px; }
.preview .phone { color: var(--yellow); margin-top: 12px; }
.dl-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.dl-grid .card-body { display: grid; gap: 8px; }

/* Messages */
.toast:not(:empty) {
  position: fixed; bottom: 18px; inset-inline: 16px; margin: 0 auto; max-width: 560px; z-index: 1000;
  padding: 12px 16px; border-radius: 10px; color: #fff; background: var(--dark); box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
}
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform 0.2s; box-shadow: 0 0 40px rgb(0 0 0 / 0.2); }
  [dir="rtl"] .side { transform: translateX(100%); }
  .side.open { transform: none; }
  .main { margin-inline-start: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .content { padding: 16px 12px 40px; }
  .toolbar input[type="search"] { width: 150px; }
  .pl-form, .xt { grid-template-columns: 1fr; }
}
.sprite { position: absolute; width: 0; height: 0; }
.swatch.soon { background: var(--soon); } .swatch.late { background: var(--late); }
.mt { margin-top: 16px; }
.m0 { margin: 0 !important; }
.center { text-align: center; }
.grow { flex: 1; min-width: 180px; }
.pill + .pill { margin-inline-start: 4px; }
td .row { flex-wrap: nowrap; gap: 6px; }
.badge { white-space: nowrap; }
