/* Exalto Reports — hand-written so Plesk needs no build step. */
:root {
  --side: #1d2135;
  --side-2: #272c45;
  --side-3: #323858;
  --side-text: #a4aac4;
  --primary: #1f6bff;
  --primary-2: #1557dc;
  --primary-soft: #e9f0ff;
  --bg: #f2f4f8;
  --card: #ffffff;
  --line: #e2e6ee;
  --line-2: #eef1f6;
  --ink: #1b2131;
  --ink-2: #4f586c;
  --ink-3: #8a92a6;
  --good: #12a150;
  --good-bg: #e4f6ec;
  --bad: #e5484d;
  --bad-bg: #fdeced;
  --warn: #b86e00;
  --warn-bg: #fff4de;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 4px 16px rgba(16, 24, 40, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
code { font-size: 12px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.ico { flex: none; display: inline-block; vertical-align: middle; }
.inline { display: inline; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* =============== shell =============== */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px 20px; color: #fff; }
.logo img { max-height: 30px; max-width: 150px; object-fit: contain; }
.logo .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
.logo .txt { font-weight: 700; font-size: 14px; line-height: 1.2; }
.logo .txt small { display: block; font-weight: 500; font-size: 11px; color: var(--side-text); }
.nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px; color: var(--side-text); font-size: 13.5px; font-weight: 500; position: relative; }
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--side-3); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav .count { margin-left: auto; font-size: 11px; background: var(--side-2); color: var(--side-text); padding: 1px 7px; border-radius: 99px; }
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #6b7290; padding: 18px 22px 6px; }
.side .clients-nav { padding: 0 10px; display: flex; flex-direction: column; gap: 1px; }
.side .clients-nav a { display: flex; align-items: center; gap: 9px; padding: 6px 12px; border-radius: 6px; color: var(--side-text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .clients-nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.side .clients-nav a.active { color: #fff; background: var(--side-2); }
.side .clients-nav .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.side .grow { flex: 1; }
.side-foot { padding: 12px 10px 16px; border-top: 1px solid var(--side-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 30; }
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }

/* client switcher */
.switcher { position: relative; }
.switcher > button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 8px; border: 1px solid transparent; }
.switcher > button:hover, .switcher.open > button { border-color: var(--line); background: #fafbfd; }
.switcher .name { font-weight: 600; font-size: 14px; }
.switcher .sub { font-size: 11.5px; color: var(--ink-3); }
.dropdown { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px; max-height: 420px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; z-index: 40; }
.dropdown.right { left: auto; right: 0; min-width: 200px; }
.open > .dropdown { display: block; }
.dropdown .search { padding: 4px 4px 8px; }
.dropdown a, .dropdown button.item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; font-size: 13.5px; color: var(--ink); }
.dropdown a:hover, .dropdown button.item:hover { background: var(--bg); text-decoration: none; }
.dropdown .sep { height: 1px; background: var(--line); margin: 6px 0; }
.dropdown .meta { padding: 8px 10px 4px; font-size: 12px; color: var(--ink-3); }

.avatar { display: inline-grid; place-items: center; border-radius: 8px; color: #fff; font-weight: 700; letter-spacing: .02em; flex: none; }
.avatar.round { border-radius: 50%; }
.me-btn { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 99px; }
.me-btn:hover { background: var(--bg); }

/* page header */
.page { padding: 24px 28px 64px; width: 100%; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; }
.page-head .crumbs { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.page-head .crumbs a { color: var(--ink-3); }
.page-head .spacer { flex: 1; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.client-head { display: flex; align-items: center; gap: 14px; }
.client-head .meta { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 3px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 22px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* =============== elements =============== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0 14px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); }
.btn:hover { border-color: #c9cfdb; background: #fafbfd; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-h .spacer { flex: 1; }
.card-h .sub { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 0 0 14px; }
.stack > * + * { margin-top: 18px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 11px; font: inherit; font-size: 13.5px; color: var(--ink); background: #fff;
}
textarea { height: auto; min-height: 150px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
select { padding-right: 28px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 107, 255, .15); }
input[type=color] { width: 46px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.search-box { position: relative; }
.search-box .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-box input { padding-left: 34px; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; }
.flash.ok { background: var(--good-bg); color: #0b7a3b; border-color: #c4ead3; }
.flash.err { background: var(--bad-bg); color: #b4262b; border-color: #f6cfd1; }
.flash.warn { background: var(--warn-bg); color: #8a5300; border-color: #f4ddb0; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--good-bg); color: #0b7a3b; }
.pill.bad { background: var(--bad-bg); color: #b4262b; }
.pill.warn { background: var(--warn-bg); color: #8a5300; }
.pill.blue { background: var(--primary-soft); color: var(--primary-2); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chg { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.chg.up { background: var(--good-bg); color: #0b7a3b; }
.chg.down { background: var(--bad-bg); color: #c42a30; }
.chg.flat { background: var(--line-2); color: var(--ink-3); }
.chg-text { font-size: 11px; font-weight: 700; white-space: nowrap; }
.chg-text.up { color: var(--good); } .chg-text.down { color: var(--bad); } .chg-text.flat { color: var(--ink-3); }
.delta { font-size: 11px; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--ink-3); }

/* integration status icons */
.integ { display: inline-flex; gap: 5px; }
.integ span { display: inline-grid; place-items: center; height: 24px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; background: var(--line-2); color: #aab0c0; }
.integ span.on.gsc { background: #e8f0fe; color: #1a5ad7; }
.integ span.on.ga4 { background: #fff1e0; color: #c46a00; }
.integ span.on.sem { background: #fbeafe; color: #a020b8; }

/* =============== tables =============== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 10px 16px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.row-link { cursor: pointer; }
.tbl tr.row-link:hover td { background: #f8faff; }
.tbl .cell-client { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.tbl .cell-client b { display: block; font-weight: 600; }
.tbl .cell-metric { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.tbl .cell-metric .v { font-weight: 600; min-width: 48px; text-align: right; }
.scroll-x { overflow-x: auto; }

table.edit { width: 100%; border-collapse: collapse; }
table.edit th { text-align: left; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 0 5px 8px; white-space: nowrap; }
table.edit td { padding: 3px 4px; vertical-align: middle; }
table.edit input[type=text], table.edit input[type=number] { height: 34px; padding: 0 9px; font-size: 13px; }
table.edit .w-num { width: 88px; }
.row-x { border: none; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 17px; line-height: 1; padding: 5px 7px; border-radius: 6px; }
.row-x:hover { background: var(--bad-bg); color: var(--bad); }
.add-row { margin-top: 12px; }
.src { font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 3px 6px; border-radius: 4px; white-space: nowrap; }
.src.gsc { background: #e8f0fe; color: #1a5ad7; }
.src.ga4 { background: #fff1e0; color: #c46a00; }
.src.manual { background: var(--line-2); color: var(--ink-3); }
#queriesTable td:first-child, #pagesTable td:first-child { width: 38%; min-width: 220px; }
#queriesTable input.w-num, #pagesTable input.w-num { width: 78px; }
#subsTable td:nth-child(3) { min-width: 190px; }

/* =============== widgets =============== */
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 14px; display: flex; flex-direction: column; min-height: 140px; }
.widget .w-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.widget .w-top .src { margin-left: auto; }
.widget .w-val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; line-height: 1.1; }
.widget .w-cmp { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.widget .w-spark { margin-top: auto; padding-top: 10px; }
.widget .w-spark svg { width: 100%; height: 34px; display: block; }
.widget.empty .w-val { color: #c3c8d4; }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.summary-strip > div { padding: 16px 20px; border-right: 1px solid var(--line-2); }
.summary-strip > div:last-child { border-right: none; }
.summary-strip .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.summary-strip .l { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.summary-strip .bar { height: 4px; border-radius: 4px; background: var(--line-2); margin-top: 10px; overflow: hidden; }
.summary-strip .bar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

.chart-wrap { position: relative; height: 280px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 7px; padding: 3px; gap: 2px; }
.seg button { all: unset; cursor: pointer; padding: 5px 11px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); border-radius: 5px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); font-weight: 600; }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty .ico { color: #c2c8d6; margin-bottom: 10px; }
.empty h2 { color: var(--ink); margin-bottom: 6px; font-size: 16px; }
.empty p { margin: 0 0 16px; }

/* =============== report builder =============== */
.builder { display: grid; grid-template-columns: 200px minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.sections { position: sticky; top: 80px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.sections .h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 8px 10px 6px; }
.sections a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); font-size: 13px; }
.sections a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.sections a.on { background: var(--primary-soft); color: var(--primary-2); font-weight: 600; }
.sections a .n { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.sections a .ok { margin-left: auto; color: var(--good); }
.rail { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }
.rail .card + .card { margin-top: 0; }
.rail .card-b > * + * { margin-top: 8px; }
.rail-meta { font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }
.rail-meta b { color: var(--ink-2); font-weight: 600; }
.section-anchor { scroll-margin-top: 80px; }
.drop { display: block; border: 1.5px dashed #c6cddc; border-radius: 8px; padding: 18px 12px; text-align: center; color: var(--ink-3); font-size: 12.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--primary); background: #f7faff; color: var(--primary-2); }
.drop input { display: none; }
.drop .ico { display: block; margin: 0 auto 6px; }
.mini-stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line-2); border-radius: 8px; margin-bottom: 14px; }
.mini-stats > div { padding: 12px 14px; border-right: 1px solid var(--line-2); }
.mini-stats > div:last-child { border-right: none; }
.mini-stats .v { font-size: 20px; font-weight: 700; }
.mini-stats .l { font-size: 11.5px; color: var(--ink-3); }
.focus-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; margin-bottom: 8px; }

/* settings */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1060px; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 20px; }
.auth .box { width: 100%; max-width: 400px; }
.auth .logo { color: var(--ink); justify-content: center; padding: 0 0 22px; }
.auth .logo .txt small { color: var(--ink-3); }
.auth .card { padding: 28px; }

/* =============== responsive =============== */
@media (max-width: 1180px) {
  .builder { grid-template-columns: minmax(0, 1fr) 250px; }
  .builder .sections { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .nav-open .side { transform: none; box-shadow: var(--shadow-2); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .builder, .settings { grid-template-columns: 1fr; }
  .rail, .settings .sections { position: static; }
  .summary-strip, .g3, .g4, .mini-stats { grid-template-columns: 1fr 1fr; }
  .summary-strip > div:nth-child(2) { border-right: none; }
  .summary-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); }
}
@media (max-width: 600px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .focus-row { grid-template-columns: 1fr; }
  .switcher .sub, .topbar .hide-sm { display: none; }
  .page-head { align-items: flex-start; }
}
