:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --border: #e2e6ea;
    --text: #1a202c;
    --heading: #0d1117;
    --muted: #5a6474;
    --accent: #2563eb;
    --accent-dim: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --radius: 8px;
    font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #F0F2F7;
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────── */

.layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */

.sidebar {
    width: 220px;
    background: #111318;
    flex-shrink: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.brand {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.03em;
    color: #ffffff;
    padding: 1.2rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.4rem;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.25rem 0.75rem;
    flex: 1;
}

.sidebar nav a {
    color: rgba(255,255,255,0.70);
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    display: block;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.10);
    color: #ffffff;
    text-decoration: none;
}

.sidebar nav a.nav-muted {
    color: rgba(255,255,255,0.35);
    margin-top: auto;
    font-size: 0.82rem;
}

.sidebar nav a.nav-muted:hover {
    color: rgba(255,255,255,0.60);
    background: rgba(255,255,255,0.06);
}

/* ── Main area ───────────────────────────────────────── */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #F0F2F7;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.75rem;
    border-bottom: 1px solid #E4E7EF;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky; top: 0; z-index: 10;
}

.topbar h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading);
    display: none;
}

.user-pill {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--muted);
    background: #F4F6FA;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    border: 1px solid #E4E7EF;
    font-weight: 500;
}

/* ── Global search bar ───────────────────────────────── */
.topbar-search {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 420px;
    margin: 0 1.25rem;
    position: relative;
}

.topbar-search-icon {
    position: absolute;
    left: 0.65rem;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0.6;
}

.topbar-search input {
    width: 100%;
    padding: 0.42rem 4rem 0.42rem 2.1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #f8fafc;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.topbar-search input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: #fff;
}

.topbar-search-kbd {
    position: absolute;
    right: 0.5rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    font-size: 0.68rem;
    color: #94a3b8;
    pointer-events: none;
    white-space: nowrap;
    font-family: inherit;
}

.topbar-search input:focus ~ .topbar-search-kbd {
    display: none;
}

.content {
    padding: 1.5rem 2rem;
    flex: 1;
    background: #F0F2F7;
}

/* ── Cards ───────────────────────────────────────────── */

.card {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.card h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading);
}

/* ── Dashboard section title ─────────────────────────── */

.dashboard-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4b5563;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

/* ── Stat grid ───────────────────────────────────────── */

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.grid-stats.tight {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* ₹ amount sections: 2 cols on mobile, 3 cols on desktop */
.grid-stats.amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
    .grid-stats.amounts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.dashboard-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    align-items: stretch;
    margin-bottom: 1.1rem;
}
.dashboard-split > .card {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.dashboard-split > .card > table.data {
    flex: 1 0 auto;
}

@media (min-width: 900px) {
    .dashboard-split.cols-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─ Stat card ─ */

.stat {
    background: #ffffff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    overflow: hidden;
    min-width: 0;
}

.stat:has(.num-ok)     { border-left-color: var(--success); }
.stat:has(.num-danger) { border-left-color: var(--danger); }
.stat:has(.num-warn)   { border-left-color: var(--warning); }
.stat:has(.num-ongoing){ border-left-color: #0369a1; }

/* num: nowrap so amounts never split mid-digit; card width handles the space */
.stat .num {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    display: block;
    max-width: 100%;
}

.stat .lbl {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* number colour variants */
.stat .num.num-need    { color: #3b5a8c; }
.stat .num.num-ongoing { color: #0369a1; }
.stat .num.num-approval{ color: #92400e; }
.stat .num.num-hold    { color: #b45309; }
.stat .num.num-done    { color: #15803d; }
.stat .num.num-warn    { color: var(--warning); }
.stat .num.num-ok      { color: var(--success); }
.stat .num.num-danger  { color: var(--danger); }

/* ── Tables ──────────────────────────────────────────── */

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

table.data th,
table.data td {
    text-align: left;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #F0F2F7;
}

table.data th {
    color: #6B7280;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #F8F9FC;
    white-space: nowrap;
}

table.data th:first-child { border-radius: 8px 0 0 0; }
table.data th:last-child  { border-radius: 0 8px 0 0; }

table.data tbody tr { transition: background 0.1s; }
table.data tbody tr:hover { background: #FFF8F3; }
table.data tbody tr:nth-child(even) { background: #FAFBFD; }
table.data tbody tr:nth-child(even):hover { background: #FFF8F3; }

table.data td {
    color: var(--text);
}

/* ── Badges ──────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    background: #e5e7eb;
    color: #374151;
    white-space: nowrap;
}

/* New CRM workflow statuses */
.badge.wf-new_lead           { background: #dbeafe; color: #1e40af; }
.badge.wf-contacted          { background: #e0f2fe; color: #0c4a6e; }
.badge.wf-qualified          { background: #d1fae5; color: #065f46; }
.badge.wf-demo_scheduled     { background: #ede9fe; color: #4c1d95; }
.badge.wf-proposal_sent      { background: #eef2ff; color: #3730a3; }
.badge.wf-negotiation        { background: #fef3c7; color: #78350f; }
.badge.wf-won                { background: #dcfce7; color: #14532d; font-weight: 700; }
.badge.wf-lost               { background: #fee2e2; color: #7f1d1d; }
.badge.wf-cold               { background: #f1f5f9; color: #475569; }
.badge.wf-future_opportunity { background: #fdf4ff; color: #6b21a8; }
/* Legacy fallbacks */
.badge.wf-lead               { background: #dbeafe; color: #1e40af; }
.badge.wf-advance_pending    { background: #fef3c7; color: #92400e; }
.badge.wf-in_progress        { background: #dcfce7; color: #14532d; }
.badge.wf-waiting_for_client { background: #fef3c7; color: #92400e; }
.badge.wf-testing            { background: #dcfce7; color: #14532d; }
.badge.wf-final_delivery     { background: #e0f2fe; color: #0c4a6e; }
.badge.wf-payment_pending    { background: #fee2e2; color: #7f1d1d; }
.badge.wf-completed          { background: #dcfce7; color: #14532d; }
.badge.wf-on_hold            { background: #f1f5f9; color: #475569; }
.badge.wf-cancelled          { background: #fee2e2; color: #7f1d1d; }
.badge.payment-advance_pending { background: #fef9c3; color: #713f12; }
.badge.payment-partial_paid    { background: #dbeafe; color: #1e40af; }
.badge.payment-fully_paid      { background: #dcfce7; color: #14532d; }
.badge.payment-overdue         { background: #fee2e2; color: #7f1d1d; }
.badge.milestone-overdue, .badge.inv-overdue { background: #fee2e2; color: #7f1d1d; }
.badge.milestone-paid,    .badge.inv-paid    { background: #dcfce7; color: #14532d; }
.badge.inv-draft        { background: #f1f5f9; color: #475569; }
.badge.inv-sent         { background: #fef3c7; color: #92400e; }
.badge.inv-partial_paid { background: #dbeafe; color: #1e40af; }
.badge.pending   { background: #fef9c3; color: #713f12; }
.badge.approved  { background: #dcfce7; color: #14532d; }
.badge.rejected  { background: #fee2e2; color: #7f1d1d; }
.badge.cancelled { background: #ede9fe; color: #5b21b6; }
.badge.ptype-client   { background: #e0e7ff; color: #3730a3; }
.badge.ptype-internal { background: #fdf2e9; color: #b45309; }
.badge.delivery-ongoing   { background: #f1f5f9; color: #475569; }
.badge.delivery-completed { background: #dcfce7; color: #14532d; }
.badge.delivery-delivered { background: #dbeafe; color: #1e40af; font-weight: 700; }

/* ── Project priority ────────────────────────────────── */
.badge.prio-low    { background: #f1f5f9; color: #475569; }
.badge.prio-normal { background: #e0e7ff; color: #3730a3; }
.badge.prio-high   { background: #fef3c7; color: #92400e; font-weight: 700; }
.badge.prio-urgent { background: #fee2e2; color: #7f1d1d; font-weight: 800; animation: prio-urgent-pulse 1.8s ease-in-out infinite; }
.badge.astatus-assigned   { background: #f1f5f9; color: #475569; }
.badge.astatus-in_progress { background: #dbeafe; color: #1d4ed8; }
.badge.astatus-completed  { background: #dcfce7; color: #14532d; font-weight: 700; }
@keyframes prio-urgent-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.35); }
    50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0); }
}

/* ── Overdue rows ────────────────────────────────────── */

.text-overdue { color: var(--danger); font-weight: 600; }
.row-overdue  { background: rgba(220,38,38,0.05); }
.row-overdue td:first-child { border-left: 3px solid var(--danger); }
.row-due-today { background: rgba(217,119,6,0.07); }
.card-alert h2 { margin-top: 0; }

/* ── Tab nav ─────────────────────────────────────────── */

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.85rem 0 0;
}

.tab-nav a {
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.tab-nav a:hover { color: var(--text); background: rgba(37,99,235,0.06); }

.tab-nav a.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(37,99,235,0.07);
    font-weight: 500;
}

/* ── Filter bar ──────────────────────────────────────── */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-bar select { max-width: 200px; }

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0 1rem;
}

/* ── Compact inline add-row (payments table, etc.) ───── */
.inline-add-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.inline-add-row .field { margin-bottom: 0; }
tr.total-row td { font-weight: 700; background: #F8F9FC; border-top: 2px solid var(--border); }
tr.total-row.pending td { color: var(--danger); }

/* ── Alert lists ─────────────────────────────────────── */

.alert-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: var(--text);
}

.alert-list li { margin-bottom: 0.3rem; }

.finance-summary .stat .num { font-size: 0.78rem; }

/* ── Forms ───────────────────────────────────────────── */

form.stacked label {
    display: block;
    margin-bottom: 0.3rem;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
}

form.stacked .field {
    margin-bottom: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
textarea,
select {
    width: 100%;
    max-width: 420px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-size: 0.9rem;
}

textarea {
    min-height: 100px;
    max-width: 100%;
}

/* ── Buttons ─────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    background: #F47920;
    color: #ffffff;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn:hover {
    background: #D95F00;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(244,121,32,0.35);
    transform: translateY(-1px);
}

.btn.secondary {
    background: #F4F6FA;
    color: #374151;
    border: 1px solid #E4E7EF;
}
.btn.secondary:hover {
    background: #E8EBF2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.btn.danger {
    background: #dc2626;
    color: #ffffff;
}
.btn.danger:hover {
    background: #b91c1c;
    box-shadow: 0 3px 10px rgba(220,38,38,0.3);
}

.btn.sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Flash alerts ────────────────────────────────────── */

.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.alert.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

/* ── Login ───────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg);
}

.login-box {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.09);
}

.login-box h1 {
    margin: 0 0 1.25rem;
    font-size: 1.3rem;
    color: var(--heading);
    font-weight: 700;
}

/* ── Utilities ───────────────────────────────────────── */

.muted {
    color: var(--muted);
    font-size: 0.875rem;
}

.stack-sm > * + * { margin-top: 0.5rem; }

/* ── KPI Big Cards (Acumatica-style) ─────────────────── */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    border-radius: 10px;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.13);
    min-height: 88px;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    right: -18px;
    top: -18px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.10);
}

.kpi-card.blue   { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
.kpi-card.green  { background: linear-gradient(135deg,#16a34a,#15803d); }
.kpi-card.orange { background: linear-gradient(135deg,#f59e0b,#d97706); }
.kpi-card.red    { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.kpi-card.teal   { background: linear-gradient(135deg,#0891b2,#0e7490); }
.kpi-card.purple { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
.kpi-card.slate  { background: linear-gradient(135deg,#475569,#334155); }
.kpi-card.indigo { background: linear-gradient(135deg,#4f46e5,#4338ca); }

.kpi-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    opacity: 0.90;
    line-height: 1;
}

.kpi-body { flex: 1; min-width: 0; }

.kpi-num {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-num.fin {
    font-size: 1.3rem;
    font-weight: 700;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
}

.kpi-label {
    font-size: 0.78rem;
    opacity: 0.90;
    margin-top: 0.3rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Chart grid ──────────────────────────────────────── */

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

@media (max-width: 820px) {
    .chart-grid          { grid-template-columns: 1fr; }
    .kpi-grid            { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid.cols-3     { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .kpi-grid.cols-3     { grid-template-columns: 1fr; }
}

.chart-box { padding: 1.1rem 1.25rem; }
.chart-box canvas { max-height: 200px; width: 100% !important; }

/* Chart.js responsive canvases need a positioned, height-bound ancestor —
   without one, in a flex/grid parent the canvas and its container can grow
   each other in a feedback loop and bleed into neighboring cards. */
.chart-wrap { position: relative; height: 220px; width: 100%; }
.chart-wrap canvas { max-height: 100% !important; }

/* ── Holiday Calendar Widget ─────────────────────────── */

.cal-widget {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cal-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--heading);
}

.cal-nav-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.cal-nav-btn:hover { background: var(--border); text-decoration: none; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.75rem;
}

.cal-dh {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0.2rem 0;
    text-transform: uppercase;
}

.cal-cell {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.28rem 0;
    border-radius: 5px;
    cursor: default;
    color: var(--text);
    position: relative;
    line-height: 1.4;
}

.cal-cell.empty { background: transparent; }
.cal-cell:not(.empty):hover { filter: brightness(0.93); }

.cal-today    { background: #16a34a; color: #ffffff !important; font-weight: 700; }
.cal-holiday  { background: #dc2626; color: #ffffff !important; font-weight: 600; }
.cal-optional { background: #92400e; color: #fde68a !important; font-weight: 600; }
.cal-weekoff  { background: #f59e0b; color: #7c2d12 !important; font-weight: 500; }

.cal-dot {
    display: block;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    margin: 1px auto 0;
}

/* Holiday list below calendar */
.cal-hlist {
    border-top: 1px solid var(--border);
    padding-top: 0.6rem;
    margin-bottom: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 120px;
    overflow-y: auto;
}

.cal-hitem {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.cal-hdate {
    font-weight: 700;
    color: var(--muted);
    min-width: 22px;
}

.cal-hname { flex: 1; color: var(--text); }

.cal-htype {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.cal-hitem-holiday .cal-htype  { background: #fee2e2; color: #7f1d1d; }
.cal-hitem-optional .cal-htype { background: #fef3c7; color: #92400e; }

/* Legend */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.cal-leg-item {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 500;
}

/* ── Attendance Widget ───────────────────────────────── */

.att-card {
    display: grid;
    grid-template-columns: 260px 1fr;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,0.09);
    margin-bottom: 1.25rem;
    min-height: 360px;
}

.att-left {
    background: linear-gradient(160deg, #0891b2 0%, #0e7490 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    gap: 0.45rem;
}

.att-avatar {
    width: 88px; height: 88px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid rgba(255,255,255,0.45);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.att-name { font-size: 1.1rem; font-weight: 700; text-align: center; }
.att-role { font-size: 0.8rem; opacity: 0.85; text-align: center; }
.att-dept {
    font-size: 0.72rem; opacity: 0.75; text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 0.15rem 0.65rem; border-radius: 999px; margin-top: 0.1rem;
}

.att-right {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.att-date-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    gap: 1rem;
}

.att-date { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.15rem; }
.att-checkin-status { font-size: 0.95rem; color: var(--heading); font-weight: 500; }

.att-wh-box { text-align: right; flex-shrink: 0; }
.att-wh-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.15rem; }
.att-wh-val { font-size: 1.05rem; font-weight: 700; color: var(--accent); }

.att-quote {
    background: #f0fdf4;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    border-left: 3px solid #16a34a;
}
.att-quote-title { font-size: 0.78rem; font-weight: 700; color: #15803d; margin-bottom: 0.3rem; }
.att-quote-text  { font-size: 0.8rem; color: var(--muted); font-style: italic; }
.att-quote-sub   { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }

.att-actions { display: flex; flex-direction: column; gap: 0.5rem; }

.att-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: opacity 0.15s, filter 0.15s;
    position: relative;
    text-decoration: none;
}

.att-btn small {
    font-size: 0.68rem;
    font-weight: 400;
    opacity: 0.85;
    position: absolute;
    right: 1rem;
}

.att-btn:disabled { opacity: 0.42; cursor: not-allowed; filter: grayscale(0.3); }
.att-btn-icon { font-size: 1rem; }

.att-btn-in  { background: #4caf50; color: #ffffff; }
.att-btn-in:not(:disabled):hover  { background: #43a047; }

.att-btn-out { background: #d97706; color: #ffffff; }
.att-btn-out:not(:disabled):hover { background: #b45309; }

.att-lunch-row { display: flex; gap: 0.5rem; }
.att-lunch-row .att-btn-lunch {
    flex: 1;
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
}
.att-lunch-row .att-btn-lunch:not(:disabled):hover { background: #e2e8f0; }

/* Attendance status badges */
.badge.att-status-present  { background: #dcfce7; color: #166534; }
.badge.att-status-half_day { background: #fef9c3; color: #713f12; }
.badge.att-status-absent   { background: #fee2e2; color: #7f1d1d; }
.badge.att-status-leave    { background: #e0e7ff; color: #3730a3; }

/* Form inputs (used in filter forms) */
.form-label {
    font-size: 0.78rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-input {
    padding: 0.42rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text);
    background: #ffffff;
    min-width: 160px;
}

.form-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (max-width: 768px) {
    .att-card { grid-template-columns: 1fr; }
    .att-left { padding: 1.5rem; min-height: unset; }
    .att-right { padding: 1.25rem; }
}

/* ── Dashboard Quick Attendance Widget ───────────────── */

.dash-att-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 3px 14px rgba(0,0,0,0.15);
    flex-wrap: wrap;
}

.dash-att-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.dash-att-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.dash-att-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dash-att-dot.checked-in  { background: #4ade80; box-shadow: 0 0 10px #4ade8099; }
.dash-att-dot.checked-out { background: #f87171; }
.dash-att-dot.not-in      { background: #94a3b8; }

.dash-att-info { color: #ffffff; }
.dash-att-label { font-size: 0.72rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.06em; }
.dash-att-val   { font-size: 0.97rem; font-weight: 600; }
.dash-att-sub   { font-size: 0.78rem; color: rgba(255,255,255,0.55); margin-top: 0.1rem; }

.dash-att-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
}

.dash-att-actions .att-btn {
    padding: 0.52rem 1.1rem;
    font-size: 0.82rem;
    min-width: 130px;
    border-radius: 7px;
}

.dash-att-link {
    color: rgba(255,255,255,0.55);
    font-size: 0.78rem;
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 7px;
    white-space: nowrap;
    transition: background 0.15s;
}
.dash-att-link:hover { background: rgba(255,255,255,0.08); color: #ffffff; text-decoration: none; }

@media (max-width: 680px) {
    .dash-att-widget { flex-direction: column; align-items: flex-start; }
    .dash-att-actions { width: 100%; }
    .dash-att-actions .att-btn { flex: 1; }
}

/* ── Employee Directory ───────────────────────────────── */

.emp-dir-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.emp-dir-search {
    padding: 0.44rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 220px;
    background: #f9fafb;
    color: var(--text);
    max-width: 300px;
    width: 100%;
}
.emp-dir-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }

.emp-dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.emp-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    transition: box-shadow 0.15s, transform 0.15s;
    cursor: default;
}

.emp-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

.emp-avatar {
    width: 66px; height: 66px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.emp-card-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--heading);
    line-height: 1.3;
    word-break: break-word;
}

.emp-card-desig {
    font-size: 0.7rem;
    background: #ede9fe;
    color: #5b21b6;
    padding: 0.18rem 0.65rem;
    border-radius: 99px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.emp-card-phone {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.emp-card.emp-hidden { display: none; }

.emp-dir-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    padding: 2rem 0;
}

/* ── Project detail form ──────────────────────────────── */
.proj-form input[type="text"],
.proj-form input[type="date"],
.proj-form input[type="number"],
.proj-form input[type="email"],
.proj-form select {
    max-width: 100%;
    width: 100%;
}

.proj-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
}

.proj-form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.proj-section-hdr {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #6b7280;
    padding: 0 0 0.4rem;
    border-bottom: 1px solid var(--border);
    margin: 0.6rem 0 0.85rem;
}

.proj-emp-select {
    max-width: 100% !important;
    width: 100% !important;
    min-height: 155px;
    max-height: 200px;
    border-radius: 8px !important;
    background: #f9fafb !important;
    font-size: 0.875rem;
    padding: 0.35rem;
    border: 1px solid var(--border) !important;
}

.proj-file-zone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    background: #f9fafb;
    transition: border-color 0.15s, background 0.15s;
}

.proj-file-zone:focus-within {
    border-color: var(--accent);
    background: #eff6ff;
}

.proj-file-zone input[type="file"] {
    max-width: none !important;
    width: auto !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 0.875rem;
    flex: 1;
}

@media (max-width: 640px) {
    .proj-form-row,
    .proj-form-row.proj-form-row-3 { grid-template-columns: 1fr; }
}

/* ── Maintenance bill badges ──────────────────────────────── */
.badge.maint-bill-pending  { background: #fef9c3; color: #713f12; }
.badge.maint-bill-overdue  { background: #fee2e2; color: #7f1d1d; }
.badge.maint-bill-paid     { background: #dcfce7; color: #14532d; }

/* ── Sidebar — Appspire Brand ─────────────────────────── */
.sidebar {
    width: 245px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #111318;
    border-right: 1px solid rgba(255,255,255,0.04);
    scrollbar-width: thin;
    scrollbar-color: rgba(244,121,32,0.25) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(244,121,32,0.25); border-radius: 2px; }

/* ── Brand header ─────────────────────────────────────── */
.sidebar-brand {
    display: flex; align-items: center; justify-content: center;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 2px solid rgba(244,121,32,0.20);
    flex-shrink: 0;
    position: sticky; top: 0; z-index: 2;
    min-height: 70px;
}
.sidebar-logo-img {
    width: 100%;
    max-width: 155px;
    height: auto;
    display: block;
    object-fit: contain;
}

.sidebar-logo {
    width: 42px; height: 42px; border-radius: 10px;
    background: linear-gradient(145deg, #F47920 0%, #C85A00 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.92rem; font-weight: 900; color: #fff;
    flex-shrink: 0; letter-spacing: 0.01em;
    box-shadow: 0 4px 16px rgba(244,121,32,0.45), 0 0 0 1px rgba(244,121,32,0.3);
}

.sidebar-brand-name {
    font-size: 1.02rem; font-weight: 800; color: #fff;
    white-space: nowrap; line-height: 1.15;
    letter-spacing: 0.01em;
}

.sidebar-brand-sub {
    font-size: 0.58rem;
    color: #F47920;
    opacity: 0.7;
    margin-top: 0.15rem;
    white-space: nowrap;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ── Nav container ────────────────────────────────────── */
.sidebar-nav {
    display: flex; flex-direction: column;
    padding: 0.8rem 0.65rem 1.5rem;
    flex: 1;
}

.nav-section-label {
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.12em; color: rgba(255,255,255,0.22);
    padding: 0.9rem 0.65rem 0.3rem;
}
.nav-section-label:first-child { padding-top: 0.4rem; }

/* ── Accordion section wrapper ───────────────────────── */
.nav-section { margin: 0.35rem 0 0; }

.nav-section-hdr {
    display: flex; align-items: center; gap: 0.5rem;
    width: 100%; padding: 0.52rem 0.85rem;
    font-size: 0.66rem; font-weight: 800;
    letter-spacing: 0.11em; text-transform: uppercase;
    border-radius: 7px;
    border: none; border-left: 3px solid transparent;
    background: transparent; cursor: pointer;
    color: rgba(255,255,255,0.28); text-align: left;
    transition: background 0.15s, color 0.15s;
    -webkit-appearance: none; appearance: none;
    font-family: inherit;
}
.nav-section-hdr .nph-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.nav-section-hdr .nph-label { flex: 1; }
.nav-section-hdr .nph-chevron {
    font-size: 0.65rem; opacity: 0.55; flex-shrink: 0;
    transition: transform 0.25s ease;
    display: inline-block;
}
.nav-section.open > .nav-section-hdr .nph-chevron { transform: rotate(180deg); }

/* CRM — primary orange */
.nav-section-hdr.crm {
    color: #F47920; background: rgba(244,121,32,0.11); border-left-color: #F47920;
}
.nav-section-hdr.crm .nph-dot { background: #F47920; box-shadow: 0 0 6px rgba(244,121,32,0.7); }
.nav-section-hdr.crm:hover { background: rgba(244,121,32,0.18); }

/* Projects — amber */
.nav-section-hdr.projects {
    color: #FBAD4E; background: rgba(251,173,78,0.10); border-left-color: #FBAD4E;
}
.nav-section-hdr.projects .nph-dot { background: #FBAD4E; box-shadow: 0 0 6px rgba(251,173,78,0.7); }
.nav-section-hdr.projects:hover { background: rgba(251,173,78,0.18); }

/* Workforce — warm yellow */
.nav-section-hdr.workforce {
    color: #FCD34D; background: rgba(252,211,77,0.08); border-left-color: #FCD34D;
}
.nav-section-hdr.workforce .nph-dot { background: #FCD34D; box-shadow: 0 0 6px rgba(252,211,77,0.6); }
.nav-section-hdr.workforce:hover { background: rgba(252,211,77,0.14); }

/* Tools — teal */
.nav-section-hdr.tools {
    color: #22D3EE; background: rgba(34,211,238,0.09); border-left-color: #22D3EE;
}
.nav-section-hdr.tools .nph-dot { background: #22D3EE; box-shadow: 0 0 6px rgba(34,211,238,0.6); }
.nav-section-hdr.tools:hover { background: rgba(34,211,238,0.16); }
.nav-section.sec-tools .nav-item.active {
    background: rgba(34,211,238,0.13); color: #22D3EE; border-left-color: #22D3EE;
}

/* ── Section body: hidden by default, visible when .open ─ */
.nav-section-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
}
.nav-section.open > .nav-section-body { max-height: 600px; }

/* ── Active item colors per section ──────────────────── */
.nav-section.sec-crm .nav-item.active {
    background: rgba(244,121,32,0.18); color: #F47920; border-left-color: #F47920;
}
.nav-section.sec-projects .nav-item.active {
    background: rgba(251,173,78,0.16); color: #FBAD4E; border-left-color: #FBAD4E;
}
.nav-section.sec-workforce .nav-item.active {
    background: rgba(252,211,77,0.13); color: #FCD34D; border-left-color: #FCD34D;
}

/* Indent items inside accordion sections */
.nav-section-body .nav-item { padding-left: 1.1rem; }

/* ── Nav items ────────────────────────────────────────── */
.nav-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.7rem; border-radius: 8px;
    color: rgba(255,255,255,0.52); text-decoration: none;
    font-size: 0.84rem; font-weight: 500;
    transition: background 0.15s, color 0.15s, border-left-color 0.15s;
    border-left: 3px solid transparent; margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item:hover {
    background: rgba(244,121,32,0.11);
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    border-left-color: rgba(244,121,32,0.35);
}
.nav-item.active {
    background: rgba(244,121,32,0.18);
    color: #F47920;
    border-left-color: #F47920;
    font-weight: 600;
}
.nav-item.active:hover { background: rgba(244,121,32,0.24); }

.nav-icon { font-size: 0.88rem; flex-shrink: 0; width: 18px; text-align: center; opacity: 0.85; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 0.65rem 0.4rem; }
.nav-logout { color: rgba(255,255,255,0.30) !important; font-size: 0.82rem; margin-top: 0.25rem; }
.nav-logout:hover { color: #f87171 !important; background: rgba(239,68,68,0.12) !important; }
.nav-badge {
    font-size: 0.62rem; font-weight: 700; min-width: 16px; height: 16px;
    padding: 0 0.3rem; border-radius: 99px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; flex-shrink: 0;
}
.nav-badge.red    { background: #dc2626; color: #fff; }
.nav-badge.orange { background: #F47920; color: #fff; }

/* ── WFH request badges ─────────────────────────────────── */
.badge.wfh-pending  { background: #fef9c3; color: #713f12; }
.badge.wfh-approved { background: #dcfce7; color: #14532d; }
.badge.wfh-rejected { background: #fee2e2; color: #7f1d1d; }

/* ── Expense / Accounts badges ──────────────────────────── */
.badge.exp-pending { background: #fef9c3; color: #713f12; }
.badge.exp-paid    { background: #dcfce7; color: #14532d; }
.row-overdue td    { background: #fff5f5 !important; }

/* ── Work report attachment link ────────────────────────── */
.wr-attach-link {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.78rem; padding: 0.2rem 0.55rem;
    background: #ede9fe; color: #5b21b6; border-radius: 5px;
    font-weight: 500; text-decoration: none;
}
.wr-attach-link:hover { background: #ddd6fe; text-decoration: none; }

/* ── Form section dividers ──────────────────────────────── */
.form-section { padding: 1rem 0 0.5rem; border-top: 1px solid #e5e7eb; margin-top: 1.25rem; }
.form-section-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: #6b7280; margin-bottom: 0.85rem;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1.5rem; }
@media (max-width: 640px) {
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════
   PROFESSIONAL PAGE LAYOUT SYSTEM
   ════════════════════════════════════════════════════ */

/* ── Page header bar ─────────────────────────────────── */
.page-hdr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-hdr-left h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #111318;
    letter-spacing: -0.02em;
}

.page-hdr-left p {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: #6B7280;
}

.page-hdr-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Collapsible form panel ──────────────────────────── */
.form-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    margin-bottom: 0;
}

.form-panel.open {
    max-height: 5000px;
    opacity: 1;
    margin-bottom: 1.25rem;
}

.form-panel .card {
    margin-bottom: 0;
    border-left: 4px solid #F47920;
}

.form-panel .card:not(.emp-form-card) h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #F47920;
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #F0F2F7;
    margin-bottom: 1.25rem;
}

.form-panel .emp-form-card h2 {
    color: #111318;
    font-size: 1.15rem;
    font-weight: 800;
    border: 0;
    padding: 0;
    margin: 0;
}

/* ── Data card with header row ───────────────────────── */
.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-top-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111318;
}

.card-top-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F47920;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 99px;
    padding: 0 0.4rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.search-inp {
    padding: 0.44rem 1rem 0.44rem 2.25rem;
    border: 1.5px solid #E4E7EF;
    border-radius: 8px;
    font-size: 0.84rem;
    background: #F8F9FC url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 0.65rem center / 14px no-repeat;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 220px;
    outline: none;
}

.search-inp:focus {
    border-color: #F47920;
    box-shadow: 0 0 0 3px rgba(244,121,32,0.12);
    background-color: #fff;
}

/* ── Alert redesign ──────────────────────────────────── */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}

.alert.success {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    color: #15803d;
}

.alert.error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #b91c1c;
}

/* ── Form field redesign ─────────────────────────────── */
form.stacked label {
    display: block;
    margin-bottom: 0.35rem;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

form.stacked .field {
    margin-bottom: 1rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="month"],
textarea,
select {
    width: 100%;
    max-width: 460px;
    padding: 0.52rem 0.85rem;
    border-radius: 8px;
    border: 1.5px solid #E4E7EF;
    background: #F8F9FC;
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="month"]:focus,
textarea:focus,
select:focus {
    border-color: #F47920;
    box-shadow: 0 0 0 3px rgba(244,121,32,0.12);
    background: #fff;
}

textarea {
    min-height: 90px;
    max-width: 100%;
}

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9CA3AF;
}
.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}
.empty-state p { margin: 0; font-size: 0.875rem; }

/* ── Action cell buttons ─────────────────────────────── */
td.actions, .actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Topbar search update ────────────────────────────── */
.topbar-search input {
    background: #F4F6FA;
    border-color: #E4E7EF;
}
.topbar-search input:focus {
    border-color: #F47920;
    box-shadow: 0 0 0 3px rgba(244,121,32,0.1);
}

/* ── Dashboard web notifications ─────────────────────── */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    margin-left: auto;
}
.notify-wrap {
    position: relative;
}
.notify-bell {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #E4E7EF;
    background: #F4F6FA;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s, border-color .15s;
}
.notify-bell:hover,
.notify-wrap.open .notify-bell {
    background: #FFF8F3;
    border-color: #F47920;
}
.notify-bell-icon { font-size: 1rem; line-height: 1; }
.notify-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 99px;
    background: #DC2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    align-items: center;
    justify-content: center;
    line-height: 18px;
    text-align: center;
}
.notify-badge.show { display: inline-flex; }
.notify-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(360px, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid #E4E7EF;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    z-index: 50;
    overflow: hidden;
}
.notify-panel-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #F0F2F7;
    background: #FAFBFD;
}
.notify-panel-hdr strong {
    font-size: 0.9rem;
    color: #111318;
}
.notify-mark-all {
    border: 0;
    background: transparent;
    color: #F47920;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}
.notify-mark-all:hover { text-decoration: underline; }
.notify-list {
    max-height: 380px;
    overflow-y: auto;
}
.notify-empty {
    padding: 1.75rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}
.notify-item {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #F0F2F7;
    color: inherit;
    text-decoration: none;
    transition: background .12s;
}
.notify-item:hover {
    background: #F8FAFC;
    text-decoration: none;
}
.notify-item.unread {
    background: #FFF8F3;
}
.notify-item-title {
    font-weight: 700;
    font-size: 0.86rem;
    color: #111318;
    margin-bottom: 0.2rem;
}
.notify-item-body {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notify-item-meta {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ── Employee form + list beautification ─────────────── */
.emp-filter-pills {
    display: inline-flex;
    background: #F4F6FA;
    border: 1px solid #E4E7EF;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.emp-pill {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
}
.emp-pill:hover { color: #111318; text-decoration: none; }
.emp-pill.active {
    background: #fff;
    color: #F47920;
    box-shadow: 0 1px 3px rgba(15,23,42,.08);
}
.emp-form-card { border: 1px solid #EEF1F6; }
.emp-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.emp-form-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.35rem;
}
.emp-step {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: #F8FAFC;
    border: 1px solid #E8ECF2;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
}
.emp-step span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #E2E8F0;
    color: #475569;
    font-size: 0.7rem;
}
.emp-step.active {
    background: #FFF8F3;
    border-color: #F7C59B;
    color: #C2410C;
}
.emp-step.active span {
    background: #F47920;
    color: #fff;
}
.emp-form-block {
    background: #FAFBFD;
    border: 1px solid #EEF1F6;
    border-radius: 12px;
    padding: 1rem 1.1rem 0.35rem;
    margin-bottom: 1rem;
}
.emp-form-block .form-section-title {
    color: #F47920;
    margin-bottom: 0.75rem;
}
.emp-form-actions {
    margin-top: 0.5rem;
    padding-top: 0.25rem;
}
.emp-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.emp-status-chip.on { background: #DCFCE7; color: #15803d; }
.emp-status-chip.off { background: #FEE2E2; color: #B91C1C; }

.emp-list-card .card-top { margin-bottom: 0.75rem; }
.emp-list { display: flex; flex-direction: column; gap: 0.75rem; }
.emp-list-main { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.emp-list-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}
.emp-list-avatar.img { object-fit: cover; }
.emp-list-name {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-weight: 800;
    color: #111318;
    font-size: 0.95rem;
}
.emp-list-meta {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.emp-list-meta .dot { color: #CBD5E1; }
.emp-list-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}
.emp-stat {
    background: #F8FAFC;
    border: 1px solid #EEF1F6;
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
}
.emp-stat-lbl {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}
.emp-stat-val {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emp-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}
.emp-mini-btn {
    padding: 0.28rem 0.65rem !important;
    font-size: 0.72rem !important;
}
.emp-view-btn {
    background: #FFF3E8 !important;
    color: #F47920 !important;
    border-color: #F47920 !important;
}
@media (max-width: 980px) {
    .emp-list-actions { justify-content: flex-start; }
    .emp-form-steps { grid-template-columns: 1fr 1fr; }
}

/* ── Shared pagination control (admin list pages) ────── */
.rpt-pager { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding-top: 1rem; margin-top: 0.25rem; border-top: 1px solid #F0F2F7; }
.rpt-pager .btn { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

/* ── Birthday widget ─────────────────────────────────── */
.bday-card {
    margin-bottom: 1.25rem;
    border: 1px solid #FFE4CC;
    background: linear-gradient(180deg, #FFFAF5 0%, #ffffff 55%);
}
.bday-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}
.bday-count {
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #F47920;
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bday-list { display: flex; flex-direction: column; gap: 0.55rem; }
.bday-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #F1F5F9;
}
.bday-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bday-avatar.img { object-fit: cover; }
.bday-info { flex: 1; min-width: 0; }
.bday-name {
    font-weight: 800;
    color: #111318;
    text-decoration: none;
    font-size: 0.92rem;
}
a.bday-name:hover { color: #F47920; text-decoration: none; }
.bday-desig { font-size: 0.78rem; color: #64748b; margin-top: 0.1rem; }
.bday-wish {
    font-size: 0.72rem;
    font-weight: 800;
    color: #C2410C;
    background: #FFF1E6;
    border-radius: 99px;
    padding: 0.28rem 0.65rem;
    white-space: nowrap;
}
.bday-empty {
    padding: 1rem 0.25rem 0.35rem;
    color: #94a3b8;
    font-size: 0.86rem;
}

/* ════════════════════════════════════════════════════
   MOBILE NAVIGATION — off-canvas sidebar
   ════════════════════════════════════════════════════ */

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--heading);
    cursor: pointer;
    padding: 0.3rem 0.55rem;
    margin-right: 0.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}
.nav-toggle:hover { background: #F4F6FA; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 899;
}

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 900;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    body.sidebar-open { overflow: hidden; }

    .main { width: 100%; min-width: 0; }
    .topbar { padding: 0.65rem 1rem; gap: 0.5rem; }
    .topbar-search { display: none; }
    .content { padding: 1rem; }
}

@media (max-width: 560px) {
    .content { padding: 0.85rem; }
    .card { padding: 1.15rem 1rem; }
    .page-hdr-actions { width: 100%; }
    .page-hdr-actions .btn { flex: 1; }
    .user-pill { display: none; }
}

/* ── Lead Info meta grid (project header) ────────────── */
.lead-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin: 0.85rem 0 0;
    padding: 0.75rem 0.9rem;
    background: #F8F9FC;
    border: 1px solid #EEF0F5;
    border-radius: 8px;
}
.lead-meta-item { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.lead-meta-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9CA3AF;
}
.lead-meta-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111318;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Project / Lead history timeline ─────────────────── */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #E4E7EF;
}
.timeline-item {
    position: relative;
    padding-bottom: 1.15rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 0.2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #F47920;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #F4792033;
}
.timeline-item.timeline-create .timeline-dot   { background: #16a34a; box-shadow: 0 0 0 2px #16a34a33; }
.timeline-item.timeline-status .timeline-dot   { background: #2563eb; box-shadow: 0 0 0 2px #2563eb33; }
.timeline-item.timeline-delivery .timeline-dot { background: #7c3aed; box-shadow: 0 0 0 2px #7c3aed33; }
.timeline-desc { font-size: 0.87rem; color: var(--text); font-weight: 500; }
.timeline-meta { font-size: 0.75rem; color: #9CA3AF; margin-top: 0.15rem; }

@media (max-width: 480px) {
    .lead-meta-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ════════════════════════════════════════════════════
   HRMS-STYLE DASHBOARD (admin/index.php, employee/index.php)
   ════════════════════════════════════════════════════ */

.hrms-greet { margin-bottom: 1.25rem; }
.hrms-greet h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #111318;
    letter-spacing: -0.02em;
}
.hrms-greet p { margin: 0.2rem 0 0; font-size: 0.88rem; color: #6B7280; }

/* ── Employee hero: photo card + floating check-in widget ───── */
.hrms-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(120deg, rgba(17,19,24,0.88), rgba(17,19,24,0.55)),
                linear-gradient(135deg, #F47920, #7c3aed);
    color: #fff;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.hrms-hero-left { flex: 1 1 200px; min-width: 180px; }
.hrms-hero-left h2 { margin: 0 0 1rem; font-size: 1.2rem; font-weight: 700; }
.hrms-hero-icons { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.hrms-hero-icon { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; font-size: 0.72rem; opacity: 0.9; }
.hrms-hero-icon-box {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
}
.hrms-hero-card {
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    padding: 1.1rem 1.4rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    min-width: 260px;
    flex: 0 1 300px;
    text-align: center;
}
.hrms-hero-date { font-size: 0.78rem; color: #6B7280; font-weight: 600; }
.hrms-hero-time { font-size: 1.7rem; font-weight: 800; color: #111318; margin: 0.15rem 0; }
.hrms-hero-status { display: flex; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.8rem; color: #16a34a; font-weight: 600; margin-bottom: 0.85rem; }
.hrms-hero-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.hrms-hero-status.out .dot { background: #94a3b8; }
.hrms-hero-status.out { color: #64748b; }
.hrms-hero-hours { font-size: 0.78rem; color: #6B7280; margin-top: 0.85rem; }
.hrms-hero-hours strong { color: #111318; font-size: 0.9rem; }
.hrms-hero-right { flex: 1 1 200px; min-width: 180px; text-align: right; }
.hrms-hero-right h2 { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.hrms-hero-right p { margin: 0.4rem 0 0; font-size: 0.82rem; opacity: 0.85; }

@media (max-width: 860px) {
    .hrms-hero { flex-direction: column; align-items: stretch; text-align: center; }
    .hrms-hero-right { text-align: center; }
    .hrms-hero-icons { justify-content: center; }
}

/* ── Stat row (4 white cards, icon square + number + label) ──── */
.hrms-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.hrms-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}
.hrms-stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.1); text-decoration: none; }
.hrms-stat-icon {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}
.hrms-stat-icon.green  { background: #DCFCE7; }
.hrms-stat-icon.orange { background: #FFEDD5; }
.hrms-stat-icon.blue   { background: #DBEAFE; }
.hrms-stat-icon.purple { background: #EDE9FE; }
.hrms-stat-icon.teal   { background: #CCFBF1; }
.hrms-stat-icon.red    { background: #FEE2E2; }
.hrms-stat-body { flex: 1; min-width: 0; }
.hrms-stat-num { font-size: 1.35rem; font-weight: 800; color: #111318; line-height: 1.15; }
.hrms-stat-lbl { font-size: 0.76rem; color: #6B7280; margin-top: 0.15rem; }

/* ── Quick actions grid ───────────────────────────────────────── */
.hrms-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.85rem;
}
.hrms-quick-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
    padding: 1rem 0.75rem;
    border-radius: 12px;
    background: #FFF3E8;
    color: #111318;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.15s, transform 0.15s;
}
.hrms-quick-item:hover { background: #FFE4CC; transform: translateY(-2px); text-decoration: none; }
.hrms-quick-icon {
    width: 42px; height: 42px; border-radius: 50%;
    background: #F47920; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}

/* ── Analytics row (charts + activity feed) ──────────────────── */
.hrms-analytics-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    margin-bottom: 1.1rem;
    align-items: stretch;
}
.hrms-analytics-row > .card { display: flex; flex-direction: column; margin-bottom: 0; }
@media (min-width: 1100px) {
    .hrms-analytics-row.cols-3 { grid-template-columns: 1.1fr 1fr 1fr; }
}
@media (min-width: 900px) and (max-width: 1099.98px) {
    .hrms-analytics-row.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
    .hrms-analytics-row.cols-2 { grid-template-columns: 1fr 1fr; }
}

.hrms-activity-feed { max-height: 280px; overflow-y: auto; padding-right: 0.25rem; }

/* ── Dept / designation horizontal bar list ──────────────────── */
.hrms-bar-list { display: flex; flex-direction: column; gap: 0.65rem; }
.hrms-bar-row { display: flex; align-items: center; gap: 0.65rem; }
.hrms-bar-name { flex: 0 0 100px; font-size: 0.78rem; color: #374151; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrms-bar-track { flex: 1; background: #F1F5F9; border-radius: 99px; height: 8px; overflow: hidden; }
.hrms-bar-fill { height: 100%; background: linear-gradient(90deg,#F47920,#FBAD4E); border-radius: 99px; }
.hrms-bar-count { flex: 0 0 26px; text-align: right; font-size: 0.78rem; font-weight: 700; color: #111318; }

/* ── Right rail (dashboard shell: main + narrower widget column) ── */
.hrms-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (min-width: 1100px) {
    .hrms-shell { grid-template-columns: minmax(0, 1fr) 300px; }
}
.hrms-rail { display: flex; flex-direction: column; gap: 1.1rem; }
.hrms-rail-card { padding: 1.15rem 1.25rem; margin-bottom: 0; }
.hrms-rail-card h2 { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.hrms-rail-card h2 a { font-size: 0.72rem; font-weight: 600; color: #F47920; }
.hrms-rail-list { display: flex; flex-direction: column; gap: 0.7rem; }
.hrms-rail-item { display: flex; align-items: center; gap: 0.65rem; }
.hrms-rail-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 0.72rem;
}
.hrms-rail-avatar.img { object-fit: cover; }
.hrms-rail-name { font-size: 0.82rem; font-weight: 700; color: #111318; }
.hrms-rail-sub { font-size: 0.72rem; color: #6B7280; margin-top: 0.05rem; }
.hrms-rail-date {
    flex-shrink: 0; text-align: center; background: #FFF3E8; color: #C2410C;
    border-radius: 8px; padding: 0.25rem 0.5rem; font-size: 0.68rem; font-weight: 800;
    line-height: 1.2; min-width: 40px;
}
.hrms-rail-empty { font-size: 0.8rem; color: #9CA3AF; padding: 0.5rem 0; }

/* ── Bottom CTA banner ────────────────────────────────────────── */
.hrms-banner {
    background: linear-gradient(120deg, rgba(17,19,24,0.85), rgba(17,19,24,0.55)),
                linear-gradient(135deg, #334155, #0f172a);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
}
.hrms-banner-text { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.hrms-banner h2 { margin: 0; font-size: 1.25rem; font-weight: 800; border-left: 3px solid #F47920; padding-left: 1rem; }
.hrms-banner p { margin: 0; font-size: 0.85rem; opacity: 0.85; max-width: 320px; }
.hrms-banner .btn { flex-shrink: 0; }

@media (max-width: 640px) {
    .hrms-stat-row, .hrms-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ════════════════════════════════════════════════════
   ADMIN SIDEBAR — light theme
   White background, black text; orange background, white text on hover/active.
   Scoped to body.admin-layout only — the employee portal sidebar is untouched.
   ════════════════════════════════════════════════════ */
body.admin-layout .sidebar {
    background: #ffffff;
    border-right: 1px solid #E5E7EB;
}
body.admin-layout .sidebar::-webkit-scrollbar-thumb { background: rgba(244,121,32,0.35); }

body.admin-layout .nav-section-hdr,
body.admin-layout .nav-section-hdr.crm,
body.admin-layout .nav-section-hdr.projects,
body.admin-layout .nav-section-hdr.workforce,
body.admin-layout .nav-section-hdr.tools {
    color: #111318;
    background: #F8F9FC;
    border-left-color: transparent;
}
body.admin-layout .nav-section-hdr .nph-dot,
body.admin-layout .nav-section-hdr.crm .nph-dot,
body.admin-layout .nav-section-hdr.projects .nph-dot,
body.admin-layout .nav-section-hdr.workforce .nph-dot,
body.admin-layout .nav-section-hdr.tools .nph-dot {
    background: #9CA3AF;
    box-shadow: none;
}
body.admin-layout .nav-section-hdr .nph-chevron { color: #9CA3AF; opacity: 1; }

body.admin-layout .nav-section-hdr:hover,
body.admin-layout .nav-section-hdr.crm:hover,
body.admin-layout .nav-section-hdr.projects:hover,
body.admin-layout .nav-section-hdr.workforce:hover,
body.admin-layout .nav-section-hdr.tools:hover,
body.admin-layout .nav-section.open > .nav-section-hdr {
    background: #F47920;
    color: #ffffff;
    border-left-color: #F47920;
}
body.admin-layout .nav-section-hdr:hover .nph-dot,
body.admin-layout .nav-section.open > .nav-section-hdr .nph-dot {
    background: #ffffff;
    box-shadow: none;
}
body.admin-layout .nav-section-hdr:hover .nph-chevron,
body.admin-layout .nav-section.open > .nav-section-hdr .nph-chevron { color: #ffffff; }

body.admin-layout .nav-item { color: #111318; }
body.admin-layout .nav-item:hover,
body.admin-layout .nav-item.active,
body.admin-layout .nav-item.active:hover,
body.admin-layout .nav-section.sec-crm .nav-item.active,
body.admin-layout .nav-section.sec-projects .nav-item.active,
body.admin-layout .nav-section.sec-workforce .nav-item.active,
body.admin-layout .nav-section.sec-tools .nav-item.active {
    background: #F47920;
    color: #ffffff;
    border-left-color: #F47920;
}

body.admin-layout .nav-section-label { color: #9CA3AF; }
body.admin-layout .nav-divider { background: #E5E7EB; }
body.admin-layout .nav-logout { color: #6B7280 !important; }
body.admin-layout .nav-logout:hover { color: #ffffff !important; background: #dc2626 !important; }
