:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #68758b;
    --line: #e3e8f2;
    --primary: #246bfe;
    --primary-dark: #1749b7;
    --success: #0f9f6e;
    --warning: #d68b00;
    --danger: #d64545;
    --sidebar: #101828;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Tahoma", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
}
a { text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 280px;
    background: var(--sidebar);
    color: #fff;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}
.brand {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 20px;
    padding: 0 8px 18px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--primary);
}
.nav-list { display: grid; gap: 5px; overflow-y: auto; }
.sidebar .nav-link {
    color: #d8dfec;
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar .nav-link:hover { background: #1d2939; color: #fff; }
.logout {
    margin-top: auto;
    color: #ffd9d9;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.main { flex: 1; margin-inline-start: 280px; min-width: 0; }
.topbar {
    min-height: 78px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 22px; margin: 0 0 3px; font-weight: 800; }
.topbar span { color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.content { padding: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card, .panel, .record-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16,24,40,.04);
}
.stat-card { padding: 18px; }
.stat-card .icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #edf4ff;
    color: var(--primary);
    margin-bottom: 12px;
}
.stat-card strong { display: block; font-size: 26px; }
.stat-card span { color: var(--muted); }
.panel { padding: 18px; margin-bottom: 18px; }
.panel-title { font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.table { vertical-align: middle; }
.badge-soft { background: #edf4ff; color: var(--primary-dark); border: 1px solid #d8e7ff; }
.form-control, .form-select, .btn { border-radius: 8px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { background: #eef3f8; border-radius: 8px; padding: 12px; min-height: 420px; }
.kanban-column h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.kanban-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; cursor: grab; }
.timeline { border-inline-start: 2px solid var(--line); padding-inline-start: 16px; }
.timeline-item { position: relative; margin-bottom: 14px; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f7fbff, #eef3f8);
}
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 18px 60px rgba(16,24,40,.08); }
.sidebar-backdrop { display: none; }
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 991px) {
    .sidebar { transform: translateX(100%); transition: .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 1030; }
    .main { margin-inline-start: 0; }
    .content { padding: 16px; }
}
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; }
    .user-chip span { display: none; }
    .panel { padding: 14px; }
}

