:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --line: #dbe3ef;
    --primary: #2457c5;
    --green: #138a5b;
    --amber: #b76b00;
    --red: #c2413a;
}

[data-bs-theme="dark"] {
    --bg: #111827;
    --panel: #182235;
    --text: #eef2ff;
    --muted: #a8b3c7;
    --line: #334155;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a { text-decoration: none; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 280px;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 0.75rem 1.25rem 1.25rem; /* adjusted right padding for scrollbar spacing */
    background: var(--panel);
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap !important;
}

/* Elegant, slim scrollbar for sidebar nav */
.sidebar nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar nav::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.2);
    border-radius: 4px;
}
.sidebar nav::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.4);
}


.brand {
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .25rem 1rem;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: .72rem;
}

.brand-mark,
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.avatar { width: 34px; height: 34px; font-size: .9rem; }

.nav-link {
    display: flex;
    gap: .7rem;
    align-items: center;
    color: var(--muted);
    border-radius: 8px;
    padding: .78rem .85rem;
    font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(36, 87, 197, .1);
    color: var(--primary);
}

.app-main { flex: 1; min-width: 0; }

.topbar {
    min-height: 78px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

[data-bs-theme="dark"] .topbar { background: rgba(24, 34, 53, .85); }

.content-wrap { padding: 1.5rem; }

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
}

.notification-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.metric-card,
.panel,
.task-card,
.report-tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.metric-card {
    padding: 1.25rem;
    border-left: 4px solid var(--primary);
}

.metric-card span,
.metric-card small,
.panel-header p,
.task-card p,
.report-tile span,
.stack-list small,
.timeline p {
    color: var(--muted);
}

.metric-card strong {
    display: block;
    font-size: 2rem;
    margin: .35rem 0;
}

.accent-green { border-left-color: var(--green); }
.accent-blue { border-left-color: var(--primary); }
.accent-amber { border-left-color: var(--amber); }
.accent-red { border-left-color: var(--red); }

.panel { padding: 1.25rem; }

.panel-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-header h2,
.kanban-column h2 {
    font-size: 1rem;
    margin: 0;
}

.panel-header p { margin: .2rem 0 0; }

.stack-list {
    display: grid;
    gap: .85rem;
}

.stack-list article {
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stack-list p { margin: .3rem 0; }

.timeline {
    display: grid;
    gap: 1rem;
}

.timeline div {
    position: relative;
    padding-left: 1.2rem;
}

.timeline span {
    position: absolute;
    left: 0;
    top: .35rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.kanban {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem 2rem;
    scroll-snap-type: x mandatory;
}

.kanban-column {
    flex: 0 0 320px;
    background: #f4f5f7;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    min-height: 70vh;
}

[data-bs-theme="dark"] .kanban-column {
    background: #1e293b;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.kanban-column h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--line);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-tasks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card {
    background: var(--panel);
    border: none;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Priority Borders */
.task-card.priority-high { border-left-color: #ef4444; }
.task-card.priority-critical { border-left-color: #991b1b; }
.task-card.priority-medium { border-left-color: #f59e0b; }
.task-card.priority-low { border-left-color: #10b981; }

.task-title {
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.task-desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.task-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.task-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.1);
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-badge-due {
    background: rgba(36, 87, 197, 0.1);
    color: var(--primary);
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.task-assignee i {
    font-size: 1.25rem;
    color: var(--primary);
}

.btn-complete {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-complete:hover {
    background: #059669;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.4);
}

.report-tile {
    min-height: 150px;
    padding: 1.1rem;
    display: grid;
    align-content: start;
    gap: .5rem;
}

.report-tile i {
    font-size: 1.7rem;
    color: var(--primary);
}

.attendance-loader {
    border-top: 4px solid #1bb394;
}

.attendance-sheet {
    padding: 0;
    overflow: hidden;
}

.attendance-sheet-title {
    background: #1bb394;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    padding: 1rem 1.25rem;
}

.attendance-entry-table {
    margin: 1.25rem;
    width: calc(100% - 2.5rem);
    border: 1px solid var(--line);
}

.attendance-entry-table th {
    font-weight: 800;
    background: var(--panel);
    border-bottom: 2px solid var(--line);
}

.attendance-entry-table td,
.attendance-entry-table th {
    padding: 1rem;
    border-right: 1px solid var(--line);
}

.attendance-entry-table tbody tr:nth-child(odd) {
    background: rgba(100, 116, 139, .08);
}

.employee-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.attendance-radio {
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 520px) 1fr;
    background: var(--bg);
}

.auth-panel {
    background: var(--panel);
    padding: clamp(1.5rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-brand {
    display: flex;
    gap: .9rem;
    align-items: center;
    margin-bottom: 2rem;
}

.auth-brand h1 { margin: 0; font-weight: 800; }
.auth-brand p { margin: 0; color: var(--muted); }

.auth-aside {
    display: flex;
    align-items: end;
    padding: clamp(2rem, 6vw, 5rem);
    color: #fff;
    background:
        linear-gradient(rgba(13, 31, 66, .76), rgba(13, 31, 66, .76)),
        url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.auth-aside h2 { max-width: 760px; font-size: clamp(2rem, 4vw, 4.5rem); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }

@media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kanban { grid-template-columns: repeat(5, 260px); }
}

@media (max-width: 768px) {
    .content-wrap { padding: 1rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .topbar h1 { font-size: 1.05rem; }
}
