/* ===== QUANTIVA CSS — Blue & White Financial App ===== */

/* Google Fonts loaded in HTML */

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #1a6cff;
    --primary-dark: #1452cc;
    --primary-light: #4d8eff;
    --primary-ghost: rgba(26, 108, 255, 0.08);
    --primary-glow: rgba(26, 108, 255, 0.25);

    --success: #00c48c;
    --danger: #ff4757;
    --warning: #ffa726;
    --info: #29b6f6;

    --bg: #f0f4ff;
    --bg-card: #ffffff;
    --bg-sidebar: #0a1628;
    --bg-input: #f4f7ff;

    --text-primary: #0d1b3e;
    --text-secondary: #5a6a8a;
    --text-muted: #9aa5c0;
    --text-sidebar: rgba(255,255,255,0.75);
    --text-sidebar-active: #ffffff;

    --border: rgba(26,108,255,0.12);
    --border-strong: rgba(26,108,255,0.25);
    --shadow-sm: 0 2px 8px rgba(10,22,60,0.06);
    --shadow-md: 0 4px 20px rgba(10,22,60,0.10);
    --shadow-lg: 0 8px 40px rgba(10,22,60,0.14);
    --shadow-blue: 0 4px 20px rgba(26,108,255,0.25);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    --sidebar-width: 260px;
    --topbar-height: 68px;

    --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
    --bg: #080f1e;
    --bg-card: #0f1c35;
    --bg-sidebar: #050c1a;
    --bg-input: #162040;

    --text-primary: #e8eeff;
    --text-secondary: #8da0c8;
    --text-muted: #4a5c80;

    --border: rgba(26,108,255,0.18);
    --border-strong: rgba(26,108,255,0.35);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input, select, textarea { font-family: var(--font-body); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== LAYOUT ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    border-right: 1px solid rgba(255,255,255,0.04);
}

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

.brand-icon {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: var(--shadow-blue);
    flex-shrink: 0;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: var(--text-sidebar-active);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(26,108,255,0.4);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-toggle, .logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    width: 100%;
    text-align: left;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.07);
    color: white;
}

.logout-btn:hover {
    background: rgba(255,71,87,0.15);
    color: #ff4757;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    display: none;
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover { background: var(--primary-ghost); color: var(--primary); }

.topbar-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

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

.user-badge {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--bg-input);
    border-radius: 50px;
    border: 1px solid var(--border);
}

.user-avatar {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    font-family: var(--font-display);
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-role { font-size: 0.72rem; color: var(--text-muted); }

/* ===== PAGE CONTENT ===== */
.page-content {
    padding: 28px;
    flex: 1;
    animation: fadeSlideIn 0.35s ease;
}

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

/* ===== ALERTS ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(0,196,140,0.1);
    border-color: rgba(0,196,140,0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(255,71,87,0.08);
    border-color: rgba(255,71,87,0.25);
    color: var(--danger);
}

.alert-close {
    margin-left: auto;
    color: inherit;
    opacity: 0.6;
    font-size: 0.85rem;
    transition: var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-left h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

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

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

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

.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.warning::before { background: var(--warning); }

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

.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-ghost); color: var(--primary); }
.stat-icon.success { background: rgba(0,196,140,0.1); color: var(--success); }
.stat-icon.danger { background: rgba(255,71,87,0.1); color: var(--danger); }
.stat-icon.warning { background: rgba(255,167,38,0.1); color: var(--warning); }

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; color: var(--text-primary); margin-top: 2px; line-height: 1.2; }
.stat-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px rgba(26,108,255,0.35);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-blue);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-ghost); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e63847; transform: translateY(-1px); }

.btn-ghost {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 13px 28px; font-size: 0.98rem; }
.btn-icon { padding: 9px; width: 38px; height: 38px; justify-content: center; }

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group.full { grid-column: 1 / -1; }

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-control {
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: var(--font-body);
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-ghost);
}

.form-control:disabled { opacity: 0.5; cursor: not-allowed; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6a8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 0.78rem; color: var(--text-muted); }
.form-error { font-size: 0.78rem; color: var(--danger); }

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .input-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.input-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
    padding-left: 14px;
}
.input-group .form-control:focus {
    border-color: var(--primary);
    border-left: 1.5px solid var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ghost);
}

/* ===== TABLE ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    background: var(--bg-input);
}

thead th {
    padding: 13px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

tbody tr {
    border-top: 1px solid var(--border);
    transition: var(--transition);
}

tbody tr:hover { background: var(--primary-ghost); }

tbody td {
    padding: 13px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 5px;
}

.badge-primary { background: var(--primary-ghost); color: var(--primary); }
.badge-success { background: rgba(0,196,140,0.12); color: var(--success); }
.badge-danger { background: rgba(255,71,87,0.1); color: var(--danger); }
.badge-warning { background: rgba(255,167,38,0.1); color: var(--warning); }
.badge-neutral { background: var(--bg-input); color: var(--text-muted); }

/* ===== CATEGORY PROGRESS ===== */
.category-bar {
    height: 6px;
    background: var(--border);
    border-radius: 50px;
    overflow: hidden;
    margin-top: 6px;
}

.category-bar-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    transition: var(--transition);
}

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

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.category-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.category-meta { flex: 1; }
.category-name { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); }
.category-pct { font-size: 0.78rem; color: var(--text-muted); }

.category-amounts {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.82rem;
}

.cat-balance { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.cat-total { color: var(--text-muted); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-icon {
    width: 72px; height: 72px;
    border-radius: var(--radius-lg);
    background: var(--primary-ghost);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    margin: 0 auto 20px;
}

.empty-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

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

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

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
}

.modal-close:hover { background: rgba(255,71,87,0.1); color: var(--danger); }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* ===== AMOUNT DISPLAY ===== */
.amount-positive { color: var(--success); font-weight: 700; }
.amount-negative { color: var(--danger); font-weight: 700; }
.amount-neutral { color: var(--text-primary); font-weight: 700; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.pagination a:hover { background: var(--primary-ghost); color: var(--primary); border-color: var(--primary); }
.pagination .active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    backdrop-filter: blur(2px);
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse at 30% 30%, rgba(26,108,255,0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 70%, rgba(77,142,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand-icon {
    width: 60px; height: 60px;
    background: var(--primary);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    color: white;
    margin: 0 auto 14px;
    box-shadow: var(--shadow-blue);
}

.auth-brand h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.auth-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 6px;
}

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.auth-btn {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-display);
    box-shadow: var(--shadow-blue);
    transition: var(--transition);
    margin-top: 8px;
}

.auth-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 25px rgba(26,108,255,0.4); }

.auth-link {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 18px;
}

.auth-link a { color: var(--primary); font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
    display: flex;
    gap: 14px;
    padding-bottom: 20px;
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 38px;
    bottom: 0;
    width: 1px;
    background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.timeline-content { flex: 1; }
.timeline-title { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.timeline-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ===== SEARCH BAR ===== */
.search-bar {
    position: relative;
    flex: 1;
    max-width: 320px;
}
.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.search-bar input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ghost); background: var(--bg-card); }

/* ===== FILTER ROW ===== */
.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ===== RISK/WARNING BLOCK ===== */
.blocked-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,71,87,0.1);
    color: var(--danger);
    border: 1px solid rgba(255,71,87,0.25);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    width: fit-content;
}

.tab-btn {
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    :root { --sidebar-width: 240px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle { display: flex; }
    .main-content { margin-left: 0 !important; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 20px 16px; }
    .topbar { padding: 0 16px; }
    .auth-card { padding: 32px 24px; }
    .user-info { display: none; }
    .modal { padding: 24px 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .filter-row { flex-direction: column; align-items: stretch; }
    .search-bar { max-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
}
