@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Instrument+Sans:wght@300;400;500;600&display=swap');

:root {
    --bg:           #f1f5f9;
    --surface:      #ffffff;
    --surface-2:    #f8fafc;
    --border:       #e2e8f0;
    --border-mid:   #cbd5e1;

    --sidebar-bg:   #0f172a;
    --sidebar-surface: #1e293b;
    --sidebar-border:  #334155;
    --sidebar-text:    #94a3b8;
    --sidebar-text-hi: #f1f5f9;

    --text:         #334155;
    --text-bright:  #0f172a;
    --text-dim:     #64748b;
    --text-muted:   #94a3b8;

    --accent:       #0891b2;
    --accent-light: #e0f2fe;
    --accent-dark:  #0369a1;
    --accent-rgb:   8, 145, 178;

    --green:        #10b981;
    --green-light:  #d1fae5;
    --red:          #ef4444;
    --red-light:    #fee2e2;
    --yellow:       #f59e0b;
    --yellow-light: #fef3c7;

    --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:       0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg:    0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);

    --sidebar-w:    260px;
    --topbar-h:     60px;
    --radius:       10px;
    --radius-sm:    6px;
    --font:         'Instrument Sans', system-ui, sans-serif;
    --font-brand:   'Syne', sans-serif;
}

[data-theme="dark"] {
    --bg:           #0f172a;
    --surface:      #1e293b;
    --surface-2:    #162032;
    --border:       #334155;
    --border-mid:   #475569;

    --text:         #94a3b8;
    --text-bright:  #f1f5f9;
    --text-dim:     #64748b;
    --text-muted:   #475569;

    --accent-light: #0c3a4a;

    --shadow-sm:    0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow:       0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg:    0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-12px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
    display: flex; align-items: center; justify-content: center;
}

.brand-icon--sm {
    width: 24px; height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 15px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
}

.brand-text {}

.brand-name {
    font-family: var(--font-brand);
    font-size: 15px;
    font-weight: 700;
    color: var(--sidebar-text-hi);
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.brand-by {
    display: block;
    font-size: 9px;
    font-weight: 400;
    opacity: 0.4;
    letter-spacing: 0.05em;
    margin-top: 1px;
}

.brand-sub {
    font-size: 11px;
    color: var(--sidebar-text);
    letter-spacing: 0.02em;
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sidebar-border);
    padding: 10px 8px 6px;
    margin-top: 8px;
}

.nav-section-label:first-child { margin-top: 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    transition: all 0.15s ease;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-surface);
    color: var(--sidebar-text-hi);
}

.nav-item.active {
    background: rgba(var(--accent-rgb), 0.15);
    color: #38bdf8;
    font-weight: 500;
}

.nav-item.active .nav-icon { color: #38bdf8; }

.nav-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(var(--accent-rgb), 0.2);
    color: #38bdf8;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--sidebar-text-hi);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10px;
    color: var(--sidebar-text);
}

.sidebar-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    margin-left: auto;
}

.sidebar-settings-btn:hover,
.sidebar-settings-btn.active { color: var(--sidebar-text-hi); background: var(--sidebar-surface); }

@keyframes glow {
    0%, 100% { box-shadow: 0 0 6px var(--green); opacity: 1; }
    50%       { box-shadow: 0 0 2px var(--green); opacity: 0.6; }
}

/* ── MAIN ────────────────────────────────────── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-crumb-sep { color: var(--border-mid); }

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
    font-family: var(--font-brand);
}

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

.topbar-user-menu {
    position: relative;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.topbar-user:hover {
    background: var(--surface-2);
}

.topbar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 100;
    animation: fadeUp 0.15s ease;
}

.topbar-dropdown.open {
    display: block;
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.1s;
}

.topbar-dropdown-item:hover {
    background: var(--surface-2);
}

.topbar-dropdown-item--danger {
    color: var(--red, #ef4444);
}

.topbar-dropdown-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-logout:hover { border-color: var(--red); color: var(--red); }

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

.topbar-clock {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.content {
    padding: 28px;
    flex: 1;
    animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* ── WIDGETS ─────────────────────────────────── */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    animation: fadeUp 0.35s ease both;
    cursor: default;
}

.widget:nth-child(1) { animation-delay: 0.05s; }
.widget:nth-child(2) { animation-delay: 0.10s; }
.widget:nth-child(3) { animation-delay: 0.15s; }
.widget:nth-child(4) { animation-delay: 0.20s; }

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

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

.widget-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.widget-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}

.widget-icon svg { width: 17px; height: 17px; }

.widget-icon.teal   { background: var(--accent-light); color: var(--accent); }
.widget-icon.green  { background: var(--green-light);  color: var(--green);  }
.widget-icon.yellow { background: var(--yellow-light); color: var(--yellow); }
.widget-icon.red    { background: var(--red-light);    color: var(--red);    }

.widget-value {
    font-family: var(--font-brand);
    font-size: 30px;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.widget-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.widget-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: gap 0.15s;
}

.widget-link:hover { gap: 8px; }
.widget-link::after { content: '→'; }

/* ── CARD ────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.35s ease both;
    overflow: hidden;
}

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

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}

.card-body { padding: 20px; }

.empty-state {
    text-align: center;
    padding: 52px 0;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 28px;
    margin-bottom: 10px;
    opacity: 0.4;
}

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

.empty-state-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── KANBAN ──────────────────────────────────── */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
}

.kanban-col--onhold {
    grid-column: 1;
    grid-row: 2;
}

.kanban-col--arch {
    grid-column: 2;
    grid-row: 2;
    opacity: 0.75;
}

.kanban-col {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    animation: fadeUp 0.35s ease both;
}

.kanban-col:nth-child(1) { animation-delay: 0.05s; }
.kanban-col:nth-child(2) { animation-delay: 0.10s; }
.kanban-col:nth-child(3) { animation-delay: 0.15s; }
.kanban-col:nth-child(4) { animation-delay: 0.20s; }
.kanban-col:nth-child(5) { animation-delay: 0.25s; }

.kanban-col-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
}

.kanban-col-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-col-dot.backlog    { background: var(--text-muted); }
.kanban-col-dot.inprogress { background: var(--accent); box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.5); }
.kanban-col-dot.review     { background: var(--yellow); box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.kanban-col-dot.done       { background: var(--green); }
.kanban-col-dot.onhold     { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.kanban-col-dot.arch       { background: var(--text-muted); }

.kanban-col-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex: 1;
}

.kanban-col-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 8px;
    min-width: 24px;
    text-align: center;
}

.kanban-cards {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.kanban-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.15s;
    cursor: grab;
    position: relative;
}

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

.kanban-card-footer-right {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.kanban-card-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.12s;
}

.kanban-card:hover .kanban-card-actions { opacity: 1; }

.kanban-card-delete,
.kanban-card-edit {
    width: 20px; height: 20px;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: all 0.12s;
    color: var(--text-muted);
}

.kanban-card-edit:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.kanban-card-delete:hover {
    background: var(--red-light);
    color: var(--red);
}

.kanban-card-ghost {
    opacity: 0.4;
    background: var(--accent-light);
    border: 1px dashed var(--accent);
}

.kanban-card-chosen {
    box-shadow: var(--shadow-lg);
    cursor: grabbing;
}

.kanban-card-drag {
    opacity: 0.9;
    transform: rotate(1deg);
    box-shadow: var(--shadow-lg);
}

.kanban-card-project {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.kanban-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: 10px;
    line-height: 1.4;
}

.kanban-card-title.done-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.priority-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

.priority-badge.high   { background: var(--red-light);    color: var(--red);    }
.priority-badge.medium { background: var(--yellow-light); color: var(--yellow); }
.priority-badge.low    { background: var(--accent-light); color: var(--accent); }

.tag-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.kanban-add-btn {
    margin: 0 12px 12px;
    padding: 9px;
    border: 1px dashed var(--border-mid);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
    width: calc(100% - 24px);
}

.kanban-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ── MODAL ───────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    animation: modalUp 0.2s ease;
}

@keyframes modalUp {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color 0.12s, background 0.12s;
}

.modal-close:hover { color: var(--text); background: var(--bg); }

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── FORM ────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-input,
.form-select {
    font-family: var(--font);
    font-size: 13.5px;
    color: var(--text-bright);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

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

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.due-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.due-badge.due-ok       { background: var(--green-light, #d1fae5); color: var(--green, #10b981); }
.due-badge.due-soon     { background: #fef3c7; color: #d97706; }
.due-badge.due-overdue  { background: var(--red-light); color: var(--red); }

.notes-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.7;
}

.assignee-avatar {
    margin-left: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* ── NOTES ───────────────────────────────────── */
.notes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    color: var(--text-muted);
    flex: 1;
    max-width: 320px;
}

.toolbar-search-input {
    background: none;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    padding: 8px 0;
    width: 100%;
}

.toolbar-search-input::placeholder { color: var(--text-muted); }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeUp 0.3s ease both;
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    flex: 1;
}

.project-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.project-card:hover .project-actions {
    opacity: 1;
}

.project-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.project-status-badge {
    font-size: 11px;
    font-weight: 500;
}

.project-date {
    font-size: 11px;
    color: var(--text-muted);
}

.repo-platform-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.repo-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}

.repo-toggle-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    align-items: start;
}

.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.notes-empty svg { opacity: 0.35; }

.note-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    animation: fadeUp 0.3s ease both;
}

.note-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.note-card:hover .note-card-actions { opacity: 1; }

.note-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 8px;
    padding-right: 48px;
}

.note-card-body {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.note-card-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
}

.modal-box--lg { max-width: 560px; }

.form-textarea--lg { min-height: 200px; }

/* ── SETTINGS ────────────────────────────────── */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 820px;
}

.settings-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.settings-stat {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
}

.settings-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.settings-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.settings-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
}

.settings-section-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.settings-table th {
    padding: 10px 24px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.settings-table td {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.settings-table tr:last-child td { border-bottom: none; }
.settings-table-muted { color: var(--text-muted) !important; }

.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-row-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-row-name {
    font-weight: 500;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-self-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    border-radius: 4px;
    padding: 1px 6px;
}

.role-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.role-badge--admin { background: var(--accent-light); color: var(--accent-dark); }
.role-badge--user  { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.status-dot {
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot--active::before { background: var(--green); }
.status-dot--inactive::before { background: var(--text-muted); }
.status-dot--active { color: var(--green); }
.status-dot--inactive { color: var(--text-muted); }

.table-edit-btn {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.table-edit-btn:hover { border-color: var(--accent); color: var(--accent); }

.settings-form { padding: 20px 24px; }

.settings-form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ── KALENDARZ ───────────────────────────────── */
.cal-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.cal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.cal-month-label {
    font-family: var(--font-brand);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-bright);
    flex: 1;
    text-align: center;
}

.cal-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.cal-today-btn {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    margin-left: 4px;
}

.cal-today-btn:hover { border-color: var(--accent); color: var(--accent); }

.cal-grid-wrap { padding: 0; }

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
}

.cal-weekdays div {
    padding: 10px 0;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.cal-weekend { color: var(--red) !important; opacity: 0.7; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
    min-height: 110px;
    padding: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
}

.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell--dim { opacity: 0.35; cursor: default; }
.cal-cell--dim:hover { background: transparent; }

.cal-cell--today .cal-day-num {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-day-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-bright);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.cal-events-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-event-chip {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-bright);
    background: var(--surface-2);
    border-left: 3px solid;
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity 0.15s;
}

.cal-event-chip:hover { opacity: 0.8; }

.cal-event-chip--todo { cursor: default; opacity: 0.85; }
.cal-event-chip--todo:hover { opacity: 0.85; }

.cal-day-popover-item--todo { cursor: default; opacity: 0.8; }

.cal-todo-label {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--green, #10b981);
    flex-shrink: 0;
}

.cal-more {
    font-size: 10px;
    color: var(--accent);
    padding-left: 4px;
    cursor: pointer;
}

.cal-more:hover { text-decoration: underline; }

.cal-day-popover {
    position: absolute;
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    max-width: 280px;
    animation: fadeUp 0.15s ease;
}

.cal-day-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-bright);
    border-bottom: 1px solid var(--border);
}

.cal-day-popover-list {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    max-height: 200px;
    overflow-y: auto;
}

.cal-day-popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.1s;
}

.cal-day-popover-item:hover { background: var(--surface-2); }

.cal-day-popover-add {
    width: 100%;
    padding: 8px 14px;
    border: none;
    border-top: 1px solid var(--border);
    background: transparent;
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
}

.cal-day-popover-add:hover { background: var(--surface-2); }

.cal-add-hint {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 16px;
    color: var(--border-mid);
    opacity: 0;
    transition: opacity 0.15s;
    line-height: 1;
}

.cal-cell:hover .cal-add-hint { opacity: 1; }

.cal-type-picker {
    display: flex;
    gap: 6px;
}

.cal-type-btn {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.cal-type-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-type-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── SNIPPETS ────────────────────────────────── */
.snippets-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.snippets-filters {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.snippets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    gap: 16px;
    align-items: start;
}

.snippet-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeUp 0.3s ease both;
}

.snippet-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.snippet-lang-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.snippet-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    flex: 1;
}

.snippet-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.snippet-card:hover .snippet-actions { opacity: 1; }

.snippet-copy-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.snippet-copy-btn:hover { border-color: var(--accent); color: var(--accent); }

.snippet-desc {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 16px 0;
}

.snippet-pre {
    margin: 0;
    padding: 14px 16px;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    background: var(--surface-2);
    max-height: 220px;
}

.snippet-pre code { font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; }

.snippet-code-input { font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 13px; }

/* ── DZIENNIK ─────────────────────────────────── */
.journal-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.journal-feed {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.journal-day-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.journal-entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    animation: fadeUp 0.3s ease both;
}

.journal-entry-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.journal-entry-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}


.journal-entry-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s;
}

.journal-entry:hover .journal-entry-actions { opacity: 1; }

.journal-entry-body {
    font-size: 13px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}


/* ── BUTTONS ─────────────────────────────────── */
.btn-primary {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary:hover { background: var(--bg); color: var(--text); }

/* ── FINANSE ─────────────────────────────────── */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.finance-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.finance-summary-card--expense { border-left: 3px solid var(--red, #ef4444); }
.finance-summary-card--income  { border-left: 3px solid var(--green, #10b981); }
.finance-summary-card--balance { border-left: 3px solid var(--accent); }

.finance-summary-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.finance-summary-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.finance-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.finance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.finance-table thead tr {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.finance-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.finance-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.finance-table tbody tr:last-child { border-bottom: none; }
.finance-table tbody tr:hover { background: var(--bg); }

.finance-table td {
    padding: 11px 14px;
    color: var(--text);
    vertical-align: middle;
}

.finance-date { color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-cat  { color: var(--text-dim); }

.finance-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.finance-badge--expense { background: rgba(239,68,68,.12); color: var(--red, #ef4444); }
.finance-badge--income  { background: rgba(16,185,129,.12); color: var(--green, #10b981); }

.finance-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.finance-amount--expense { color: var(--red, #ef4444); }
.finance-amount--income  { color: var(--green, #10b981); }

/* ── SCROLLBAR ───────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 1100px) {
    .widgets-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .widgets-grid { grid-template-columns: 1fr; }
    .content { padding: 16px; }
}
