/* Employee Management System - professional light theme */
:root {
    --ems-primary: #2f5d9e;
    --ems-primary-dark: #244a80;
    --ems-primary-soft: #e8eff8;
    --ems-bg: #f4f6f9;
    --ems-surface: #ffffff;
    --ems-border: #e3e8ef;
    --ems-text: #1f2a37;
    --ems-muted: #6b7686;
    --ems-sidebar-w: 250px;
}

body {
    background: var(--ems-bg);
    color: var(--ems-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.925rem;
}

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

/* Sidebar */
.sidebar {
    overflow: auto;
    width: var(--ems-sidebar-w);
    background: var(--ems-surface);
    border-right: 1px solid var(--ems-border);
    position: fixed; top: 0; bottom: 0; left: 0;
    display: flex; flex-direction: column;
    z-index: 1030;
    transition: transform .2s ease;
}
.sidebar-brand {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--ems-border);
    display: flex; align-items: center; gap: .65rem;
    font-weight: 600; font-size: 1.05rem; color: var(--ems-text);
}
.sidebar-brand .logo {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--ems-primary); color: #fff;
    display: grid; place-items: center; font-size: 1.1rem;
}
.sidebar-nav { padding: .75rem; flex: 1; }
.sidebar-section {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ems-muted); padding: .9rem .75rem .35rem;
}
.sidebar-nav .nav-link {
    color: #44505f; border-radius: 8px; padding: .55rem .75rem;
    display: flex; align-items: center; gap: .7rem; font-weight: 500;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; color: var(--ems-muted); }
.sidebar-nav .nav-link:hover { background: var(--ems-bg); }
.sidebar-nav .nav-link.active { background: var(--ems-primary-soft); color: var(--ems-primary); }
.sidebar-nav .nav-link.active i { color: var(--ems-primary); }

/* Main */
.app-main { margin-left: var(--ems-sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: var(--ems-surface); border-bottom: 1px solid var(--ems-border);
    padding: .7rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1020;
}
.app-content { padding: 1.5rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.page-header h1 { font-size: 1.35rem; font-weight: 600; margin: 0; }
.page-header .sub { color: var(--ems-muted); font-size: .85rem; }

/* Cards */
.card { border: 1px solid var(--ems-border); border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04); background: var(--ems-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--ems-border); font-weight: 600; padding: .85rem 1.15rem; }
.stat-card { padding: 1.15rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-size: 1.3rem; background: var(--ems-primary-soft); color: var(--ems-primary); }
.stat-icon.green { background: #e6f4ec; color: #2e7d4f; }
.stat-icon.amber { background: #fdf3e0; color: #b7791f; }
.stat-icon.slate { background: #eceff3; color: #556070; }
.stat-value { font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.stat-label { color: var(--ems-muted); font-size: .82rem; }

/* Buttons & forms */
.btn-primary { background: var(--ems-primary); border-color: var(--ems-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--ems-primary-dark); border-color: var(--ems-primary-dark); }
.btn-outline-primary { color: var(--ems-primary); border-color: var(--ems-primary); }
.btn-outline-primary:hover { background: var(--ems-primary); border-color: var(--ems-primary); }
.form-control:focus, .form-select:focus { border-color: var(--ems-primary); box-shadow: 0 0 0 .2rem rgba(47,93,158,.15); }
.form-label { font-weight: 500; font-size: .85rem; }

/* Tables */
.table > :not(caption) > * > * { padding: .8rem 1rem; vertical-align: middle; }
.table thead th { background: #f8fafc; color: var(--ems-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--ems-border); }

/* Avatar */
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--ems-primary-soft); color: var(--ems-primary);
    display: inline-grid; place-items: center; font-weight: 600; font-size: .8rem; flex-shrink: 0;
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }

/* Badges */
.badge-soft-success { background: #e6f4ec; color: #2e7d4f; }
.badge-soft-secondary { background: #eceff3; color: #556070; }
.badge-soft-primary { background: var(--ems-primary-soft); color: var(--ems-primary); }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--ems-bg); }
.auth-card { width: 100%; max-width: 410px; padding: 2rem; }

.detail-list dt { color: var(--ems-muted); font-weight: 500; font-size: .8rem; }
.detail-list dd { margin-bottom: .9rem; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); box-shadow: 0 0 30px rgba(0,0,0,.15); }
    .app-main { margin-left: 0; }
}

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(250px, 1fr)); gap: 1rem; overflow-x: auto; align-items: start; padding-bottom: .5rem; }
.kanban-col { background: #eef1f6; border-radius: 10px; padding: .75rem; min-height: 220px; }
.kanban-col.drag-over { background: var(--ems-primary-soft); outline: 2px dashed var(--ems-primary); }
.kanban-col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ems-muted); display: flex; justify-content: space-between; margin: .1rem .25rem .75rem; }
.task-card {
    background: #fff; border: 1px solid var(--ems-border); border-left: 5px solid var(--task-color, var(--ems-primary));
    border-radius: 8px; padding: .7rem .8rem; margin-bottom: .6rem; cursor: grab; box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.task-card.dragging { opacity: .45; }
.task-card .t-title { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.task-card .t-desc { color: var(--ems-muted); font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; font-size: .72rem; }
.task-meta .chip { background: #f1f4f8; color: #4a5565; border-radius: 20px; padding: .12rem .55rem; }
.task-meta .chip.overdue { background: #fdeaea; color: #b42318; }
.task-meta .chip.points { background: #fff4d6; color: #8a6100; font-weight: 600; }
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #999); }
.toast-lite { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2000; max-width: 340px; }
.notif-unread { background: var(--ems-primary-soft); }
.shot-thumb { aspect-ratio: 16 / 10; background: #eef1f6; border-radius: 8px; display: grid; place-items: center; color: var(--ems-muted); overflow: hidden; cursor: pointer; border: 1px solid var(--ems-border); }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; }
.state-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .4rem; background: #aab3c0; }
.state-dot.working { background: #2e9e5b; } .state-dot.idle { background: #d9a21b; } .state-dot.break { background: #2f6fb5; }
