/* =========================================================
   2FA EZKEY – App Stylesheet
   Bootstrap 5.3 là nền tảng. KHÔNG dùng Tailwind.
   ========================================================= */

/* ── Variables (portal light — trắng + tím #7c3aed) ─── */
:root {
    color-scheme: light;
    --c-bg:          #f4f6f9;
    --c-surface:     #ffffff;
    --c-surface-2:   #f8fafc;
    --c-surface-3:   #f1f5f9;
    --c-border:      #e5e7eb;
    --c-text:        #111827;
    --c-muted:       #6b7280;
    --c-primary:     #7c3aed;
    --c-primary-dk:  #6d28d9;
    --c-primary-lt:  #ede9fe;
    --c-success:     #059669;
    --c-success-lt:  #d1fae5;
    --c-warning:     #d97706;
    --c-warning-lt:  #fef3c7;
    --c-danger:      #dc2626;
    --c-danger-lt:   #fee2e2;
    --r:             12px;
    --r-sm:          8px;
    --r-lg:          16px;
    --shadow-sm:     0 1px 2px rgba(15, 23, 42, .06);
    --shadow:        0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .04);
    --shadow-lg:     0 8px 24px rgba(15, 23, 42, .1);
    --sidebar-w:     268px;
    --topbar-h:      60px;
    --transition:    .18s ease;
}

/* ── Reset / Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Figtree', system-ui, -apple-system, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Shell ────────────────────────────────────────────── */
.ez-shell {
    display: flex;
    min-height: 100vh;
}

.ez-main {
    flex: 1;
    min-width: 0;
    padding: 20px 16px 28px;
    padding-top: calc(var(--topbar-h) + 20px);
    background: var(--c-bg);
}

@media (min-width: 992px) {
    .ez-main {
        margin-left: var(--sidebar-w);
        padding: calc(var(--topbar-h) + 24px) 28px 36px;
    }
}

/* ── Sidebar ──────────────────────────────────────────── */
.ez-sidebar {
    width: var(--sidebar-w);
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    color: var(--c-text);
    box-shadow: 1px 0 0 rgba(15, 23, 42, .04);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
}

.ez-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--c-text);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.02rem;
    padding: 22px 18px 14px;
    letter-spacing: -.01em;
}
.ez-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}
.ez-sidebar-brand-sub {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--c-muted);
    margin-top: 2px;
}

.ez-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(124, 58, 237, .35);
}

.ez-nav {
    padding: 8px 10px;
    flex: 1;
}

.ez-nav-section {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    padding: 16px 12px 6px;
}

.ez-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    color: #4b5563;
    text-decoration: none;
    font-weight: 600;
    font-size: .88rem;
    transition: background var(--transition), color var(--transition);
    min-height: 40px;
    margin-bottom: 2px;
}

.ez-nav-link i {
    width: 18px;
    text-align: center;
    font-size: .85rem;
    flex-shrink: 0;
    opacity: .8;
}

.ez-nav-link:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
}

.ez-nav-link.active {
    background: var(--c-primary-lt);
    color: var(--c-primary-dk);
}

.ez-nav-link.active i {
    color: var(--c-primary);
    opacity: 1;
}

.ez-sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,.06);
}

/* ── Topbar ───────────────────────────────────────────── */
.ez-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    z-index: 1030;
}

@media (min-width: 992px) {
    .ez-topbar {
        left: var(--sidebar-w);
    }
}

/* ── Page header ──────────────────────────────────────── */
.ez-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

.ez-eyebrow {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--c-muted);
}

.ez-title {
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--c-text);
    margin: 3px 0 0;
}

.ez-subtitle {
    color: var(--c-muted);
    margin: 6px 0 0;
    font-size: .95rem;
}

/* ── Cards ────────────────────────────────────────────── */
.ez-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.ez-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border);
}

.ez-card-body {
    padding: 20px;
}

/* Stat cards */
.ez-stat {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 126px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.ez-stat:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.ez-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--c-primary-lt);
    color: var(--c-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
}

.ez-stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--c-text);
}

/* ── Table ────────────────────────────────────────────── */
.ez-table {
    margin: 0;
    font-size: .9rem;
}

.ez-table thead th {
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-border);
    color: var(--c-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 12px 16px;
    white-space: nowrap;
}

.ez-table tbody tr {
    transition: background var(--transition);
}

.ez-table tbody tr:hover {
    background: var(--c-surface-2);
}

.ez-table tbody tr[id] {
    scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.ez-table tbody tr:target {
    background: var(--c-primary-lt);
    box-shadow: inset 3px 0 0 var(--c-primary);
}

.ez-table td {
    padding: 13px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-border);
}

.ez-table tbody tr:last-child td {
    border-bottom: 0;
}

/* ── Badges ───────────────────────────────────────────── */
.ez-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.ez-badge-primary  { background: var(--c-primary-lt); color: var(--c-primary-dk); }
.ez-badge-success  { background: var(--c-success-lt); color: #047857; }
.ez-badge-warning  { background: var(--c-warning-lt); color: #b45309; }
.ez-badge-muted    { background: var(--c-surface-3); color: var(--c-muted); }
.ez-badge-danger   { background: var(--c-danger-lt); color: #b91c1c; }

/* ── Buttons ──────────────────────────────────────────── */
.ez-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: var(--r-sm);
    font-weight: 700;
    font-size: .88rem;
    min-height: 38px;
    padding: 0 16px;
    transition: all var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.ez-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    flex-shrink: 0;
}

.btn-sm.ez-btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.82rem;
}

/* Primary */
.btn.ez-btn.btn-primary {
    background: var(--c-primary) !important;
    border-color: var(--c-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, .35);
}
.btn.ez-btn.btn-primary:hover,
.btn.ez-btn.btn-primary:focus {
    background: var(--c-primary-dk) !important;
    border-color: var(--c-primary-dk) !important;
    box-shadow: 0 6px 18px rgba(124, 58, 237, .4) !important;
    transform: translateY(-1px);
}

/* Light */
.btn.ez-btn.btn-light {
    background: var(--c-surface) !important;
    border-color: var(--c-border) !important;
    color: var(--c-text) !important;
}
.btn.ez-btn.btn-light:hover {
    background: var(--c-surface-3) !important;
    border-color: var(--c-muted) !important;
}

/* Outline primary */
.btn.ez-btn.btn-outline-primary {
    background: transparent !important;
    border-color: var(--c-primary) !important;
    color: var(--c-primary) !important;
}
.btn.ez-btn.btn-outline-primary:hover {
    background: var(--c-primary-lt) !important;
}

/* Outline danger */
.btn.ez-btn.btn-outline-danger {
    background: transparent !important;
    border-color: var(--c-danger) !important;
    color: var(--c-danger) !important;
}
.btn.ez-btn.btn-outline-danger:hover {
    background: var(--c-danger-lt) !important;
}

/* Success */
.btn.ez-btn.btn-success {
    background: var(--c-success) !important;
    border-color: var(--c-success) !important;
    color: #fff !important;
}

/* Danger */
.btn.ez-btn.btn-danger {
    background: var(--c-danger) !important;
    border-color: var(--c-danger) !important;
    color: #fff !important;
}

.ez-btn:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

/* ── Form controls ────────────────────────────────────── */
.form-control.ez-input,
.form-select.ez-input {
    border-radius: var(--r-sm);
    border-color: var(--c-border);
    min-height: 42px;
    font-size: .9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control.ez-input:focus,
.form-select.ez-input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Legacy class kept for compatibility */
.ez-form-control,
.ez-form-control:focus {
    border-radius: var(--r-sm);
    min-height: 42px;
    border-color: var(--c-border);
    font-size: .9rem;
}

.ez-form-control:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ── Secret monospace pill ────────────────────────────── */
.ez-secret {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    color: var(--c-text);
    font-family: 'Menlo', 'Consolas', 'Liberation Mono', monospace;
    font-size: .82rem;
    max-width: 280px;
    overflow-wrap: anywhere;
}

/* ── OTP display ──────────────────────────────────────── */
.ez-otp-display {
    font-family: 'Menlo', 'Consolas', 'Liberation Mono', monospace;
    font-size: clamp(2.4rem, 9vw, 3.8rem);
    font-weight: 800;
    line-height: 1;
    color: var(--c-primary);
    letter-spacing: .14em;
}

.ez-otp-display.loading {
    color: var(--c-border);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .45; }
}

/* Countdown ring */
.ez-countdown-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ez-countdown-ring {
    width: 48px;
    height: 48px;
    position: relative;
}

.ez-countdown-ring svg {
    transform: rotate(-90deg);
    width: 48px;
    height: 48px;
}

.ez-countdown-ring circle {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
}

.ez-countdown-ring .track  { stroke: var(--c-border); }
.ez-countdown-ring .prog   {
    stroke: var(--c-primary);
    stroke-dasharray: 125.66;
    transition: stroke-dashoffset .98s linear;
}

.ez-countdown-ring .num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 800;
    color: var(--c-primary);
}

/* Progress bar countdown (simpler alternative) */
.ez-progress-bar-wrap {
    width: 100%;
    height: 4px;
    background: var(--c-border);
    border-radius: 99px;
    overflow: hidden;
}

.ez-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c-primary), #60a5fa);
    border-radius: 99px;
    transition: width 1s linear;
}

/* ── Empty state ──────────────────────────────────────── */
.ez-empty {
    text-align: center;
    padding: 52px 20px;
    color: var(--c-muted);
}

.ez-kpi {
    min-height: 86px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: var(--c-surface-2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .25rem;
}

.ez-kpi strong {
    font-size: 1.35rem;
    line-height: 1.1;
}

.ez-kpi span {
    color: var(--c-muted);
    font-size: .86rem;
    font-weight: 700;
}

.ez-admin-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    flex-wrap: nowrap;
}

.ez-admin-actions form {
    display: inline-flex;
    margin: 0;
}

.ez-admin-actions .ez-btn-icon {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    font-size: .9rem;
}

.ez-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--c-muted);
    margin-bottom: 14px;
}

/* ── Footer ───────────────────────────────────────────── */
.ez-footer {
    color: var(--c-muted);
    font-size: .82rem;
    padding: 20px 0 4px;
    border-top: 1px solid var(--c-border);
    margin-top: 32px;
}

/* ── Modal overrides ──────────────────────────────────── */
.modal-content {
    border: none;
    border-radius: var(--r) !important;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--c-border) !important;
    padding: 18px 20px;
}

.modal-body {
    padding: 24px 20px;
}

/* ── OTP Key card (in KEY list) ───────────────────────── */
.ez-key-card {
    transition: box-shadow var(--transition);
}

.ez-key-card:hover {
    box-shadow: var(--shadow-lg);
}

/* ── Admin accent ─────────────────────────────────────── */
.ez-shell.ez-admin .ez-brand-mark {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 2px 8px rgba(245,158,11,.4);
}
.ez-shell.ez-admin .ez-nav-link.active {
    background: rgba(245,158,11,.18);
    color: #fcd34d;
}
.ez-shell.ez-admin .ez-nav-link.active i { color: #fbbf24; }
.ez-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(245,158,11,.15);
    border: 1px solid rgba(245,158,11,.35);
    color: #fbbf24;
    font-size: .72rem;
    font-weight: 700;
}

.ez-shell {
    background: var(--c-bg);
}

.ez-shell .ez-sidebar {
    background: var(--c-surface);
}
.ez-main main { min-height: calc(100vh - var(--topbar-h) - 80px); }

/* ── Homepage (landing) ───────────────────────────────── */
.home-page {
    --home-bg: #070b14;
    --home-surface: #ffffff;
    --home-muted: #94a3b8;
    --home-accent: #3b82f6;
    --home-accent-2: #6366f1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--home-bg);
    color: #e2e8f0;
}

.home-page a { text-decoration: none; }

.home-container {
    width: min(1140px, calc(100% - 32px));
    margin: 0 auto;
}

/* Header */
.home-header {
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: rgba(7,11,20,.82);
    backdrop-filter: blur(16px);
}

.home-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
}

.home-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.02em;
}

.home-logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .95rem;
    box-shadow: 0 4px 14px rgba(59,130,246,.45);
}

.home-nav {
    display: none;
    align-items: center;
    gap: 4px;
}

@media (min-width: 768px) {
    .home-nav { display: flex; }
}

.home-nav a {
    color: #94a3b8;
    font-weight: 600;
    font-size: .88rem;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color .15s, background .15s;
}

.home-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}

.home-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .88rem;
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,.12);
    background: transparent;
    transition: all .15s;
}

.home-btn-ghost:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.home-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .88rem;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border: none;
    box-shadow: 0 4px 14px rgba(37,99,235,.4);
    transition: transform .15s, box-shadow .15s;
}

.home-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,.5);
    color: #fff;
}

.home-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    background: transparent;
    color: #e2e8f0;
    cursor: pointer;
}

@media (min-width: 768px) {
    .home-menu-toggle { display: none; }
}

.home-mobile-nav {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0 16px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.home-mobile-nav.open { display: flex; }

.home-mobile-nav a {
    color: #94a3b8;
    font-weight: 600;
    padding: 10px 4px;
}

.home-mobile-nav a:hover { color: #fff; }

/* Hero */
.home-hero {
    position: relative;
    padding: 56px 0 72px;
    overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(59,130,246,.25), transparent),
        radial-gradient(ellipse 50% 40% at 90% 50%, rgba(99,102,241,.12), transparent);
    pointer-events: none;
}

.home-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
}

@media (min-width: 992px) {
    .home-hero { padding: 72px 0 88px; }
    .home-hero-grid {
        grid-template-columns: 1fr 420px;
        gap: 56px;
        align-items: center;
    }
}

.home-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(59,130,246,.15);
    border: 1px solid rgba(59,130,246,.3);
    color: #93c5fd;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.home-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: home-pulse 2s ease infinite;
}

@keyframes home-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.home-hero h1 {
    font-size: clamp(2rem, 5.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.12;
    color: #fff;
    letter-spacing: -.03em;
    margin: 0 0 18px;
}

.home-hero h1 span {
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero-lead {
    font-size: 1.05rem;
    color: #94a3b8;
    line-height: 1.7;
    max-width: 520px;
    margin-bottom: 28px;
}

.home-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
}

.home-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.home-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: .85rem;
    font-weight: 600;
}

.home-trust-item i {
    color: #3b82f6;
    font-size: 1rem;
}

/* OTP Tool Card */
.home-tool {
    background: var(--home-surface);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.08),
        0 24px 64px rgba(0,0,0,.45);
    overflow: hidden;
    color: var(--c-text);
}

.home-tool-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--c-border);
    background: linear-gradient(180deg, #fafbfc, #fff);
}

.home-tool-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--c-text);
    margin: 4px 0 0;
}

.home-tool-body {
    padding: 24px;
}

.home-tool-label {
    font-weight: 700;
    font-size: .88rem;
    color: var(--c-text);
    margin-bottom: 8px;
    display: block;
}

.home-tool textarea {
    width: 100%;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 14px 16px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: .85rem;
    resize: vertical;
    min-height: 110px;
    transition: border-color .15s, box-shadow .15s;
    color: var(--c-text);
    background: #fafbfc;
}

.home-tool textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    background: #fff;
}

.home-tool-hint {
    font-size: .8rem;
    color: var(--c-muted);
    margin-top: 8px;
}

.home-tool-submit {
    width: 100%;
    margin-top: 16px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
}

.home-tool-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,.45);
}

.home-tool-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: .88rem;
    font-weight: 600;
}

.home-otp-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
}

.home-otp-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.home-otp-results-head strong {
    font-size: .95rem;
    color: var(--c-text);
}

.home-otp-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .8rem;
    font-weight: 700;
}

.home-otp-card {
    background: #f8fafc;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 10px;
}

.home-otp-card:last-child { margin-bottom: 0; }

.home-otp-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.home-otp-card-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-muted);
}

.home-otp-card-secret {
    font-family: monospace;
    font-size: .78rem;
    color: #475569;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.home-otp-card-code {
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 2rem;
    font-weight: 800;
    color: var(--c-primary);
    letter-spacing: .12em;
}

.home-otp-copy {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--c-border);
    background: #fff;
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}

.home-otp-copy:hover {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

/* Features section */
.home-features {
    background: #0d1321;
    padding: 72px 0;
    border-top: 1px solid rgba(255,255,255,.05);
}

.home-section-title {
    text-align: center;
    margin-bottom: 48px;
}

.home-section-title h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
}

.home-section-title p {
    color: #64748b;
    margin: 0;
    font-size: 1rem;
}

.home-features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 576px) {
    .home-features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
    .home-features-grid { grid-template-columns: repeat(4, 1fr); }
}

.home-feature-card {
    padding: 24px;
    border-radius: 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    transition: border-color .2s, background .2s;
}

.home-feature-card:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(59,130,246,.25);
}

.home-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.home-feature-icon.blue   { background: rgba(59,130,246,.15); color: #60a5fa; }
.home-feature-icon.green  { background: rgba(34,197,94,.15);  color: #4ade80; }
.home-feature-icon.purple { background: rgba(168,85,247,.15); color: #c084fc; }
.home-feature-icon.amber  { background: rgba(245,158,11,.15); color: #fbbf24; }

.home-feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 8px;
}

.home-feature-card p {
    font-size: .88rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* Steps */
.home-steps {
    padding: 72px 0;
    background: linear-gradient(180deg, #0d1321 0%, #070b14 100%);
}

.home-steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .home-steps-grid { grid-template-columns: repeat(3, 1fr); }
}

.home-step {
    text-align: center;
    padding: 28px 20px;
}

.home-step-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 4px 16px rgba(37,99,235,.4);
}

.home-step h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 8px;
}

.home-step p {
    font-size: .88rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* CTA band */
.home-cta-band {
    padding: 56px 0;
    text-align: center;
}

.home-cta-band-inner {
    padding: 48px 32px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37,99,235,.2), rgba(99,102,241,.15));
    border: 1px solid rgba(59,130,246,.25);
}

.home-cta-band h2 {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
}

.home-cta-band p {
    color: #94a3b8;
    margin: 0 0 24px;
    font-size: 1rem;
}

/* Footer */
.home-footer {
    margin-top: auto;
    background: #050810;
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 56px 0 0;
}

.home-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 40px;
}

@media (min-width: 768px) {
    .home-footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }
}

.home-footer-brand p {
    color: #64748b;
    font-size: .9rem;
    line-height: 1.7;
    margin: 14px 0 0;
    max-width: 280px;
}

.home-footer-col h4 {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #475569;
    margin: 0 0 16px;
}

.home-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.home-footer-col li { margin-bottom: 10px; }

.home-footer-col a {
    color: #94a3b8;
    font-size: .9rem;
    font-weight: 500;
    transition: color .15s;
}

.home-footer-col a:hover { color: #fff; }

.home-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 20px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-footer-bottom span {
    color: #475569;
    font-size: .82rem;
}

.home-footer-bottom a {
    color: #64748b;
    font-size: .82rem;
}

.home-footer-bottom a:hover { color: #94a3b8; }

/* Legacy public (keep for change2fa if needed) */
.ez-public {
    min-height: 100vh;
    background: var(--c-bg);
}

.ez-public-wrap {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

/* ── Auth pages (portal) ──────────────────────────────── */
.ez-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(ellipse 80% 55% at 50% -15%, rgba(237, 233, 254, .95), transparent),
        var(--c-bg);
}
.ez-auth-layout {
    width: min(100%, 920px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
}
@media (min-width: 992px) {
    .ez-auth-layout {
        grid-template-columns: 1fr 1fr;
        gap: 0;
        background: var(--c-surface);
        border: 1px solid var(--c-border);
        border-radius: var(--r-lg);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
    }
}
.ez-auth-aside {
    flex-direction: column;
    padding: 40px 36px;
    background: linear-gradient(145deg, #6d28d9 0%, #7c3aed 42%, #a78bfa 100%);
    color: #fff;
}
.ez-auth-aside-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    margin-bottom: 28px;
}
.ez-auth-aside-logo .ez-brand-mark {
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .25);
}
.ez-auth-aside-title {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 12px;
}
.ez-auth-aside-text {
    opacity: .92;
    font-size: .95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}
.ez-auth-aside-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}
.ez-auth-aside-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    font-weight: 600;
}
.ez-auth-aside-list i {
    width: 28px;
    text-align: center;
    opacity: .9;
}
.ez-auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}
@media (min-width: 992px) {
    .ez-auth-main {
        max-width: none;
        padding: 32px 36px 28px;
    }
}
.ez-auth-logo-mobile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--c-text);
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    margin-bottom: 16px;
}
.ez-auth-card {
    width: 100%;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
@media (min-width: 992px) {
    .ez-auth-layout .ez-auth-card {
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
}
.ez-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
}
.ez-auth-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--c-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.ez-auth-tab:hover {
    color: var(--c-primary);
    background: rgba(124, 58, 237, .06);
}
.ez-auth-tab.is-active {
    color: var(--c-primary);
    background: var(--c-surface);
    border-bottom-color: var(--c-primary);
}
.ez-auth-panel-body {
    padding: 28px 24px 24px;
}
@media (min-width: 576px) {
    .ez-auth-panel-body { padding: 32px 32px 28px; }
}
.ez-auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.ez-auth-header-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--c-primary-lt);
    color: var(--c-primary);
    font-size: 1.25rem;
}
.ez-auth-eyebrow { color: var(--c-muted); margin-bottom: 6px; }
.ez-auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--c-text);
    margin: 0;
    letter-spacing: -.02em;
}
.ez-auth-subtitle {
    color: var(--c-muted);
    font-size: .92rem;
    margin: 8px 0 0;
    line-height: 1.55;
}
.ez-auth-label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 6px;
}
.ez-auth-input-wrap {
    position: relative;
}
.ez-auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-muted);
    font-size: .85rem;
    pointer-events: none;
    z-index: 2;
}
.ez-auth-input {
    padding-left: 42px !important;
    min-height: 44px;
    border-radius: var(--r-sm) !important;
}
.ez-auth-input:focus {
    border-color: var(--c-primary) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .15) !important;
}
.ez-auth-form .btn.ez-btn { min-height: 44px; }
.ez-auth-form .btn + .btn { margin-top: 10px; }
.ez-auth-link {
    font-size: .88rem;
    font-weight: 600;
    color: var(--c-primary);
    text-decoration: none;
}
.ez-auth-link:hover { color: var(--c-primary-dk); text-decoration: underline; }
.ez-auth-switch {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
    font-size: .9rem;
    color: var(--c-muted);
}
.ez-auth-switch a {
    color: var(--c-primary);
    text-decoration: none;
}
.ez-auth-switch a:hover { text-decoration: underline; }
.ez-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--c-muted);
    text-decoration: none;
    margin-bottom: 20px;
}
.ez-auth-back:hover { color: var(--c-primary); }
.ez-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--c-muted);
    font-size: .8rem;
    font-weight: 600;
    text-transform: lowercase;
}
.ez-auth-divider::before,
.ez-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}
.ez-auth-otp-block {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: var(--r-sm);
    background: var(--c-primary-lt);
    border: 1px solid rgba(124, 58, 237, .2);
}
.ez-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: .88rem;
    margin-bottom: 20px;
    border-radius: var(--r-sm) !important;
}
.ez-auth-home-link {
    margin-top: 16px;
    font-size: .82rem;
}
.ez-auth-home-link a {
    color: var(--c-muted);
    text-decoration: none;
    font-weight: 600;
}
.ez-auth-home-link a:hover { color: var(--c-primary); }
.letter-spacing-otp { letter-spacing: .35em; }

/* Pagination */
.pagination { gap: 4px; }
.page-link {
    border-radius: var(--r-sm) !important;
    border-color: var(--c-border) !important;
    color: var(--c-text) !important;
    font-weight: 600;
    font-size: .88rem;
    padding: .4rem .75rem;
}
.page-item.active .page-link {
    background: var(--c-primary) !important;
    border-color: var(--c-primary) !important;
}
.page-link:hover { background: var(--c-surface-2); }

/* Detail / OTP inline */
.ez-otp-panel {
    background: var(--c-surface-3);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    padding: 24px;
    text-align: center;
}
.ez-detail-grid {
    display: grid;
    gap: 20px;
}
@media (min-width: 768px) {
    .ez-detail-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Alerts ───────────────────────────────────────────── */
.alert {
    border-radius: var(--r-sm) !important;
    border: none !important;
    font-size: .9rem;
}

/* ── Notes ────────────────────────────────────────────── */
.ez-note-card {
    transition: box-shadow var(--transition), transform var(--transition);
    border-top: 3px solid var(--c-border);
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}
.ez-note-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.ez-note-card-pinned {
    border-color: rgba(245, 158, 11, .45);
    background: linear-gradient(180deg, rgba(251, 191, 36, .1) 0%, var(--c-surface) 48px);
}
.ez-note-card .ez-card-body {
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.ez-note-card-title {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.ez-note-card-title a {
    color: inherit;
}
.ez-note-card-title a:hover {
    color: var(--c-primary);
}
.ez-note-card-actions {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}
.ez-note-card-excerpt {
    line-height: 1.55;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    flex: 0 1 auto;
}
.ez-note-card-footer-actions {
    margin-top: auto;
    min-width: 0;
    flex-shrink: 0;
}
.ez-note-card-footer-actions > .text-nowrap {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ez-note-card-actions .btn.ez-btn,
.ez-note-card-actions .ez-btn-icon-only {
    width: 34px;
    height: 34px;
    min-height: 34px;
    min-width: 34px;
    padding: 0;
    flex-shrink: 0;
}
.ez-note-card-actions .btn.ez-btn i,
.ez-note-card-pin .btn.ez-btn i {
    font-size: 0.82rem;
    line-height: 1;
    pointer-events: none;
}
.ez-note-card-pin {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}
.ez-note-card-pin .btn.ez-btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    min-width: 34px;
    padding: 0;
}
.ez-btn-icon-only.dropdown-toggle::after {
    display: none;
}
.ez-note-accent-blue { border-top-color: #3b82f6; }
.ez-note-accent-green { border-top-color: #10b981; }
.ez-note-accent-amber { border-top-color: #f59e0b; }
.ez-note-accent-purple { border-top-color: #8b5cf6; }
.ez-note-accent-rose { border-top-color: #f43f5e; }
.ez-note-accent-slate { border-top-color: #64748b; }

.ez-note-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ez-note-color-option input { position: absolute; opacity: 0; pointer-events: none; }
.ez-note-color-swatch {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
}
.ez-note-swatch-blue { background: #3b82f6; }
.ez-note-swatch-green { background: #10b981; }
.ez-note-swatch-amber { background: #f59e0b; }
.ez-note-swatch-purple { background: #8b5cf6; }
.ez-note-swatch-rose { background: #f43f5e; }
.ez-note-swatch-slate { background: #64748b; }
.ez-note-color-option input:checked + .ez-note-color-swatch {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 2px;
}

.ez-note-autosave-status {
    font-size: .82rem;
    font-weight: 600;
}
.ez-note-autosave-idle { color: var(--c-muted); }
.ez-note-autosave-dirty { color: #d97706; }
.ez-note-autosave-saving { color: var(--c-primary); }
.ez-note-autosave-ok { color: var(--c-success); }
.ez-note-autosave-warn { color: var(--c-warning); }
.ez-note-autosave-error { color: var(--c-danger); }

.ez-note-tabs .nav-link {
    font-size: .82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    color: var(--c-muted);
}
.ez-note-tabs .nav-link.active {
    background: var(--c-primary-lt);
    color: var(--c-primary);
}

.ez-note-preview {
    min-height: 280px;
    padding: 16px 18px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background: var(--c-surface-2);
    line-height: 1.65;
    font-size: .95rem;
    max-width: 100%;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.ez-note-preview *,
.ez-note-content-view *,
.ez-note-content * {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.ez-note-preview p,
.ez-note-preview li,
.ez-note-preview a,
.ez-note-content-view p,
.ez-note-content-view li,
.ez-note-content-view a {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
}
.ez-note-preview h1, .ez-note-preview h2, .ez-note-preview h3 { font-size: 1.1rem; font-weight: 800; margin-top: 1em; }
.ez-note-preview code {
    background: var(--c-surface-3);
    color: var(--c-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .88em;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-all;
}
.ez-note-preview pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-all;
}
.ez-note-raw-md {
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    color: var(--c-text);
    border-radius: var(--r-sm);
    padding: 12px;
    font-size: .85rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 240px;
    overflow: auto;
}
.ez-note-editor {
    min-height: 280px;
    resize: vertical;
    line-height: 1.6;
    font-size: .95rem;
}
.ez-note-content {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.7;
    font-size: .95rem;
    color: var(--c-text);
    min-height: 120px;
    max-width: 100%;
    overflow: hidden;
}
.ez-card-footer {
    background: var(--c-surface-2);
}

/* ── Inline OTP on KEY list ───────────────────────────── */
.ez-otp-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ez-otp-inline-code {
    font-family: ui-monospace, monospace;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: .12em;
    color: var(--c-primary);
    min-width: 7ch;
}
.ez-otp-inline-bar-wrap {
    width: 48px;
    height: 4px;
    background: var(--c-border);
    border-radius: 4px;
    overflow: hidden;
}
.ez-otp-inline-bar {
    height: 100%;
    background: var(--c-primary);
    transition: width .3s linear;
}

/* ── Toasts ───────────────────────────────────────────── */
.ez-toast-container {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    right: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
}
.ez-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: ez-toast-in .25s ease;
}
.ez-toast-success { background: #059669; }
.ez-toast-danger { background: #dc2626; }
.ez-toast-warning { background: #d97706; }
.ez-toast-hide { opacity: 0; transform: translateX(8px); transition: .3s; }
@keyframes ez-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Bootstrap / utilities (light portal) ─────────────── */
.text-muted { color: var(--c-muted) !important; }
.dropdown-menu {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-lg);
}
.dropdown-item { color: var(--c-text); }
.dropdown-item:hover,
.dropdown-item:focus { background: var(--c-surface-2); color: var(--c-text); }
.dropdown-divider { border-color: var(--c-border); }
.form-control,
.form-select,
.ez-form-control {
    background: var(--c-surface);
    border-color: var(--c-border);
    color: var(--c-text);
}
.form-control:focus,
.form-select:focus,
.ez-form-control:focus {
    background: var(--c-surface);
    border-color: var(--c-primary);
    color: var(--c-text);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .15);
}
.alert-warning {
    background: var(--c-warning-lt);
    border: 1px solid #fcd34d;
    color: #92400e;
}
.alert-success {
    background: var(--c-success-lt);
    border: 1px solid #6ee7b7;
    color: #065f46;
}
.alert-danger {
    background: var(--c-danger-lt);
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.ez-main a:not(.btn):not(.ez-nav-link):not(.dropdown-item) {
    color: var(--c-primary-dk);
}
.ez-main a:not(.btn):not(.ez-nav-link):not(.dropdown-item):hover {
    color: var(--c-primary);
}
.list-group-item {
    background: var(--c-surface);
    border-color: var(--c-border);
    color: var(--c-text);
}
.list-group-item-action:hover,
.list-group-item-action:focus {
    background: var(--c-surface-2);
    color: var(--c-text);
}
.modal-content {
    background: var(--c-surface);
    color: var(--c-text);
    border: 1px solid var(--c-border);
}
.modal-header,
.modal-footer {
    border-color: var(--c-border) !important;
}
.border-bottom {
    border-color: var(--c-border) !important;
}
hr {
    border-color: var(--c-border);
    opacity: 1;
}
.form-control::placeholder {
    color: #64748b;
    opacity: 1;
}

/* Page layout (portal) */
.ez-page-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--c-text);
    margin: 0 0 20px;
    letter-spacing: -.02em;
}
.ez-page-header .ez-page-title {
    margin-bottom: 0.25rem;
}
.ez-deploy-pre {
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    color: var(--c-text);
    border-radius: var(--r-sm);
    padding: 1rem 1.1rem;
    overflow-x: auto;
}
.ez-reveal-value {
    font-size: 0.9rem;
    word-break: break-all;
}
.ez-section-card {
    margin-bottom: 20px;
}
.ez-section-card .ez-card-header {
    background: var(--c-surface);
    font-weight: 700;
    font-size: .95rem;
    padding: 16px 22px;
}
.ez-section-card .ez-card-body {
    padding: 20px 22px;
}
.ez-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--c-muted);
}
.ez-empty-state i {
    font-size: 2.5rem;
    opacity: .35;
    margin-bottom: 12px;
}

/* Welcome + stat tiles */
.ez-welcome-card {
    overflow: hidden;
    border: 1px solid var(--c-border);
}
.ez-welcome-card .ez-card-body {
    padding: 0;
    position: relative;
}
.ez-welcome-card-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    background: linear-gradient(90deg, rgba(237, 233, 254, .95) 0%, rgba(255, 255, 255, 0) 42%);
}
.ez-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(124, 58, 237, .35);
}
.ez-welcome-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    color: var(--c-text);
}
.ez-welcome-meta {
    color: var(--c-muted);
    font-size: .9rem;
    margin: 4px 0 0;
}
.ez-stat-tile {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 0;
    height: 100%;
    overflow: hidden;
}
.ez-stat-tile-inner {
    background: var(--c-surface-2);
    margin: 12px;
    border-radius: var(--r-sm);
    padding: 18px 16px;
    text-align: center;
    height: calc(100% - 24px);
}
.ez-stat-tile-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-muted);
    margin-bottom: 10px;
}
.ez-stat-tile-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--c-text);
}
.ez-stat-tile-meta {
    font-size: .85rem;
    color: var(--c-muted);
    margin-top: 6px;
}
.ez-sidebar-user {
    margin-top: auto;
    padding: 14px 12px 16px;
    border-top: 1px solid var(--c-border);
}
.ez-sidebar-user-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: var(--c-surface-3);
    border: 1px solid var(--c-border);
}
.ez-sidebar-user-name {
    font-weight: 700;
    font-size: .88rem;
    color: var(--c-text);
    line-height: 1.2;
}
.ez-sidebar-user-email {
    font-size: .75rem;
    color: var(--c-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}
.ez-quick-panel {
    border-radius: var(--r-lg);
}
.ez-quick-panel .ez-card-body {
    padding: 24px 28px;
}
.btn.ez-btn.btn-outline-secondary {
    background: var(--c-surface) !important;
    border-color: var(--c-border) !important;
    color: var(--c-text) !important;
}
.btn.ez-btn.btn-outline-secondary:hover {
    background: var(--c-surface-2) !important;
    border-color: #d1d5db !important;
}
.btn.ez-btn.btn-warning {
    background: var(--c-warning-lt) !important;
    border-color: #fcd34d !important;
    color: #b45309 !important;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 767.98px) {
    .ez-main {
        padding: 16px 14px;
        padding-top: calc(var(--topbar-h) + 16px);
    }

    .ez-page-header {
        flex-direction: column;
        gap: 10px;
    }

    .ez-card-body,
    .ez-card-header { padding: 16px; }

    .ez-btn { min-height: 42px; }

    .ez-table td,
    .ez-table thead th { padding: 10px 12px; }

    .ez-otp-display {
        font-size: clamp(2rem, 13vw, 3rem);
    }
}
