/* nasweb CRM ─────────────────────────────────────────────── */
:root {
    --bg: #f4f5fb;
    --surface: #ffffff;
    --surface-2: #f8f9fd;
    --ink: #0f1222;
    --ink-2: #3b4058;
    --muted: #6e748c;
    --line: #e6e8f2;
    --line-2: #d9dcea;

    --violet: #6d4dff;
    --violet-2: #8b72ff;
    --cyan: #19c3e6;
    --green: #12b886;
    --amber: #f59f00;
    --red: #f03e5e;

    --grad: linear-gradient(135deg, #7c5cff 0%, #5a7bff 50%, #22d3ee 100%);
    --ring: 0 0 0 4px rgba(109, 77, 255, .16);
    --shadow-sm: 0 1px 2px rgba(15, 18, 34, .05), 0 1px 1px rgba(15, 18, 34, .03);
    --shadow: 0 1px 2px rgba(15, 18, 34, .04), 0 8px 24px -8px rgba(15, 18, 34, .10);
    --shadow-lg: 0 24px 60px -20px rgba(33, 22, 110, .35);
    --radius: 18px;
    --radius-sm: 12px;

    --side-w: 264px;
    --side-bg: #0b0e1c;
    --side-ink: #c9cce0;
    --side-muted: #6f7493;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #090b16;
        --surface: #11142a;
        --surface-2: #161a33;
        --ink: #eef0fb;
        --ink-2: #c2c6dc;
        --muted: #8a8fab;
        --line: #20254a;
        --line-2: #2a3058;
        --shadow-sm: none;
        --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
        --side-bg: #070912;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 15px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
b, strong { font-weight: 700; }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.ta-r { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { width: 18px; height: 18px; flex: none; }
::selection { background: rgba(109, 77, 255, .22); }

/* ─── Brand ─── */
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 800; margin-left: 3px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { width: 34px; height: 34px; filter: drop-shadow(0 6px 14px rgba(124, 92, 255, .45)); }

/* ─── App shell ─── */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
    display: flex; flex-direction: column; padding: 22px 16px 16px;
    background:
        radial-gradient(420px 260px at -10% -5%, rgba(124, 92, 255, .30), transparent 60%),
        radial-gradient(360px 300px at 120% 105%, rgba(34, 211, 238, .14), transparent 60%),
        var(--side-bg);
    color: var(--side-ink);
    border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar .brand { padding: 0 8px 26px; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--side-muted); padding: 14px 12px 6px; }
.nav a {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px; color: var(--side-ink); font-weight: 600; font-size: 14.5px;
    transition: background .18s, color .18s;
}
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(124, 92, 255, .28), rgba(124, 92, 255, .06)); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav a.active .ic { color: #a996ff; }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 800; min-width: 22px; height: 22px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: #ff5c7a; color: #fff; box-shadow: 0 0 0 3px rgba(255, 92, 122, .18); }
.sidebar-foot { display: flex; align-items: center; gap: 6px; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .07); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 12px; color: var(--side-ink); }
.me:hover, .me.active { background: rgba(255, 255, 255, .05); text-decoration: none; }
.me span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me b { color: #fff; font-size: 14px; }
.me small { color: var(--side-muted); }
.sidebar .icon-btn { color: var(--side-muted); }
.sidebar .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .07); }

.main { flex: 1; min-width: 0; margin-left: var(--side-w); }
.topbar { display: none; }
.content { max-width: 1240px; margin: 0 auto; padding: 36px 40px 64px; }
.scrim { display: none; }

/* ─── Avatars ─── */
.avatar {
    --a: #6d4dff; --b: #22d3ee;
    flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
    font-weight: 800; font-size: 14.5px; color: #fff; letter-spacing: .02em;
    background: linear-gradient(135deg, var(--a), var(--b));
    box-shadow: 0 6px 16px -6px var(--a);
}
.avatar.xs { width: 30px; height: 30px; border-radius: 10px; font-size: 11.5px; }
.avatar.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
.avatar.xl { width: 72px; height: 72px; border-radius: 22px; font-size: 26px; }
.av-0 { --a: #7c5cff; --b: #b18cff; }
.av-1 { --a: #0ea5e9; --b: #22d3ee; }
.av-2 { --a: #10b981; --b: #6ee7b7; }
.av-3 { --a: #f59e0b; --b: #fbbf24; }
.av-4 { --a: #f43f5e; --b: #fb7185; }
.av-5 { --a: #6366f1; --b: #22d3ee; }
.av-6 { --a: #ec4899; --b: #a855f7; }
.av-7 { --a: #14b8a6; --b: #3b82f6; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
    font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap;
    transition: transform .12s, box-shadow .18s, background .18s, border-color .18s, color .18s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { color: #fff; background: var(--grad); background-size: 140% 140%; background-position: 0 0; box-shadow: 0 8px 22px -8px rgba(109, 77, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { background-position: 100% 100%; box-shadow: 0 12px 28px -8px rgba(109, 77, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ghost { color: var(--ink); background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--violet-2); color: var(--violet); }
.btn-soft { color: var(--violet); background: rgba(109, 77, 255, .09); }
.btn-soft:hover { background: rgba(109, 77, 255, .16); }
.btn-danger { color: #fff; background: var(--red); box-shadow: 0 8px 20px -8px rgba(240, 62, 94, .7); }
.btn-danger:hover { background: #d92f50; }
.btn-lg { height: 50px; font-size: 15.5px; border-radius: 14px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn .ic { transition: transform .2s; }
.btn:hover .ic:last-child:not(:first-child) { transform: translateX(3px); }
.icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn-danger:hover { background: rgba(240, 62, 94, .1); color: var(--red); }

/* ─── Page header ─── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; font-weight: 800; }
.page-head .muted { margin-top: 6px; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--violet); margin-bottom: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 18px; }
.back:hover { color: var(--ink); text-decoration: none; }
.back .ic { width: 16px; height: 16px; transition: transform .2s; }
.back:hover .ic { transform: translateX(-3px); }

/* ─── Cards ─── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.card-head h2 .ic { color: var(--violet); }
.card-head .count { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 9px; border-radius: 999px; }
.tone-danger .ic { color: var(--red) !important; }
.tone-warn .ic { color: var(--amber) !important; }
.tone-ok .ic { color: var(--green) !important; }
.tone-muted .ic { color: var(--muted) !important; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13.5px; }
.link .ic { width: 15px; height: 15px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-detail { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; min-width: 0; }

/* ─── KPI ─── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi {
    --c: var(--violet);
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px;
    padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
    color: var(--ink); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.kpi::after { content: ""; position: absolute; width: 180px; height: 180px; right: -70px; top: -80px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); pointer-events: none; }
a.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.kpi-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; margin-bottom: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.kpi-ic .ic { width: 21px; height: 21px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi strong { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.kpi small { color: var(--muted); }
.kpi-violet { --c: #7c5cff; }
.kpi-cyan { --c: #0ab3d6; }
.kpi-green { --c: #12b886; }
.kpi-amber { --c: #f08c00; }

/* ─── Lists / timeline ─── */
.list { list-style: none; margin: -6px -10px; padding: 0; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; color: var(--ink); }
.list-row:hover { background: var(--surface-2); text-decoration: none; }
.list-main { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.list-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { color: var(--muted); }

.svc-ic { --c: var(--violet); flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.svc-domain { --c: #0ab3d6; }
.svc-hosting { --c: #12b886; }
.svc-other { --c: #7c5cff; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
.timeline p { font-size: 14px; color: var(--ink-2); }
.timeline p b { color: var(--ink); }
.timeline small { color: var(--muted); }

/* ─── Pills, tags, status ─── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { color: #0c8a64; background: rgba(18, 184, 134, .12); }
.pill-info { color: #0b87a8; background: rgba(25, 195, 230, .13); }
.pill-warn { color: #b86e00; background: rgba(245, 159, 0, .15); }
.pill-danger { color: #d0213f; background: rgba(240, 62, 94, .12); }
.pill-danger::before { animation: pulse 1.6s infinite; }
.pill-muted { color: var(--muted); background: var(--surface-2); }
.pill-muted::before { display: none; }
@media (prefers-color-scheme: dark) {
    .pill-ok { color: #4ade9f; } .pill-info { color: #56d7f2; } .pill-warn { color: #ffc24b; } .pill-danger { color: #ff7d95; }
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); }
.tag .ic { width: 12px; height: 12px; }
.tag-own { color: #0c8a64; background: rgba(18, 184, 134, .09); border-color: rgba(18, 184, 134, .25); }
.tag-ext { color: #b86e00; background: rgba(245, 159, 0, .09); border-color: rgba(245, 159, 0, .28); }
.tag-auto { color: var(--violet); background: rgba(109, 77, 255, .08); border-color: rgba(109, 77, 255, .2); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-active { color: #0c8a64; background: rgba(18, 184, 134, .12); }
.status-paused { color: #b86e00; background: rgba(245, 159, 0, .14); }
.status-ended { color: var(--muted); background: var(--surface-2); }

/* ─── Toolbar / tabs / search ─── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow-x: auto; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a .ic { width: 15px; height: 15px; }
.tabs a em { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tabs a.on { color: #fff; background: var(--ink); }
.tabs a.on em { background: rgba(255, 255, 255, .16); color: #fff; }
@media (prefers-color-scheme: dark) { .tabs a.on { background: var(--violet); } }
.search { position: relative; display: flex; align-items: center; flex: 0 1 320px; }
.search .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.toggle:hover { color: var(--ink); text-decoration: none; }
.toggle-track { width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); padding: 3px; transition: background .2s; }
.toggle-track span { display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle.on .toggle-track { background: var(--violet); }
.toggle.on .toggle-track span { transform: translateX(16px); }

/* ─── Customer cards ─── */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.cust-card {
    position: relative; display: flex; flex-direction: column; gap: 16px; padding: 20px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    color: var(--ink); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cust-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--violet) 35%, var(--line)); text-decoration: none; }
.cust-card.is-ended { opacity: .62; }
.cust-top { display: flex; align-items: center; gap: 13px; }
.cust-name { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.cust-name b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-name small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 9px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; }
.chip-domain .ic { color: #0ab3d6; }
.chip-hosting .ic { color: #12b886; }
.chip-other .ic { color: #7c5cff; }
.chip-muted { color: var(--muted); border-style: dashed; }
.cust-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line-2); margin-top: auto; }
.cust-foot > span { display: flex; flex-direction: column; gap: 4px; }
.cust-foot small { color: var(--muted); font-weight: 600; }
.cust-foot .ta-r { align-items: flex-end; }

/* ─── Customer detail ─── */
.profile-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    padding: 26px; margin-bottom: 20px; border-radius: 22px; color: #fff;
    background:
        radial-gradient(500px 220px at 0% 0%, rgba(124, 92, 255, .55), transparent 60%),
        radial-gradient(420px 260px at 100% 120%, rgba(34, 211, 238, .35), transparent 60%),
        #0e1124;
    box-shadow: var(--shadow-lg);
}
.profile-hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000 60%); pointer-events: none; }
.profile-hero > * { position: relative; z-index: 1; }
.profile-hero .avatar { box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }
.profile-title { flex: 1; min-width: 220px; }
.profile-title h1 { font-size: 30px; font-weight: 800; margin: 8px 0 4px; }
.profile-title .muted { color: #a8adc8; }
.profile-title .status-active { color: #5df2c0; background: rgba(18, 184, 134, .2); }
.profile-title .status-paused { color: #ffd27a; background: rgba(245, 159, 0, .2); }
.profile-title .status-ended { color: #c6c9dc; background: rgba(255, 255, 255, .1); }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-hero .btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .16); box-shadow: none; }
.profile-hero .btn-ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.svc { display: flex; gap: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); transition: border-color .2s; }
.svc:hover { border-color: var(--line-2); }
.svc-body { flex: 1; min-width: 0; }
.svc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc-line b { font-size: 15.5px; margin-right: 2px; word-break: break-word; }
.svc-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.svc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.svc-meta .ic { width: 14px; height: 14px; }
.svc-note { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.svc-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; }
.svc-actions { display: flex; gap: 2px; }
.svc-actions form { margin: 0; }

.info { margin: 0; display: grid; gap: 14px; }
.info div { display: grid; gap: 2px; }
.info dt { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.info dt .ic { width: 14px; height: 14px; }
.info dd { margin: 0; font-weight: 600; word-break: break-word; }
.info-inline { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.prose { color: var(--ink-2); white-space: normal; }

/* ─── Tables ─── */
.table-card { padding: 22px 0 6px; margin-bottom: 20px; }
.table-card .card-head { padding: 0 22px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-ended { opacity: .55; }
.table form { margin: 0; display: inline; }
.cell-svc { display: inline-flex; align-items: center; gap: 12px; }
.cell-svc .svc-ic { width: 34px; height: 34px; border-radius: 10px; }
.cell-svc .svc-ic .ic { width: 16px; height: 16px; }
.cell-exp { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }

/* ─── Forms ─── */
.form fieldset { border: 0; padding: 0; margin: 0 0 24px; }
.form legend { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; margin-bottom: 14px; padding: 0; }
.form legend .ic { color: var(--violet); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.form-grid .field { margin-bottom: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
    width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
    background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px;
    transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 90px; }
select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e748c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
.has-error input { border-color: var(--red); }
.err { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--red); }
.input-ic { position: relative; display: flex; align-items: center; }
.input-ic > .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input-ic input { padding-left: 44px !important; }
.input-ic input[type=password], .input-ic .reveal + input { padding-right: 46px !important; }
.reveal { position: absolute; right: 6px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.reveal:hover, .reveal.on { color: var(--violet); background: rgba(109, 77, 255, .08); }
.check { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; border-color: rgba(240, 62, 94, .3); background: color-mix(in srgb, var(--red) 4%, var(--surface)); }
.danger-zone .muted { font-size: 13.5px; margin-top: 2px; max-width: 620px; }

.type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 13px; border: 1.5px solid var(--line-2); font-weight: 700; color: var(--muted); cursor: pointer; transition: all .15s; }
.type-opt span:hover { border-color: var(--violet-2); color: var(--ink); }
.type-opt input:checked + span { border-color: var(--violet); color: var(--violet); background: rgba(109, 77, 255, .07); box-shadow: var(--ring); }
.type-opt input:focus-visible + span { box-shadow: var(--ring); }
.type-domain input:checked + span { --violet: #0ab3d6; box-shadow: 0 0 0 4px rgba(10, 179, 214, .15); background: rgba(10, 179, 214, .07); }
.type-hosting input:checked + span { --violet: #12b886; box-shadow: 0 0 0 4px rgba(18, 184, 134, .15); background: rgba(18, 184, 134, .07); }

/* ─── Modal ─── */
.modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 100px -20px rgba(10, 8, 40, .5); }
.modal::backdrop { background: rgba(9, 11, 24, .55); backdrop-filter: blur(6px); }
.modal[open] { animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal form { padding: 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { font-size: 20px; font-weight: 800; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ─── Flash ─── */
.flash { display: flex; align-items: center; gap: 12px; padding: 13px 16px; margin-bottom: 18px; border-radius: 14px; font-weight: 600; font-size: 14.5px; border: 1px solid; animation: slide .35s ease-out; transition: opacity .5s, transform .5s; }
.flash > span { flex: 1; }
.flash.fade { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.flash-success { color: #0c7a59; background: rgba(18, 184, 134, .1); border-color: rgba(18, 184, 134, .28); }
.flash-error { color: #c41c3a; background: rgba(240, 62, 94, .08); border-color: rgba(240, 62, 94, .28); }
.flash-info { color: #0b7c9a; background: rgba(25, 195, 230, .1); border-color: rgba(25, 195, 230, .3); }
@media (prefers-color-scheme: dark) { .flash-success { color: #5df2c0; } .flash-error { color: #ff8da2; } .flash-info { color: #6fe0f7; } }
.flash-x { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 2px; display: grid; }
.flash-x:hover { opacity: 1; }
@keyframes slide { from { opacity: 0; transform: translateY(-8px); } }

/* ─── Empty states ─── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 48px 20px; }
.empty-sm { padding: 26px 10px; }
.empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; color: var(--violet); background: rgba(109, 77, 255, .1); }
.empty-ic .ic { width: 26px; height: 26px; }
.empty-ic.ok { color: var(--green); background: rgba(18, 184, 134, .12); }
.hero-empty { display: flex; align-items: center; gap: 28px; margin-top: 20px; padding: 30px; background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 8%, var(--surface)), var(--surface) 60%); }
.hero-empty h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.hero-empty .muted { margin-bottom: 16px; max-width: 560px; }
.hero-empty-art { flex: none; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); transform: rotate(-6deg); }
.hero-empty-art .ic { width: 44px; height: 44px; }

.me-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.me-card h2 { margin-top: 10px; font-size: 20px; }
.me-card .info { margin-top: 16px; width: 100%; padding-top: 16px; border-top: 1px solid var(--line); }

/* ─── Login ─── */
.auth { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; background: var(--surface); }
.auth-art { position: relative; overflow: hidden; display: flex; align-items: center; padding: 56px; background: #080a17; color: #fff; isolation: isolate; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .75; z-index: -1; animation: drift 18s ease-in-out infinite alternate; }
.orb-1 { width: 520px; height: 520px; left: -140px; top: -160px; background: #6d4dff; }
.orb-2 { width: 460px; height: 460px; right: -160px; bottom: -120px; background: #0ec5e8; animation-duration: 22s; animation-direction: alternate-reverse; }
.orb-3 { width: 300px; height: 300px; left: 40%; top: 55%; background: #d946ef; opacity: .4; animation-duration: 26s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }
.grid-lines { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 40% 50%, #000 20%, transparent 75%); }
.auth-art-inner { position: relative; max-width: 560px; }
.auth-art .brand { margin-bottom: 64px; }
.auth-art h1 { font-size: clamp(40px, 4.6vw, 64px); font-weight: 800; letter-spacing: -.04em; line-height: 1.02; }
.grad-text { background: linear-gradient(90deg, #a996ff, #5ee7ff 60%, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { margin-top: 22px; font-size: 17px; color: #b3b8d6; max-width: 440px; }
.float-cards { position: relative; height: 210px; margin-top: 44px; }
.fcard {
    position: absolute; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-width: 240px;
    border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(14px); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
    animation: float 7s ease-in-out infinite;
}
.fcard .ic { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: rgba(255, 255, 255, .1); color: #c8bcff; }
.fcard div { display: flex; flex-direction: column; flex: 1; line-height: 1.3; }
.fcard small { color: #9ca2c6; }
.fcard-1 { left: 0; top: 0; }
.fcard-2 { left: 190px; top: 74px; animation-delay: -2.3s; }
.fcard-2 .ic { color: #6ff0c6; }
.fcard-3 { left: 30px; top: 148px; animation-delay: -4.6s; }
.fcard-3 .ic { color: #6fe0f7; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-ok { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }
.dot-warn { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, .2); animation: pulse 1.8s infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }

.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-form { width: 100%; max-width: 400px; animation: rise .6s cubic-bezier(.2, .8, .2, 1); }
.auth-form h2 { font-size: 30px; font-weight: 800; }
.auth-form > .muted { margin: 6px 0 30px; }
.auth-form .field { margin-bottom: 18px; }
.auth-form input { height: 50px !important; border-radius: 14px !important; }
.auth-form .btn { margin-top: 10px; }
.auth-foot { margin-top: 34px; text-align: center; font-size: 13px; color: var(--muted); }
.brand-mobile { display: none !important; color: var(--ink); margin-bottom: 36px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ─── Responsive ─── */
@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .grid-detail { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .brand-mobile { display: inline-flex !important; }
    .auth-form-wrap { min-height: 100vh; background: radial-gradient(500px 300px at 50% -10%, rgba(124, 92, 255, .18), transparent 70%), var(--surface); }

    .sidebar { transform: translateX(-100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
    .nav-open .sidebar { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, .4); }
    .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(9, 11, 24, .5); backdrop-filter: blur(3px); }
    .main { margin-left: 0; }
    .topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--side-bg) 92%, transparent); backdrop-filter: blur(12px); }
    .topbar .icon-btn { color: #fff; }
    .topbar .icon-btn:hover { background: rgba(255, 255, 255, .08); }
    .brand-sm { font-size: 16px; }
    .brand-sm .brand-mark { width: 28px; height: 28px; }
    .content { padding: 24px 16px 48px; }
    .grid-2 { grid-template-columns: 1fr; }
    .page-head h1 { font-size: 26px; }
}
@media (max-width: 640px) {
    .kpis { gap: 12px; }
    .kpi { padding: 16px; }
    .kpi strong { font-size: 26px; }
    .kpi-ic { margin-bottom: 10px; width: 38px; height: 38px; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .cust-grid { grid-template-columns: 1fr; }
    .search { flex: 1 1 100%; }
    .profile-hero { padding: 20px; }
    .profile-title h1 { font-size: 24px; }
    .svc { flex-wrap: wrap; }
    .svc-side { flex-direction: row; align-items: center; width: 100%; padding-left: 52px; }
    .danger-zone { flex-direction: column; align-items: flex-start; }
    .hero-empty { flex-direction: column; text-align: center; }
    .type-opt span { height: 46px; font-size: 13.5px; }
    .page-head .btn { width: 100%; }

    /* tabuľka → karty */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 12px 18px; border-bottom: 1px solid var(--line); }
    .table td { padding: 4px 0 !important; border: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
    .table td[data-l]::before { content: attr(data-l); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; }
    .table td:first-child { padding-bottom: 8px !important; }
    .table td:first-child::before { display: none; }
    .table td:last-child { justify-content: flex-end; padding-top: 8px !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
