/* ======================================================================
   ПДн Комплаенс — Дизайн-система НЭК.ТЕХ
   Тёмная тема / Bootstrap 5.3 dark override
   ====================================================================== */

/* --- CSS Custom Properties (НЭК.ТЕХ brand) --- */
:root {
    --bg-primary:    #141414;
    --bg-surface:    #1e1e1e;
    --bg-sidebar:    #0d0d0d;
    --bg-elevated:   #252525;
    --accent:        #00cb62;
    --accent-hover:  #00a550;
    --accent-dim:    rgba(0, 203, 98, 0.12);
    --text-primary:  #ffffff;
    --text-secondary:#8a8a8a;
    --text-muted:    #555555;
    --border:        #2a2a2a;
    --border-light:  #333333;
    --danger:        #f04c4c;
    --warning:       #f0a020;
    --info:          #4c9ef0;
    --success:       #00cb62;
    --sidebar-width: 250px;
    --topbar-height: 56px;
    --radius-sm:     4px;
    --radius-md:     8px;
    --radius-lg:     12px;
    --shadow-sm:     0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-md:     0 4px 16px rgba(0, 0, 0, 0.5);
    --transition:    0.18s ease;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Golos Text', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* --- Bootstrap dark overrides --- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.modal-header {
    border-bottom-color: var(--border);
}

.modal-footer {
    border-top-color: var(--border);
}

.form-control,
.form-select {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 203, 98, 0.18);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(0, 203, 98, 0.05);
    --bs-table-border-color: var(--border);
    color: var(--text-primary);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Статусные строки таблицы проверок */
.row-overdue {
    background: rgba(240, 76, 76, 0.08) !important;
    border-left: 3px solid var(--danger);
}
.row-due-soon {
    background: rgba(240, 160, 32, 0.08) !important;
    border-left: 3px solid var(--warning);
}

/* --- Sidebar --- */
.pdn-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    transition: transform var(--transition);
}

.pdn-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 18px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.pdn-brand:hover {
    color: var(--text-primary);
}

.pdn-brand-icon {
    font-size: 1.75rem;
    color: var(--accent);
    line-height: 1;
}

.pdn-brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.pdn-brand-sub {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 1px;
}

.pdn-nav {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 12px 0;
}

.pdn-nav li {
    margin: 0;
}

.pdn-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
}

.pdn-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.pdn-nav-link.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

.pdn-nav-link .bi {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.pdn-sidebar-upload {
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.pdn-sidebar-user {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.pdn-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* --- Mobile overlay --- */
.pdn-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1039;
}

.pdn-overlay.show {
    display: block;
}

/* --- Top bar --- */
.pdn-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1030;
}

.pdn-menu-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.pdn-topbar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.pdn-topbar-org {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Main content --- */
.pdn-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
}

/* --- Page header --- */
.page-header {
    margin-bottom: 24px;
}

.page-header h1,
.page-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-header .page-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- KPI Cards --- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color var(--transition);
}

.kpi-card:hover {
    border-color: var(--border-light);
}

a.kpi-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

a.kpi-card:hover {
    border-color: var(--accent);
}

.kpi-icon {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon.green  { background: rgba(0, 203, 98, 0.12);  color: var(--accent); }
.kpi-icon.red    { background: rgba(240, 76, 76, 0.12);  color: var(--danger); }
.kpi-icon.yellow { background: rgba(240, 160, 32, 0.12); color: var(--warning); }
.kpi-icon.blue   { background: rgba(76, 158, 240, 0.12); color: var(--info); }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Widget cards --- */
.widget-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.widget-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.widget-action {
    font-size: 0.8rem;
    color: var(--accent);
    cursor: pointer;
}

.widget-action:hover {
    color: var(--accent-hover);
}

/* --- Status badges --- */
.badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.badge-approved,
.badge-active,
.badge-success {
    background: rgba(0, 203, 98, 0.15);
    color: var(--accent);
}

.badge-draft,
.badge-warning {
    background: rgba(240, 160, 32, 0.15);
    color: var(--warning);
}

.badge-expired,
.badge-missing,
.badge-danger {
    background: rgba(240, 76, 76, 0.15);
    color: var(--danger);
}

.badge-revoked,
.badge-secondary {
    background: rgba(138, 138, 138, 0.15);
    color: var(--text-secondary);
}

/* ISPDn level badges */
.badge-uz1 { background: rgba(240,  76,  76, 0.15); color: var(--danger); }
.badge-uz2 { background: rgba(240, 160,  32, 0.15); color: var(--warning); }
.badge-uz3 { background: rgba( 76, 158, 240, 0.15); color: var(--info); }
.badge-uz4 { background: rgba(  0, 203,  98, 0.15); color: var(--accent); }

/* Score colours */
.score-high   { color: var(--accent); }
.score-medium { color: var(--warning); }
.score-low    { color: var(--danger); }

/* --- Charts --- */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.chart-container-bars {
    position: relative;
    width: 100%;
    min-height: 260px;
}

/* --- Notifications --- */
.notification-list {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

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

.severity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.severity-dot.critical { background: var(--danger); }
.severity-dot.warning  { background: var(--warning); }
.severity-dot.info     { background: var(--info); }

.notification-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.4;
}

.notification-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.notification-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- Filter bar --- */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

/* --- Progress mini --- */
.progress-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-mini-track {
    flex: 1;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.progress-mini-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
    transition: width 0.4s ease;
}

/* --- Category score bar --- */
.category-score-bar {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.category-score-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
    transition: width 0.4s ease;
}

/* --- Upload zone --- */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-surface);
    transition: all var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Buttons (Bootstrap override) --- */
.btn-accent {
    background: var(--accent);
    color: #000;
    border: none;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #000;
}

.btn-outline-accent {
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    transition: all var(--transition);
}

.btn-outline-accent:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

/* --- HTMX loading --- */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Dashboard clickable rows (Задача 1) --- */
.dashboard-clickable-row {
    cursor: pointer;
    transition: background-color var(--transition);
}

tr.dashboard-clickable-row:hover {
    background-color: rgba(0, 203, 98, 0.06) !important;
}

div.dashboard-clickable-row:hover {
    background-color: rgba(0, 203, 98, 0.06);
}

/* ISPDn items on dashboard hover */
a > div.dashboard-clickable-row:hover {
    border-color: rgba(0, 203, 98, 0.4) !important;
    box-shadow: 0 0 0 1px rgba(0, 203, 98, 0.2);
}

/* --- ISPDn card clickable collapse (Задача 3) --- */
.ispdn-card-clickable {
    transition: border-color var(--transition), box-shadow var(--transition);
}

.ispdn-card-clickable:hover {
    border-color: rgba(0, 203, 98, 0.4) !important;
    box-shadow: 0 0 0 1px rgba(0, 203, 98, 0.15), var(--shadow-md);
}

/* Clickable header wrapper (collapse trigger — inner div only) */
.ispdn-header-clickable {
    cursor: pointer;
}

/* Chevron transition */
.ispdn-collapse-chevron {
    transition: transform var(--transition);
}

/* --- Responsive --- */
@media (max-width: 1199.98px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991.98px) {
    .pdn-sidebar {
        transform: translateX(-100%);
    }

    .pdn-sidebar.show {
        transform: translateX(0);
    }

    .pdn-topbar,
    .pdn-main {
        margin-left: 0;
        left: 0;
    }
}

@media (max-width: 575.98px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }

    .pdn-main {
        padding: 16px;
    }
}

/* --- Print --- */
@media print {
    .pdn-sidebar,
    .pdn-topbar,
    .pdn-menu-btn,
    .filter-bar,
    .upload-zone { display: none !important; }

    .pdn-main {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* ── Toast ─────────────────────────────────────────────────────────── */
.pdn-toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border) !important;
    color: var(--text-primary);
    min-width: 280px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-md);
}
.pdn-toast .btn-close-white {
    filter: invert(1) grayscale(1);
    opacity: 0.6;
}
.pdn-toast .btn-close-white:hover {
    opacity: 1;
}
.pdn-toast #pdn-toast-icon {
    font-size: 1rem;
    color: var(--accent);
}
.pdn-toast.toast-error #pdn-toast-icon {
    color: var(--danger);
}

/* ── Walkthrough v2 — Material Design + Glassmorphism ─────── */
.pdn-walkthrough-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1070;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.pdn-walkthrough-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Pulse ring around target */
.pdn-walkthrough-pulse {
    position: absolute;
    z-index: 1071;
    pointer-events: none;
    border: 2px solid rgba(0, 203, 98, 0.6);
    animation: pdn-pulse-ring 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes pdn-pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(0, 203, 98, 0.4); }
    70%  { box-shadow: 0 0 0 14px rgba(0, 203, 98, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 203, 98, 0); }
}

/* Tooltip wrapper */
.pdn-wt-tooltip {
    position: absolute;
    z-index: 1080;
    width: 360px;
    max-width: calc(100vw - 32px);
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}
.pdn-wt-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.pdn-wt-pos-top {
    transform: translateY(-12px) scale(0.97);
}
.pdn-wt-pos-top.visible {
    transform: translateY(0) scale(1);
}
.pdn-wt-pos-left {
    transform: translateX(-12px) scale(0.97);
}
.pdn-wt-pos-left.visible {
    transform: translateX(0) scale(1);
}
.pdn-wt-pos-right {
    transform: translateX(12px) scale(0.97);
}
.pdn-wt-pos-right.visible {
    transform: translateX(0) scale(1);
}

/* Glass card — Material 3 elevated surface */
.pdn-wt-card {
    background: rgba(30, 30, 30, 0.78);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 203, 98, 0.1);
    overflow: hidden;
}

/* Header — spacious, no border */
.pdn-wt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.pdn-wt-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.01em;
}
.pdn-wt-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-muted, #8a8a8a);
    font-size: 1rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.pdn-wt-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Body — generous padding */
.pdn-wt-body {
    padding: 14px 24px 20px;
    font-size: 0.84rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.7);
}

/* Footer — airy layout */
.pdn-wt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Dot indicators — Material ripple-like */
.pdn-wt-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pdn-wt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.pdn-wt-dot.active {
    background: var(--accent);
    transform: scale(1.35);
    box-shadow: 0 0 8px rgba(0, 203, 98, 0.35);
}

/* Action buttons — Material filled/text style */
.pdn-wt-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pdn-wt-btn-skip,
.pdn-wt-btn-prev {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
    letter-spacing: 0.02em;
}
.pdn-wt-btn-skip:hover,
.pdn-wt-btn-prev:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.pdn-wt-btn-next {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 8px 22px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0, 203, 98, 0.25);
}
.pdn-wt-btn-next:hover {
    background: var(--accent-hover, #00a550);
    box-shadow: 0 4px 16px rgba(0, 203, 98, 0.35);
}

/* ── Learning mode toggle ────────────────────────────────── */
.pdn-learning-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 0.72rem;
    color: var(--text-muted, #8a8a8a);
    transition: color 0.15s;
}
.pdn-learning-toggle:hover {
    color: var(--accent);
}
.pdn-learning-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 32px;
    height: 18px;
    border-radius: 9px;
    background: var(--border, #2a2a2a);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.pdn-learning-toggle input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted, #8a8a8a);
    transition: transform 0.2s, background 0.2s;
}
.pdn-learning-toggle input[type="checkbox"]:checked {
    background: var(--accent);
}
.pdn-learning-toggle input[type="checkbox"]:checked::after {
    transform: translateX(14px);
    background: #000;
}
.pdn-learning-toggle input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .pdn-walkthrough-backdrop { transition: none; }
    .pdn-wt-tooltip { transition: none; }
    .pdn-walkthrough-pulse { animation: none; }
    .pdn-wt-dot { transition: none; }
    .pdn-learning-toggle input[type="checkbox"],
    .pdn-learning-toggle input[type="checkbox"]::after { transition: none; }
}

/* =========================================================================
   Setup Wizard (split-layout)
   ========================================================================= */

.pdn-setup-layout {
    display: flex;
    min-height: 100vh;
}

.pdn-setup-sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--bg-sidebar, #0d0d0d) 0%, #111 100%);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.pdn-setup-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.pdn-setup-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent, #00cb62), #009945);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #000;
}

.pdn-setup-brand-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.pdn-setup-brand-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
}

.pdn-setup-steps {
    display: flex;
    flex-direction: column;
}

.pdn-setup-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.pdn-setup-step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.pdn-setup-step.active .pdn-setup-step-circle {
    background: var(--accent, #00cb62);
    color: #000;
    font-weight: 700;
}

.pdn-setup-step.completed .pdn-setup-step-circle {
    background: var(--accent, #00cb62);
    color: #000;
    font-weight: 700;
}

.pdn-setup-step.pending .pdn-setup-step-circle {
    border: 1.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.3);
}

.pdn-setup-step.optional.pending .pdn-setup-step-circle {
    border-style: dashed;
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.25);
}

.pdn-setup-step-title {
    font-size: 13px;
    font-weight: 500;
}

.pdn-setup-step.active .pdn-setup-step-title { color: #fff; }
.pdn-setup-step.completed .pdn-setup-step-title { color: rgba(255,255,255,0.6); }
.pdn-setup-step.pending .pdn-setup-step-title { color: rgba(255,255,255,0.35); }

.pdn-setup-step-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
}

.pdn-setup-step.active .pdn-setup-step-desc { color: rgba(255,255,255,0.4); }

.pdn-setup-optional {
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    margin-left: 4px;
}

.pdn-setup-step-connector {
    margin-left: 14px;
    width: 2px;
    height: 16px;
    background: rgba(255,255,255,0.08);
}

.pdn-setup-step-connector.completed {
    background: var(--accent, #00cb62);
    opacity: 0.4;
}

.pdn-setup-sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 10px;
    color: rgba(255,255,255,0.2);
}

.pdn-setup-content {
    flex: 1;
    padding: 48px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 640px;
}

.pdn-setup-form-wrapper {
    width: 100%;
    max-width: 520px;
}

.pdn-setup-form-header { margin-bottom: 32px; }

.pdn-setup-form-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.pdn-setup-form-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

.pdn-setup-label {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
    font-weight: 500;
    display: block;
}

.pdn-setup-input {
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-size: 14px;
}

.pdn-setup-input:focus {
    border-color: var(--accent, #00cb62) !important;
    box-shadow: 0 0 0 2px rgba(0,203,98,0.15) !important;
    outline: none;
}

.pdn-setup-field-autofill {
    background: rgba(0,203,98,0.04) !important;
    border-color: rgba(0,203,98,0.15) !important;
}

.pdn-setup-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
}

.pdn-setup-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin-top: 4px;
}

.pdn-setup-password-strength {
    height: 3px;
    border-radius: 2px;
    margin-top: 6px;
    width: 0;
    transition: width 0.3s ease, background 0.3s ease;
}

.pdn-setup-actions {
    margin-top: 28px;
    display: flex;
    justify-content: flex-end;
}

.pdn-setup-actions-split { justify-content: space-between; }

.pdn-setup-btn-next {
    padding: 10px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 12px rgba(0,203,98,0.25);
}

.pdn-setup-btn-skip {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .pdn-setup-layout { flex-direction: column; }
    .pdn-setup-sidebar {
        width: 100%;
        padding: 16px 20px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }
    .pdn-setup-brand { margin-bottom: 0; }
    .pdn-setup-steps { flex-direction: row; gap: 8px; flex-wrap: wrap; }
    .pdn-setup-step-connector { display: none; }
    .pdn-setup-step-desc, .pdn-setup-optional { display: none; }
    .pdn-setup-sidebar-footer { display: none; }
    .pdn-setup-content { padding: 24px 20px; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .pdn-setup-step-circle,
    .pdn-setup-password-strength,
    .pdn-setup-field-autofill {
        transition: none;
    }
}
