/*
 * Copyright (c) 2026 ZaidCreationStudio. All rights reserved.
 */

/* ── ZCS Ref+Track Frontend Styles ─────────────────────────────────────────── */
:root {
    --rt-bg: #0a0e19;
    --rt-bg2: #111827;
    --rt-bg3: #1a2332;
    --rt-border: #243048;
    --rt-text: #e2e8f0;
    --rt-muted: #8895aa;
    --rt-green: #00b87e;
    --rt-green-dim: rgba(0,184,126,0.15);
    --rt-gold: #b8942a;
    --rt-blue: #3b82f6;
    --rt-red: #f87171;
    --rt-purple: #a78bfa;
    --rt-pink: #ec4899;
    --rt-amber: #f59e0b;
    --rt-teal: #14b8a6;
    --rt-radius: 10px;
    --rt-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.zcs-rt-root {
    font-family: var(--rt-font);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: var(--rt-text);
    background: var(--rt-bg);
    min-height: 100vh;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.rt-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 40px);
}

.rt-sidebar {
    width: 240px;
    background: var(--rt-bg2);
    border-right: 1px solid var(--rt-border);
    border-radius: var(--rt-radius) 0 0 var(--rt-radius);
    padding: 20px 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.rt-sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--rt-border);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--rt-green);
}

.rt-sidebar-logo span {
    background: linear-gradient(135deg, var(--rt-green), #006644);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.rt-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--rt-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.rt-nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--rt-text);
}

.rt-nav-item.active {
    background: var(--rt-green-dim);
    color: var(--rt-green);
    font-weight: 600;
    border-right: 3px solid var(--rt-green);
}

.rt-nav-spacer { flex: 1; }

.rt-nav-user {
    padding: 16px 20px;
    border-top: 1px solid var(--rt-border);
    font-size: 12px;
    color: var(--rt-muted);
}

.rt-main {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    background: var(--rt-bg);
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.rt-card {
    background: var(--rt-bg2);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.rt-card h2, .rt-card h3 {
    margin: 0 0 14px;
    font-size: 16px;
    color: var(--rt-text);
}

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.rt-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.rt-stat-card {
    background: var(--rt-bg2);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    padding: 18px 20px;
    text-align: center;
}

.rt-stat-label-f {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rt-muted);
    margin-bottom: 6px;
}

.rt-stat-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--rt-green);
}

.rt-stat-sub-f {
    font-size: 11px;
    color: var(--rt-muted);
    margin-top: 4px;
}

.rt-stat-change-f {
    font-size: 12px;
    margin-top: 4px;
}

/* ── Charts ────────────────────────────────────────────────────────────────── */
.rt-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.rt-chart-box {
    position: relative;
    min-height: 260px;
}

.rt-chart-box canvas {
    max-height: 240px;
}

/* ── Analytics wrap ────────────────────────────────────────────────────────── */
.rt-analytics-wrap { width: 100%; }

.rt-analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.rt-analytics-header h2 {
    margin: 0;
    font-size: 20px;
}

/* ── Grids ─────────────────────────────────────────────────────────────────── */
.rt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rt-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.rt-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-border);
    border-radius: 8px;
    color: var(--rt-text);
    font-size: 14px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.rt-input:focus {
    outline: none;
    border-color: var(--rt-green);
    box-shadow: 0 0 0 3px rgba(0,184,126,0.15);
}

.rt-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-border);
    border-radius: 8px;
    color: var(--rt-text);
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
    box-sizing: border-box;
}

.rt-textarea:focus {
    outline: none;
    border-color: var(--rt-green);
}

.rt-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rt-muted);
    margin-bottom: 4px;
    font-weight: 600;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.rt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #fff;
    background: var(--rt-border);
}

.rt-btn.primary {
    background: var(--rt-green);
    color: #fff;
}

.rt-btn.primary:hover {
    background: #00d68f;
    box-shadow: 0 4px 12px rgba(0,184,126,0.3);
}

.rt-btn.danger {
    background: #3b1a1a;
    color: var(--rt-red);
}

.rt-btn.danger:hover {
    background: #4b2020;
}

.rt-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ── Table ─────────────────────────────────────────────────────────────────── */
.rt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rt-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rt-muted);
    border-bottom: 1px solid var(--rt-border);
}

.rt-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(36,48,72,0.5);
    vertical-align: middle;
}

.rt-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.rt-table a {
    color: var(--rt-green);
    text-decoration: none;
}

.rt-table a:hover {
    text-decoration: underline;
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.rt-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.rt-badge-new { background: rgba(59,130,246,0.15); color: #60a5fa; }
.rt-badge-assigned { background: rgba(167,139,250,0.15); color: #a78bfa; }
.rt-badge-scheduled { background: rgba(245,158,11,0.15); color: #fbbf24; }
.rt-badge-completed { background: rgba(0,184,126,0.15); color: #34d399; }
.rt-badge-signed { background: rgba(52,211,153,0.2); color: #10b981; }
.rt-badge-file_opened { background: rgba(236,72,153,0.15); color: #ec4899; }

/* ── Sections (collapsible) ────────────────────────────────────────────────── */
.rt-sec { margin-bottom: 8px; }

.rt-sec-hdr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--rt-bg3);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.rt-sec-hdr:hover { background: rgba(36,48,72,0.7); }

.rt-sec-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--rt-green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.rt-sec-title { flex: 1; font-weight: 600; font-size: 14px; }
.rt-sec-arrow { color: var(--rt-muted); font-size: 12px; }

.rt-sec-body {
    padding: 16px;
    border: 1px solid var(--rt-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* ── Checkbox groups ───────────────────────────────────────────────────────── */
.rt-chk-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rt-chk-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.rt-chk-item:hover {
    border-color: var(--rt-green);
}

.rt-chk-item input[type="checkbox"] {
    accent-color: var(--rt-green);
}

/* ── Injury groups ─────────────────────────────────────────────────────────── */
.rt-inj-groups { margin: 8px 0; }

.rt-inj-group {
    margin-bottom: 12px;
}

.rt-inj-group-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--rt-muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.rt-inj-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Login card ────────────────────────────────────────────────────────────── */
.rt-login-wrap {
    max-width: 400px;
    margin: 60px auto;
}

.rt-login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.rt-login-logo-badge {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--rt-green), #006644);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

/* ── Muted text ────────────────────────────────────────────────────────────── */
.rt-muted {
    color: var(--rt-muted);
    font-size: 13px;
}

/* ── Pipeline cards ────────────────────────────────────────────────────────── */
.rt-pipeline-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.rt-pipeline-card {
    background: var(--rt-bg2);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

.rt-pipeline-card:hover {
    border-color: var(--rt-green);
    transform: translateY(-2px);
}

.rt-pipeline-card.active {
    border-color: var(--rt-green);
    background: var(--rt-green-dim);
}

.rt-pipeline-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--rt-green);
}

.rt-pipeline-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--rt-muted);
    margin-top: 4px;
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.rt-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rt-modal {
    background: var(--rt-bg2);
    border: 1px solid var(--rt-border);
    border-radius: 14px;
    padding: 28px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.rt-modal h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .rt-layout { flex-direction: column; }
    .rt-sidebar { width: 100%; border-radius: var(--rt-radius) var(--rt-radius) 0 0; border-right: none; border-bottom: 1px solid var(--rt-border); padding: 12px 0; flex-direction: row; overflow-x: auto; }
    .rt-sidebar-logo { display: none; }
    .rt-nav-item { padding: 8px 14px; white-space: nowrap; }
    .rt-nav-item.active { border-right: none; border-bottom: 3px solid var(--rt-green); }
    .rt-nav-spacer { display: none; }
    .rt-nav-user { display: none; }
    .rt-main { padding: 16px; }
    .rt-grid2, .rt-grid3 { grid-template-columns: 1fr; }
    .rt-chart-row { grid-template-columns: 1fr; }
    .rt-stat-grid { grid-template-columns: 1fr 1fr; }
    .rt-pipeline-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .rt-stat-grid { grid-template-columns: 1fr; }
    .rt-pipeline-row { grid-template-columns: 1fr; }
}

/* Design reference skin: ZCS Ref+Track dark/gold professional intake UI. */
:root {
    --rt-bg: #0a0a0c;
    --rt-bg2: #141416;
    --rt-bg3: #1a1a1d;
    --rt-border: #252528;
    --rt-text: #e1e1e1;
    --rt-muted: rgba(225,225,225,0.42);
    --rt-green: #c5a059;
    --rt-green-dim: rgba(197,160,89,0.12);
    --rt-gold: #c5a059;
    --rt-radius: 16px;
    --rt-font: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

body:has(.zcs-rt-root) {
    background: var(--rt-bg);
}

body:has(.zcs-rt-root) .wp-block-post-title,
body:has(.zcs-rt-root) .wp-block-site-tagline,
body:has(.zcs-rt-root) footer {
    display: none;
}

body:has(.zcs-rt-root) .wp-site-blocks,
body:has(.zcs-rt-root) .entry-content,
body:has(.zcs-rt-root) .wp-block-post-content {
    margin: 0;
    padding: 0;
    max-width: none;
}

.zcs-rt-root {
    max-width: none;
    width: 100vw;
    margin: 0;
    padding: 0;
    background: var(--rt-bg);
    color: var(--rt-text);
    min-height: 100vh;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.rt-layout {
    min-height: 100vh;
    background: var(--rt-bg);
}

.rt-sidebar {
    width: 256px;
    background: var(--rt-bg);
    border-right: 1px solid var(--rt-border);
    border-radius: 0;
    padding: 24px 0;
}

.rt-sidebar-logo {
    border-bottom: none;
    display: block;
    padding: 0 24px 28px;
    color: var(--rt-gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
}

.rt-sidebar-logo strong {
    display: block;
    line-height: 1.1;
}

.rt-sidebar-logo em {
    color: #fff;
    font-style: italic;
}

.rt-sidebar-logo small,
.rt-nav-user small {
    display: block;
    margin-top: 7px;
    color: rgba(225,225,225,0.32);
    font: 700 10px/1.2 var(--rt-font);
    letter-spacing: .18em;
    text-transform: uppercase;
}

.rt-nav-item {
    margin: 0 16px;
    width: calc(100% - 32px);
    padding: 13px 16px;
    border-left: 2px solid transparent;
    color: rgba(225,225,225,0.58);
    font-weight: 700;
    border-radius: 0;
}

.rt-nav-icon {
    width: 20px;
    color: inherit;
    opacity: .72;
    text-align: center;
}

.rt-nav-item:hover,
.rt-nav-item.active {
    background: #1a1a1d;
    border-left-color: var(--rt-gold);
    border-right: 0;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,.22);
}

.rt-nav-item.active .rt-nav-icon {
    color: var(--rt-gold);
    opacity: 1;
}

.rt-logout {
    color: #f87171;
}

.rt-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 24px;
    padding: 18px 0 0;
    border-top: 1px solid var(--rt-border);
}

.rt-nav-user strong {
    display: block;
    color: #fff;
    font-size: 12px;
}

.rt-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--rt-border);
    background: var(--rt-bg2);
    color: var(--rt-gold);
    display: grid;
    place-items: center;
    font: italic 700 12px Georgia, serif;
}

.rt-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--rt-bg);
}

/* ── Skeleton loader ────────────────────────────────────────────────────────── */
@keyframes rt-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
.rt-skel-line {
    height: 13px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--rt-bg2) 25%, rgba(255,255,255,.06) 50%, var(--rt-bg2) 75%);
    background-size: 600px 100%;
    animation: rt-shimmer 1.4s infinite;
}
.rt-skel-line + .rt-skel-line { margin-top: 8px; }

.rt-topbar {
    min-height: 64px;
    border-bottom: 1px solid var(--rt-border);
    background: rgba(20,20,22,.78);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 0 32px;
}

/* Topbar search input */
.rt-search {
    width: min(420px, 100%);
    border: 1px solid var(--rt-border);
    background: var(--rt-bg2);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
}
.rt-topbar-input {
    color: var(--rt-text);
    outline: none;
    transition: border-color .15s;
}
.rt-topbar-input::placeholder { color: rgba(225,225,225,.22); }
.rt-topbar-input:focus { border-color: var(--rt-gold); }

.rt-api-status {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.rt-api-status span {
    color: var(--rt-gold);
}

.rt-api-status strong {
    color: #22c55e;
}

.rt-api-status strong:before {
    content: "";
    width: 7px;
    height: 7px;
    display: inline-block;
    margin-right: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.rt-main {
    padding: 32px;
    background: var(--rt-bg);
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.rt-main > h2,
.rt-analytics-header h2 {
    color: var(--rt-gold);
    font: 700 40px/1.05 Georgia, "Times New Roman", serif;
    letter-spacing: 0;
}

.rt-page-subtitle {
    margin: 0 0 28px;
    color: rgba(225,225,225,.38);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.rt-card,
.rt-stat-card,
.rt-pipeline-card {
    background: var(--rt-bg2);
    border-color: var(--rt-border);
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.rt-card {
    border-radius: 24px;
    padding: 26px 30px;
    box-sizing: border-box;
}

.rt-main > .rt-card {
    max-width: 1120px;
}

.rt-main > div > .rt-card:first-child:last-child,
.rt-main > div > .rt-card:first-child {
    max-width: 1120px;
}

.rt-grid2 {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 16px;
}

.rt-grid3 {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
}

.rt-card h2,
.rt-card h3,
.rt-card h4 {
    color: var(--rt-gold);
    font-family: Georgia, "Times New Roman", serif;
}

.rt-stat-grid {
    gap: 22px;
    margin-bottom: 28px;
}

.rt-stat-card {
    text-align: left;
    border-radius: 22px;
    padding: 24px;
    transition: border-color .2s, transform .2s;
}

.rt-stat-card:hover {
    border-color: rgba(197,160,89,.45);
    transform: translateY(-2px);
}

.rt-stat-label-f,
.rt-table th,
.rt-pipeline-label,
.rt-label {
    color: rgba(225,225,225,.34);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .2em;
}

.rt-stat-val,
.rt-pipeline-count {
    color: var(--rt-gold);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
}

.rt-input,
.rt-textarea,
.rt-chk-item {
    background: var(--rt-bg);
    border-color: var(--rt-border);
    color: var(--rt-text);
    border-radius: 12px;
    font-weight: 700;
}

.rt-input,
.rt-textarea {
    min-width: 0;
}

.rt-input:focus,
.rt-textarea:focus {
    border-color: rgba(197,160,89,.7);
    box-shadow: 0 0 0 3px rgba(197,160,89,.12);
}

.rt-btn {
    border-radius: 14px;
    font-weight: 800;
}

.rt-btn.primary {
    background: #fff;
    color: var(--rt-bg);
}

.rt-btn.primary:hover {
    background: #f5f5f5;
    box-shadow: 0 18px 45px rgba(255,255,255,.1);
    transform: translateY(-1px);
}

.rt-table th,
.rt-table td {
    border-color: rgba(37,37,40,.72);
    padding: 15px 18px;
}

.rt-table tr:hover td {
    background: rgba(255,255,255,.045);
}

.rt-table a {
    color: #fff;
    font-weight: 800;
}

.rt-table a:hover {
    color: var(--rt-gold);
    text-decoration: none;
}

.rt-badge,
.rt-pipeline-card {
    border: 1px solid var(--rt-border);
    background: var(--rt-bg);
    border-radius: 8px;
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.rt-sec-hdr {
    background: var(--rt-bg3);
    border: 1px solid var(--rt-border);
    border-radius: 14px;
    padding: 13px 16px;
}

.rt-sec-num {
    background: var(--rt-gold);
    color: var(--rt-bg);
}

.rt-sec-body {
    background: rgba(20,20,22,.72);
    border-color: var(--rt-border);
    border-radius: 0 0 18px 18px;
}

.rt-pipeline-row {
    gap: 18px;
}

.rt-pipeline-card {
    background: linear-gradient(180deg, #1a1a1d 0%, #111113 100%);
    border-radius: 24px;
    padding: 20px;
}

.rt-pipeline-card:hover,
.rt-pipeline-card.active {
    border-color: rgba(197,160,89,.52);
    background: #1a1a1d;
}

.rt-chart-row {
    gap: 24px;
}

.rt-chart-box {
    min-height: 310px;
}

.rt-login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 2px 2px, rgba(197,160,89,.18) 1px, transparent 0) 0 0 / 60px 60px,
        var(--rt-bg);
    padding: 32px;
}

.rt-login-wrap {
    width: min(440px, 100%);
    max-width: none;
    margin: 0;
}

.rt-login-logo {
    margin-bottom: 28px;
}

.rt-login-logo-badge {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-border);
    border-radius: 24px;
    color: var(--rt-gold);
    transform: rotate(6deg);
}

.rt-login-logo h1 {
    margin: 0;
    color: var(--rt-gold);
    font: 700 42px/1.05 Georgia, "Times New Roman", serif;
}

.rt-login-logo h1 em {
    color: #fff;
}

.rt-login-logo p,
.rt-login-foot {
    color: rgba(225,225,225,.32);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .28em;
    text-transform: uppercase;
}

.rt-login-card,
.rt-register-card {
    border-radius: 34px;
    padding: 36px;
}

.rt-login-card .rt-input,
.rt-register-card .rt-input {
    margin-bottom: 14px;
    padding: 14px 16px;
}

.rt-login-card #rt-auth-msg {
    text-align: center;
    min-height: 18px;
    margin: 14px 0 0;
}

.rt-register-card {
    margin-top: 16px;
}

@media (max-width: 860px) {
    .rt-sidebar {
        width: 100%;
        border-radius: 0;
        border-bottom: 1px solid var(--rt-border);
    }

    .rt-sidebar-logo {
        display: block;
        min-width: 220px;
        padding: 0 16px;
    }

    .rt-topbar {
        display: none;
    }

    .rt-main {
        padding: 20px;
    }

    .rt-grid2,
    .rt-grid3 {
        grid-template-columns: 1fr;
    }

    .rt-main > h2,
    .rt-analytics-header h2 {
        font-size: 30px;
    }
}

/* ── Settings sections ───────────────────────────────────────────────────────── */
.rt-settings-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rt-border);
}

.rt-settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.rt-settings-section-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--rt-gold);
    margin-bottom: 16px;
}

/* ── AI card ────────────────────────────────────────────────────────────────── */
.rt-ai-card {
    border-color: rgba(197,160,89,.2);
    background: linear-gradient(180deg, rgba(197,160,89,.04) 0%, var(--rt-bg2) 100%);
}

.rt-ai-card h3 {
    color: var(--rt-gold);
}

/* ── Mobile — full responsive pass ─────────────────────────────────────────── */
@media (max-width: 860px) {

    /* Sidebar becomes top nav strip */
    .rt-layout {
        flex-direction: column;
    }

    .rt-sidebar {
        width: 100%;
        border-radius: 0;
        border-right: none;
        border-bottom: 1px solid var(--rt-border);
        padding: 0;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .rt-sidebar::-webkit-scrollbar { display: none; }

    .rt-sidebar-logo {
        display: none;
    }

    .rt-nav-spacer { display: none; }
    .rt-nav-user   { display: none; }
    .rt-logout     { white-space: nowrap; }

    .rt-nav-item {
        margin: 0;
        width: auto;
        flex-shrink: 0;
        padding: 14px 16px;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        font-size: 12px;
        white-space: nowrap;
    }

    .rt-nav-item:hover,
    .rt-nav-item.active {
        border-left: none;
        border-bottom-color: var(--rt-gold);
        background: rgba(197,160,89,.06);
        box-shadow: none;
    }

    .rt-nav-icon {
        display: none;
    }

    /* Topbar search hidden on mobile — use in-tab search */
    .rt-topbar {
        display: none;
    }

    .rt-main {
        padding: 16px;
    }

    .rt-main > h2,
    .rt-analytics-header h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    /* Grids collapse to single column */
    .rt-grid2,
    .rt-grid3 {
        grid-template-columns: 1fr;
    }

    .rt-chart-row {
        grid-template-columns: 1fr;
    }

    .rt-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .rt-pipeline-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Cards tighter on mobile */
    .rt-card {
        padding: 16px;
        border-radius: 14px;
    }

    /* Table: allow horizontal scroll */
    .rt-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rt-table {
        min-width: 560px;
    }

    /* Client profile header stack */
    .rt-client-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    /* Chips inline */
    .rt-chips {
        flex-wrap: wrap;
    }

    /* Notification dropdown full-width on mobile */
    .rt-notif-dropdown {
        width: calc(100vw - 32px);
        right: -16px;
    }

    /* Toast full-width on mobile */
    #rt-toast-container {
        left: 12px;
        right: 12px;
        bottom: 16px;
    }

    .rt-toast {
        max-width: 100%;
        min-width: 0;
    }

    /* Login screen */
    .rt-login-screen {
        padding: 16px;
        place-items: start;
    }

    .rt-login-wrap {
        width: 100%;
        margin-top: 24px;
    }

    .rt-login-logo h1 {
        font-size: 30px;
    }

    .rt-login-card,
    .rt-register-card {
        padding: 24px;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .rt-stat-grid {
        grid-template-columns: 1fr;
    }

    .rt-pipeline-row {
        grid-template-columns: 1fr 1fr;
    }

    .rt-stat-val,
    .rt-pipeline-count {
        font-size: 22px;
    }

    .rt-nav-item {
        padding: 12px 12px;
        font-size: 11px;
    }
}

/* ── Topbar actions (right-side slot) ───────────────────────────────────────── */
.rt-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Notification bell ──────────────────────────────────────────────────────── */
.rt-notif-wrap {
    position: relative;
}

.rt-notif-btn {
    background: none;
    border: 1px solid var(--rt-border);
    border-radius: 12px;
    color: var(--rt-text);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 18px;
    line-height: 1;
    position: relative;
    transition: border-color .15s;
}

.rt-notif-btn:hover {
    border-color: var(--rt-gold);
}

.rt-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
}

.rt-notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--rt-bg2);
    border: 1px solid var(--rt-border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.5);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.rt-notif-dropdown.rt-notif-open {
    display: flex;
}

.rt-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--rt-border);
    font-size: 13px;
}

.rt-notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.rt-notif-item {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(37,37,40,.7);
    cursor: pointer;
    transition: background .12s;
}

.rt-notif-item:last-child {
    border-bottom: none;
}

.rt-notif-item:hover {
    background: rgba(255,255,255,.035);
}

.rt-notif-item.rt-notif-unread {
    border-left: 3px solid var(--rt-gold);
    background: rgba(197,160,89,.06);
}

.rt-notif-text {
    font-size: 13px;
    color: var(--rt-text);
    line-height: 1.4;
}

.rt-notif-meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--rt-muted);
}

/* ── Milestone chips ────────────────────────────────────────────────────────── */
.rt-chips {
    display: flex;
    gap: 4px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.rt-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;
    border: 1px solid var(--rt-border);
    background: var(--rt-bg3);
    color: var(--rt-muted);
    transition: all .15s;
}

.rt-chip.rt-chip-done {
    background: rgba(197,160,89,.18);
    border-color: rgba(197,160,89,.5);
    color: var(--rt-gold);
}

/* ── Toast notification system ──────────────────────────────────────────────── */
#rt-toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.rt-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--rt-bg2);
    border: 1px solid var(--rt-border);
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
    pointer-events: all;
    opacity: 0;
    transform: translateY(12px) scale(.97);
    transition: opacity .28s ease, transform .28s ease;
    max-width: 380px;
    min-width: 220px;
}

.rt-toast.rt-toast-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.rt-toast-success {
    border-color: rgba(0,184,126,.35);
}

.rt-toast-success .rt-toast-icon {
    color: #00b87e;
}

.rt-toast-error {
    border-color: rgba(248,113,113,.35);
}

.rt-toast-error .rt-toast-icon {
    color: #f87171;
}

.rt-toast-info {
    border-color: rgba(99,102,241,.35);
}

.rt-toast-info .rt-toast-icon {
    color: #818cf8;
}

.rt-toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Stage undo toast */
.rt-toast-undo {
    justify-content: space-between;
}

.rt-undo-btn {
    background: var(--rt-border);
    border: none;
    border-radius: 8px;
    color: var(--rt-text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    flex-shrink: 0;
    transition: background .15s;
}

.rt-undo-btn:hover {
    background: rgba(197,160,89,.22);
    color: var(--rt-gold);
}
