:root {
  --brand: #2f5d8a;
  --brand-dark: #203f5e;
  --accent: #e8a33d;
  --bg-soft: #f4f6f9;
  --sidebar-bg: #1c2b3a;
  --sidebar-active: #2f5d8a;
  --card-radius: 10px;
}

body { background: var(--bg-soft); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

.app-navbar { background: linear-gradient(90deg, var(--brand-dark), var(--brand)); padding: .6rem 1rem; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.app-navbar .navbar-brand { color: #fff; }
.app-navbar .btn-outline-secondary, .app-navbar a:not(.dropdown-item) { color: #eef3f8; }

.avatar-circle { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #26313d; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }

.app-body { display: flex; min-height: calc(100vh - 58px); }

.sidebar { width: 230px; background: var(--sidebar-bg); flex-shrink: 0; padding: 1rem 0; }
.sidebar .nav-link { color: #b8c4d0; padding: .55rem 1.25rem; font-size: .92rem; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.08); border-left-color: var(--accent); font-weight: 600; }
.sidebar .nav-section-label { display:block; color:#6d7f91; text-transform:uppercase; font-size:.7rem; letter-spacing:.06em; padding:.5rem 1.25rem .25rem; }

.app-content { padding: 1.25rem 1.5rem; }

.kpi-card { border: none; border-radius: var(--card-radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; position: relative; }
.kpi-card .kpi-value { font-size: 1.9rem; font-weight: 700; }
.kpi-card .kpi-icon { font-size: 1.6rem; opacity: .25; position: absolute; right: 1rem; top: 1rem; }
a.kpi-link { text-decoration: none; color: inherit; display: block; }
a.kpi-link .kpi-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
a.kpi-link:hover .kpi-card { transform: translateY(-4px); box-shadow: 0 6px 15px rgba(0,0,0,.15); }


.card { border: none; border-radius: var(--card-radius); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6d7f91; border-bottom-width: 1px; }

.badge-priority-Critical { background: #b0202f; }
.badge-priority-High { background: #d9662d; }
.badge-priority-Medium { background: #4a7fb0; }
.badge-priority-Low { background: #7a8896; }

.badge-status { font-weight: 500; }
.overdue-text { color: #b0202f; font-weight: 600; }
.due-today-text { color: #d9662d; font-weight: 600; }

.kanban-column { background: #f4f6f8; border-radius: 12px; padding: 1rem; height: calc(100vh - 280px); min-height: 400px; border: 1px solid rgba(0,0,0,0.05); display: flex; flex-direction: column; }
.kanban-column-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid rgba(0,0,0,0.04); flex-shrink: 0; }
.kanban-list { flex-grow: 1; overflow-y: auto; overflow-x: hidden; padding-right: 4px; min-height: 0; }
.kanban-list::-webkit-scrollbar { width: 6px; }
.kanban-list::-webkit-scrollbar-track { background: transparent; }
.kanban-list::-webkit-scrollbar-thumb { background: #c1c9d2; border-radius: 3px; }
.kanban-list::-webkit-scrollbar-thumb:hover { background: #a8b2bd; }
.kanban-card { background: #fff; border-radius: 10px; padding: 1rem 1rem 1rem 1.25rem; margin-bottom: 0.85rem; box-shadow: 0 4px 6px rgba(0,0,0,0.02), 0 1px 3px rgba(0,0,0,0.04); cursor: grab; border: 1px solid rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.priority-Critical::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #b0202f; }
.kanban-card.priority-High::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #d9662d; }
.kanban-card.priority-Medium::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #4a7fb0; }
.kanban-card.priority-Low::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #7a8896; }
.kanban-board-wrapper { overflow-x: auto; overflow-y: hidden; padding-bottom: 1rem; }
.kanban-board-wrapper::-webkit-scrollbar { height: 8px; }
.kanban-board-wrapper::-webkit-scrollbar-track { background: #eef1f5; border-radius: 4px; }
.kanban-board-wrapper::-webkit-scrollbar-thumb { background: #c1c9d2; border-radius: 4px; }
.kanban-board-wrapper::-webkit-scrollbar-thumb:hover { background: #a8b2bd; }

[data-bs-theme="dark"] body, html[data-bs-theme="dark"] body { background: #131b24; color: #dce3ea; }
[data-bs-theme="dark"] .card { background: #1b2733; color: #dce3ea; }
[data-bs-theme="dark"] .kanban-column { background: #18222c; border-color: rgba(255,255,255,0.05); }
[data-bs-theme="dark"] .kanban-column-header { border-bottom-color: rgba(255,255,255,0.05); }
[data-bs-theme="dark"] .kanban-card { background: #22303e; border-color: rgba(255,255,255,0.05); box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
[data-bs-theme="dark"] .table { color: #dce3ea; }
[data-bs-theme="dark"] .dropdown-menu { background: #1b2733; border-color: #2c3e50; }
[data-bs-theme="dark"] .dropdown-item { color: #dce3ea; }
[data-bs-theme="dark"] .dropdown-item:hover { background: #24333f; color: #fff; }

.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.auth-card { max-width: 420px; width: 100%; border-radius: 14px; }

@media (max-width: 992px) {
  .sidebar { position: fixed; z-index: 1030; top: 58px; left: 0; height: calc(100% - 58px); }
}
