/* Zenovate Dashboard — Ozel stiller */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --green: #10b981;
    --yellow: #f59e0b;
    --red: #ef4444;
    --gray: #6b7280;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
}

.sidebar-logo {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo h1 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo span {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
}

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

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-item.active .badge {
    background: rgba(255,255,255,0.2);
    color: white;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border-color);
}

/* Sidebar user section */
.sidebar-user-section {
    padding: 12px 12px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

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

.user-details { min-width: 0; }

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Main content */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 24px;
    height: 100vh;
    overflow-y: auto;
}

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

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
}

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

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Charts grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.chart-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

/* Table */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.filter-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.search-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 7px 12px 7px 36px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    width: 220px;
    transition: border-color 0.15s;
}

.search-input:focus {
    border-color: var(--accent);
}

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

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

.data-table thead th {
    background: var(--bg-tertiary);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.data-table thead th:hover {
    color: var(--text-primary);
}

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

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table tbody td {
    padding: 10px 12px;
    white-space: nowrap;
}

/* Badges */
.badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-priority {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* Pipeline / Kanban */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: calc(100vh - 180px);
}

.kanban-column {
    min-width: 280px;
    max-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.kanban-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
}

.kanban-header .count {
    margin-left: auto;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.kanban-body {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
}

.kanban-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.15s;
}

.kanban-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.kanban-card.sortable-ghost {
    opacity: 0.4;
}

.kanban-card.sortable-chosen {
    box-shadow: 0 8px 24px rgba(99,102,241,0.3);
    border-color: var(--accent);
}

.kanban-card-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.kanban-card-area {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.kanban-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 4px;
}

.kanban-card-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-style: italic;
}

/* Detail page */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-compare-bar {
    height: 32px;
    border-radius: 8px;
    position: relative;
    background: var(--bg-tertiary);
    overflow: hidden;
    margin-bottom: 16px;
}

.price-bar-fill {
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.cost-breakdown {
    width: 100%;
    border-collapse: collapse;
}

.cost-breakdown tr {
    border-bottom: 1px solid var(--border-color);
}

.cost-breakdown td {
    padding: 8px 0;
    font-size: 13px;
}

.cost-breakdown td:last-child {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cost-breakdown tr.total-row td {
    font-weight: 700;
    font-size: 15px;
    padding-top: 12px;
    border-bottom: none;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-secondary);
}

.timeline-content {
    font-size: 13px;
}

.timeline-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Form elements */
.form-select, .form-input, .form-textarea {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
    border-color: var(--accent);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

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

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-icon {
    padding: 6px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Starred */
.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    transition: color 0.15s;
    padding: 2px;
}

.star-btn.starred {
    color: var(--yellow);
}

.star-btn:hover {
    color: var(--yellow);
}

/* Toast */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, #475569 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive — Tablet */
@media (max-width: 1024px) {
    .sidebar { width: 60px; }
    .sidebar-logo span, .nav-item span, .sidebar-footer { display: none; }
    .sidebar-logo h1 { font-size: 14px; }
    .nav-item { justify-content: center; padding: 10px; }
    .nav-item .badge { display: none; }
    .main-content { margin-left: 60px; }
    .detail-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
}

/* Pipeline stage pills — hidden on desktop, shown on mobile */
.pipe-stage-pills {
    display: none;
}

.pipe-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
}

.pipe-pill.active {
    color: var(--text-primary);
    border-color: var(--pill-color, var(--accent));
    background: color-mix(in srgb, var(--pill-color, var(--accent)) 15%, transparent);
}

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

.pipe-pill-count {
    background: var(--bg-tertiary);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

.pipe-pill.active .pipe-pill-count {
    background: color-mix(in srgb, var(--pill-color, var(--accent)) 25%, transparent);
    color: var(--text-primary);
}

/* Responsive — Mobile */
@media (max-width: 768px) {
    /* Sidebar → Bottom tab bar */
    .sidebar {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 64px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 50;
        background: var(--bg-secondary);
    }

    .sidebar-logo { display: none; }
    .sidebar-footer { display: none; }
    .mobile-sync-btn { display: flex !important; }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        width: 100%;
        padding: 0;
        height: 100%;
    }

    .nav-item {
        flex-direction: column;
        gap: 2px;
        padding: 6px 4px;
        font-size: 10px;
        margin: 0;
        border-radius: 8px;
        min-width: 56px;
        align-items: center;
        justify-content: center;
    }

    .nav-item span { display: block; font-size: 10px; }
    .nav-item .badge { display: none; }

    .nav-item.active {
        background: rgba(99, 102, 241, 0.15);
        color: var(--accent);
    }

    /* Main content */
    .main-content {
        margin-left: 0;
        padding: 16px 12px 80px 12px;
        height: 100vh;
    }

    .page-header { margin-bottom: 16px; }
    .page-header h2 { font-size: 20px; }
    .page-header p { font-size: 12px; }

    /* KPI grid — 2 columns on mobile */
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 16px;
    }

    .kpi-card { padding: 12px; gap: 10px; }
    .kpi-icon { width: 32px; height: 32px; border-radius: 8px; }
    .kpi-value { font-size: 18px; }
    .kpi-label { font-size: 10px; }

    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }

    .chart-card { padding: 14px; }
    .chart-card h3 { font-size: 13px; margin-bottom: 12px; }

    /* Filter bar — scrollable horizontally */
    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
    }

    .filter-bar::-webkit-scrollbar { display: none; }

    .filter-chip {
        padding: 8px 14px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .search-input { width: 160px; flex-shrink: 0; }

    .filter-bar .form-select {
        flex-shrink: 0;
    }

    /* Desktop table: hide on mobile */
    .desktop-table { display: none !important; }

    /* Mobile card list: show on mobile */
    .mobile-cards { display: block !important; }

    /* Mobile sort: show */
    .mobile-sort { display: flex !important; align-items: center; gap: 8px; }
    .mobile-sort::before {
        content: 'Sirala:';
        font-size: 12px;
        color: var(--text-muted);
        flex-shrink: 0;
    }

    /* Cards */
    .card { padding: 14px; border-radius: 10px; }

    /* Detail page */
    .detail-grid { grid-template-columns: 1fr; gap: 12px; }

    .price-compare-bar { height: 28px; }
    .price-bar-fill { font-size: 11px; padding: 0 8px; }

    .cost-breakdown td { padding: 6px 0; font-size: 12px; }
    .cost-breakdown tr.total-row td { font-size: 14px; }

    /* Pipeline stage pills — show on mobile */
    .pipe-stage-pills {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px;
        margin-bottom: 4px;
    }
    .pipe-stage-pills::-webkit-scrollbar { display: none; }

    /* Pipeline / Kanban — full width columns */
    .kanban-board {
        gap: 0;
        min-height: auto;
        flex-direction: column;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .kanban-column {
        min-width: 100%;
        max-width: 100%;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .kanban-card { padding: 14px; }
    .kanban-card-title { font-size: 14px; }

    /* Show mobile stage dropdown */
    .mobile-stage-select { display: flex !important; }

    /* Timeline */
    .timeline-item { margin-bottom: 12px; padding-bottom: 12px; }

    /* Buttons — larger tap targets */
    .btn { padding: 10px 18px; font-size: 14px; }
    .btn-sm { padding: 8px 14px; font-size: 13px; }
    .btn-icon { padding: 10px; }

    .star-btn { font-size: 20px; padding: 4px; }

    /* Form elements — larger */
    .form-select, .form-input, .form-textarea {
        padding: 10px 14px;
        font-size: 14px;
    }

    .pill-tab { padding: 6px 12px; font-size: 12px; }

    /* Toast — bottom position on mobile */
    #toast-container {
        top: auto;
        bottom: 80px;
        left: 12px;
        right: 12px;
    }

    /* Comp table — scroll */
    .comp-table { font-size: 11px; }
    .comp-table thead th { padding: 6px 8px; font-size: 10px; }
    .comp-table tbody td { padding: 5px 8px; }

    /* Modal */
    .modal-content {
        width: 95%;
        padding: 16px;
        border-radius: 12px;
    }

    /* Empty state */
    .empty-state { padding: 30px 16px; }
}

/* Mobile listing cards */
.mobile-cards { display: none; }

.mobile-listing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.mobile-listing-card:active {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.mlc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.mlc-title-wrap { min-width: 0; flex: 1; }

.mlc-title {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mlc-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mlc-prices {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 8px;
}

.mlc-price-item {
    flex: 1;
    text-align: center;
}

.mlc-price-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.mlc-price-value {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mlc-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mlc-metric { display: flex; flex-direction: column; }

.mlc-metric-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.mlc-footer .badge-sm { margin-left: auto; }

/* Mobile stage changer on kanban cards */
.mobile-stage-select {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.mobile-stage-select .form-select {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

/* Mobile sort control */
.mobile-sort { display: none; }

/* Comp table */
.comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.comp-table thead th {
    background: var(--bg-tertiary);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    border-bottom: 1px solid var(--border-color);
}

.comp-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Gap bar inline */
.gap-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gap-bar-track {
    width: 60px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.gap-bar-fill {
    height: 100%;
    border-radius: 3px;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state i {
    margin-bottom: 12px;
}

/* Pill tabs for note types */
.pill-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pill-tab {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    transition: all 0.15s;
}

.pill-tab:hover, .pill-tab.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99,102,241,0.1);
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

/* ===================== LOGIN PAGE ===================== */
#login-page {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(99, 102, 241, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 14px;
    color: var(--text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color 0.15s;
    color: var(--text-muted);
}

.login-input-wrap:focus-within {
    border-color: var(--accent);
    color: var(--accent);
}

.login-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
}

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

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.login-btn:hover { background: var(--accent-hover); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* User management grid — mobile */
@media (max-width: 768px) {
    .user-add-grid {
        grid-template-columns: 1fr !important;
    }
    .sidebar-user-section { display: none; }
}

/* Mobile bottom menu sheet */
.mobile-menu-sheet {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.mobile-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.mobile-menu-content {
    position: absolute;
    bottom: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
    padding: 20px 16px 16px;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.mobile-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.mobile-menu-item:active {
    background: var(--bg-tertiary);
}

.mobile-menu-logout {
    color: var(--red);
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    border-radius: 0 0 12px 12px;
}
