/* =========================================================
   ZTunnel — "Aurora" design system
   Award-winning responsive layout, dark-first, glassmorphic
   ========================================================= */

:root {
    /* Core palette */
    --zt-bg:         #07090f;
    --zt-bg-2:       #0b0f18;
    --zt-bg-3:       #0f1422;
    --zt-panel:      rgba(20, 26, 42, 0.72);
    --zt-panel-2:    rgba(28, 34, 54, 0.85);
    --zt-panel-solid:#121829;
    --zt-border:     rgba(148, 163, 184, 0.14);
    --zt-border-2:   rgba(148, 163, 184, 0.24);
    --zt-text:       #e7edf6;
    --zt-text-dim:   #b4bdd0;
    --zt-muted:      #8593ab;
    --zt-muted-2:    #6b7a93;

    /* Brand + accents */
    --zt-primary:    #7c7cff;
    --zt-primary-2:  #5b5bff;
    --zt-primary-3:  #8f7bff;
    --zt-accent:     #22d3ee;
    --zt-accent-2:   #06b6d4;
    --zt-violet:     #a855f7;
    --zt-pink:       #ec4899;

    /* State */
    --zt-ok:         #22c55e;
    --zt-ok-2:       #16a34a;
    --zt-warn:       #f59e0b;
    --zt-warn-2:     #d97706;
    --zt-err:        #ef4444;
    --zt-err-2:      #dc2626;

    /* Gradients */
    --zt-grad-primary: linear-gradient(135deg, #7c7cff 0%, #a855f7 50%, #22d3ee 100%);
    --zt-grad-cta:     linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --zt-grad-ok:      linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    --zt-grad-warn:    linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --zt-grad-err:     linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
    --zt-grad-panel:   linear-gradient(160deg, rgba(124,124,255,0.06) 0%, rgba(34,211,238,0.03) 50%, rgba(168,85,247,0.05) 100%);

    /* Structure */
    --zt-radius-sm:  8px;
    --zt-radius:     14px;
    --zt-radius-lg:  20px;
    --zt-radius-xl:  28px;

    /* Shadow */
    --zt-shadow-sm:  0 2px 8px rgba(2, 6, 23, 0.35);
    --zt-shadow:     0 8px 28px rgba(2, 6, 23, 0.55);
    --zt-shadow-lg:  0 20px 60px rgba(2, 6, 23, 0.7);
    --zt-glow:       0 0 0 1px rgba(124,124,255,0.35), 0 10px 30px rgba(124,124,255,0.25);

    /* Motion */
    --zt-ease:       cubic-bezier(.2, .8, .2, 1);
    --zt-fast:       160ms;
    --zt-med:        260ms;
    --zt-slow:       420ms;

    /* Layout */
    --zt-sidebar-w:  268px;
    --zt-topbar-h:   68px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: var(--zt-bg);
    color: var(--zt-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    letter-spacing: -0.005em;
    line-height: 1.5;
}

/* Ambient background aurora — the "wow" factor */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1100px 700px at 8% -10%, rgba(124,124,255,0.22), transparent 60%),
        radial-gradient(900px 640px at 100% 0%, rgba(34,211,238,0.14), transparent 55%),
        radial-gradient(800px 600px at 60% 120%, rgba(168,85,247,0.16), transparent 55%),
        radial-gradient(600px 480px at 10% 100%, rgba(236,72,153,0.08), transparent 60%);
    z-index: -2;
    pointer-events: none;
    animation: auroraShift 22s ease-in-out infinite alternate;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
    z-index: -1;
    pointer-events: none;
}

@keyframes auroraShift {
    0%   { transform: translate3d(0,0,0) scale(1); filter: hue-rotate(0deg); }
    50%  { transform: translate3d(-1.5%, 1%, 0) scale(1.03); filter: hue-rotate(14deg); }
    100% { transform: translate3d(1.2%, -0.8%, 0) scale(1.02); filter: hue-rotate(-10deg); }
}

/* Typography */
h1, h2, h3, h4 { letter-spacing: -0.018em; }
h1 { font-size: clamp(1.6rem, 2.2vw + 1rem, 2.4rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 1.2vw + 1rem, 1.6rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }

a {
    color: var(--zt-accent);
    text-decoration: none;
    transition: color var(--zt-fast) var(--zt-ease);
}
a:hover { color: #67e8f9; text-decoration: none; }

code {
    background: rgba(124,124,255,0.10);
    padding: 2px 8px;
    border-radius: 6px;
    color: #d6dcff;
    font-size: 0.88em;
    font-family: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    border: 1px solid rgba(124,124,255,0.18);
}

pre {
    background: linear-gradient(180deg, #070a13 0%, #0a0f1c 100%);
    border: 1px solid var(--zt-border);
    padding: 16px 18px;
    border-radius: var(--zt-radius);
    overflow-x: auto;
    color: #cdd6ff;
    box-shadow: var(--zt-shadow-sm);
    font-family: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.6;
}
pre code { background: transparent; padding: 0; border: none; }

/* Focus ring (accessible) */
:focus-visible {
    outline: 2px solid var(--zt-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.18);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.35); background-clip: padding-box; }

/* =========================================================
   App shell
   ========================================================= */
.zt-app {
    display: grid;
    grid-template-columns: var(--zt-sidebar-w) 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Sidebar */
.zt-sidebar {
    background: linear-gradient(180deg, rgba(11,15,24,0.92) 0%, rgba(11,15,24,0.72) 100%);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border-right: 1px solid var(--zt-border);
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 30;
}

.zt-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 18px 8px;
    border-bottom: 1px solid var(--zt-border);
}
.zt-logo {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--zt-grad-primary);
    background-size: 200% 200%;
    display: grid; place-items: center;
    font-weight: 900; color: #fff;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
    box-shadow: 0 10px 26px rgba(124,124,255,0.35), inset 0 0 0 1px rgba(255,255,255,0.22);
    animation: gradShift 8s ease-in-out infinite;
    position: relative;
}
.zt-logo::after {
    content: "";
    position: absolute; inset: -2px;
    border-radius: 14px;
    background: var(--zt-grad-primary);
    filter: blur(14px);
    opacity: 0.55;
    z-index: -1;
    animation: gradShift 8s ease-in-out infinite;
}
@keyframes gradShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
.zt-brand-title {
    font-weight: 800;
    font-size: 1.08rem;
    background: linear-gradient(90deg, #fff, #b4bdd0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.zt-brand-sub { color: var(--zt-muted); font-size: 0.74rem; letter-spacing: 0.02em; }

.zt-nav { display: flex; flex-direction: column; gap: 4px; }
.zt-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--zt-muted);
    font-weight: 600;
    font-size: 0.92rem;
    transition: background var(--zt-fast) var(--zt-ease),
                color var(--zt-fast) var(--zt-ease),
                transform var(--zt-fast) var(--zt-ease);
    position: relative;
    overflow: hidden;
}
.zt-nav-item::before {
    content: "";
    position: absolute;
    left: 0; top: 10%; bottom: 10%;
    width: 3px;
    border-radius: 999px;
    background: var(--zt-grad-primary);
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity var(--zt-med) var(--zt-ease), transform var(--zt-med) var(--zt-ease);
}
.zt-nav-item:hover {
    background: rgba(255,255,255,0.045);
    color: var(--zt-text);
    text-decoration: none;
    transform: translateX(2px);
}
.zt-nav-item.active {
    background: linear-gradient(90deg, rgba(124,124,255,0.22) 0%, rgba(124,124,255,0.04) 100%);
    color: #fff;
}
.zt-nav-item.active::before { opacity: 1; transform: scaleY(1); }
.zt-nav-icon {
    width: 22px;
    text-align: center;
    font-size: 1.05rem;
    filter: drop-shadow(0 0 6px rgba(124,124,255,0.4));
}

.zt-sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--zt-border); }

/* Main column */
.zt-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.zt-topbar {
    height: var(--zt-topbar-h);
    padding: 0 28px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--zt-border);
    background: linear-gradient(180deg, rgba(11,15,24,0.85), rgba(11,15,24,0.55));
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    position: sticky; top: 0; z-index: 10;
}
.zt-topbar-title {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, #fff, #c9d2e6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.zt-topbar-right { display: flex; align-items: center; gap: 10px; }
.zt-menu-toggle {
    display: none;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--zt-border);
    color: var(--zt-text);
    width: 42px; height: 42px;
    border-radius: 12px;
    cursor: pointer;
    align-items: center; justify-content: center;
    font-size: 1.2rem;
    transition: background var(--zt-fast) var(--zt-ease);
}
.zt-menu-toggle:hover { background: rgba(255,255,255,0.08); }

.zt-content {
    padding: 32px clamp(20px, 3vw, 40px);
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* =========================================================
   Status chips
   ========================================================= */
.zt-status-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px; border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: var(--zt-muted);
    font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.015em;
    border: 1px solid var(--zt-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform var(--zt-fast) var(--zt-ease);
}
.zt-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--zt-muted);
    display: inline-block;
    position: relative;
}
.zt-status-chip.ok {
    color: #86efac;
    border-color: rgba(34,197,94,0.4);
    background: linear-gradient(180deg, rgba(34,197,94,0.16), rgba(34,197,94,0.06));
}
.zt-status-chip.ok .zt-dot {
    background: var(--zt-ok);
    box-shadow: 0 0 12px var(--zt-ok);
}
.zt-status-chip.ok .zt-dot::after {
    content: "";
    position: absolute; inset: -3px;
    border-radius: 50%;
    background: var(--zt-ok);
    opacity: 0.55;
    animation: chipPulse 1.8s ease-in-out infinite;
}
.zt-status-chip.warn {
    color: #fcd34d;
    border-color: rgba(245,158,11,0.4);
    background: linear-gradient(180deg, rgba(245,158,11,0.16), rgba(245,158,11,0.06));
}
.zt-status-chip.warn .zt-dot {
    background: var(--zt-warn);
    box-shadow: 0 0 12px var(--zt-warn);
    animation: chipPulse 1.1s ease-in-out infinite;
}
.zt-status-chip.err {
    color: #fca5a5;
    border-color: rgba(239,68,68,0.4);
    background: linear-gradient(180deg, rgba(239,68,68,0.16), rgba(239,68,68,0.06));
}
.zt-status-chip.err .zt-dot {
    background: var(--zt-err);
    box-shadow: 0 0 12px var(--zt-err);
}

@keyframes chipPulse {
    0%, 100% { opacity: .55; transform: scale(1); }
    50%      { opacity: 0;    transform: scale(2); }
}

/* =========================================================
   Cards
   ========================================================= */
.zt-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: clamp(14px, 1.4vw, 22px);
}

.zt-card {
    background: var(--zt-panel);
    background-image: var(--zt-grad-panel);
    border: 1px solid var(--zt-border);
    border-radius: var(--zt-radius-lg);
    box-shadow: var(--zt-shadow);
    overflow: hidden;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    position: relative;
    transition: transform var(--zt-med) var(--zt-ease),
                border-color var(--zt-med) var(--zt-ease),
                box-shadow var(--zt-med) var(--zt-ease);
}
.zt-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(124,124,255,0.35), transparent 40%, rgba(34,211,238,0.25) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: 0.55;
    transition: opacity var(--zt-med) var(--zt-ease);
}
.zt-card:hover::before { opacity: 0.9; }
.zt-card-wide { grid-column: 1 / -1; }
.zt-card-form { max-width: 760px; }

.zt-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--zt-border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0));
    flex-wrap: wrap;
}
.zt-card-header h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.zt-card-body { padding: 22px; }
.zt-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Key/value grid */
.zt-kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}
.zt-kv > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--zt-border);
    border-radius: var(--zt-radius-sm);
    transition: border-color var(--zt-fast) var(--zt-ease), background var(--zt-fast) var(--zt-ease);
}
.zt-kv > div:hover { border-color: var(--zt-border-2); background: rgba(255,255,255,0.04); }
.zt-kv label {
    color: var(--zt-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.zt-kv span { font-weight: 600; color: var(--zt-text); }

/* Stats */
.zt-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    margin-right: 28px;
    padding: 4px 0;
}
.zt-stat-num {
    font-size: clamp(1.8rem, 2.4vw + 0.5rem, 2.6rem);
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #c9d2e6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.zt-stat-label {
    color: var(--zt-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* =========================================================
   Alerts
   ========================================================= */
.zt-alert {
    padding: 12px 16px;
    border-radius: var(--zt-radius);
    font-size: 0.9rem;
    border: 1px solid var(--zt-border);
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.zt-alert.ok   { border-color: rgba(34,197,94,0.4);  background: linear-gradient(180deg, rgba(34,197,94,0.14), rgba(34,197,94,0.04));  color: #86efac; }
.zt-alert.warn { border-color: rgba(245,158,11,0.4); background: linear-gradient(180deg, rgba(245,158,11,0.14), rgba(245,158,11,0.04)); color: #fcd34d; }
.zt-alert.err  { border-color: rgba(239,68,68,0.4);  background: linear-gradient(180deg, rgba(239,68,68,0.14), rgba(239,68,68,0.04));  color: #fca5a5; }

/* =========================================================
   Tables
   ========================================================= */
.zt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.zt-table thead tr {
    position: sticky;
    top: 0;
}
.zt-table th, .zt-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid var(--zt-border);
}
.zt-table th {
    color: var(--zt-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    background: rgba(255,255,255,0.02);
}
.zt-table tbody tr {
    transition: background var(--zt-fast) var(--zt-ease);
}
.zt-table tbody tr:hover td { background: rgba(124,124,255,0.06); }
.zt-table tbody tr:last-child td { border-bottom: none; }

/* Table scroll wrapper for small screens */
.zt-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* =========================================================
   Forms
   ========================================================= */
.zt-form-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.flex-grow { flex: 1; min-width: 0; }
.zt-form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.zt-form-group label {
    font-size: 0.82rem;
    color: var(--zt-text-dim);
    font-weight: 600;
}
.zt-form-group .form-control,
.zt-form-group .form-select,
input.form-control,
select.form-select,
textarea.form-control {
    background: rgba(12, 16, 26, 0.75);
    border: 1px solid var(--zt-border);
    color: var(--zt-text);
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 0.92rem;
    transition: border-color var(--zt-fast) var(--zt-ease),
                box-shadow var(--zt-fast) var(--zt-ease),
                background var(--zt-fast) var(--zt-ease);
}
.zt-form-group .form-control:focus,
.zt-form-group .form-select:focus,
input.form-control:focus,
select.form-select:focus,
textarea.form-control:focus {
    outline: none;
    border-color: var(--zt-primary);
    box-shadow: 0 0 0 4px rgba(124,124,255,0.22);
    background: rgba(12, 16, 26, 0.95);
    color: var(--zt-text);
}
.zt-form-group .form-control::placeholder { color: var(--zt-muted-2); }

.zt-help { font-size: 0.78rem; color: var(--zt-muted); }
.zt-form-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.zt-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--zt-muted);
    margin: 18px 0 10px;
}

/* =========================================================
   Buttons — fit the theme
   ========================================================= */
.btn {
    border-radius: 12px;
    font-weight: 700;
    padding: 10px 18px;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    transition: transform var(--zt-fast) var(--zt-ease),
                box-shadow var(--zt-med) var(--zt-ease),
                background var(--zt-fast) var(--zt-ease),
                border-color var(--zt-fast) var(--zt-ease),
                color var(--zt-fast) var(--zt-ease);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(124,124,255,0.35);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: 9px; }
.btn-primary {
    background: var(--zt-grad-cta);
    background-size: 200% 200%;
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99,102,241,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover {
    background-position: 100% 100%;
    color: #fff;
    box-shadow: 0 12px 28px rgba(99,102,241,0.5), inset 0 1px 0 rgba(255,255,255,0.35);
    transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-outline-primary {
    border: 1px solid rgba(124,124,255,0.55);
    color: #c7cbff;
    background: rgba(124,124,255,0.08);
}
.btn-outline-primary:hover {
    background: rgba(124,124,255,0.2);
    color: #fff;
    border-color: var(--zt-primary);
}
.btn-outline-secondary {
    border: 1px solid var(--zt-border-2);
    color: var(--zt-text-dim);
    background: rgba(255,255,255,0.02);
}
.btn-outline-secondary:hover {
    background: rgba(255,255,255,0.06);
    color: var(--zt-text);
    border-color: var(--zt-border-2);
}
.btn-outline-danger {
    border: 1px solid rgba(239,68,68,0.55);
    color: #fca5a5;
    background: rgba(239,68,68,0.06);
}
.btn-outline-danger:hover {
    background: rgba(239,68,68,0.18);
    color: #fff;
    border-color: var(--zt-err);
}

/* =========================================================
   Toolbar
   ========================================================= */
.zt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}
.zt-toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* =========================================================
   Empty state
   ========================================================= */
.zt-empty {
    text-align: center;
    padding: 72px 24px;
    background: linear-gradient(160deg, rgba(124,124,255,0.05), rgba(34,211,238,0.03));
    border: 1px dashed var(--zt-border-2);
    border-radius: var(--zt-radius-lg);
    position: relative;
    overflow: hidden;
}
.zt-empty::after {
    content: "";
    position: absolute; inset: -40% -20% auto auto;
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(124,124,255,0.15), transparent 60%);
    pointer-events: none;
}
.zt-empty-icon {
    font-size: 2.8rem;
    opacity: 0.8;
    filter: drop-shadow(0 8px 24px rgba(124,124,255,0.5));
}
.zt-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 12px;
}
.zt-empty-sub { color: var(--zt-muted); margin-top: 4px; }

/* =========================================================
   Forward cards
   ========================================================= */
.zt-forward-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.zt-forward-card {
    background: var(--zt-panel);
    background-image: var(--zt-grad-panel);
    border: 1px solid var(--zt-border);
    border-radius: var(--zt-radius);
    padding: 18px;
    box-shadow: var(--zt-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform var(--zt-med) var(--zt-ease),
                border-color var(--zt-med) var(--zt-ease),
                box-shadow var(--zt-med) var(--zt-ease);
    position: relative;
    overflow: hidden;
}
.zt-forward-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 3px; height: 100%;
    background: var(--zt-grad-primary);
    opacity: 0;
    transition: opacity var(--zt-fast) var(--zt-ease);
}
.zt-forward-card:hover {
    transform: translateY(-3px);
    border-color: rgba(124,124,255,0.45);
    box-shadow: 0 20px 40px rgba(2,6,23,0.6), 0 0 0 1px rgba(124,124,255,0.2);
}
.zt-forward-card:hover::before { opacity: 1; }
.zt-forward-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.zt-forward-name {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--zt-text);
    font-size: 0.98rem;
}
.zt-forward-route {
    color: var(--zt-muted);
    margin-top: 6px;
    font-size: 0.88rem;
    font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    word-break: break-all;
}
.zt-forward-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* Badges */
.zt-badge {
    font-size: 0.68rem;
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.zt-badge.local  { background: rgba(34,211,238,0.16);  color: #67e8f9;  border: 1px solid rgba(34,211,238,0.4); }
.zt-badge.remote { background: rgba(168,85,247,0.16);  color: #d8b4fe; border: 1px solid rgba(168,85,247,0.4); }

/* =========================================================
   Switch (checkbox)
   ========================================================= */
.zt-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--zt-text-dim);
    user-select: none;
}
.zt-switch input {
    width: 18px; height: 18px;
    accent-color: var(--zt-primary);
    cursor: pointer;
}

/* =========================================================
   Modal
   ========================================================= */
.zt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 14, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    z-index: 1000;
    padding: 20px;
    animation: fade 180ms var(--zt-ease);
}
.zt-modal {
    background: linear-gradient(180deg, rgba(24,30,48,0.95), rgba(18,24,41,0.95));
    border: 1px solid var(--zt-border-2);
    border-radius: var(--zt-radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--zt-shadow-lg), 0 0 0 1px rgba(124,124,255,0.1);
    overflow: hidden;
    animation: pop 240ms var(--zt-ease);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.zt-modal-header,
.zt-modal-footer {
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--zt-border);
}
.zt-modal-footer {
    border-bottom: none;
    border-top: 1px solid var(--zt-border);
    gap: 10px;
    background: rgba(0,0,0,0.15);
}
.zt-modal-header h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
}
.zt-modal-body {
    padding: 22px;
    max-height: 70vh;
    overflow-y: auto;
}
.zt-close {
    background: transparent;
    border: none;
    color: var(--zt-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background var(--zt-fast) var(--zt-ease), color var(--zt-fast) var(--zt-ease);
}
.zt-close:hover { color: #fff; background: rgba(255,255,255,0.06); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

/* =========================================================
   Tabs
   ========================================================= */
.zt-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--zt-border);
    margin-top: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.zt-tabs::-webkit-scrollbar { display: none; }
.zt-tab {
    background: transparent;
    border: none;
    color: var(--zt-muted);
    padding: 12px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color var(--zt-fast) var(--zt-ease), border-color var(--zt-fast) var(--zt-ease);
    white-space: nowrap;
}
.zt-tab:hover { color: var(--zt-text); }
.zt-tab.active {
    color: #fff;
    border-bottom-color: var(--zt-primary);
}

/* =========================================================
   Docs
   ========================================================= */
.zt-doc { max-width: 920px; }
.zt-doc h1 {
    font-size: 2rem;
    margin-top: 0;
    background: linear-gradient(135deg, #fff 0%, #c9d2e6 60%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.zt-doc .lead { color: var(--zt-muted); font-size: 1.05rem; max-width: 68ch; }
.zt-steps {
    list-style: none;
    padding: 0;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 30px;
}
.zt-steps > li {
    background: var(--zt-panel);
    background-image: var(--zt-grad-panel);
    border: 1px solid var(--zt-border);
    border-radius: var(--zt-radius);
    padding: 20px 24px;
    position: relative;
    counter-increment: step;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.zt-steps > li::before {
    content: counter(step);
    position: absolute;
    left: -14px; top: 18px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--zt-grad-primary);
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(124,124,255,0.45);
    border: 2px solid var(--zt-bg);
}
.zt-steps h3 { margin: 0 0 10px; font-size: 1.08rem; }

/* =========================================================
   Utilities
   ========================================================= */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 22px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 22px; }
.flex-wrap { flex-wrap: wrap; }
.text-muted { color: var(--zt-muted); }
.text-center { text-align: center; }

/* =========================================================
   Responsive layout
   ========================================================= */

/* Wide desktop */
@media (min-width: 1600px) {
    :root { --zt-sidebar-w: 290px; }
    .zt-content { max-width: 1560px; }
}

/* Tablet landscape / small desktop */
@media (max-width: 1200px) {
    .zt-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* Tablet portrait */
@media (max-width: 960px) {
    .zt-grid { grid-template-columns: 1fr; }
    .zt-stat { margin-right: 20px; }
}

/* Mobile */
@media (max-width: 768px) {
    .zt-app { grid-template-columns: 1fr; }
    .zt-sidebar {
        position: fixed;
        left: 0; top: 0;
        width: min(280px, 82vw);
        height: 100vh;
        height: 100dvh;
        transform: translateX(-102%);
        transition: transform var(--zt-med) var(--zt-ease);
        box-shadow: var(--zt-shadow-lg);
        z-index: 40;
    }
    .zt-sidebar.open { transform: translateX(0); }
    .zt-main { width: 100%; }
    .zt-menu-toggle { display: inline-flex; }
    .zt-topbar { padding: 0 16px; }
    .zt-content { padding: 20px 16px; }
    .zt-card-body { padding: 18px; }
    .zt-card-header { padding: 16px 18px; }
    .zt-forward-list { grid-template-columns: 1fr; }
    .zt-form-row { flex-direction: column; align-items: stretch; }
    .zt-form-row .zt-form-group { max-width: none !important; }
    .zt-stat { margin-right: 16px; }
    .zt-stat-num { font-size: 1.8rem; }
    .zt-topbar-title { font-size: 1rem; }
    .btn { padding: 10px 14px; }
}

/* Small mobile */
@media (max-width: 420px) {
    .zt-content { padding: 16px 12px; }
    .zt-card-body { padding: 16px; }
    .zt-stat { display: block; margin-right: 0; margin-bottom: 10px; }
    .zt-modal { border-radius: var(--zt-radius); }
}

/* Motion-reduced */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    body::before { animation: none; }
}

/* Light-mode courtesy (keeps dark-first look but respects user OS) */
@media print {
    body::before, body::after { display: none; }
    .zt-sidebar, .zt-topbar { display: none; }
    .zt-app { display: block; }
    .zt-content { padding: 0; max-width: 100%; }
    .zt-card { box-shadow: none; background: #fff; color: #000; }
    .zt-card::before { display: none; }
}
