﻿/* ============================================================
   MKS DTECH - portal theme
   Same visual language as the MKS website (MKS-Website/app/globals.css)
   and the current customer portal (MKS-Portal/src/index.css):
   light-grey background with a faint blueprint grid, near-black text,
   MKS blue (#1DB7F1) accent, hairline borders, soft cards, mono eyebrows.
   Loaded after Bootstrap and the legacy stylesheets, so it restyles
   every page (Bootstrap classes included) without touching markup.
   ============================================================ */

:root {
    /* surfaces */
    --bg: #f5f5f7;
    --bg-2: #ebebee;
    --bg-alt: #fbfbfd;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-2: rgba(255, 255, 255, 0.92);
    --border: rgba(0, 0, 0, 0.07);
    --border-2: rgba(0, 0, 0, 0.13);

    /* text */
    --text: #111114;
    --text-dim: #3a3a42;
    --text-faint: #66666e;
    --text-ghost: #999999;

    /* brand */
    --mks-blue: #1DB7F1;
    --mks-blue-dim: rgba(29, 183, 241, 0.70);
    --accent: #0e8fbf;
    --accent-soft: rgba(29, 183, 241, 0.10);
    --accent-line: rgba(29, 183, 241, 0.24);

    /* status */
    --ok-bg: #dcfce7; --ok-fg: #166534;
    --info-bg: #e0f2fe; --info-fg: #0369a1;
    --warn-bg: #fef9c3; --warn-fg: #854d0e;
    --danger-bg: #fee2e2; --danger-fg: #dc2626; --danger-fg2: #991b1b;

    /* type */
    --sans: -apple-system, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
    --mono: "SF Mono", ui-monospace, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

    --radius: 16px;

    /* Bootstrap hooks */
    --bs-primary: #1DB7F1;
    --bs-primary-rgb: 29, 183, 241;
    --bs-body-font-family: var(--sans);
    --bs-body-color: var(--text);
    --bs-link-color: var(--accent);
    --bs-link-hover-color: var(--mks-blue);
    --bs-border-color: var(--border-2);

    /* legacy portal variables, mapped onto the theme */
    --main-background: transparent;
    --font-main: var(--sans);
    --font-medium: var(--sans);
    --font-bold: var(--sans);
    --font-color-text: var(--text);
    --font-color-label: var(--text-faint);
    --font-color-blue: var(--mks-blue);
    --border-color: var(--border-2);
    --border-color-active: var(--mks-blue);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* faint blueprint grid across the page, fading out down the fold */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: center -1px;
    -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 70%);
    mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}

::selection { background: var(--accent-soft); color: var(--text); }

h1, h2, h3, h4, h5 {
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.03em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--mks-blue); }
a:not(.btn):hover { text-decoration: underline; }

/* ============================================================
   Page header: mono eyebrow + big tight title + subtitle
   ============================================================ */
.page-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: clamp(20px, 3vw, 32px); }
.page-eyebrow, .eyebrow {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mks-blue);
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.page-eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--mks-blue); opacity: 0.7; }
.page-title { font-size: clamp(26px, 3vw, 32px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
.page-sub { font-size: clamp(15px, 1.6vw, 17px); color: var(--text-faint); max-width: 46em; margin: 0; }

/* ============================================================
   Buttons (Bootstrap classes restyled)
   ============================================================ */
.btn {
    font-family: var(--sans);
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding: 10px 17px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: transform .18s cubic-bezier(.2,.7,.3,1), background .18s, border-color .18s, box-shadow .18s, color .18s;
}
.btn-sm { font-size: 13px; padding: 6px 12px; border-radius: 8px; }
.btn-lg { font-size: 16px; padding: 13px 22px; }
.btn:disabled, .btn.disabled { opacity: 0.55; }

.btn-primary, .btn-primary:focus {
    background: var(--mks-blue);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 1px 2px rgba(29,183,241,.22), 0 4px 12px -6px rgba(29,183,241,.40);
}
.btn-primary:hover:not(:disabled), .btn-primary:active {
    background: #0ea5d9 !important;
    border-color: transparent !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(29,183,241,.28), 0 6px 16px -6px rgba(29,183,241,.48);
}

.btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .btn-light, .btn-secondary {
    background: #fff;
    color: #18181b;
    border-color: rgba(0,0,0,.12);
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.btn-outline-primary:hover:not(:disabled), .btn-outline-secondary:hover:not(:disabled), .btn-outline-dark:hover:not(:disabled),
.btn-light:hover:not(:disabled), .btn-secondary:hover:not(:disabled) {
    background: #fafafa;
    color: #18181b;
    border-color: rgba(0,0,0,.2);
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.btn-danger { background: var(--danger-fg); border-color: transparent; color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-fg2); border-color: transparent; transform: translateY(-1px); }
.btn-outline-danger { background: #fff; color: var(--danger-fg); border-color: rgba(220, 38, 38, .35); }
.btn-outline-danger:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger-fg2); border-color: rgba(220, 38, 38, .5); }

.btn-link { color: var(--accent); text-decoration: none; padding-inline: 0; }
.btn-link:hover { color: var(--mks-blue); text-decoration: underline; }

.btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft) !important; }

/* ============================================================
   Form fields
   ============================================================ */
.form-label { font-size: 12.5px; color: var(--text-faint); letter-spacing: -0.005em; margin-bottom: 6px; }
.form-control, .form-select {
    font-family: var(--sans);
    font-size: 14.5px;
    color: var(--text);
    background-color: #fff;
    border: 1px solid var(--border-2);
    border-radius: 9px;
    padding: 10px 13px;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:active { box-shadow: none; }
.form-control::placeholder { color: var(--text-ghost); }
.form-control:focus, .form-select:focus {
    border-color: var(--mks-blue-dim);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-text { font-size: 12.5px; color: var(--text-faint); }
.form-check-input:checked { background-color: var(--mks-blue); border-color: var(--mks-blue); }

/* ============================================================
   Cards, badges, alerts, tables
   ============================================================ */
.card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.card.border-danger { border-color: rgba(220, 38, 38, .25) !important; }

.card-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0;
}

.badge {
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.badge.bg-success { background: var(--ok-bg) !important; color: var(--ok-fg); }
.badge.bg-secondary { background: var(--bg-2) !important; color: var(--text-faint); }
.badge.bg-primary, .badge.bg-info { background: var(--info-bg) !important; color: var(--info-fg); }

.alert { border-radius: 12px; border: 1px solid transparent; font-size: 14.5px; padding: 12px 16px; }
.alert-success { background: var(--ok-bg); color: var(--ok-fg); border-color: rgba(22, 101, 52, .12); }
.alert-danger { background: var(--danger-bg); color: var(--danger-fg2); border-color: rgba(220, 38, 38, .15); }
.alert-info { background: var(--info-bg); color: var(--info-fg); border-color: rgba(3, 105, 161, .12); }
.alert-warning { background: var(--warn-bg); color: var(--warn-fg); border-color: rgba(133, 77, 14, .12); }

.table { --bs-table-bg: transparent; color: var(--text); }
.table > thead th {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border-2);
}
.table > tbody td { border-color: var(--border); }
.table > tbody tr:hover > * { background: var(--accent-soft); }

.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.18);
    padding: 6px;
}
.dropdown-item { border-radius: 8px; font-size: 14px; padding: 7px 12px; }
.dropdown-item:active { background: var(--accent-soft); color: var(--text); }

/* ============================================================
   Settings pages: section title + explanation on the left,
   controls on the right, hairline between sections
   ============================================================ */
.settings-card { padding: 0 !important; overflow: hidden; margin-bottom: 24px; }
.settings-section {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 2fr;
    gap: 24px 40px;
    padding: clamp(20px, 2.6vw, 30px);
    border-top: 1px solid var(--border);
}
.settings-section:first-child { border-top: none; }
.settings-intro h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 6px; }
.settings-intro p { font-size: 13.5px; color: var(--text-faint); margin: 0; line-height: 1.5; }
.settings-body { display: grid; gap: 14px; align-content: start; min-width: 0; }
.settings-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.settings-danger .settings-intro h2 { color: var(--danger-fg); }
@media (max-width: 760px) { .settings-section { grid-template-columns: 1fr; } }

.value-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 9px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 14.5px;
    color: var(--text);
    max-width: 100%;
}

.method-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.method-row .method-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok-fg); }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .15); }

.plain-list { margin: 0; padding-left: 18px; color: var(--text-faint); font-size: 14px; display: grid; gap: 4px; }

/* ============================================================
   Sign-in pages: glass card on the grid backdrop
   ============================================================ */
.auth-layout {
    display: flex;
    justify-content: center;
    padding: 6vh 16px 48px;
}
.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--surface-2);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.10), 0 1px 0 rgba(0, 0, 0, 0.03);
    padding: 2.4rem 2rem 2rem;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 2rem;
    width: 44px;
    height: 2px;
    background: linear-gradient(90deg, var(--mks-blue), transparent);
}
.auth-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mks-blue);
    margin: 0 0 0.6rem;
}
.auth-card h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 0.35rem; }
.auth-sub { font-size: 14.5px; color: var(--text-faint); margin: 0 0 1.6rem; }
.auth-card .mb-3 { margin-bottom: 0.9rem !important; }
.auth-card .btn { width: 100%; padding: 11px 16px; }
.auth-card .btn-sm { width: auto; }

.auth-error, .auth-success {
    margin-top: 14px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.45;
}
.auth-error { background: var(--danger-bg); color: var(--danger-fg2); text-align: left; }
.auth-success { background: var(--ok-bg); color: var(--ok-fg); text-align: left; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-ghost);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }

.provider-buttons { display: grid; gap: 10px; }
.provider-button { display: inline-flex !important; align-items: center; justify-content: center; gap: 10px; }

.email-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 13px;
    margin-bottom: 1rem;
    border-radius: 9px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 14.5px;
}
.email-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth-note { font-size: 14px; color: var(--text-dim); line-height: 1.55; margin: 0 0 1.1rem; }

.auth-links {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 6px;
    justify-items: center;
    font-size: 13px;
    color: var(--text-faint);
}
.auth-links .auth-link-row { display: flex; gap: 6px; padding: 0; }
.auth-links .auth-link-row span { color: var(--text-faint); }
.link-button { color: var(--accent); cursor: pointer; text-decoration: none; }
.link-button:hover { color: var(--mks-blue); text-decoration: underline; }

.code-input {
    font-family: var(--mono);
    font-size: 22px !important;
    letter-spacing: 0.45em;
    text-align: center;
    padding: 12px 13px !important;
}
.code-input::placeholder { letter-spacing: 0.45em; color: var(--bg-2); }

/* ============================================================
   Organization member list
   ============================================================ */
.member-list { display: grid; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--border); }
.member-row:first-child { border-top: none; }
.member-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.member-who { flex: 1; min-width: 0; }
.member-name { font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-email { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-role { width: auto; min-width: 110px; padding-top: 5px; padding-bottom: 5px; font-size: 13px; }

/* ============================================================
   Company domains and company accounts
   ============================================================ */
.domain-card { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 14px 16px; display: grid; gap: 10px; }
.domain-card.verified { border-color: rgba(34, 197, 94, .25); }
.domain-head { display: flex; align-items: center; gap: 10px; }
.domain-name { font-weight: 600; font-size: 15px; }
.domain-help { margin: 0; font-size: 13.5px; color: var(--text-faint); }
.dns-record { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--border-2); font-size: 13px; }
.dns-record > div { display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.dns-label { width: 46px; flex-shrink: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.dns-record code { color: var(--text); background: none; padding: 0; word-break: break-all; font-size: 12.5px; user-select: all; }
.company-chip { margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); vertical-align: 2px; }
.member-confirm { display: grid; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--danger-bg); color: var(--danger-fg2); font-size: 13.5px; }


/* ============================================================
   App pages (sidebar shell): header row with an action,
   settings with their own side menu, list toolbars, data tables
   ============================================================ */
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-head-row .btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; }
.page-head-row .btn .material-symbols-outlined { font-size: 19px; }
.narrow-page { max-width: 640px; }
.text-faint { color: var(--text-faint); }

.settings-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; align-items: start; }
.section-nav { position: sticky; top: 0; display: grid; gap: 2px; }
.section-nav-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 0 10px 8px; }
.section-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-dim); font-size: 14px; font-weight: 500; text-decoration: none !important; }
.section-link .material-symbols-outlined { font-size: 18px; color: var(--text-faint); }
.section-link:hover { background: rgba(0, 0, 0, .045); color: var(--text); }
.section-link.active { background: #fff; color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, .04); }
.section-link.active .material-symbols-outlined { color: var(--mks-blue); }
.section-link.danger, .section-link.danger .material-symbols-outlined { color: var(--danger-fg); }
.section-content { min-width: 0; }
.settings-section.stacked { grid-template-columns: 1fr; gap: 16px; }
@media (max-width: 900px) {
    .settings-shell { grid-template-columns: 1fr; gap: 16px; }
    .section-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
    .section-nav-label { display: none; }
}

.list-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.list-toolbar .form-select { padding: 7px 36px 7px 12px; font-size: 14px; min-width: 130px; background-position: right 12px center; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-2); margin-right: auto; }
.segmented button { border: 0; background: transparent; border-radius: 8px; padding: 6px 12px; font-size: 13.5px; font-weight: 500; color: var(--text-faint); display: inline-flex; align-items: center; gap: 6px; }
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.segmented .count { font-size: 12px; color: var(--text-faint); background: rgba(0, 0, 0, .05); border-radius: 999px; padding: 0 7px; }
.search-box { position: relative; width: 260px; max-width: 100%; }
.search-box .material-symbols-outlined { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 19px; color: var(--text-faint); pointer-events: none; }
.search-box .form-control { padding: 7px 12px 7px 36px; font-size: 14px; }

.data-card { padding: 0 !important; overflow: visible; }
.data-table > thead th { padding: 11px 16px; }
.data-table > tbody td { padding: 10px 16px; vertical-align: middle; }
.data-table > tbody tr:last-child td { border-bottom: none; }
.data-table > tbody tr:hover > * { background: rgba(0, 0, 0, .015); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.you-chip, .guest-chip { padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--bg-2); color: var(--text-faint); vertical-align: 2px; }
.you-chip { margin-left: 6px; }
.role-label { font-size: 13.5px; color: var(--text-dim); }
.icon-button { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; color: var(--text-faint); font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
.icon-button:hover:not(:disabled) { background: rgba(0, 0, 0, .06); color: var(--text); }
.icon-button:disabled { opacity: .35; }
.dropdown-item .material-symbols-outlined { font-size: 18px; vertical-align: -4px; margin-right: 6px; color: inherit; opacity: .75; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-faint); }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 48px 24px; text-align: center; color: var(--text-faint); }
.empty-state .material-symbols-outlined { font-size: 34px; color: var(--text-ghost); }
.empty-state p { margin: 0; }
.inline-confirm { display: grid; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--danger-bg); color: var(--danger-fg2); font-size: 13.5px; }

/* ---------- dialog ---------- */
.mks-dialog-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(17, 17, 20, .32); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.mks-dialog { width: 100%; max-width: 480px; background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .2); outline: none; }
.mks-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.mks-dialog-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.mks-dialog.danger .mks-dialog-head h2 { color: var(--danger-fg); }
.mks-dialog-close { border: 0; background: none; color: var(--text-faint); font-size: 22px; border-radius: 8px; }
.mks-dialog-close:hover { background: var(--bg); color: var(--text); }
.mks-dialog-body { padding: 14px 20px 18px; display: grid; gap: 14px; }
.mks-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-alt); border-radius: 0 0 16px 16px; }
.dialog-note { margin: 0; font-size: 14px; color: var(--text-dim); line-height: 1.5; }

/* ---------- overview tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-tile { display: grid; gap: 6px; padding: 18px 20px; border-radius: 14px; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0, 0, 0, .04); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.stat-tile:hover { border-color: var(--accent-line); box-shadow: 0 4px 14px rgba(0, 0, 0, .06); color: var(--text); }
.stat-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); font-weight: 500; }
.stat-label .material-symbols-outlined { font-size: 18px; color: var(--mks-blue); }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.stat-foot { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-card { padding: 18px 20px; display: grid; gap: 4px; }
.setup-card .card-eyebrow { margin-bottom: 6px; }
.setup-step { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.setup-step:hover { background: var(--bg); color: var(--text); }
.setup-step > .material-symbols-outlined:first-child { color: var(--text-ghost); font-size: 22px; }
.setup-step.done > .material-symbols-outlined:first-child { color: #16a34a; }
.setup-step.done strong { text-decoration: line-through; color: var(--text-faint); }
.setup-text { flex: 1; display: grid; font-size: 14px; }
.setup-text span { font-size: 13px; color: var(--text-faint); }
.setup-step .chevron { color: var(--text-ghost); }

/* ---------- apps ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.app-card { display: grid; gap: 16px; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.app-card.inactive { opacity: .7; }
.app-head { display: flex; align-items: center; gap: 12px; }
.app-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #1DB7F1, #0a6f9a); flex-shrink: 0; }
.app-card.inactive .app-icon { background: var(--bg-2); color: var(--text-faint); }
.app-title { display: grid; gap: 2px; min-width: 0; }
.app-name { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.app-status-off { font-size: 13px; color: var(--text-faint); }
.app-seats { display: grid; gap: 6px; }
.app-seats-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-faint); }
.seat-meter { height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.seat-meter span { display: block; height: 100%; border-radius: 999px; background: var(--mks-blue); }
.app-facts { display: grid; gap: 6px; font-size: 13px; color: var(--text-faint); border-top: 1px solid var(--border); padding-top: 12px; }
.app-facts .material-symbols-outlined { font-size: 16px; vertical-align: -3px; margin-right: 4px; }

@media (max-width: 700px) {
    .col-account { display: none; }
    .data-table > thead th, .data-table > tbody td { padding-left: 12px; padding-right: 8px; }
    .data-table .member-role { min-width: 0; padding-right: 30px; background-position: right 8px center; }
    .page-head-row { flex-direction: column; gap: 0; }
    .page-head-row .btn { margin-top: 0; margin-bottom: 20px; }
    .search-box { width: 100%; }
}

/* ---------- personal overview: organizations and hints ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.section-head a { font-size: 13.5px; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.org-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0, 0, 0, .04); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.org-card:hover { border-color: var(--accent-line); box-shadow: 0 4px 14px rgba(0, 0, 0, .06); color: var(--text); }
.org-card.new { border-style: dashed; box-shadow: none; background: transparent; }
.org-avatar { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #1DB7F1, #0a6f9a); }
.org-avatar.new { background: var(--bg-2); color: var(--text-faint); font-size: 20px; font-weight: 400; }
.org-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.org-name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-sub { font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-card .chevron { color: var(--text-ghost); }
.hint-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: 14px; background: var(--info-bg); border: 1px solid rgba(3, 105, 161, .15); margin-bottom: 8px; }
.hint-icon { font-size: 26px; color: var(--info-fg); }
.hint-text { flex: 1; min-width: 220px; display: grid; gap: 2px; font-size: 14px; color: var(--text-dim); }
.hint-text strong { color: var(--text); font-weight: 600; }
.hint-actions { display: flex; gap: 8px; flex-wrap: wrap; }
