/* Nexus Core Payroll & Leave – style.css */
:root {
    --navy: #14213d;
    --navy-2: #1d2f57;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --green: #15803d;
    --red: #b91c1c;
    --amber: #b45309;
    --sidebar-w: 250px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }

/* ---------- layout + persistent left nav ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: var(--navy); color: #fff; display: flex; flex-direction: column; overflow-y: auto; z-index: 50; }
.brand { padding: 20px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-name { display: block; font-weight: 700; font-size: 16px; }
.brand-sub { display: block; font-size: 12px; color: #aab4cc; }
.nav-list { list-style: none; margin: 10px 0; padding: 0; flex: 1; }
.nav-list a { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; color: #cdd5e6; text-decoration: none; border-left: 3px solid transparent; }
.nav-list a:hover { background: var(--navy-2); color: #fff; }
.nav-list a.active { background: var(--navy-2); color: #fff; border-left-color: var(--accent); font-weight: 600; }
.nav-badge { background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.logout-form { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.1); }

.content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; padding: 0 28px 40px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 0; }
.topbar h1 { font-size: 22px; margin: 0; flex: 1; }
.topbar-user { color: var(--muted); font-size: 14px; }
.nav-toggle { display: none; background: var(--navy); color: #fff; border: 0; border-radius: 6px; font-size: 20px; padding: 4px 10px; cursor: pointer; }

/* ---------- cards + widgets ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card h2 { font-size: 17px; margin: 0 0 14px; }
.widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.widget { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 16px; }
.widget .num { font-size: 28px; font-weight: 700; line-height: 1.1; }
.widget .lbl { color: var(--muted); font-size: 13px; }
.widget.warn { border-left-color: var(--amber); }
.widget.danger { border-left-color: var(--red); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .card { margin-bottom: 0; }
.stack { margin-bottom: 20px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f9fafb; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.reason { max-width: 420px; white-space: normal; }

/* ---------- forms + buttons ---------- */
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid #cbd2dc; border-radius: 6px; font: inherit; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37,99,235,.35); border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.filter-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.filter-form > div { flex: 1; min-width: 160px; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--accent); color: #fff; }
.btn:hover { background: var(--accent-dark); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #991b1b; }
.btn-success { background: var(--green); }
.btn-success:hover { background: #166534; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-block { width: 100%; }
.inline-form { display: inline; }
.field-error { color: var(--red); font-size: 13px; margin-top: 4px; }

/* ---------- flash + badges ---------- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-verbal { background: #fef9c3; color: #854d0e; }
.badge-written { background: #ffedd5; color: #9a3412; }
.badge-final_written { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ---------- announcements + pagination ---------- */
.announcement { padding: 12px 0; border-bottom: 1px solid var(--border); }
.announcement:last-child { border-bottom: 0; }
.announcement h3 { margin: 0 0 2px; font-size: 15px; }
.announcement p { margin: 6px 0 0; }
.pagination { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; background: #fff; font-size: 13px; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- login ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.auth-card { background: #fff; width: 100%; max-width: 400px; border-radius: 12px; padding: 32px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card .sub { color: var(--muted); margin: 0 0 18px; }
.auth-links { margin-top: 14px; text-align: center; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; padding: 0 14px 30px; }
    .nav-toggle { display: inline-block; }
    .grid-2, .form-row { grid-template-columns: 1fr; }
    .topbar-user { display: none; }
}


/* ---------- logo + grouped dropdown navigation ---------- */
.brand { display: block; padding: 14px 14px 12px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo { display: block; background: #fff; border-radius: 10px; padding: 8px 10px; }
.brand-logo img { display: block; width: 100%; height: auto; }
.brand-sub { display: block; margin-top: 8px; font-size: 11px; color: #aab4cc; text-align: center; letter-spacing: .08em; text-transform: uppercase; }

.nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; padding: 10px 18px; color: #e6ebf7; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; border-left: 3px solid transparent; user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary > span:first-child { flex: 1; }
.nav-group > summary::after { content: ''; width: 6px; height: 6px; border-right: 2px solid #aab4cc; border-bottom: 2px solid #aab4cc; transform: rotate(-45deg); transition: transform .15s ease; margin-left: 8px; }
.nav-group[open] > summary::after { transform: rotate(45deg); }
.nav-group > summary:hover { background: var(--navy-2); }
.nav-group[open] > summary { background: rgba(255,255,255,.05); }
.nav-sub { list-style: none; margin: 0; padding: 0 0 6px; background: rgba(0,0,0,.12); }
.nav-sub a { padding: 8px 18px 8px 32px; font-size: 14px; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; margin-left: 6px; }

.auth-logo { display: block; width: 230px; max-width: 70%; height: auto; margin: 0 auto 14px; }
.auth-card h1 { text-align: center; }
.auth-card .sub { text-align: center; }

/* ---------- attendance ---------- */
.cam-box { background: #0b1220; border-radius: 10px; overflow: hidden; max-width: 480px; aspect-ratio: 4 / 3; margin-bottom: 8px; }
.cam-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); margin-top: 4px; vertical-align: middle; }

.badge-paid { background: #dbeafe; color: #1e40af; }
.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- messaging ---------- */
.msg-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.msg-layout > .card { margin-bottom: 0; }
.thread { max-height: 460px; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 10px; background: #f9fafb; border: 1px solid var(--border); border-radius: 8px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 12px; font-size: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: #dbeafe; border-bottom-right-radius: 3px; }
.bubble.them { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.bubble.unread { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.bubble-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.convo-list { list-style: none; margin: 0; padding: 0; }
.convo-list a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--text); border: 1px solid transparent; }
.convo-list a:hover { background: #f3f4f6; }
.convo-list a.active { background: #eff6ff; border-color: #bfdbfe; }
@media (max-width: 900px) { .msg-layout { grid-template-columns: 1fr; } .bubble { max-width: 92%; } }

/* ---------- tasks, assets, reviews ---------- */
.badge-in_progress { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-returned { background: #e5e7eb; color: #374151; }
.badge-maintenance { background: #ffedd5; color: #9a3412; }
.stars { color: #f59e0b; letter-spacing: 2px; white-space: nowrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.task-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.task-item:last-child { border-bottom: 0; }
.task-item.late { border-left: 3px solid var(--red); padding-left: 12px; }
.task-main { flex: 1; min-width: 0; }
.task-form { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.task-form select { width: auto; padding: 5px 8px; }
@media (max-width: 700px) { .task-item { flex-direction: column; } }

/* ---------- settings ---------- */
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; }
label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; margin: 6px 0; }
label.check input { width: auto; margin-top: 3px; }
.badge-cancelled { background: #e5e7eb; color: #4b5563; }
.badge-withdrawn { background: #e0e7ff; color: #3730a3; }
.badge-expired { background: #f3f4f6; color: #6b7280; }
tr.closed td { color: #9ca3af; }
tr.closed td.reason, tr.closed td strong { text-decoration: line-through; text-decoration-color: #cbd5e1; }

.box-form { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: #fafbfd; }
.emp201 td, .emp201 th { padding: 8px 12px; }
.emp201 tr.sum td { font-weight: 700; background: #f6f8fb; border-top: 2px solid var(--border); }
