/* ==========================================================================
   RSS CRM - Aurora Design System
   Modern SaaS-grade UI. All legacy class names preserved.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    color-scheme: light;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.12);
    --accent: #8b5cf6;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.12);

    --bg: #f1f5f9;
    --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, 0.08), transparent 60%);
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;

    --text: #0f172a;
    --text-2: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-2: #cbd5e1;

    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    --sidebar-text: #c7d2fe;
    --sidebar-text-dim: #8b93a7;
    --sidebar-active: rgba(99, 102, 241, 0.28);
    --sidebar-active-border: #818cf8;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.08);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;

    --sidebar-width: 260px;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary-hover); }

input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

button { font-family: inherit; }

img { max-width: 100%; }

::selection { background: rgba(99, 102, 241, 0.25); }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.wrapper { display: flex; min-height: 100vh; overflow-x: hidden; }

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    padding: 28px 32px 48px;
    min-height: 100vh;
    animation: fadeSlide 0.28s ease;
}

.main-content > * {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   4. Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
}

.sidebar-brand {
    padding: 22px 20px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.sidebar-brand i { color: var(--sidebar-active-border); font-size: 1.3rem; }

.sidebar-logo {
    max-height: 30px;
    max-width: 120px;
    vertical-align: middle;
    border-radius: 6px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section-label {
    padding: 16px 12px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-text-dim);
}

.nav-section-label:first-child { padding-top: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 3px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.16s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
    color: #fff;
    background: var(--sidebar-active);
    border-left-color: var(--sidebar-active-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--sidebar-text-dim);
    transition: color 0.16s ease, transform 0.16s ease;
}

.nav-item:hover i, .nav-item.active i { color: #fff; }
.nav-item:hover i { transform: translateX(1px); }

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(0, 0, 0, 0.15);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    font-size: 0.88rem;
    color: #e2e8f0;
    font-weight: 600;
}

.user-info i { font-size: 1.4rem; color: var(--sidebar-active-border); }

.user-info .badge { margin-left: auto; }

/* Mobile toggle (hamburger) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 16px;
    z-index: 120;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    align-items: center;
    justify-content: center;
}

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

.page-header h1 {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    align-items: center;
}

.page-header h1 i {
    color: var(--primary);
    margin-right: 10px;
    background: var(--primary-soft);
    padding: 8px;
    border-radius: 10px;
    font-size: 1.1rem;
    vertical-align: middle;
}

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

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.card:hover { box-shadow: var(--shadow); border-color: var(--border-2); }

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--surface-2);
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.card-header h3 i { color: var(--primary); margin-right: 8px; }

.card-body { padding: 20px; }

.card.mb-3 { margin-bottom: 16px; }
.card.mt-3 { margin-top: 16px; }

/* --------------------------------------------------------------------------
   7. Stats grid
   -------------------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-xs);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-2);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   8. Tables & pagination
   -------------------------------------------------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-2);
    font-weight: 700;
    white-space: nowrap;
    background: var(--surface-2);
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:nth-child(even) { background: rgba(241, 245, 249, 0.5); }
.table tbody tr:hover { background: rgba(99, 102, 241, 0.06); }
.table tbody tr:last-child td { border-bottom: none; }

.table-sm th, .table-sm td { padding: 8px 10px; font-size: 0.84rem; }

.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.card-body > .table th:first-child, .card-body > .table td:first-child { padding-left: 0; }
.card-body > .table th:last-child, .card-body > .table td:last-child { padding-right: 0; }

.table td code {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 0.82em;
}

.pagination {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.pagination .btn { min-width: 34px; justify-content: center; }

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: var(--text-2);
    font-weight: 600;
}

.form-group label i { color: var(--text-muted); margin-right: 6px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-control:hover { border-color: var(--primary); }

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.form-control:disabled {
    background: var(--surface-3);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.8;
}

.form-control::placeholder { color: #94a3b8; }

.form-control-sm { padding: 7px 10px; font-size: 0.84rem; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.password-hint { display: block; margin-top: 5px; font-size: 0.78rem; color: var(--text-muted); }

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.search-form .form-control { width: auto; min-width: 170px; }

.filter-form .form-group { margin-bottom: 10px; }

.manual-panel { margin-top: 14px; }

/* --------------------------------------------------------------------------
   10. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.16s ease;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(0.98); }

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

.btn-sm { padding: 5px 11px; font-size: 0.8rem; border-radius: 7px; }
.btn-sm:hover { transform: none; }

.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: var(--warning); color: #78350f; }
.btn-warning:hover { background: #d97706; }

.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #2563eb; }

.btn-secondary { background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); }
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--text-2);
    box-shadow: none;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn:disabled, .btn.disabled { opacity: 0.5; pointer-events: none; box-shadow: none; }

.w-100 { width: 100%; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-3 { margin-bottom: 16px; }

/* --------------------------------------------------------------------------
   11. Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.3;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-owner { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.badge-manager { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.badge-member { background: rgba(99, 102, 241, 0.14); color: #4f46e5; }
.badge-primary { background: rgba(99, 102, 241, 0.14); color: #4f46e5; }
.badge-danger { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.badge-success { background: rgba(16, 185, 129, 0.14); color: #047857; }
.badge-secondary { background: rgba(148, 163, 184, 0.2); color: #475569; }
.badge-info { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }

.badge-creating, .badge-provisioning, .badge-starting, .badge-stopping {
    background: rgba(245, 158, 11, 0.18); color: #b45309;
}
.badge-ready, .badge-active {
    background: rgba(16, 185, 129, 0.14); color: #047857;
}
.badge-destroying { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.badge-expired { background: rgba(148, 163, 184, 0.2); color: #475569; }
.badge-error { background: rgba(239, 68, 68, 0.2); color: #dc2626; }

.badge-pending { background: rgba(234, 179, 8, 0.16); color: #ca8a04; }
.badge-sent { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.badge-done { background: rgba(34, 197, 94, 0.16); color: #15803d; }
.badge-duplicate { background: rgba(239, 68, 68, 0.14); color: #dc2626; }

/* --------------------------------------------------------------------------
   12. Alerts & flash
   -------------------------------------------------------------------------- */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.88rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xs);
}

.alert::before { font-family: 'Font Awesome 6 Free'; font-weight: 900; }

.alert-success { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.3); color: #047857; }
.alert-success::before { content: '\f058'; }
.alert-danger { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); color: #b91c1c; }
.alert-danger::before { content: '\f057'; }
.alert-info { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.3); color: #1d4ed8; }
.alert-info::before { content: '\f05a'; }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); color: #b45309; }
.alert-warning::before { content: '\f071'; }

.flash-container { margin-bottom: 18px; }

/* --------------------------------------------------------------------------
   13. Modals
   -------------------------------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3, .modal-header h4 { font-size: 1.1rem; }
.modal-header h3 i, .modal-header h4 i { color: var(--primary); margin-right: 8px; }

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* --------------------------------------------------------------------------
   14. Tabs
   -------------------------------------------------------------------------- */
.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow: visible;
    flex-wrap: wrap;
}
.tab-panel { overflow: visible; }

.tab-btn {
    background: transparent;
    border: none;
    padding: 11px 18px;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 500;
    transition: color 0.15s ease, border-color 0.15s ease;
    border-radius: 8px 8px 0 0;
}

.tab-btn i { font-size: 0.9rem; }

.tab-btn:hover { color: var(--text); background: rgba(99, 102, 241, 0.05); }

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 700;
    background: var(--primary-soft);
}

.tab-panel { display: none; width: 100%; }
.tab-panel.active { display: block; animation: fadeSlide 0.2s ease; }
.tab-panel .card { overflow: visible; }
.tab-panel .card-body { overflow: visible; }
.tab-panel .table { min-width: 0; width: 100%; table-layout: auto; word-break: break-word; }
.tab-panel .table th, .tab-panel .table td { white-space: normal; word-break: break-word; }
@media (max-width: 768px) {
    .tab-panel .table, .tab-panel .table thead, .tab-panel .table tbody, .tab-panel .table th, .tab-panel .table td, .tab-panel .table tr { display: block; width: 100%; }
    .tab-panel .table thead { display: none; }
    .tab-panel .table tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
    .tab-panel .table td { border: none; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; }
    .tab-panel .table td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); font-size: 0.8rem; margin-right: 12px; }
    .tab-panel .table td:last-child { border-bottom: none; }
}
a.tab-btn { text-decoration: none; }

/* --------------------------------------------------------------------------
   15. RDP - status card, countdown, details
   -------------------------------------------------------------------------- */
.rdp-status-card {
    text-align: center;
    padding: 34px 24px;
}

.rdp-status-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rdp-status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.rdp-status-dot.ready, .rdp-status-dot.active {
    background: #34d399;
    box-shadow: 0 0 12px #34d399;
    animation: pulse 2s infinite;
}

.rdp-status-dot.creating, .rdp-status-dot.provisioning { background: #fbbf24; }
.rdp-status-dot.error { background: #ef4444; }
.rdp-status-dot.expired { background: #64748b; }

@keyframes pulse {
    0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; }
}

.rdp-status-label { font-weight: 800; letter-spacing: 2.5px; color: var(--text-muted); }

.rdp-countdown { margin: 16px 0 22px; }

.rdp-countdown-value {
    font-size: 4rem;
    font-weight: 800;
    font-family: var(--mono);
    color: var(--success);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.rdp-countdown-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
}

.rdp-details {
    max-width: 520px;
    margin: 0 auto 22px;
    text-align: left;
}

.rdp-detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rdp-detail-row:hover { border-color: var(--border-2); background: var(--surface); }

.rdp-detail-label {
    width: 110px;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
    font-weight: 600;
}

.rdp-detail-value {
    flex: 1;
    font-family: var(--mono);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rdp-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.extend-form { display: inline-block; }
.inline-form { display: inline-block; margin: 0 2px; }

/* --------------------------------------------------------------------------
   16. Quick links
   -------------------------------------------------------------------------- */
.quick-links {
    max-width: 520px;
    margin: 0 auto 22px;
    text-align: left;
}

.quick-links-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
}

.quick-links-header span i { color: var(--primary); margin-right: 6px; }

.quick-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ql-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ql-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.ql-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ql-btn i { color: var(--primary); }
.ql-del i { color: var(--danger); }
.ql-btn.ql-del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.ql-item-results {
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 180px;
    overflow-y: auto;
    background: var(--surface);
}

.ql-item-result {
    padding: 9px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.12s ease;
}

.ql-item-result:hover { background: rgba(99, 102, 241, 0.08); }
.ql-item-result.selected { background: rgba(99, 102, 241, 0.15); color: var(--primary); font-weight: 600; }

/* --------------------------------------------------------------------------
   17. Icon picker
   -------------------------------------------------------------------------- */
.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.icon-opt {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.12s ease;
}

.icon-opt:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.icon-opt.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* --------------------------------------------------------------------------
   18. Create wizard / stepper / cost panel
   -------------------------------------------------------------------------- */
.wizard-toolbar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.stepper {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
}

.stepper .step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--surface);
    transition: all 0.15s ease;
}

.stepper .step .step-num {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--border-2);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.stepper .step.active {
    border-color: var(--accent);
    color: var(--text);
    background: var(--primary-soft);
    box-shadow: var(--shadow-xs);
}

.stepper .step.active .step-num { background: var(--gradient); color: #fff; }

.wizard-body { min-height: 320px; }
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.wizard-title { margin: 0 0 16px; font-size: 1.05rem; color: var(--text); }

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.wizard-progress { color: var(--text-muted); font-size: 0.85rem; }

.cost-panel {
    margin-top: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    max-width: 460px;
}

.cost-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cost-line .cost-amount { font-family: var(--mono); color: var(--text); font-weight: 600; }
.cost-line-note { font-size: 0.78rem; color: var(--text-muted); }

.cost-line.live { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }
.cost-line.live .cost-amount { color: #059669; }

/* --------------------------------------------------------------------------
   19. Bulk action bar / estimate / plan form
   -------------------------------------------------------------------------- */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(99, 102, 241, 0.07);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-2);
    font-weight: 600;
}

/* column visibility picker */
.col-picker-wrap { position: relative; }
.col-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 8px;
    min-width: 190px;
}
.col-menu-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding: 4px 8px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.col-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
}
.col-menu-item:hover { background: var(--surface-2); }
.col-menu-item input { margin: 0; accent-color: var(--primary); }

.estimate-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.estimate-amount { color: var(--success); font-weight: 800; font-size: 1.1rem; font-family: var(--mono); }

.plan-form { border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 15px; }

.countdown { font-family: var(--mono); font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }
.countdown-cell .countdown { color: var(--warning); }

/* --------------------------------------------------------------------------
   20. Feed / RSS
   -------------------------------------------------------------------------- */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.feed-grid .card { margin-bottom: 0; }

.feed-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xs);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.feed-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.feed-icon { font-size: 1.5rem; color: var(--warning); }

.feed-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    min-width: 0;
}

.feed-info strong { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-info small { color: var(--text-muted); }

.feed-actions { display: flex; gap: 4px; flex-shrink: 0; }

.feed-url {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.78rem;
    color: var(--primary);
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
    font-family: var(--mono);
}

.rss-preview {
    background: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: #cbd5e1;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 70vh;
    overflow-y: auto;
}

/* --------------------------------------------------------------------------
   21. Charts & analytics
   -------------------------------------------------------------------------- */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }

.bar-item { display: flex; align-items: center; gap: 10px; }

.bar-label {
    min-width: 100px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    min-width: 30px;
    transition: width 0.5s ease;
}

.bar-fill span { font-size: 0.75rem; font-weight: 700; color: #fff; }

/* vertical analytics bars */
.bar-chart {
    display: flex;
    gap: 2px;
    width: 100%;
    overflow-x: auto;
}

.bar-col {
    flex: 1;
    min-width: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.bar-stack {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    gap: 1px;
}

.bar {
    width: 100%;
    border-radius: 2px;
    min-height: 2px;
}

.bar.created { background: #60a5fa; }
.bar.active { background: #34d399; }
.bar.cost { background: #fbbf24; }

.legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 4px;
}

.legend-dot.created { background: #60a5fa; }
.legend-dot.active { background: #34d399; }
.legend-dot.cost { background: #fbbf24; }

.h-bars { display: flex; flex-direction: column; gap: 8px; }
.h-bar-row { display: flex; align-items: center; gap: 10px; }
.h-bar-label {
    width: 110px;
    flex-shrink: 0;
    font-size: 0.82rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.h-bar-track {
    flex: 1;
    height: 12px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.h-bar-fill { height: 100%; background: #818cf8; border-radius: 8px; min-width: 0; }
.h-bar-fill.user { background: #60a5fa; }
.h-bar-fill.status { background: #34d399; }
.h-bar-value {
    width: 120px;
    flex-shrink: 0;
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   22. Account tracking
   -------------------------------------------------------------------------- */
.progress {
    height: 10px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient);
    border-radius: 8px;
    transition: width 0.4s ease;
}

.progress-num { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.progress-block { margin-bottom: 14px; }

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-2);
    margin-bottom: 5px;
    font-weight: 600;
}

.pw-val {
    margin-right: 6px;
    font-family: var(--mono);
    font-size: 0.86rem;
    letter-spacing: 0.3px;
}

.text-right { text-align: right; }

/* --------------------------------------------------------------------------
   23. Toast
   -------------------------------------------------------------------------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--gradient);
    color: #fff;
    padding: 13px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------------------
   24. Branding
   -------------------------------------------------------------------------- */
.sidebar-logo {
    max-height: 26px;
    max-width: 110px;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 4px;
}

.brand-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--primary-soft);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius-sm);
    min-height: 52px;
}

/* --------------------------------------------------------------------------
   25. Recent items / team list
   -------------------------------------------------------------------------- */
.recent-list { list-style: none; }

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    color: var(--text);
}

.recent-item:hover { color: var(--primary); }

.recent-title { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-date { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }

.team-list { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }

/* --------------------------------------------------------------------------
   26. Row / grid utilities
   -------------------------------------------------------------------------- */
.row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.row > .col-2 { flex: 1 1 calc(16.667% - 12px); min-width: 0; }
.row > .col-3 { flex: 1 1 calc(25% - 11px); min-width: 0; }
.row > .col-4 { flex: 1 1 calc(33.333% - 10px); min-width: 0; }
.row > .col-6 { flex: 1 1 calc(50% - 7px); min-width: 0; }
.row > .col-8 { flex: 1 1 calc(66.667% - 5px); min-width: 0; }
.row > .col-9 { flex: 1 1 calc(75% - 4px); min-width: 0; }

/* --------------------------------------------------------------------------
   27. Login
   -------------------------------------------------------------------------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg);
    background-image:
        radial-gradient(900px 500px at 15% -10%, rgba(139, 92, 246, 0.35), transparent 60%),
        radial-gradient(800px 500px at 90% 110%, rgba(99, 102, 241, 0.3), transparent 60%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(700px 500px at 50% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(700px 500px at 50% 40%, #000 30%, transparent 75%);
}

.login-card {
    position: relative;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}

.login-header { text-align: center; margin-bottom: 30px; }

.login-header i {
    font-size: 2.6rem;
    color: #fff;
    background: var(--gradient);
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: var(--shadow-md);
}

.login-header h2 { font-size: 1.5rem; color: var(--text); letter-spacing: -0.02em; }
.login-header p { color: var(--text-muted); font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   27b. RDP Servers — senior dashboard design
   -------------------------------------------------------------------------- */

/* KPI strip */
.rdp-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.rdp-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}
.rdp-kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.rdp-kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.rdp-kpi-live .rdp-kpi-icon { background: rgba(16,185,129,0.12); color: #10b981; }
.rdp-kpi-creating .rdp-kpi-icon { background: rgba(59,130,246,0.12); color: #3b82f6; }
.rdp-kpi-expiring .rdp-kpi-icon { background: rgba(245,158,11,0.14); color: #f59e0b; }
.rdp-kpi-errors .rdp-kpi-icon { background: rgba(239,68,68,0.12); color: #ef4444; }
.rdp-kpi-cost .rdp-kpi-icon { background: rgba(99,102,241,0.12); color: #6366f1; }
.rdp-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.rdp-kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toolbar */
.rdp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.rdp-toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rdp-search {
    position: relative;
    display: flex;
    align-items: center;
}
.rdp-search i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.rdp-search input {
    padding: 9px 12px 9px 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 0.88rem;
    width: 240px;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rdp-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.rdp-count { font-size: 0.88rem; color: var(--text-muted); }
.rdp-count strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* Responsive table (desktop table, mobile stacked cards) */
.rdp-table-scroll {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.rdp-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
    width: 100%;
}
.rdp-table th { white-space: nowrap; }
.rdp-table tbody tr:nth-child(even) { background: rgba(241, 245, 249, 0.5); }
.rdp-table tbody tr:hover { background: rgba(99, 102, 241, 0.06); }
.rdp-check-col { width: 36px; text-align: center; }
.rdp-check-col input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Sticky Actions column: always visible while the table scrolls horizontally */
.rdp-actions-col {
    width: 104px;
    text-align: right;
    position: sticky;
    right: 0;
    z-index: 4;
    background: var(--surface);
    box-shadow: -6px 0 12px -10px rgba(15, 23, 42, 0.35);
}
.rdp-table thead .rdp-actions-col {
    background: var(--surface-2);
    z-index: 6;
}
.rdp-table tbody tr:nth-child(even) .rdp-actions-col { background: rgba(241, 245, 249, 0.5); }
.rdp-table tbody tr:hover .rdp-actions-col { background: rgba(99, 102, 241, 0.06); }
.rdp-cell-actions { display: inline-flex; gap: 6px; align-items: center; }
.rdp-ip { font-family: var(--mono); font-size: 0.84rem; }
.rdp-ready-text {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.rdp-ready-on { color: #059669; }
.rdp-ready-wait { color: #d97706; }
.rdp-cost { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rdp-no-rows td { padding: 48px 20px !important; }

/* Collapse to stacked labeled cards on narrow screens */
@media (max-width: 900px) {
    .rdp-table-scroll { overflow: visible; border: none; background: transparent; box-shadow: none; }
    .rdp-table,
    .rdp-table thead,
    .rdp-table tbody,
    .rdp-table tr,
    .rdp-table th,
    .rdp-table td { display: block; width: 100%; }
    .rdp-table thead { display: none; }
    .rdp-table tbody { display: flex; flex-direction: column; gap: 12px; }
    .rdp-table tbody tr {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-xs);
        overflow: hidden;
        padding: 6px 14px;
    }
    .rdp-table tbody tr[data-id]:hover { box-shadow: var(--shadow); }
    .rdp-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 8px 0;
        border-bottom: 1px dashed var(--border);
        min-width: 0;
        text-align: right;
    }
    .rdp-table tbody td:last-child { border-bottom: none; }
    .rdp-table tbody td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: var(--text-muted);
        white-space: nowrap;
        flex-shrink: 0;
    }
    .rdp-table tbody td.rdp-check-col {
        justify-content: flex-start;
        border-bottom: 1px solid var(--border);
        padding: 10px 0 12px;
        margin-bottom: 6px;
    }
    .rdp-table tbody td.rdp-check-col::before { content: 'Select'; }
    .rdp-table tbody td.rdp-actions-col {
        justify-content: flex-end;
        border-top: 1px solid var(--border);
        padding-top: 12px;
        margin-top: 6px;
        width: 100%;
        position: static;
        background: var(--surface);
        box-shadow: none;
    }
    .rdp-table tbody td.rdp-actions-col::before { content: ''; }
    .rdp-no-rows td { text-align: center !important; }
}

@media (max-width: 640px) {
    .rdp-search input { width: 100%; }
    .rdp-toolbar { flex-direction: column; align-items: stretch; }
    .rdp-toolbar-left { justify-content: space-between; }
    .rdp-search { flex: 1; }
    .rdp-search input { flex: 1; }
    .bulk-bar { width: 100%; justify-content: center; }
    .rdp-kpis { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   28. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .sidebar-toggle { display: inline-flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }

    .wrapper.sidebar-open .sidebar { transform: translateX(0); box-shadow: 4px 0 24px rgba(15, 23, 42, 0.25); }

    .main-content { margin-left: 0; padding: 70px 18px 40px; }

    .wrapper.sidebar-open .main-content::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 99;
    }
}

@media (max-width: 768px) {
    .row > [class*="col-"] { flex: 0 0 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .search-form .form-control { min-width: 100px; }
    .table { display: block; overflow-x: auto; }
    .page-header h1 { font-size: 1.35rem; }
    .login-card { padding: 28px; }
    .main-content { padding: 70px 16px 40px; }
    .bulk-bar { flex-wrap: wrap; }
}

@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr; }
    .rdp-kpis { grid-template-columns: 1fr; }
    .rdp-kpi { padding: 12px 14px; }
    .rdp-search input { width: 100%; }
    .col-menu { right: auto; left: 0; }
}