/* ═══════════════════════════════════════════
   Design System — Light & Dark Mode
   Pink / Purple / Amber / Teal palette
   ═══════════════════════════════════════════ */

/* ── CSS Custom Properties ── */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);

    --transition: 150ms ease;
    --sidebar-width: 240px;

    /* Palette constants */
    --purple: #9333ea;
    --purple-light: #a855f7;
    --pink: #db2777;
    --pink-light: #ec4899;
    --teal: #0d9488;
    --teal-light: #2dd4bf;
    --amber: #d97706;
    --amber-light: #f59e0b;
}

/* Light theme (default) */
:root, [data-theme="light"] {
    --bg-body: #f7f5fa;
    --bg-surface: #ffffff;
    --bg-surface-hover: #faf8fc;
    --bg-surface-raised: #ffffff;
    --bg-sidebar: #1c1030;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-sidebar-active: rgba(168,85,247,0.2);
    --bg-input: #ffffff;
    --bg-muted: #f1edf7;
    --bg-accent: #9333ea;
    --bg-accent-hover: #7e22ce;

    --text-primary: #1a1028;
    --text-secondary: #6b6080;
    --text-tertiary: #9890a8;
    --text-inverse: #ffffff;
    --text-sidebar: rgba(255,255,255,0.65);
    --text-sidebar-active: #ffffff;
    --text-accent: #7c3aed;
    --text-link: #7c3aed;

    --border-default: #e4dff0;
    --border-light: #ede9f5;
    --border-input: #d0c8e0;
    --border-input-focus: #9333ea;

    --status-success: #0d9488;
    --status-success-bg: #f0fdfa;
    --status-warning: #d97706;
    --status-warning-bg: #fffbeb;
    --status-danger: #db2777;
    --status-danger-bg: #fdf2f8;
    --status-info: #7c3aed;
    --status-info-bg: #f5f3ff;
    --status-muted: #6b6080;
    --status-muted-bg: #f1edf7;

    --focus-ring: rgba(147,51,234,0.15);

    color-scheme: light;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-body: #0b0a12;
    --bg-surface: #14132a;
    --bg-surface-hover: #1c1a35;
    --bg-surface-raised: #19172e;
    --bg-sidebar: #0d0c18;
    --bg-sidebar-hover: rgba(255,255,255,0.05);
    --bg-sidebar-active: rgba(168,85,247,0.15);
    --bg-input: #19172e;
    --bg-muted: #1c1a35;
    --bg-accent: #a855f7;
    --bg-accent-hover: #9333ea;

    --text-primary: #e8e4f0;
    --text-secondary: #9890ad;
    --text-tertiary: #6b6585;
    --text-inverse: #0b0a12;
    --text-sidebar: rgba(255,255,255,0.55);
    --text-sidebar-active: #ffffff;
    --text-accent: #c084fc;
    --text-link: #c084fc;

    --border-default: #28254a;
    --border-light: #1e1c38;
    --border-input: #383460;
    --border-input-focus: #a855f7;

    --status-success: #2dd4bf;
    --status-success-bg: rgba(13,148,136,0.12);
    --status-warning: #fbbf24;
    --status-warning-bg: rgba(217,119,6,0.12);
    --status-danger: #ec4899;
    --status-danger-bg: rgba(219,39,119,0.12);
    --status-info: #c084fc;
    --status-info-bg: rgba(147,51,234,0.12);
    --status-muted: #9890ad;
    --status-muted-bg: rgba(107,101,133,0.12);

    --focus-ring: rgba(168,85,247,0.25);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);

    --bs-body-color: var(--text-primary);

    color-scheme: dark;
}

/* ── Load Inter font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Base ── */

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ── App Layout ── */

.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Sidebar ── */

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #fff;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

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

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    padding: 8px 10px 6px;
}

.app-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    margin-bottom: 1px;
}

.app-sidebar .nav-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.app-sidebar .nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.app-sidebar .nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    border-left: 2px solid var(--purple-light);
    padding-left: 8px;
}

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

.sidebar-user {
    margin-top: 2px;
}

.sidebar-logout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logout-row form {
    flex: 1;
    min-width: 0;
}

.logout-btn {
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    padding: 8px 10px;
    color: var(--text-sidebar);
}

.logout-btn:hover {
    color: var(--text-sidebar-active);
    background: var(--bg-sidebar-hover);
    border-radius: var(--radius-sm);
}

/* Theme toggle switch */
.theme-switch {
    display: flex;
    align-items: center;
    padding: 0;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.theme-switch input {
    display: none;
}

.theme-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(255,255,255,0.12);
    border-radius: 11px;
    transition: background var(--transition);
    flex-shrink: 0;
}

.theme-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
}

.theme-switch input:checked ~ .theme-slider {
    background: var(--bg-accent);
}

.theme-switch input:checked ~ .theme-slider::before {
    transform: translateX(18px);
}

.theme-slider .theme-icon-light,
.theme-slider .theme-icon-dark {
    position: absolute;
    top: 4px;
    font-size: 10px;
    line-height: 14px;
}

.theme-slider .theme-icon-light {
    left: 5px;
    color: rgba(255,255,255,0.5);
}

.theme-slider .theme-icon-dark {
    right: 5px;
    color: rgba(255,255,255,0.5);
}

/* ── Content Header ── */

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    border-bottom: 1px solid var(--border-default);
    background: var(--bg-surface);
    flex-shrink: 0;
    min-height: 48px;
}

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

.header-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.header-sep {
    color: var(--text-tertiary);
    font-size: 13px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb {
    font-size: 13px;
    margin: 0;
    background: none;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-tertiary);
}

/* ── Content Main ── */

.content-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* ── Typography ── */

h1, .h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

h2, .h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

h3, .h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

h4, .h4, h5, .h5, h6, .h6 {
    color: var(--text-primary);
}

/* ── Cards ── */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-default);
    padding: 14px 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* ── Stat Cards (Dashboard) ── */

.stat-card {
    border: 1px solid var(--border-default);
    border-left: 4px solid;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
    padding: 16px 20px;
}

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

.stat-card.border-primary { border-left-color: var(--purple-light) !important; }
.stat-card.border-success { border-left-color: var(--teal-light) !important; }
.stat-card.border-warning { border-left-color: var(--amber-light) !important; }
.stat-card.border-danger { border-left-color: var(--pink-light) !important; }

.stat-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1;
}

/* ── Tables ── */

.table {
    color: var(--text-primary);
    border-color: var(--border-default);
}

.table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text-primary);
    border-bottom-color: var(--border-default);
    padding: 10px 14px;
}

.table > thead > tr > th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-default);
    white-space: nowrap;
    background: var(--bg-muted);
}

.table-hover > tbody > tr:hover > * {
    background: var(--bg-surface-hover);
}

.table-light {
    --bs-table-bg: var(--bg-muted);
    --bs-table-border-color: var(--border-default);
}

/* Grid View */
.grid-view {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.grid-view .table {
    margin-bottom: 0;
}

.grid-view .summary {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-default);
}

.grid-view th {
    white-space: nowrap;
}

a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px var(--text-secondary);
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px var(--text-secondary);
    border-bottom-width: 0;
}

/* Detail View */
.table.detail-view {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.table.detail-view > :not(caption) > * > * {
    border-bottom-color: var(--border-default);
}

.table.detail-view th {
    font-weight: 600;
    width: 180px;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    background: var(--bg-muted);
}

.table.detail-view td {
    background: var(--bg-surface);
}

/* Pagination */
.pagination {
    gap: 2px;
    padding: 12px 14px;
}

.page-link {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    background: var(--bg-surface);
    font-size: 13px;
    padding: 5px 10px;
}

.page-link:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.page-item.active .page-link {
    background: var(--bg-accent);
    border-color: var(--bg-accent);
    color: #fff;
}

.page-item.disabled .page-link {
    background: var(--bg-muted);
    color: var(--text-tertiary);
}

/* ── Buttons ── */

.btn {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    transition: all var(--transition);
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background: var(--bg-accent-hover);
    border-color: var(--bg-accent-hover);
}

.btn-primary:focus-visible,
.btn-outline-primary:focus-visible {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn-outline-primary {
    color: var(--text-accent);
    border-color: var(--border-input);
    background: transparent;
}

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

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-input);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
    border-color: var(--border-input);
}

.btn-danger {
    background: var(--status-danger);
    border-color: var(--status-danger);
    color: #fff;
}

.btn-outline-danger {
    color: var(--status-danger);
    border-color: var(--border-input);
}

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

.btn-success {
    background: var(--status-success);
    border-color: var(--status-success);
    color: #fff;
}

.btn-outline-light {
    color: var(--text-sidebar);
    border-color: rgba(255,255,255,0.15);
}

.btn-sm {
    font-size: 12px;
    padding: 4px 10px;
}

/* ── Button Groups ── */

.btn-toolbar {
    gap: 8px;
    justify-content: flex-end;
}

.btn-group form {
    display: inline-flex;
}

.btn-group form .btn {
    border-radius: 0;
}

.btn-group > :first-child,
.btn-group > :first-child .btn {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.btn-group > :last-child,
.btn-group > :last-child .btn {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

/* ── GridView Action Column ── */

.action-column {
    white-space: nowrap;
}

.action-column a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    border: 1px solid var(--border-input);
    background: var(--bg-surface);
    color: var(--text-secondary);
    vertical-align: middle;
    transition: all var(--transition);
    margin-left: -1px;
}

.action-column a:first-child {
    margin-left: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.action-column a:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.action-column a:only-child {
    border-radius: var(--radius-sm);
}

.action-column a:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
    z-index: 1;
}

.action-column a svg {
    width: 14px;
    height: 14px;
}

/* ── Forms ── */

.form-control, .form-select {
    font-family: var(--font-sans);
    font-size: 14px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 8px 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--border-input-focus);
    box-shadow: 0 0 0 3px var(--focus-ring);
    background: var(--bg-input);
    color: var(--text-primary);
}

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

.form-control-sm {
    font-size: 13px;
    padding: 5px 10px;
}

.form-label, .control-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group {
    margin-bottom: 16px;
}

.form-check-input {
    border-color: var(--border-input);
}

.form-check-input:checked {
    background-color: var(--bg-accent);
    border-color: var(--bg-accent);
}

.form-check-label {
    color: var(--text-primary);
}

.input-group-text {
    background: var(--bg-muted);
    border-color: var(--border-input);
    color: var(--text-secondary);
    font-size: 13px;
}

.invalid-feedback, .help-block {
    font-size: 12px;
}

.has-error .form-control {
    border-color: var(--status-danger);
}

/* ── Status Badges ── */

.badge {
    font-weight: 500;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.badge-status-draft { background: var(--status-muted-bg); color: var(--status-muted); }
.badge-status-active { background: var(--status-success-bg); color: var(--status-success); }
.badge-status-on_hold { background: var(--status-warning-bg); color: var(--status-warning); }
.badge-status-completed { background: var(--status-info-bg); color: var(--status-info); }
.badge-status-cancelled { background: var(--status-danger-bg); color: var(--status-danger); }
.badge-status-sent { background: var(--status-info-bg); color: var(--status-info); }
.badge-status-paid { background: var(--status-success-bg); color: var(--status-success); }
.badge-status-overdue { background: var(--status-danger-bg); color: var(--status-danger); }

.bg-secondary {
    background: var(--status-muted-bg) !important;
    color: var(--status-muted) !important;
}

/* ── Alerts ── */

.alert {
    border-radius: var(--radius-md);
    border: 1px solid;
    font-size: 13px;
    padding: 12px 16px;
}

.alert-success {
    background: var(--status-success-bg);
    border-color: var(--status-success);
    color: var(--status-success);
}

.alert-danger {
    background: var(--status-danger-bg);
    border-color: var(--status-danger);
    color: var(--status-danger);
}

.alert-warning {
    background: var(--status-warning-bg);
    border-color: var(--status-warning);
    color: var(--status-warning);
}

/* ── Modals ── */

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom-color: var(--border-default);
    padding: 16px 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    color: var(--text-primary);
}

.modal-footer {
    border-top-color: var(--border-default);
    padding: 12px 20px;
}

.btn-close {
    filter: var(--text-primary);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ── Nav Tabs ── */

.nav-tabs {
    border-bottom-color: var(--border-default);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-color: var(--border-default) var(--border-default) transparent;
    background: var(--bg-surface-hover);
}

.nav-tabs .nav-link.active {
    color: var(--text-accent);
    background: var(--bg-surface);
    border-color: var(--border-default) var(--border-default) var(--bg-surface);
}

/* ── Utility ── */

.not-set {
    color: var(--text-tertiary);
    font-style: italic;
}

.error-summary {
    color: var(--status-danger);
    background: var(--status-danger-bg);
    border-left: 3px solid var(--status-danger);
    padding: 10px 20px;
    margin: 0 0 15px 0;
    border-radius: var(--radius-sm);
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* ── Login Page ── */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
}

.login-card {
    width: 400px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.login-logo .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
}

.login-logo .logo-text {
    font-size: 22px;
    color: var(--text-primary);
}

/* ── Totals Section (Invoice) ── */

.totals-section {
    max-width: 450px;
    margin-left: auto;
}

.totals-table {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.totals-table td {
    padding: 6px 14px !important;
    font-size: 13px;
}

/* ── DetailView dark mode fix ── */

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

[data-theme="dark"] .table-bordered {
    border-color: var(--border-default);
}

/* ── Dropdowns ── */

.dropdown-menu {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
}

.dropdown-item {
    color: var(--text-primary);
    font-size: 13px;
}

.dropdown-item:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.dropdown-item:active {
    background: var(--bg-accent);
    color: #fff;
}

/* ── Bootstrap overrides for dark mode ── */

[data-theme="dark"] .bg-light {
    background: var(--bg-muted) !important;
}

[data-theme="dark"] .border-secondary {
    border-color: var(--border-default) !important;
}

[data-theme="dark"] .table-light > * > * {
    background: var(--bg-muted);
    color: var(--text-primary);
}

/* ── Accent color utilities ── */

.text-purple { color: var(--purple-light); }
.text-pink { color: var(--pink-light); }
.text-teal { color: var(--teal-light); }
.text-amber { color: var(--amber-light); }

.bg-purple-subtle { background: rgba(147,51,234,0.1); }
.bg-pink-subtle { background: rgba(219,39,119,0.1); }
.bg-teal-subtle { background: rgba(13,148,136,0.1); }
.bg-amber-subtle { background: rgba(217,119,6,0.1); }

/* ── Scrollbar styling ── */

.content-main::-webkit-scrollbar {
    width: 6px;
}

.content-main::-webkit-scrollbar-track {
    background: transparent;
}

.content-main::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

.content-main::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ── Selection color ── */

::selection {
    background: rgba(147,51,234,0.25);
    color: inherit;
}

[data-theme="dark"] ::selection {
    background: rgba(168,85,247,0.35);
}
