﻿:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --primary: #2563eb;
    --text: #0f172a;
    --muted: #6b7280;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --danger: #e55353;
    --success: #00a878;
    --border: #e5e7eb;
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5f5;
    --sidebar-active: #1e293b;
    --card-shadow: 0 8px 18px rgba(2, 6, 23, 0.08);
}

body.theme-dark {
    --bg: #0b1220;
    --card: #0f172a;
    --primary: #3b82f6;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --border: #1e293b;
    --sidebar-bg: #0b1220;
    --sidebar-text: #b6c0e0;
    --sidebar-active: #172554;
    --card-shadow: 0 12px 30px rgba(2, 6, 23, 0.45);
}

body.theme-dark .portal-page {
    --portal-bg: #0b1220;
    --portal-accent: #60a5fa;
    --portal-muted: #94a3b8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 16px 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    transition: width 0.2s ease, right 0.2s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    font-weight: 700;
    color: #fff;
}

.sidebar-brand .logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(59, 130, 246, 0.2);
}

.sidebar-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 16px 6px 8px;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.15);
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.9rem;
}

.shortcut:hover {
    background: rgba(59, 130, 246, 0.3);
}

.sidebar-nav {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-section {
    margin: 12px 10px 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
    background: var(--sidebar-active);
    color: #fff;
}
.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
    position: relative;
}
.nav-item.active::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    border-radius: 6px;
    background: var(--accent);
}

.sidebar-stats {
    margin: 14px 6px 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
}

.stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--muted);
}

.stat-value {
    color: #e2e8f0;
    font-weight: 600;
}

.sidebar-tasks {
    margin: 10px 6px 8px;
}

.sidebar-tasks .section-title {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.sidebar-tasks .section-sub {
    font-size: 0.75rem;
    color: #93c5fd;
    margin-bottom: 6px;
}

.task-item {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    color: #e2e8f0;
    text-decoration: none;
    margin-bottom: 6px;
}

.task-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.task-meta {
    font-size: 0.75rem;
    color: var(--muted);
}

.sidebar-tasks .empty {
    font-size: 0.8rem;
    color: var(--muted);
}

.running-timer {
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    color: #e2e8f0;
}

.running-timer .label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.running-timer .title {
    font-weight: 700;
}

.running-timer .meta {
    font-size: 0.85rem;
    color: var(--sidebar-text);
    margin-top: 4px;
}

.running-timer .mini-link {
    display: inline-block;
    margin-top: 8px;
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.85rem;
}

.timer-live {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #93c5fd;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 20px 0 60px;
}

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 4%;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

.search-form input {
    width: 240px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    transition: width 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.theme-dark .search-form input {
    background: rgba(15, 23, 42, 0.6);
}

.search-form input:focus {
    width: 280px;
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.brand {
    font-weight: 700;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(2, 6, 23, 0.25);
}

.inline {
    display: inline;
}

.link {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}

.card.narrow {
    max-width: 420px;
    margin: 40px auto;
}

.form label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    color: var(--muted);
}

.hint {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.8rem;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    background: transparent;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn:focus,
.icon-btn:focus,
.link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.4);
}

select {
    background: var(--card);
    color: var(--text);
}

body.theme-dark select,
body.theme-dark option,
body.theme-dark optgroup {
    background-color: #0f172a;
    color: #e2e8f0;
}

textarea {
    min-height: 90px;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    margin-top: 12px;
    cursor: pointer;
}

.btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
}

.modal-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    width: min(420px, 90%);
    z-index: 1;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.4);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: flex-end;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.table th, .table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: right;
}

.table th {
    background: rgba(15, 23, 42, 0.3);
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    display: grid;
    gap: 6px;
}

.alert.success {
    background: rgba(0, 168, 120, 0.12);
    color: var(--success);
    border-color: rgba(0, 168, 120, 0.35);
}

.alert.error {
    background: rgba(229, 83, 83, 0.12);
    color: var(--danger);
    border-color: rgba(229, 83, 83, 0.35);
}

.alert.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.35);
}

.alert.info {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.35);
}

body.theme-dark .alert.warning {
    color: #fbbf24;
}

body.theme-dark .alert.info {
    color: #93c5fd;
}

.alert-title {
    font-weight: 700;
}

.alert ul {
    margin: 0;
    padding-right: 18px;
}

.alert li {
    margin: 2px 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.row {
    display: flex;
    gap: 10px;
}

.task-actions {
    margin: 8px 0 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.task-actions .btn {
    margin-top: 0;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.18);
}

.task-actions .btn.secondary {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: var(--text);
    box-shadow: none;
}

.task-actions .btn.secondary:hover {
    border-color: var(--primary);
}

.checkbox {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.actions {
    margin-bottom: 16px;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.token {
    background: rgba(59, 130, 246, 0.2);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9em;
}

.portal-link {
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
}

.portal-link .label {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.portal-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.portal-row input {
    flex: 1;
}

.portal-page {
    background: #0b1324;
    border: 1px solid #1f2a44;
    border-radius: 20px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 25px 60px rgba(2, 6, 23, 0.45);
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}

.portal-title {
    color: var(--portal-muted, #94a3b8);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.portal-page h1 {
    margin: 6px 0 0;
    color: #60a5fa;
    font-size: 1.6rem;
}

.portal-badge .status-badge {
    font-size: 0.85rem;
}

.portal-table {
    border-radius: 14px;
    overflow: hidden;
}

.portal-table th {
    background: #172554;
    color: #e2e8f0;
}

.portal-table td {
    background: #0f172a;
}

.portal-table tr:nth-child(even) td {
    background: #101b33;
}

.portal-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 12px 0 20px;
}

.portal-card {
    background: #0f172a;
    border: 1px solid #1e3a8a;
    border-radius: 14px;
    padding: 14px;
}

.portal-card-label {
    color: var(--portal-muted, #94a3b8);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.portal-card-value {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
}

.logo-preview {
    margin: 8px 0;
}

.ltr {
    direction: ltr;
    unicode-bidi: plaintext;
    display: inline-block;
}

.floating-timer {
    position: fixed;
    left: 24px;
    bottom: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.35);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 30;
}

.floating-timer select {
    width: 180px;
}

.floating-timer input[type="text"] {
    width: 180px;
    padding: 8px 10px;
    border-radius: 8px;
}

.floating-timer .label {
    font-size: 0.75rem;
    color: var(--muted);
}

.floating-timer .title {
    font-weight: 700;
}

@media (max-width: 720px) {
    .floating-timer {
        left: 12px;
        right: 12px;
        bottom: 12px;
        flex-direction: column;
        align-items: stretch;
    }
    .floating-timer select {
        width: 100%;
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-active {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.status-paused {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
}

.status-completed,
.status-done {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.status-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
.status-pending {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
}

.status-canceled {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

.status-todo {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.status-doing {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

body.sidebar-collapsed .sidebar {
    width: 78px;
}

body.sidebar-collapsed .sidebar .title,
body.sidebar-collapsed .sidebar .nav-item span,
body.sidebar-collapsed .sidebar .shortcut span,
body.sidebar-collapsed .sidebar .running-timer,
body.sidebar-collapsed .sidebar .sidebar-stats,
body.sidebar-collapsed .sidebar .sidebar-tasks,
body.sidebar-collapsed .sidebar .nav-section {
    display: none;
}

body.sidebar-collapsed .sidebar .nav-item,
body.sidebar-collapsed .sidebar .shortcut {
    justify-content: center;
}

@media (max-width: 920px) {
    .sidebar {
        position: fixed;
        right: -260px;
        top: 0;
        bottom: 0;
        z-index: 20;
        transition: right 0.2s ease;
    }
    body.sidebar-collapsed .sidebar {
        right: 0;
        width: 240px;
    }
    body.sidebar-collapsed .sidebar .title,
    body.sidebar-collapsed .sidebar .nav-item span,
    body.sidebar-collapsed .sidebar .shortcut span,
    body.sidebar-collapsed .sidebar .running-timer,
    body.sidebar-collapsed .sidebar .sidebar-stats,
    body.sidebar-collapsed .sidebar .sidebar-tasks,
    body.sidebar-collapsed .sidebar .nav-section {
        display: block;
    }
    body.sidebar-collapsed .sidebar .nav-item,
    body.sidebar-collapsed .sidebar .shortcut {
        justify-content: flex-start;
    }
    .main {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        padding: 12px 16px;
    }
    .topbar-left,
    .topbar-right {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }
    .search-form {
        width: 100%;
    }
    .search-form input {
        width: 100%;
        min-width: 0;
    }
    .main .container {
        padding: 16px;
    }
    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .table th, .table td {
        white-space: nowrap;
    }
    .row {
        flex-direction: column;
    }
    .dashboard-summary,
    .dashboard-alerts,
    .dashboard-progress,
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

.dashboard-summary {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dashboard-alerts,
.dashboard-progress,
.dashboard-charts {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.dashboard-quick {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dashboard-shortcuts {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.filter-card {
    margin-bottom: 20px;
}

.filter-state {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.filter-state span:first-child {
    color: var(--text);
    font-weight: 700;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    color: var(--text-muted);
}

.metric strong {
    color: var(--text);
}

.trend {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
}

.trend.up {
    background: rgba(46, 204, 113, 0.15);
    color: #7bed9f;
}

.trend.down {
    background: rgba(231, 76, 60, 0.15);
    color: #ff7979;
}

.progress-row {
    margin-bottom: 16px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.progress-bar {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    height: 8px;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2e6bff, #4bd2ff);
}

.progress-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.rank-list {
    display: grid;
    gap: 10px;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.rank-name {
    color: var(--text);
}

.rank-value {
    color: var(--accent);
    font-weight: 600;
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.activity-label {
    font-size: 13px;
    color: var(--text-muted);
}

.activity-meta {
    text-align: left;
    font-size: 12px;
    color: var(--text-muted);
}

.bar-chart {
    display: grid;
    gap: 12px;
}

.bar-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}

.bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.bar div {
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}

.empty {
    color: var(--text-muted);
    font-size: 13px;
}

trix-toolbar .trix-button-row {
    flex-wrap: wrap;
}

trix-toolbar .trix-button {
    background: #101b2e;
    border: 1px solid rgba(140, 170, 220, 0.35);
    color: #f1f6ff;
}

trix-toolbar .trix-button.trix-active {
    background: rgba(46, 107, 255, 0.35);
    color: #ffffff;
}

trix-toolbar .trix-button-row {
    background: #0b1525;
    border: 1px solid rgba(140, 170, 220, 0.25);
    border-radius: 10px;
    padding: 6px;
    gap: 6px;
}

trix-toolbar .trix-button-group {
    border: 1px solid rgba(140, 170, 220, 0.25);
    border-radius: 8px;
    overflow: hidden;
}

trix-toolbar .trix-button-group:not(:last-child) {
    margin-left: 6px;
}

trix-toolbar .trix-dialogs {
    background: #0b1525;
    border: 1px solid rgba(140, 170, 220, 0.35);
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
}

trix-toolbar .trix-dialog__input {
    background: #0f1c2f;
    border: 1px solid rgba(140, 170, 220, 0.35);
    color: #f1f6ff;
}

trix-toolbar .trix-dialog__input::placeholder {
    color: rgba(190, 210, 235, 0.7);
}

trix-toolbar .trix-dialog__buttons .trix-button {
    background: #1d4ed8;
    border-color: transparent;
    color: #fff;
}

trix-toolbar .trix-dialog__buttons .trix-button:not(.trix-button--dialog) {
    background: #0f1c2f;
}

trix-editor {
    min-height: 160px;
    border-radius: 12px;
    border: 1px solid rgba(140, 160, 190, 0.25);
    background: #0b1525;
    color: #e6eef9;
}

trix-editor:focus {
    box-shadow: 0 0 0 2px rgba(46, 107, 255, 0.2);
    border-color: rgba(46, 107, 255, 0.6);
}

.form trix-toolbar {
    margin-bottom: 6px;
}

.form trix-editor {
    margin-top: 6px;
    margin-bottom: 10px;
}

body:not(.theme-dark) trix-toolbar .trix-button-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body:not(.theme-dark) trix-toolbar .trix-button {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

body:not(.theme-dark) trix-toolbar .trix-button.trix-active {
    background: rgba(37, 99, 235, 0.15);
    color: #0f172a;
}

body:not(.theme-dark) trix-toolbar .trix-button-group {
    border: 1px solid #e2e8f0;
}

body:not(.theme-dark) trix-toolbar .trix-dialogs {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body:not(.theme-dark) trix-toolbar .trix-dialog__input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body:not(.theme-dark) trix-toolbar .trix-dialog__buttons .trix-button {
    background: #2563eb;
    border-color: transparent;
    color: #fff;
}

body:not(.theme-dark) trix-toolbar .trix-dialog__buttons .trix-button:not(.trix-button--dialog) {
    background: #e2e8f0;
    color: #0f172a;
}

body:not(.theme-dark) trix-editor {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

body:not(.theme-dark) trix-editor:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
}
.muted {
    color: var(--muted);
    font-size: 14px;
}
.stat-number {
    font-size: 24px;
    font-weight: 700;
    margin-top: 6px;
}
.stat-title {
    font-weight: 700;
    font-size: 0.95rem;
}
.stat-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}
.inline-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.card canvas {
    margin-top: 8px;
}
.form-footer {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}
.auth-page .topbar {
    display: none;
}
.auth-page main.container {
    width: min(1200px, 92%);
    padding: 40px 0 60px;
}
.auth-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: center;
    min-height: calc(100vh - 80px);
}
.auth-panel {
    padding: 28px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.2), rgba(15, 23, 42, 0.7));
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--card-shadow);
}
.auth-panel h1 {
    margin: 16px 0 8px;
}
.auth-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}
.auth-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
    font-size: 22px;
}
.auth-title {
    font-weight: 700;
    font-size: 1.1rem;
}
.auth-sub {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.auth-points {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}
.auth-point {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.auth-point i {
    color: #93c5fd;
}
.auth-hint {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}
.auth-card-header h2 {
    margin: 8px 0 6px;
}
.auth-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    font-weight: 700;
    font-size: 12px;
}
.auth-form label {
    margin-top: 12px;
}
.auth-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.05);
}
.auth-input i {
    color: var(--muted);
}
.auth-input input {
    border: 0;
    padding: 0;
    background: transparent;
    width: 100%;
    color: var(--text);
}
.auth-input input:focus {
    outline: none;
    box-shadow: none;
}
.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.auth-link {
    color: var(--accent);
    font-size: 0.9rem;
}
.auth-submit {
    width: 100%;
    margin-top: 16px;
    padding: 12px 16px;
    font-weight: 700;
}
.auth-footer {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
}
.auth-footer a {
    color: var(--accent);
}
@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
}
.dashboard-hero {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.2));
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}
.hero-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--muted);
}
.hero-sub {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
@media (max-width: 920px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

.cv-dashboard-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
    padding: 22px;
    border-radius: 20px;
    margin-bottom: 18px;
    background: linear-gradient(140deg, rgba(30, 64, 175, 0.2), rgba(15, 23, 42, 0.35));
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--card-shadow);
}
.cv-dashboard-hero h1 {
    margin: 8px 0 6px;
}
.cv-dashboard-hero p {
    margin: 0;
    color: var(--text-muted);
}
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.hero-left .hero-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hero-right {
    display: grid;
    gap: 12px;
}
.hero-metric {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 14px 16px;
}
.hero-metric span {
    color: var(--text-muted);
    font-size: 12px;
}
.hero-metric strong {
    display: block;
    font-size: 20px;
    margin-top: 6px;
}
.hero-metric small {
    color: var(--text-muted);
}

.cv-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 12px;
    box-shadow: var(--card-shadow);
    position: relative;
}
.kpi-card.highlight {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.7));
    border-color: rgba(59, 130, 246, 0.35);
}
.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    font-size: 18px;
}
.kpi-label {
    color: var(--text-muted);
    font-size: 13px;
}
.kpi-value {
    font-size: 22px;
    font-weight: 700;
}
.kpi-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}
.kpi-mini {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}
.kpi-mini strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
}
.kpi-mini-list {
    display: grid;
    gap: 10px;
}
.kpi-mini-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 13px;
}
.kpi-mini-row strong {
    color: var(--text);
}

@media (max-width: 920px) {
    .cv-dashboard-hero {
        grid-template-columns: 1fr;
    }
}

/* Notifications */
.notifications-header .header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.notifications-header .header-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}
.notifications-list {
    display: grid;
    gap: 12px;
}
.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.12);
}
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    flex-shrink: 0;
}
.notification-body {
    flex: 1;
    display: grid;
    gap: 6px;
}
.notification-title {
    font-weight: 700;
    color: var(--text);
}
.notification-meta {
    font-size: 12px;
}
.notification-actions .btn {
    margin-top: 0;
}
.notification-item.unread {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2) inset;
}
.notification-item.read {
    opacity: 0.85;
}

.subscription-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 16px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.15));
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--card-shadow);
}
.subscription-hero h2 {
    margin: 10px 0 6px;
}
.subscription-meta {
    display: grid;
    gap: 10px;
    min-width: 220px;
}
.meta-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.subscription-detail {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.timeline {
    display: grid;
    gap: 16px;
    position: relative;
    padding: 4px 0;
}
.timeline-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.15);
    margin-top: 6px;
    flex-shrink: 0;
}
.timeline-content {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
}
.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #9ca3af;
}

.note-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.import-card .inline-row {
    align-items: center;
}

@media (max-width: 720px) {
    .subscription-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .notification-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .notification-actions {
        width: 100%;
    }
}
.import-card input[type="file"] {
    margin-bottom: 8px;
}

/* CV plan selection */
.plan-section .plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.plan-card {
    display: block;
    cursor: pointer;
}
.plan-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.plan-card-body {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.35);
    border-radius: 16px;
    padding: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.plan-card-body:hover {
    transform: translateY(-2px);
    border-color: rgba(46, 107, 255, 0.5);
    box-shadow: 0 14px 30px rgba(8, 20, 40, 0.35);
}
.plan-radio:checked + .plan-card-body {
    border-color: #2e6bff;
    box-shadow: 0 0 0 2px rgba(46, 107, 255, 0.25), 0 16px 34px rgba(10, 20, 40, 0.4);
    background: linear-gradient(135deg, rgba(46, 107, 255, 0.15), rgba(15, 23, 42, 0.45));
}
.plan-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.plan-selected {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(46, 107, 255, 0.2);
    color: #a5b4fc;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.plan-radio:checked + .plan-card-body .plan-selected {
    opacity: 1;
}
.plan-features {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}
.plan-features div {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #cbd5f5;
}
.plan-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.plan-price {
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}
.plan-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

/* Notifications */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.notif-stat {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 8px 12px;
    min-width: 110px;
    text-align: center;
}
.notif-stat strong {
    display: block;
    color: #e2e8f0;
    font-size: 1.1rem;
}
.notification-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.35);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.notification-item.unread {
    border-color: rgba(46, 107, 255, 0.4);
    box-shadow: 0 12px 24px rgba(10, 20, 40, 0.25);
}
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(46, 107, 255, 0.15);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notification-body .notification-title {
    font-weight: 700;
    margin-bottom: 4px;
}
.notifications-empty {
    text-align: center;
    padding: 24px 16px;
}
.notifications-empty .empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 18px;
    background: rgba(46, 107, 255, 0.1);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}
.notifications-empty .empty-title {
    font-weight: 700;
    margin-bottom: 6px;
}
