/* CoreInto — shared styles for the admin and client areas */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #142033;
  --muted: #5b6b82;
  --line: #dde3ec;
  --accent: #0d8f86;
  --accent-ink: #ffffff;
  --accent-soft: #e2f5f3;
  --bar: #0b1e3a;
  --bar-2: #12305a;
  --bar-ink: #e9f0fa;
  --bar-muted: #9fb3cf;
  --good: #15803d;  --good-soft: #e5f6eb;
  --bad: #c62828;   --bad-soft: #fdeceb;
  --warn: #b45309;  --warn-soft: #fdf3e2;
  --t-green: #2f9e57; --t-pink: #d04f7c; --t-amber: #d98a1c; --t-blue: #2f7fc1;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 4px 14px rgba(16, 30, 54, .06);
  --radius: 6px;
  --ctl-h: 38px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1420; --surface: #151f2e; --surface-2: #1a2637; --ink: #e5ecf5; --muted: #94a3b8; --line: #263449;
    --accent: #2ec4b6; --accent-ink: #062320; --accent-soft: #123a38;
    --bar: #08111f; --bar-2: #10213a; --bar-ink: #e5ecf5; --bar-muted: #8ea2bf;
    --good: #4ade80; --good-soft: #12301f; --bad: #f87171; --bad-soft: #3a1717; --warn: #fbbf24; --warn-soft: #3a2a0c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1420; --surface: #151f2e; --surface-2: #1a2637; --ink: #e5ecf5; --muted: #94a3b8; --line: #263449;
  --accent: #2ec4b6; --accent-ink: #062320; --accent-soft: #123a38;
  --bar: #08111f; --bar-2: #10213a; --bar-ink: #e5ecf5; --bar-muted: #8ea2bf;
  --good: #4ade80; --good-soft: #12301f; --bad: #f87171; --bad-soft: #3a1717; --warn: #fbbf24; --warn-soft: #3a2a0c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; font-weight: 600; }
h2 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 .8em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.break { word-break: break-all; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small, small { font-size: .86em; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.nowrap { white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* controls */
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; min-height: var(--ctl-h); width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input.short { max-width: 160px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ctl-h); padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn-dark { background: var(--bar); border-color: var(--bar); color: var(--bar-ink); }
.btn-light { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, .1); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover, .icon-btn.on { background: rgba(127, 140, 160, .18); text-decoration: none; }
.when-dark { display: none; }
:root[data-theme="dark"] .when-dark { display: inline-flex; }
:root[data-theme="dark"] .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-dark { display: inline-flex; }
  :root:not([data-theme="light"]) .when-light { display: none; }
}

/* forms */
.stack { display: grid; gap: 12px; }
.stack label, .field > label { display: grid; gap: 4px; font-weight: 500; }
.field { margin-bottom: 14px; }
.field > label { margin-bottom: 4px; }
.check { display: flex !important; align-items: flex-start; gap: 8px; font-weight: 400 !important; cursor: pointer; }
.check input { width: auto; min-height: 0; margin-top: 3px; }
.help { color: var(--muted); font-size: .86em; margin: 4px 0 0; }
.err { color: var(--bad); font-size: .9em; margin: 4px 0 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.actions { display: flex; gap: 10px; padding: 12px 0; }
.actions.sticky { position: sticky; bottom: 0; z-index: 5; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 0; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { font-weight: 600; font-size: 1.05rem; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.pw-meter { height: 4px; border-radius: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s; }

/* blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card.wide { max-width: 980px; margin-left: auto; margin-right: auto; }
.alert { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-good { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.alert-bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.page-title { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--muted); font-size: .86em; text-transform: uppercase; letter-spacing: .03em; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.big { font-size: 1.8rem; font-weight: 600; margin: 0 0 .4em; }
.big small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.codes { columns: 2; list-style: none; padding: 0; }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 6px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { position: relative; display: flex; flex-direction: column; padding: 16px 18px; border-radius: var(--radius); color: #fff; overflow: hidden; box-shadow: var(--shadow); }
.tile:hover { text-decoration: none; filter: brightness(1.05); }
.tile .num { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.tile .ico { position: absolute; right: 12px; bottom: 10px; width: 46px; height: 46px; opacity: .3; }
.t-green { background: var(--t-green); } .t-pink { background: var(--t-pink); } .t-amber { background: var(--t-amber); } .t-blue { background: var(--t-blue); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tab { padding: 9px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; color: var(--muted); }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.on { background: var(--surface); border-color: var(--line); color: var(--ink); margin-bottom: -1px; font-weight: 500; }
.js .tabs + .tabpane, .js .tabpane { border-top-left-radius: 0; }
.js .tabpane:not(.on) { display: none; }
.js .tabpane-title { display: none; }

/* dropdown menus (hover, focus or click) */
.menus ul { list-style: none; margin: 0; padding: 0; }
.menu { position: relative; }
.menu-btn, .menu-link { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.menu-btn .ico:last-child { width: 14px; height: 14px; opacity: .7; }
.drop { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(10, 20, 40, .18); padding: 6px 0; z-index: 50; }
.drop-right { left: auto; right: 0; }
.drop a, .drop .linklike { display: block; width: 100%; text-align: left; padding: 7px 16px; color: var(--ink); }
.drop a:hover, .drop .linklike:hover { background: var(--accent-soft); text-decoration: none; }
/* a line after each link of a drop-down (admin and client area) */
.drop > li + li { border-top: 1px solid var(--line); }
.drop > li.who + li { border-top: 0; }
.drop .sub a { padding-left: 30px; color: var(--muted); font-size: .94em; }
.drop .who { padding: 6px 16px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 600; }
.drop .who small { display: block; color: var(--muted); font-weight: 400; }
.menu:hover > .drop, .menu:focus-within > .drop, .menu.open > .drop { display: block; }

.soon { text-align: center; padding: 40px 20px; }
.soon > .ico { width: 56px; height: 56px; color: var(--accent); margin-bottom: 10px; }

/* sign-in pages */
.auth { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.auth-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
.auth-foot { margin-top: 12px; }
.row-split { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.foot { color: var(--muted); font-size: .86em; padding: 20px 16px; text-align: center; }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row img { border: 1px solid var(--line); border-radius: var(--radius); background: #eef2f6; flex: none; }
.captcha-row input { max-width: 160px; text-transform: uppercase; letter-spacing: .15em; }

/* right-to-left languages (html dir="rtl") */
[dir="rtl"] { direction: rtl; }
[dir="rtl"] .right { text-align: left !important; }
[dir="rtl"] .drop-right { right: auto; left: 0; }
[dir="rtl"] .tile .ico { right: auto; left: 12px; }
[dir="rtl"] .skip:focus { left: auto; right: 8px; }
[dir="rtl"] .mono, [dir="rtl"] code, [dir="rtl"] pre, [dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[type="number"], [dir="rtl"] input.money { direction: ltr; unicode-bidi: isolate; text-align: right; }
