:root {
    --bg: #0b1220;
    --bg-soft: #111a2e;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --success: #059669;
    --success-soft: #d1fae5;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --info-soft: #e0f2fe;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    --radius: 16px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: #f4f7fb;
    overflow-x: hidden;
    max-width: 100vw;
}
a {
    color: var(--primary);
    text-decoration: none;
}

main {
    min-height: calc(100vh - 120px);
    max-width: 100%;
    overflow-x: hidden;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0f172a;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    box-sizing: border-box;
    position: relative;
    z-index: 110;
}
.header-nav { margin-left: auto; }

/* Language switcher */
.lang-switch {
    position: relative;
    flex-shrink: 0;
    margin-left: 8px;
    z-index: 120;
}
.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}
.lang-switch-btn:hover,
.lang-switch.is-open .lang-switch-btn {
    background: rgba(255,255,255,0.16);
}
.lang-flag {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
    display: block;
}
.lang-switch-btn .lang-name { display: none; }
.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    padding: 6px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.38);
}
.lang-switch.is-open .lang-menu { display: block; }
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
}
.lang-option:hover,
.lang-option.is-active { background: rgba(37,99,235,0.35); }
.lang-option .lang-native { font-weight: 650; }
.lang-option .lang-english {
    margin-left: auto;
    color: rgba(255,255,255,0.55);
    font-size: 0.78rem;
}
.lang-switch-float {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 200;
}
.login-page .lang-switch-float .lang-switch-btn {
    background: #0f172a;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    min-width: 0;
    flex-shrink: 1;
    text-decoration: none;
}

.brand-logo {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-mark.large {
    width: 48px;
    height: 48px;
    font-size: 1rem;
    margin-bottom: 12px;
}

.nav-toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.nav-toggle-bars {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.2s ease, top 0.2s ease;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.app-header.nav-open .nav-toggle-bars { background: transparent; }
.app-header.nav-open .nav-toggle-bars::before {
    top: 0;
    transform: rotate(45deg);
}
.app-header.nav-open .nav-toggle-bars::after {
    top: 0;
    transform: rotate(-45deg);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    max-width: 100%;
    min-width: 0;
}

.nav-overlay {
    display: none;
}

.user-chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* Phone only: hamburger. Laptop/desktop keep a normal top tab bar. */
@media (max-width: 768px) {
    .header-nav { margin-left: 0; }
    .lang-switch { margin-left: auto; }
    .nav-toggle {
        display: inline-flex !important;
        margin-left: 8px;
    }

    .brand-text {
        font-size: 0.85rem;
        max-width: 42vw;
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 90;
    }

    .app-header.nav-open .nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .header-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 4px;
        max-height: min(70vh, calc(100dvh - 72px));
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        background: #0f172a;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
        padding: 10px 12px 16px;
        z-index: 110;
    }

    .app-header.nav-open .header-nav {
        display: flex;
    }

    .header-nav .nav-link {
        display: block;
        width: 100%;
        padding: 14px 12px;
        border-radius: 10px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .header-nav .user-chip {
        display: block;
        width: 100%;
        max-width: none;
        text-align: center;
        margin: 8px 0 4px;
        box-sizing: border-box;
    }

    .header-nav .inline-form {
        display: block;
        width: 100%;
        margin-top: 6px;
    }

    .header-nav .inline-form .btn {
        width: 100%;
        justify-content: center;
    }

    body.nav-open {
        overflow: hidden;
    }
}

/* Laptop / desktop: always a normal top tab bar, never hamburger */
@media (min-width: 769px) {
    .nav-toggle { display: none !important; }
    .nav-overlay { display: none !important; }
    .header-inner {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .header-nav {
        display: flex !important;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 8px;
        margin-left: auto;
        max-height: none;
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
    }
    .header-nav .nav-link {
        display: inline-flex;
        width: auto;
        white-space: nowrap;
        padding: 8px 12px;
        border-bottom: 0;
        border-radius: 8px;
    }
    .header-nav .user-chip {
        display: inline-block;
        width: auto;
        margin: 0;
    }
    .header-nav .inline-form {
        display: inline;
        width: auto;
        margin: 0;
    }
    .header-nav .inline-form .btn {
        width: auto;
    }
    body.nav-open { overflow: auto; }
}

.app-footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 24px 16px 32px;
}

/* Buttons */
.btn {
    appearance: none;
    border: none;
    border-radius: 10px;
    padding: 11px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn:disabled,
.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-block {
    width: 100%;
}

/* Login page */
.login-page {
    background: var(--bg);
}

.login-page main {
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

.login-hero {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.35), transparent 40%),
        radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.28), transparent 35%),
        linear-gradient(160deg, #0b1220 0%, #111a2e 55%, #0f172a 100%);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    padding: 48px;
}

.hero-content {
    max-width: 460px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(147, 197, 253, 0.25);
    color: #bfdbfe;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.login-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1.15;
    color: #fff;
}

.login-hero p {
    margin: 0 0 22px;
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.6;
}

.hero-points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.hero-points li {
    position: relative;
    padding-left: 28px;
    color: #cbd5e1;
}

.hero-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 5px var(--primary);
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 24px 32px;
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--panel);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    padding: 32px 28px 24px;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.login-card-header {
    text-align: center;
    margin-bottom: 22px;
}

.login-card-header h2 {
    margin: 0 0 6px;
    font-size: 1.55rem;
}

.login-card-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.login-form {
    display: grid;
    gap: 14px;
}

.form-group {
    display: grid;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.98rem;
    outline: none;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 68px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 8px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 4px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
}

.help-link {
    font-size: 0.82rem;
    color: var(--muted);
}

.field-error {
    color: var(--danger);
    font-size: 0.82rem;
}

.alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.alert-error,
.validation-summary-errors {
    background: var(--danger-soft);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-error ul,
.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

.alert-success {
    background: var(--success-soft);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-info {
    background: var(--info-soft);
    color: #075985;
    border: 1px solid #bae6fd;
}

.demo-box {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    font-size: 0.84rem;
    color: #475569;
}

.demo-box strong {
    display: block;
    margin-bottom: 8px;
    color: #334155;
}

.demo-box table {
    width: 100%;
    border-collapse: collapse;
}

.demo-box th,
.demo-box td {
    text-align: left;
    padding: 6px 4px;
    border-bottom: 1px solid #f1f5f9;
}

.demo-box th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Dashboard */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px 40px;
    width: 100%;
    box-sizing: border-box;
}

/* Owner/Admin manage users — use full browser width, no forced right overflow */
.dashboard-admin {
    max-width: 100%;
    width: 100%;
    padding: 20px 16px 40px;
    overflow-x: hidden;
}
.admin-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 100%;
}
.admin-add-panel {
    width: 100%;
    max-width: 100%;
}
.admin-form-wide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px 16px;
    align-items: end;
}
.admin-form-wide .form-group {
    min-width: 0;
}
/* Full-width fields (company name / address need room to type) */
.admin-form-wide .form-group-full {
    grid-column: 1 / -1;
    min-width: 0;
}
.admin-form-wide .form-group-full .form-control {
    width: 100%;
    font-size: 1.05rem;
    padding: 14px 16px;
}
.admin-form-wide .form-control-company-name {
    min-height: 48px;
}
.admin-form-wide .form-control-company-address {
    min-height: 140px;
    resize: vertical;
    line-height: 1.45;
}
.admin-form-wide .form-row-2 {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
}
.admin-form-wide .btn-primary {
    grid-column: 1 / -1;
    justify-self: start;
    min-width: 180px;
    width: auto;
    max-width: 100%;
}
.admin-list-panel {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.admin-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table-admin {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}
.data-table-admin th,
.data-table-admin td {
    padding: 8px 6px;
    font-size: 0.88rem;
    vertical-align: top;
    word-break: break-word;
}
.data-table-admin .login-edit-form {
    max-width: 100%;
    min-width: 0;
    display: grid;
    gap: 6px;
}
.data-table-admin .balance-form,
.data-table-admin .expiry-form,
.data-table-admin .reset-form {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
}
.data-table-admin .balance-input,
.data-table-admin .expiry-input,
.data-table-admin .reset-input {
    width: 100%;
    max-width: 140px;
    min-width: 0;
}
.data-table-admin .action-stack {
    max-width: 160px;
}
.account-badges-mobile {
    display: none;
}

/* Account list — mobile card layout (Owner / Admin) */
@media (max-width: 900px) {
    .dashboard-admin {
        padding: 14px 12px 32px;
    }

    .dashboard-admin .dashboard-header h1 {
        font-size: 1.4rem;
    }

    .dashboard-admin .dashboard-header .muted {
        font-size: 0.9rem;
    }

    .admin-form-wide {
        grid-template-columns: 1fr;
    }

    .admin-form-wide .form-row-2 {
        grid-template-columns: 1fr;
    }

    .admin-form-wide .btn-primary {
        width: 100%;
        max-width: none;
        justify-self: stretch;
    }

    .admin-list-panel {
        overflow: visible;
        padding: 14px 12px 16px;
    }

    .admin-list-panel .panel-header {
        margin-bottom: 10px;
    }

    .admin-table-wrap {
        overflow: visible;
    }

    .account-list-table,
    .account-list-table tbody,
    .account-list-table tr,
    .account-list-table td {
        display: block;
        width: 100%;
    }

    .account-list-table thead {
        display: none;
    }

    .account-list-table tbody {
        display: grid;
        gap: 12px;
    }

    .account-list-table tr.account-row {
        background: #f8fafc;
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 12px 12px 10px;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
        box-sizing: border-box;
    }

    .account-list-table td {
        border-bottom: 1px solid #eef2f7;
        padding: 10px 0;
        font-size: 0.92rem;
    }

    .account-list-table td:last-child {
        border-bottom: none;
        padding-bottom: 2px;
    }

    .account-list-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted);
        margin-bottom: 6px;
    }

    .account-list-table td[data-label="Login"]::before {
        display: none;
    }

    .account-card-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }

    .account-id-block {
        min-width: 0;
        flex: 1;
    }

    .account-id-link code {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--primary-dark);
    }

    .account-email {
        word-break: break-all;
    }

    .account-badges-mobile {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
        flex-shrink: 0;
    }

    .account-list-table .account-cell-role,
    .account-list-table .desktop-only-email {
        display: none;
    }

    .account-list-table .account-cell-status .badge:first-child {
        display: none;
    }

    .data-table-admin .balance-form,
    .data-table-admin .expiry-form,
    .data-table-admin .reset-form {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        width: 100%;
    }

    .data-table-admin .balance-input,
    .data-table-admin .expiry-input,
    .data-table-admin .reset-input {
        flex: 1 1 140px;
        max-width: none;
        min-width: 0;
    }

    .data-table-admin .action-stack {
        max-width: none;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .data-table-admin .action-stack .btn,
    .data-table-admin .action-stack .inline-form,
    .data-table-admin .action-stack .inline-form .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .data-table-admin .action-stack .inline-form {
        display: flex;
    }

    .data-table-admin .action-stack .inline-form .btn {
        width: 100%;
    }

    .status-switch {
        margin-top: 8px;
    }

    .status-switch .btn,
    .balance-block .btn-paid-sm,
    .login-edit-form .btn {
        width: 100%;
        justify-content: center;
    }

    .login-edit-form .reset-input {
        max-width: none !important;
        width: 100%;
    }

    .balance-block {
        display: grid;
        gap: 8px;
        width: 100%;
    }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-header h1 {
    margin: 0 0 6px;
    font-size: 1.8rem;
}

.muted {
    color: var(--muted);
    margin: 0;
}

.status-pill {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--success-soft);
    color: #047857;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.stat-card.highlight {
    background: linear-gradient(145deg, #eff6ff, #fff);
    border-color: #bfdbfe;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.stat-card strong {
    font-size: 1.2rem;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.panel h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.panel-header {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.panel-header h2 {
    margin: 0;
}
.panel-toggle {
    margin-left: auto;
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 650;
    font-size: 0.88rem;
    cursor: pointer;
}
.panel-toggle:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}
html.dash-collapse .dashboard > .panel.service-dash:not(.is-open) > :not(.panel-header) {
    display: none !important;
}
html.dash-collapse .dashboard > .panel.service-dash:not(.is-open) .panel-header {
    margin-bottom: 0;
}

.pay-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(120deg, #0f172a, #1e3a8a);
    color: #fff;
    border: none;
}

.pay-panel .muted {
    color: #cbd5e1;
}

.pay-panel .btn-primary {
    background: #fff;
    color: #1d4ed8;
}

.pay-panel .btn-primary:hover:not(:disabled) {
    background: #e2e8f0;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.94rem;
}

.data-table th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--success-soft);
    color: #047857;
    font-size: 0.8rem;
    font-weight: 700;
}

@media (max-width: 960px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero {
        padding: 36px 24px 20px;
        min-height: auto;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pay-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-header {
        flex-direction: column;
    }

    .login-card {
        padding: 24px 18px;
    }
}

/* Admin + nav extras */
.nav-link {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-ghost-dark {
    background: #fff;
    color: #0f172a;
    border: 1px solid var(--border);
}
.btn-ghost-dark:hover { background: #f1f5f9; }
.admin-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    align-items: start;
}
.admin-form { display: grid; gap: 12px; }
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.btn-danger-sm, .btn-success-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.btn-danger-sm { background: #fee2e2; color: #b91c1c; }
.btn-danger-sm:hover { background: #fecaca; }
.btn-success-sm { background: #d1fae5; color: #047857; }
.btn-success-sm:hover { background: #a7f3d0; }
.badge-ok { background: var(--success-soft); color: #047857; }
.badge-trial { background: #e0e7ff; color: #3730a3; }
.badge-off { background: #f1f5f9; color: #64748b; }
.trial-option {
    padding: 10px 12px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
}
.storage-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.storage-plan-grid .storage-card {
    min-height: 72px;
}
.platform-card[title] {
    cursor: help;
}
.xcsm-track-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px 12px;
    margin-top: 8px;
}
.xcsm-track-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.92rem;
}
.xcsm-track-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}
.xcsm-track-item input {
    width: auto;
    margin: 0;
}
.muted.small, .small { font-size: 0.8rem; }
@media (max-width: 960px) {
    .admin-grid { grid-template-columns: 1fr; }
    .form-row-2 { grid-template-columns: 1fr; }
}

.password-panel { max-width: 480px; }
.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Xdata branding */
.login-logo {
    display: block;
    width: auto;
    max-width: 200px;
    height: 48px;
    object-fit: contain;
    margin: 0 auto 14px;
}
.brand-logo {
    height: 28px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    display: block;
}
.brand {
    gap: 10px;
}

.balance-form {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 150px;
}
.balance-input {
    width: 100px;
    padding: 6px 8px;
    font-size: 0.9rem;
}
.action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.btn-delete-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: #7f1d1d;
    color: #fff;
}
.btn-delete-sm:hover { background: #991b1b; }

.balance-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}
.reset-form {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 170px;
}
.reset-input {
    width: 110px;
    padding: 6px 8px;
    font-size: 0.85rem;
}
.btn-paid-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: #1d4ed8;
    color: #fff;
}
.btn-paid-sm:hover { background: #1e40af; }
.btn-reset-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
}
.btn-reset-sm:hover { background: #fde68a; }

.bank-panel {
    border: 1px solid #bfdbfe;
    background: linear-gradient(145deg, #eff6ff, #fff);
}
.bank-details {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}
.bank-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px;
    align-items: baseline;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.bank-label {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.account-number {
    letter-spacing: 0.04em;
    font-size: 1.05rem;
    color: #1d4ed8;
}
.proof-upload-form {
    display: grid;
    gap: 12px;
    max-width: 720px;
    position: relative;
}
.proof-upload-form.is-busy {
    pointer-events: none;
}
.proof-upload-form.is-busy .btn-primary {
    opacity: 0.75;
}
.proof-wait {
    margin: 4px 0 0;
    padding: 14px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
}
.proof-wait.is-checking {
    display: block;
}
.proof-wait-anim {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
}
.proof-wait-host {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}
.proof-wait.is-checking .mail-dns-wire {
    background: #dbeafe;
}
.proof-wait.is-checking .mail-dns-wire i {
    width: 40%;
    background: linear-gradient(90deg, #2563eb, #93c5fd, #2563eb);
    background-size: 200% 100%;
    animation: mail-dns-slide 0.9s linear infinite;
}
.proof-wait-title {
    margin: 0 0 4px;
    font-weight: 700;
    color: #1e3a8a;
}
.proof-hint {
    margin: 0 0 4px;
    padding: 12px 14px;
    border: 1px solid var(--primary-soft, #dbeafe);
    background: var(--info-soft, #e0f2fe);
    border-radius: 12px;
    color: var(--text, #0f172a);
    font-size: 0.92rem;
    line-height: 1.45;
}
.proof-hint p { margin: 0 0 8px; }
.proof-hint ul { margin: 0; padding-left: 18px; }
.proof-hint li { margin: 0 0 6px; }
.badge-pending {
    background: #fef3c7;
    color: #92400e;
}
.badge-reject {
    background: var(--danger-soft);
    color: #b91c1c;
}
@media (max-width: 640px) {
    .bank-row { grid-template-columns: 1fr; }
}

.badge-suspend {
    background: #ffedd5;
    color: #c2410c;
}
.status-switch {
    margin-top: 6px;
}
.btn-suspend-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: #ffedd5;
    color: #c2410c;
}
.btn-suspend-sm:hover { background: #fed7aa; }

.alert-suspend {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.alert-suspend p { margin: 8px 0; line-height: 1.5; }
.alert-suspend ul { margin: 8px 0 0 18px; padding: 0; }
.alert-suspend li { margin: 4px 0; }
.status-pill.status-suspended {
    background: #ffedd5;
    color: #c2410c;
}

.register-footer {
    text-align: center;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}
.register-footer a {
    font-weight: 600;
}

.expiry-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 150px;
}
.expiry-input {
    width: 140px;
    padding: 6px 8px;
    font-size: 0.85rem;
}
.expiry-form-wide {
    max-width: 360px;
    flex-direction: column;
    align-items: stretch;
}
.expiry-form-wide .form-group { width: 100%; }

.resend-box {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.resend-form {
    display: grid;
    gap: 8px;
}

.add-service-box {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.add-service-box h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}
.add-service-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    max-width: 640px;
}
.add-service-form .form-control {
    flex: 1 1 260px;
}

.admin-add-service {
    margin: 0 0 18px;
    padding: 14px 0 16px;
    border-top: none;
    border-bottom: 1px dashed var(--border);
}
.service-edit-row {
    vertical-align: top;
    background: #fafbfc;
}
.service-edit-form {
    margin-bottom: 8px;
}
.service-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px 12px;
    align-items: end;
    margin-bottom: 6px;
}
.service-remarks-field {
    grid-column: span 2;
    min-width: 200px;
}
@media (max-width: 700px) {
    .service-remarks-field {
        grid-column: span 1;
    }
}
.service-edit-grid label {
    display: block;
    margin-bottom: 4px;
}
.reminder-field {
    grid-column: span 2;
    min-width: 220px;
}
.reminder-days {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    padding: 6px 0 2px;
}
.reminder-chk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
}
@media (max-width: 700px) {
    .reminder-field {
        grid-column: span 1;
    }
}
.service-edit-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 2px;
}
.service-delete-form {
    margin-top: 4px;
}

/* Support tickets */
.ticket-create-form,
.ticket-reply-form {
    display: grid;
    gap: 12px;
    max-width: 640px;
}
.ticket-create-form .form-row,
.ticket-reply-form label {
    display: grid;
    gap: 6px;
}
.ticket-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
}
.ticket-filters .form-control {
    min-width: 160px;
}
.ticket-thread {
    display: grid;
    gap: 12px;
}
.ticket-msg {
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border, #e5e7eb);
    background: #fff;
}
.ticket-msg-admin {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.ticket-msg-user {
    background: #f8fafc;
}
.ticket-msg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.ticket-msg-body {
    white-space: pre-wrap;
    line-height: 1.5;
    word-break: break-word;
}
.ticket-admin-bar {
    padding: 12px 16px;
}
.status-switch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.badge-tech {
    background: #dbeafe;
    color: #1d4ed8;
}
.badge-billing {
    background: #fef3c7;
    color: #b45309;
}
.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.shared-upload-form {
    display: grid;
    gap: 12px;
    max-width: 720px;
    margin-bottom: 8px;
}
/* XCSM / Cloud dashboard actions */
.xcsm-actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
.xcsm-actions-cell .btn-primary {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
}

/* Cloud Server setup — plan cards */
.cloud-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 12px 0 8px;
}
.cloud-plan-card {
    position: relative;
    display: block;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 16px 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.cloud-plan-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}
.cloud-plan-card.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb;
}
.cloud-plan-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.cloud-plan-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}
.cloud-plan-price {
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}
.cloud-plan-specs {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.45;
}
.cloud-plan-specs li {
    margin: 2px 0;
}

/* Cloud Server dashboard (view-only) */
.cloud-view-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px 18px;
    margin-top: 12px;
    background: #fafbfc;
}
.cloud-view-card + .cloud-view-card {
    margin-top: 16px;
}
.cloud-view-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.cloud-view-header strong {
    margin-right: 8px;
}
.cloud-view-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.cloud-view-block {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
}
.cloud-view-block h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #0f172a;
}
.cloud-dl {
    margin: 0;
}
.cloud-dl > div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px 10px;
    padding: 4px 0;
    border-bottom: 1px dashed #f1f5f9;
    font-size: 0.9rem;
}
.cloud-dl > div:last-child {
    border-bottom: none;
}
.cloud-dl dt {
    margin: 0;
    color: #64748b;
    font-weight: 500;
}
.cloud-dl dd {
    margin: 0;
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}
.cloud-dl dd.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 500;
}
/* Mail System setup + administrator */
.mail-feature-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    max-width: 480px;
}
.mail-unit-price {
    margin: 8px 0 0;
    font-size: 1.02rem;
}
.mail-hover-hint {
    margin-top: 6px;
}
.xcsm-setup-card [hidden] {
    display: none !important;
}
.mail-domain-result {
    margin: 10px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: #0f172a;
}
.mail-dns-guide {
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 12px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.mail-dns-guide p {
    margin: 0 0 10px;
    color: #0f172a;
}
.mail-dns-guide .data-table {
    background: #fff;
    color: #0f172a;
    font-size: 0.95rem;
}
.mail-dns-guide .data-table td,
.mail-dns-guide .data-table th {
    color: #0f172a;
    font-family: inherit;
}
.mail-mig-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 10px 0;
}
.mail-mgmt-card {
    position: relative;
}
.mail-mgmt-card[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(100% + 8px);
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.8rem;
    line-height: 1.35;
    padding: 8px 10px;
    border-radius: 8px;
    z-index: 5;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .25);
    pointer-events: none;
}
.mail-summary-row {
    margin-bottom: 12px;
}
.mail-logo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 0 0 14px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.mail-webmail-logo {
    max-height: 56px;
    max-width: 180px;
    object-fit: contain;
    background: #fff;
}
.mail-logo-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.mail-dns-box {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}
.mail-dns-anim {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
}
.mail-dns-host {
    font-weight: 700;
    color: #0f172a;
    word-break: break-all;
}
.mail-dns-wire {
    flex: 1;
    height: 8px;
    min-width: 64px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
}
.mail-dns-wire i {
    display: block;
    height: 100%;
    width: 36%;
    border-radius: 99px;
    background: #94a3b8;
}
.mail-dns-box.is-checking .mail-dns-wire i {
    width: 40%;
    background: linear-gradient(90deg, #2563eb, #93c5fd, #2563eb);
    background-size: 200% 100%;
    animation: mail-dns-slide 0.9s linear infinite;
}
.mail-dns-box.is-ok .mail-dns-wire { background: #bbf7d0; }
.mail-dns-box.is-ok .mail-dns-wire i {
    width: 100%;
    background: #059669;
    animation: none;
}
.mail-dns-box.is-bad .mail-dns-wire { background: #fecaca; }
.mail-dns-box.is-bad .mail-dns-wire i {
    width: 100%;
    background: #dc2626;
    animation: none;
}
@keyframes mail-dns-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(280%); }
}
.mail-dns-result { margin: 0 0 4px; }
.mail-dns-detail { margin: 0; }
.mail-accounts-table {
    width: 100%;
    table-layout: auto;
    white-space: nowrap;
}
.mail-accounts-table th,
.mail-accounts-table td {
    vertical-align: middle;
    padding: 6px 8px;
    white-space: nowrap;
}
.mail-accounts-table input.form-control {
    min-width: 0;
    width: 150px;
    font-size: 0.85rem;
    padding: 6px 8px;
    height: 34px;
}
.mail-accounts-table .mail-name-input { width: 120px; }
.mail-accounts-table .mail-email-input { width: 200px; }
.mail-acc-pw,
.mail-acc-reset,
.mail-acc-status {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}
.mail-acc-reset { margin: 0; }
.mail-pw-now { width: 120px !important; }
.mail-pw-new { width: 132px !important; }
.mail-accounts-table .btn,
.mail-accounts-table .btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    height: 34px;
    white-space: nowrap;
    flex-shrink: 0;
}
.mail-acc-usage {
    min-width: 140px;
    max-width: 220px;
}
.mail-acc-quota {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.mail-acc-quota .mail-quota-gb {
    width: 72px !important;
    min-width: 72px !important;
}
.mail-acc-quota .mail-quota-gb.is-off {
    opacity: 0.45;
}
.mail-quota-unlim {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 0.8rem;
    color: #475569;
    white-space: nowrap;
}
.mail-quota {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.mail-quota-head {
    font-size: 0.8rem;
    font-weight: 650;
    margin: 0;
    flex-shrink: 0;
}
.mail-quota .mail-mig-bar {
    flex: 1;
    min-width: 64px;
    height: 8px;
    margin: 0;
}
.mail-mig-inline {
    min-width: 140px;
}
.mail-mig-inline .mail-mig-job-head,
.mail-mig-inline .mail-mig-msg { margin: 0; font-size: 0.75rem; }
.table-wrap:has(.mail-accounts-table) {
    overflow-x: auto;
}
.mail-outlook-row td {
    white-space: normal;
    background: #f8fafc;
    border-top: 0;
    padding: 0 8px 12px;
}
.mail-outlook-imap {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    max-width: 640px;
}
.mail-outlook-imap-kicker {
    margin: 0 0 4px;
    font-weight: 750;
    font-size: 0.92rem;
    color: #0f172a;
}
.mail-outlook-imap-warn {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: #9a3412;
    font-weight: 650;
}
.mail-outlook-imap-dl {
    margin: 0;
    display: grid;
    gap: 4px 12px;
}
.mail-outlook-imap-dl > div {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 6px 10px;
    align-items: baseline;
}
.mail-outlook-imap-dl dt {
    margin: 0;
    color: #64748b;
    font-weight: 650;
    font-size: 0.8rem;
}
.mail-outlook-imap-dl dd {
    margin: 0;
    font-size: 0.88rem;
    color: #0f172a;
}
.mail-outlook-imap-dl code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86rem;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
}
.mail-outlook-imap .muted {
    margin: 8px 0 0;
}
@media (max-width: 640px) {
    .mail-outlook-imap-dl > div {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
.row-pending-mail {
    background: #fffbeb;
}
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88rem;
}

/* Colocation billing period cards */
.billing-period-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 8px;
}
.billing-period-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.billing-period-card p,
.billing-period-card strong {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.billing-period-card:hover {
    border-color: #93c5fd;
}
.billing-period-card.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb;
}
.billing-period-radio {
    margin-top: 4px;
}
.billing-period-card strong {
    display: block;
    margin-bottom: 2px;
}
.billing-period-card.mail-kind-card,
.billing-period-card.mail-reg-card,
.billing-period-card.mail-mig-card {
    flex-direction: column;
    gap: 6px;
}
.billing-period-card.mail-kind-card p,
.billing-period-card.mail-reg-card p,
.billing-period-card.mail-mig-card p {
    margin: 0;
}
.billing-total {
    margin: 8px 0 0;
    font-size: 0.98rem;
}
.mail-mig-box {
    margin: 12px 0 16px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}
.mail-mig-box h3,
.mail-mig-box > p strong {
    margin: 0 0 8px;
    font-size: 1.05rem;
}
.mail-mig-summary { margin: 0 0 12px; }
.mail-mig-job {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.mail-mig-job:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.mail-mig-job-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 6px;
}
.mail-mig-email { font-weight: 600; word-break: break-all; }
.mail-mig-label { font-size: 0.88rem; color: #64748b; white-space: nowrap; }
.mail-mig-job.is-done .mail-mig-label { color: #059669; font-weight: 700; }
.mail-mig-job.is-error .mail-mig-label { color: #dc2626; font-weight: 700; }
.mail-mig-bar {
    height: 10px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
}
.mail-mig-bar i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
    background-size: 200% 100%;
    width: 0;
    transition: width .4s ease;
}
.mail-mig-job.is-running .mail-mig-bar i {
    animation: mail-mig-slide 1.2s linear infinite;
}
.mail-mig-job.is-done .mail-mig-bar i {
    background: #059669;
    animation: none;
}
.mail-mig-job.is-error .mail-mig-bar i {
    background: #dc2626;
    animation: none;
}
@keyframes mail-mig-slide {
    0% { background-position: 0 0; }
    100% { background-position: -200% 0; }
}
.mail-mig-msg { margin-top: 6px; font-size: 0.85rem; color: #64748b; }
.mail-mig-empty { margin: 0; color: #64748b; }
.mail-acc-live { margin: 8px 0 4px; }
.mail-mig-inline { margin: 0; padding: 0; border: 0; }
.mail-quota-bar i {
    background: #059669;
    animation: none;
}
.mail-quota-bar.is-hot i { background: #d97706; }
.xdc-drive-meter {
    margin: 12px 0 4px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.xdc-drive-meter-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.xdc-drive-meter-head strong { font-size: 0.95rem; }
.xdc-drive-meter-label { font-size: 0.9rem; color: #334155; font-variant-numeric: tabular-nums; }
.xdc-drive-meter-bar {
    height: 16px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
}
.xdc-drive-meter-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #0b57d0, #60a5fa, #0b57d0);
    background-size: 200% 100%;
    transition: width 1.15s cubic-bezier(.22, .9, .28, 1);
    animation: xdc-drive-shine 1.3s linear infinite;
}
.xdc-drive-meter.is-ready .xdc-drive-meter-bar i {
    animation: none;
    background: #059669;
}
.xdc-drive-meter.is-hot .xdc-drive-meter-bar i {
    animation: none;
    background: #d97706;
}
.xdc-drive-meter.is-full .xdc-drive-meter-bar i {
    animation: none;
    background: #dc2626;
}
.xdc-drive-meter.is-sub {
    margin: 0;
    padding: 8px 10px;
    min-width: 170px;
}
.xdc-drive-meter.is-sub .xdc-drive-meter-head { margin-bottom: 6px; }
.xdc-drive-meter.is-sub .xdc-drive-meter-label { font-size: 0.8rem; }
.xdc-drive-meter.is-sub .xdc-drive-meter-bar { height: 10px; }
.xdc-drive-meter.is-stack .xdc-drive-meter-bar {
    display: flex;
    height: 28px;
    background: #e2e8f0;
}
.xdc-drive-stack b {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 0;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
    transition: width 0.95s cubic-bezier(.22, .9, .28, 1);
}
.xdc-drive-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
}
.xdc-drive-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #334155;
}
.xdc-drive-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: #e2e8f0;
    flex: 0 0 auto;
}
.xdc-drive-legend span.is-empty { color: #64748b; }
@keyframes xdc-drive-shine {
    0% { background-position: 0 0; }
    100% { background-position: -200% 0; }
}

.mail-storage-total {
    margin: 10px 0 4px;
    padding: 10px 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #065f46;
}

.mail-admin-extras {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.mail-x-block {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px 18px;
    border: 1px solid #1e293b;
}
.mail-x-block h3,
.mail-x-block h4 {
    margin: 0 0 4px;
    color: #f8fafc;
}
.mail-x-block .muted,
.mail-x-block .muted.small {
    color: #94a3b8;
}
.mail-x-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.mail-mon-ranges {
    display: flex;
    gap: 6px;
    background: #1e293b;
    border-radius: 999px;
    padding: 3px;
}
.mail-range {
    border: 0;
    background: transparent;
    color: #cbd5e1;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
}
.mail-range.is-on {
    background: #334155;
    color: #fff;
}
.mail-mon-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.mail-mon-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px 14px 10px;
    min-height: 180px;
}
.mail-mon-card h4 {
    font-size: 0.95rem;
    font-weight: 650;
}
.mail-mon-total {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 4px 0 6px;
}
.mail-mon-chart { min-height: 90px; }
.mail-mon-legend {
    font-size: 0.78rem;
    color: #38bdf8;
    margin-top: 4px;
}
.mail-mon-empty {
    border: 1px dashed #475569;
    border-radius: 10px;
    color: #94a3b8;
    padding: 18px 12px;
    text-align: center;
    font-size: 0.88rem;
    margin-top: 18px;
}
.mail-spark { width: 100%; height: 104px; display: block; }
.mail-spark-t { fill: #64748b; font-size: 10px; }
.mail-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
    color: #e2e8f0;
    cursor: pointer;
    user-select: none;
}
.mail-switch input {
    appearance: none;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #475569;
    position: relative;
    cursor: pointer;
    border: 0;
}
.mail-switch input:checked { background: #2563eb; }
.mail-switch input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left .15s;
}
.mail-switch input:checked::after { left: 21px; }
.mail-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.mail-filter-add {
    display: flex;
    gap: 8px;
    margin: 8px 0 10px;
}
.mail-filter-add .form-control { flex: 1; }
.mail-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mail-filter-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #334155;
}
.mail-filter-list code { color: #e2e8f0; }
.mail-ret-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 14px 16px;
}
.mail-ret-row {
    display: grid;
    grid-template-columns: 140px minmax(160px, 1fr) auto 90px auto;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
}
.mail-ret-row label { font-weight: 650; color: #f8fafc; }
.mail-ret-days { max-width: 90px; text-align: center; }
.mail-x-block .form-control,
.mail-x-block select.form-control,
.mail-x-block textarea.form-control {
    background: #0f172a;
    color: #f8fafc;
    border-color: #475569;
}
.mail-group-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.mail-g-email-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mail-g-suffix { color: #94a3b8; white-space: nowrap; }
.mail-g-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}
.mail-g-mem { color: #e2e8f0; }
.mail-g-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mail-group-send {
    margin-top: 14px;
    background: #1e293b;
    border-radius: 12px;
    padding: 12px 14px;
}
.mail-group-send textarea { margin-top: 8px; }
.mail-group-table { background: #1e293b; color: #e2e8f0; }
.mail-group-table th,
.mail-group-table td { color: #e2e8f0; }
@media (max-width: 900px) {
    .mail-mon-grid,
    .mail-filter-grid,
    .mail-group-fields { grid-template-columns: 1fr; }
    .mail-ret-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}
.colo-plan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) {
    .colo-plan-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 900px) {
    .cloud-plan-grid {
        grid-template-columns: 1fr;
    }
    .cloud-view-grid {
        grid-template-columns: 1fr;
    }
    .billing-period-grid {
        grid-template-columns: 1fr;
    }
}

/* XCSM setup / customize — full usable width on laptop browsers */
body.xcsm-page {
    background: #f4f7fb;
    overflow-x: hidden;
}
.xcsm-page-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    width: 100%;
    box-sizing: border-box;
}
.xcsm-setup-card {
    width: 100%;
    max-width: none;
    padding: 28px 32px 36px;
    overflow: visible;
}
.xcsm-form {
    display: grid;
    gap: 8px;
    width: 100%;
    max-width: none;
}
.xcsm-section {
    margin: 8px 0 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.xcsm-section:last-of-type {
    border-bottom: none;
}
.xcsm-section-title {
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}
.xcsm-subsection-title {
    margin: 16px 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}
.xcsm-info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 14px;
}
.xcsm-whatsapp-box {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.xcsm-beta-box {
    background: #fff7ed;
    border-color: #fdba74;
}
.xcsm-price-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #334155;
    font-size: 0.92rem;
}
.xcsm-price-list li { margin-bottom: 4px; }
.xcsm-price-summary {
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 16px;
    display: grid;
    gap: 8px;
}
.xcsm-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: #334155;
}
.xcsm-price-total {
    border-top: 1px dashed #cbd5e1;
    padding-top: 10px;
    margin-top: 2px;
    font-size: 1.02rem;
}
.xcsm-price-total strong {
    color: #1d4ed8;
    font-size: 1.08rem;
}
.xcsm-final-summary {
    margin-top: 8px;
    border: 2px solid #bfdbfe;
    background: #f8fbff;
}
#xcsmEmailSettings {
    margin-top: 4px;
}
.xcsm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}
.mail-local-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.mail-local-wrap .mig-local {
    flex: 1;
    min-width: 0;
}
.mail-local-suffix {
    flex: 0 0 auto;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xcsm-extra-owner {
    margin: 10px 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}
.xcsm-input {
    min-height: 48px;
    font-size: 1rem !important;
    padding: 12px 14px !important;
    width: 100% !important;
    max-width: 100% !important;
}
.xcsm-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.45;
}
.xcsm-form select.xcsm-input {
    cursor: pointer;
    appearance: auto;
}
.xcsm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
}
.xcsm-actions .xcsm-submit {
    min-width: 220px;
    min-height: 48px;
    font-size: 1.02rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.xcsm-submit {
    min-width: 220px;
    min-height: 48px;
    font-size: 1.02rem;
    font-weight: 700;
}
.xcsm-cancel {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
}
@media (max-width: 800px) {
    .xcsm-grid-2 {
        grid-template-columns: 1fr;
    }
    .xcsm-setup-card {
        padding: 16px 12px 24px;
        overflow-x: hidden;
    }
    .xcsm-page-wrap,
    body.xcsm-page .dashboard {
        padding: 12px 10px 36px;
        overflow-x: hidden;
        max-width: 100%;
    }
    .xcsm-submit,
    .xcsm-cancel {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
    .billing-period-grid {
        grid-template-columns: 1fr !important;
    }
    .billing-period-card {
        flex-direction: column;
        gap: 6px;
    }
    .billing-period-card strong {
        display: block;
        margin-bottom: 4px;
    }
    .billing-total {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .mail-dns-guide {
        padding: 12px;
        overflow-x: hidden;
    }
    .mail-dns-guide .table-wrap {
        overflow: visible;
    }
    .mail-dns-guide .data-table thead {
        display: none;
    }
    .mail-dns-guide .data-table,
    .mail-dns-guide .data-table tbody,
    .mail-dns-guide .data-table tr,
    .mail-dns-guide .data-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .mail-dns-guide .data-table tr {
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    .mail-dns-guide .data-table td {
        border-bottom: 0;
        padding: 4px 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .mail-dns-guide .data-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #64748b;
        margin-bottom: 2px;
    }
    .xcsm-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .xcsm-actions .btn {
        width: 100%;
        min-width: 0;
    }
}
.file-row-actions {
    flex-direction: column;
    align-items: flex-start;
}
.file-manage {
    width: 100%;
    max-width: 280px;
}
.file-manage > summary {
    cursor: pointer;
    list-style: none;
    display: inline-block;
}
.file-manage > summary::-webkit-details-marker { display: none; }
.file-manage-panel {
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: #fff;
    display: grid;
    gap: 8px;
}
.reactivate-form,
.replace-form {
    display: grid;
    gap: 6px;
}
.file-manage-hr {
    border: none;
    border-top: 1px dashed var(--border, #e5e7eb);
    margin: 4px 0;
}
.login-edit-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
    max-width: 220px;
}
.login-edit-form .form-control,
.login-edit-form .reset-input {
    width: 100%;
    min-width: 0;
}



.coupon-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}
.coupon-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.apply-coupon-form {
    max-width: 520px;
}
.apply-coupon-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.apply-coupon-row .form-control {
    flex: 1 1 220px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.coupon-generate-form {
    display: grid;
    gap: 14px;
}
.coupon-kinds {
    display: grid;
    gap: 8px;
}
.coupon-kind-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
}
.coupon-kind-card:has(input:checked) {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12);
    background: #f8faff;
}
.coupon-kind-card strong {
    display: block;
    margin-bottom: 2px;
}
.coupon-kind-card input[type="radio"] {
    margin-top: 4px;
}
.coupon-kind-value {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.88rem;
    color: #334155;
}
.coupon-kind-value .coupon-value-input {
    width: 96px;
    height: 34px;
    padding: 4px 8px;
}
.coupon-new-code {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: #ecfdf3;
    border: 1px solid #86efac;
}
.coupon-code-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.06em;
    font-size: 1.05rem;
}
.coupon-row-used {
    opacity: 0.72;
}
.btn-copy-code {
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 0.78rem;
}
.coupon-field {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 4px;
}
.coupon-field .form-control {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    max-width: 280px;
}
@media (max-width: 980px) {
    .coupon-layout,
    .coupon-row {
        grid-template-columns: 1fr;
    }
}

.pc-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.pc-fab-dot {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25d366;
    box-shadow: 0 8px 18px rgba(37, 211, 102, 0.4);
}
.pc-pop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 16px;
    box-sizing: border-box;
}
.pc-pop.is-open { display: flex; }
.pc-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
}
.pc-panel {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    max-height: min(92vh, 560px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}
.pc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #075e54;
    color: #fff;
}
.pc-head h3 { margin: 0; font-size: 1.05rem; color: #fff; }
.pc-head p { margin: 2px 0 0; font-size: 0.8rem; color: rgba(255,255,255,0.75); }
.pc-head-ico {
    width: 38px; height: 38px; border-radius: 50%;
    background: #25d366;
    display: grid; place-items: center; flex: 0 0 auto;
}
.pc-x {
    margin-left: auto;
    border: 0;
    background: rgba(255,255,255,0.12);
    color: #fff;
    width: 34px; height: 34px;
    border-radius: 999px;
    font-size: 1.2rem;
    cursor: pointer;
}
.pc-body {
    flex: 1;
    background: #ece5dd;
    padding: 12px;
    overflow-y: auto;
    min-height: 220px;
}
.pc-msg {
    max-width: 82%;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.pc-msg-bot {
    background: #fff;
    border-radius: 0 10px 10px 10px;
    color: #111;
}
.pc-msg-user {
    background: #dcf8c6;
    border-radius: 10px 0 10px 10px;
    margin-left: auto;
    color: #111;
}
.pc-msg.pending { opacity: 0.7; }
.pc-msg.err { color: #b91c1c; }
.pc-compose {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: #f0f0f0;
}
.pc-compose input {
    flex: 1;
    margin: 0;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
}
.pc-send {
    width: 42px; height: 42px;
    border: 0; border-radius: 50%;
    background: #25d366; color: #fff;
    display: grid; place-items: center;
    cursor: pointer; flex: 0 0 auto;
}
body.pc-open { overflow: hidden; }

.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.stat-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 16px; min-width: 120px;
}
.stat-card b { display: block; font-size: 1.4rem; color: var(--primary); }
.stat-card span { color: var(--muted); font-size: 0.8rem; }
.range-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.range-tabs a {
    color: var(--muted); text-decoration: none; border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; background: #fff;
}
.range-tabs a.on { color: var(--primary); border-color: var(--primary); }
.sec-manual {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 18px;
}
.sec-manual label { color: var(--muted); font-size: 0.8rem; }
.sec-manual input {
    display: block; margin-top: 4px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 8px; min-width: 160px;
}
.badge-crawler { background: #fef3c7; color: #92400e; }
.badge-watch { background: #fef3c7; color: #92400e; }
.badge-blocked { background: var(--danger-soft); color: #991b1b; }
.badge-visitor { background: var(--info-soft); color: #075985; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; word-break: break-all; }
.btn-danger { background: #dc2626; color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; }

.totp-input {
    letter-spacing: 0.28em;
    font-size: 1.35rem;
    text-align: center;
    font-family: ui-monospace, Consolas, monospace;
}
.qrbox {
    width: 220px; height: 220px;
    margin: 8px auto 14px;
    background: #fff;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.qrbox svg { display: block; width: 100%; height: 100%; }
.totp-secret { letter-spacing: 0.12em; }
.backup-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.backup-list code { font-size: 0.95rem; }

.totp-nudge {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(15, 23, 42, 0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.totp-nudge[hidden] { display: none !important; }
.totp-nudge-card {
    width: min(440px, 100%);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 22px 20px;
}
.totp-nudge-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.totp-nudge-card p { margin: 0 0 16px; color: var(--muted); }
.totp-nudge-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) {
    .pc-fab-dot { width: 54px; height: 54px; }
}

.xdc-hub-bar {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
    background: #111; color: #fff; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px;
}
.xdc-hub-brand { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.xdc-hub-brand img { width: 28px; height: 28px; }
.xdc-hub-links { display: flex; gap: 16px; align-items: center; }
.xdc-hub-links a { color: #e5e7eb; text-decoration: none; font-weight: 600; }
.xdc-hub-links a.on, .xdc-hub-links a:hover { color: #fff; }
.xdc-create-wrap { display: flex; gap: 10px; justify-content: center; margin: 18px 0 24px; flex-wrap: wrap; }
.xdc-create {
    background: var(--primary); color: #fff; border: 0; font-weight: 800; padding: 12px 22px;
    border-radius: 8px; cursor: pointer; font-size: 1.05rem;
}
.xdc-create:hover { background: var(--primary-dark); color: #fff; }
.xdc-del-modal {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.xdc-del-modal[hidden] { display: none !important; }
.xdc-del-box {
    background: #fff; border-radius: 12px; padding: 20px 22px;
    max-width: 420px; width: 100%; box-shadow: 0 12px 40px rgba(15,23,42,.2);
}
.xdc-del-box p { margin: 0 0 16px; font-size: 1.02rem; color: #0f172a; }
.xdc-del-actions { display: flex; gap: 8px; justify-content: flex-end; }
.xdc-hours { margin: 10px 0 14px; padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.xdc-map-card {
    margin: 12px 0;
    padding: 14px 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    color: #065f46;
}
.xdc-map-card .btn { margin-left: 6px; }
.xdc-net-isolated { background: #ecfdf5; }
.xdc-hub-split { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
@media (max-width: 800px) { .xdc-hub-split { grid-template-columns: 1fr; } }
.xdc-node-pill {
    display: inline-flex; min-width: 28px; height: 28px; align-items: center; justify-content: center;
    border-radius: 50%; background: #2563eb; color: #fff; font-weight: 700; font-size: 0.85rem;
}
.xdc-net-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.xdc-net-head h1 { margin: 0 0 6px; }
.xdc-nwid { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.xdc-nwid span { font-size: 0.8rem; color: var(--muted); }
.xdc-nwid input { width: 220px; }
.xdc-dl { max-width: 980px; margin: 24px auto; padding: 0 16px 40px; }
.xdc-dl h1 { text-align: center; font-size: 2.6rem; margin: 10px 0 6px; }
.xdc-dl-ver { text-align: center; color: var(--muted); margin-bottom: 28px; }
.xdc-dl-grid { display: grid; grid-template-columns: 200px 1fr; gap: 18px; }
@media (max-width: 720px) { .xdc-dl-grid { grid-template-columns: 1fr; } }
.xdc-dl-nav { display: flex; flex-direction: column; gap: 4px; }
.xdc-dl-nav a {
    padding: 10px 14px; border-radius: 10px 0 0 10px; text-decoration: none; color: #334155; font-weight: 650;
}
.xdc-dl-nav a.on { background: #ddd6fe; color: #1e1b4b; }
.xdc-dl-pane {
    background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px;
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
}
.xdc-dl-btn {
    display: inline-block; margin-top: 12px; background: #334155; color: #fff; text-decoration: none;
    padding: 12px 18px; border-radius: 8px; font-weight: 700;
}
.xdc-dl-btn:hover { background: #1e293b; color: #fff; }
.xdc-pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow: auto; }
.xdc-steps { margin: 0; padding-left: 1.2rem; }
.xdc-steps li { margin: 0 0 10px; }
.xdc-dl-pane .mono { font-family: ui-monospace, Consolas, monospace; }
.xdc-wait-row { background: #fff7ed; }
.xdc-wait-badge { background: #ffedd5; color: #9a3412; }
.xdc-member-actions { white-space: nowrap; }
.xdc-member-actions .btn-primary { font-weight: 800; min-width: 110px; }
@media (max-width: 800px) {
    .xdc-member-actions { white-space: normal; display: flex; flex-direction: column; gap: 6px; }
    .xdc-member-actions .btn,
    .xdc-member-actions .btn-primary { width: 100%; }
}
.qrbox { width: 200px; height: 200px; margin: 12px auto; }
.totp-input { letter-spacing: .2em; font-size: 1.15rem; text-align: center; }
.totp-secret { word-break: break-all; }
.backup-list { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.backup-list code { display: block; background: #f1f5f9; padding: 8px; border-radius: 8px; text-align: center; }
.xdc-act-table { min-width: 760px; }
.xdc-act-table .xdc-act-time,
.xdc-act-table .xdc-act-user,
.xdc-act-table .xdc-act-ip { white-space: nowrap; }
