:root {
    --navy: #1d2c57;
    --navy-2: #142141;
    --orange: #f4511e;
    --orange-dark: #d94315;
    --ink: #182033;
    --muted: #6b7280;
    --line: #e6e8ef;
    --surface: #ffffff;
    --canvas: #f4f6fa;
    --success: #15803d;
    --success-bg: #ecfdf3;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --warning: #b54708;
    --warning-bg: #fffaeb;
    --info: #0e7490;
    --info-bg: #ecfeff;
    --shadow: 0 10px 30px rgba(20, 33, 65, .08);
    --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--orange); }
img { max-width: 100%; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 256px;
    color: #fff;
    background: linear-gradient(180deg, var(--navy-2), var(--navy));
    z-index: 40;
    display: flex;
    flex-direction: column;
    box-shadow: 12px 0 30px rgba(20, 33, 65, .08);
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 86px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.11);
}
.sidebar-brand img {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
    border-radius: 11px;
    padding: 5px;
}
.sidebar-brand strong { display: block; font-size: 18px; letter-spacing: .4px; }
.sidebar-brand span { display: block; opacity: .72; font-size: 11px; }
.sidebar-nav { padding: 16px 12px; overflow-y: auto; flex: 1; }
.sidebar-label {
    margin: 14px 12px 8px;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    margin: 3px 0;
    color: rgba(255,255,255,.8);
    border-radius: 10px;
    font-weight: 600;
    transition: .18s ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, var(--orange), #ff7445); box-shadow: 0 8px 20px rgba(244,81,30,.28); }
.nav-icon {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(255,255,255,.1);
    font-size: 11px;
    font-weight: 900;
}
.nav-link.active .nav-icon { background: rgba(255,255,255,.2); }
.sidebar-footer { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.11); color: rgba(255,255,255,.6); font-size: 11px; }

.main-area { min-height: 100vh; margin-left: 256px; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 72px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; font-size: 20px; color: var(--navy); }
.topbar-subtitle { color: var(--muted); font-size: 12px; }
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--navy), var(--orange));
    font-weight: 800;
}
.user-meta strong { display: block; font-size: 13px; }
.user-meta span { display: block; font-size: 11px; color: var(--muted); }
.content { padding: 28px 30px 44px; max-width: 1640px; margin: 0 auto; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.page-heading h2 { margin: 0 0 4px; font-size: 24px; color: var(--navy); }
.page-heading p { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.card-header h3 { margin: 0; color: var(--navy); font-size: 16px; }
.card-body { padding: 20px; }
.card-footer { padding: 15px 20px; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.stat-card { position: relative; overflow: hidden; padding: 20px; min-height: 132px; }
.stat-card::after {
    content: "";
    position: absolute;
    width: 105px;
    height: 105px;
    right: -28px;
    bottom: -35px;
    border-radius: 50%;
    background: rgba(29,44,87,.05);
}
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .45px; }
.stat-value { margin-top: 8px; color: var(--navy); font-size: 27px; font-weight: 800; line-height: 1.1; }
.stat-note { margin-top: 9px; color: var(--muted); font-size: 12px; }
.stat-accent { width: 42px; height: 4px; border-radius: 99px; background: var(--orange); margin-bottom: 14px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 39px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    transition: .16s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.btn-primary:hover { color: #fff; background: var(--navy-2); }
.btn-accent { color: #fff; background: var(--orange); border-color: var(--orange); }
.btn-accent:hover { color: #fff; background: var(--orange-dark); }
.btn-light { color: var(--navy); background: #fff; border-color: var(--line); }
.btn-light:hover { color: var(--navy); background: #f8fafc; border-color: #ccd2df; }
.btn-success { color: #fff; background: var(--success); border-color: var(--success); }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-warning { color: #fff; background: var(--warning); border-color: var(--warning); }
.btn-sm { min-height: 32px; padding: 6px 10px; border-radius: 7px; font-size: 12px; }
.btn-icon { width: 38px; padding: 0; }
.inline-form { display: inline; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 6px; color: #344054; font-weight: 700; font-size: 12px; }
.required::after { content: " *"; color: var(--danger); }
.form-control, .form-select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #d5d9e2;
    border-radius: 9px;
    outline: none;
    transition: border .15s, box-shadow .15s;
}
textarea.form-control { min-height: 96px; resize: vertical; }
.form-control:focus, .form-select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244,81,30,.12); }
.form-control[readonly] { background: #f8fafc; color: var(--muted); }
.form-help { margin-top: 5px; color: var(--muted); font-size: 11px; }
.form-error { margin-top: 5px; color: var(--danger); font-size: 11px; }
.input-group { display: flex; }
.input-group > * { border-radius: 0; }
.input-group > *:first-child { border-radius: 9px 0 0 9px; }
.input-group > *:last-child { border-radius: 0 9px 9px 0; }
.input-addon { display: grid; place-items: center; padding: 0 12px; background: #f8fafc; border: 1px solid #d5d9e2; color: var(--muted); font-weight: 700; }
.checkbox-line { display: flex; align-items: center; gap: 8px; }
.checkbox-line input { width: 17px; height: 17px; accent-color: var(--orange); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 20px; }

.filter-bar { display: grid; grid-template-columns: 2fr repeat(3, minmax(140px, 1fr)) auto; gap: 10px; align-items: end; }
.filter-bar.compact { grid-template-columns: 2fr repeat(2, minmax(140px, 1fr)) auto; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #475467; background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .45px; white-space: nowrap; }
tbody tr:hover { background: #fcfcfd; }
tbody tr:last-child td { border-bottom: 0; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.fw-bold { font-weight: 800; }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.badge-primary { color: var(--navy); background: #edf1fb; }
.badge-success { color: var(--success); background: var(--success-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: #475467; background: #f2f4f7; }

.alert { position: relative; padding: 13px 42px 13px 15px; margin-bottom: 14px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; }
.alert-success { color: var(--success); background: var(--success-bg); border-color: #abefc6; }
.alert-danger { color: var(--danger); background: var(--danger-bg); border-color: #fecdca; }
.alert-warning { color: var(--warning); background: var(--warning-bg); border-color: #fedf89; }
.alert-info { color: var(--info); background: var(--info-bg); border-color: #a5f3fc; }
.alert-close { position: absolute; right: 10px; top: 8px; border: 0; background: transparent; cursor: pointer; font-size: 18px; color: inherit; }

.empty-state { padding: 48px 22px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--navy); font-size: 16px; }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 18px; background: #eef2f8; color: var(--navy); font-weight: 900; }

.detail-list { display: grid; gap: 0; }
.detail-row { display: grid; grid-template-columns: 165px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-weight: 700; }
.detail-row dd { margin: 0; font-weight: 600; }

.invoice-summary { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
.invoice-paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.invoice-paper-header { padding: 24px; display: flex; justify-content: space-between; gap: 25px; border-bottom: 4px solid var(--orange); }
.invoice-logo { max-width: 270px; }
.invoice-title { text-align: right; }
.invoice-title h2 { margin: 0; color: var(--navy); font-size: 32px; letter-spacing: 1px; }
.invoice-paper-body { padding: 24px; }
.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 22px; }
.bill-box h4 { margin: 0 0 7px; color: var(--orange); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.bill-box p { margin: 2px 0; }
.totals-table { width: 360px; margin: 20px 0 0 auto; }
.totals-table td { padding: 7px 10px; border-bottom: 0; }
.totals-table tr.total td { padding-top: 12px; border-top: 2px solid var(--navy); color: var(--navy); font-size: 16px; font-weight: 900; }
.totals-table tr.balance td { color: var(--danger); font-size: 15px; font-weight: 900; }
.note-box { padding: 14px; margin-top: 18px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.note-box h4 { margin: 0 0 6px; color: var(--navy); font-size: 12px; }
.note-box p { margin: 0; white-space: pre-line; }

.chart-bars { display: grid; gap: 12px; }
.chart-row { display: grid; grid-template-columns: 82px 1fr 110px; align-items: center; gap: 12px; }
.chart-track { height: 10px; background: #edf0f5; border-radius: 99px; overflow: hidden; }
.chart-fill { height: 100%; min-width: 2px; background: linear-gradient(90deg, var(--navy), var(--orange)); border-radius: 99px; }

.pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; margin-top: 18px; }
.pagination a { min-width: 34px; height: 34px; padding: 0 9px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); font-weight: 700; }
.pagination a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.invoice-items-table input, .invoice-items-table select, .invoice-items-table textarea { min-width: 76px; }
.invoice-items-table .description-cell { min-width: 280px; }
.invoice-items-table textarea { min-height: 62px; }
.invoice-items-table .line-total { font-weight: 800; color: var(--navy); white-space: nowrap; }
.invoice-calculation { max-width: 480px; margin-left: auto; display: grid; gap: 9px; }
.calc-row { display: grid; grid-template-columns: 1fr 190px; align-items: center; gap: 12px; }
.calc-row.output { padding: 9px 0; border-top: 1px solid var(--line); }
.calc-row.grand { color: var(--navy); font-size: 17px; font-weight: 900; border-top: 2px solid var(--navy); }
.calc-control { display: grid; grid-template-columns: 95px 1fr; }
.calc-control select { border-radius: 9px 0 0 9px; }
.calc-control input { border-radius: 0 9px 9px 0; }

.tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-weight: 700; }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(380px, 46%) 1fr;
    background: #fff;
}
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 430px; }
.login-logo { width: 285px; margin-bottom: 28px; }
.login-card h1 { margin: 0 0 7px; color: var(--navy); font-size: 29px; }
.login-card > p { margin: 0 0 26px; color: var(--muted); }
.login-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 64px;
    color: #fff;
    background: linear-gradient(145deg, rgba(20,33,65,.96), rgba(29,44,87,.91)), url('../letterhead/OVALFOX-Letterhead.jpg') center/cover;
}
.login-visual::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 15%, rgba(244,81,30,.32), transparent 34%); }
.login-copy { position: relative; max-width: 600px; }
.login-copy h2 { margin: 0 0 12px; font-size: clamp(34px, 5vw, 62px); line-height: 1.05; }
.login-copy p { margin: 0; color: rgba(255,255,255,.78); font-size: 17px; }

.install-page { min-height: 100vh; padding: 36px 18px; background: linear-gradient(145deg, #f5f7fb, #fff); }
.install-card { max-width: 940px; margin: 0 auto; }
.install-head { text-align: center; margin-bottom: 24px; }
.install-head img { width: 300px; }
.install-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.install-step { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; }
.install-step span { width: 28px; height: 28px; margin: 0 auto 6px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 35; }

@media (max-width: 1200px) {
    .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar .filter-actions { grid-column: 1 / -1; }
    .invoice-summary { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .overlay { display: block; }
    .main-area { margin-left: 0; }
    .menu-toggle { display: grid; place-items: center; }
    .topbar { padding: 0 18px; }
    .content { padding: 22px 18px 38px; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .grid-3, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .page-heading { flex-direction: column; }
    .page-actions { justify-content: flex-start; }
    .grid-2, .grid-3, .grid-4, .grid-5, .form-grid, .form-grid-3, .filter-bar, .filter-bar.compact, .bill-grid { grid-template-columns: 1fr; }
    .user-meta { display: none; }
    .content { padding-left: 12px; padding-right: 12px; }
    .topbar { padding: 0 12px; }
    .card-body { padding: 16px; }
    .detail-row { grid-template-columns: 1fr; gap: 2px; }
    .invoice-paper-header { flex-direction: column; }
    .invoice-title { text-align: left; }
    .totals-table { width: 100%; }
    .calc-row { grid-template-columns: 1fr; }
    .form-actions { justify-content: stretch; flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .login-panel { padding: 30px 20px; }
    .login-logo { width: 240px; }
    .install-steps { grid-template-columns: 1fr; }
}

@media print {
    .sidebar, .topbar, .page-heading, .no-print, .overlay { display: none !important; }
    .main-area { margin: 0; }
    .content { padding: 0; max-width: none; }
    .card, .invoice-paper { box-shadow: none; border: 0; }
    body { background: #fff; }
}

/* OVALFOX HR / Attendance / Payroll v2 */
.attendance-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn-attendance { min-width: 170px; min-height: 52px; font-size: 15px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 0 14px; }
.calendar-toolbar h2 { margin: 0; color: var(--navy); font-size: 21px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); }
.cal-head { padding: 10px 8px; text-align: center; color: #fff; background: var(--navy); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .45px; }
.cal-cell { min-height: 132px; padding: 9px; background: #fff; position: relative; overflow: hidden; }
.cal-empty { background: #f8fafc; }
.cal-holiday { background: #fffaf7; }
.cal-today { box-shadow: inset 0 0 0 2px var(--orange); }
.cal-date { min-height: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; color: var(--navy); font-size: 12px; }
.cal-date > strong { display: grid; place-items: center; min-width: 25px; height: 25px; border-radius: 7px; background: #f2f4f7; }
.cal-date span { color: var(--orange-dark); font-size: 9px; font-weight: 800; text-align: right; line-height: 1.15; }
.cal-events { display: grid; gap: 5px; }
.cal-event { display: grid; gap: 1px; margin-top: 5px; padding: 6px 7px; border-left: 3px solid #98a2b3; border-radius: 7px; color: #344054; background: #f2f4f7; font-size: 10px; line-height: 1.25; overflow: hidden; }
a.cal-event:hover { color: inherit; transform: translateY(-1px); }
.cal-event strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event small { opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-present { color: #166534; border-left-color: #16a34a; background: #ecfdf3; }
.cal-late, .cal-half_day { color: #92400e; border-left-color: #f59e0b; background: #fffaeb; }
.cal-absent, .cal-unpaid_leave { color: #991b1b; border-left-color: #ef4444; background: #fef3f2; }
.cal-leave, .cal-paid_leave { color: #0e7490; border-left-color: #06b6d4; background: #ecfeff; }
.cal-holiday, .cal-off_day { color: #475467; border-left-color: #98a2b3; background: #f2f4f7; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 14px 2px 22px; color: var(--muted); font-size: 11px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; background: #98a2b3; }
.cal-dot.cal-present { background: #16a34a; }
.cal-dot.cal-late, .cal-dot.cal-half_day { background: #f59e0b; }
.cal-dot.cal-absent, .cal-dot.cal-unpaid_leave { background: #ef4444; }
.cal-dot.cal-leave, .cal-dot.cal-paid_leave { background: #06b6d4; }
.cal-dot.cal-holiday, .cal-dot.cal-off_day { background: #98a2b3; }
.salary-preview { max-width: 560px; margin: 22px 0 0 auto; border-top: 1px solid var(--line); }
.salary-preview > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 2px; }
.salary-preview span { color: var(--muted); font-weight: 700; }
.salary-preview strong { color: var(--navy); font-size: 16px; }
.salary-preview .salary-net { border-top: 2px solid var(--navy); }
.salary-preview .salary-net span, .salary-preview .salary-net strong { color: var(--navy); font-size: 19px; font-weight: 900; }
.employee-photo { width: 86px; height: 86px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); background: #f8fafc; }
.location-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--muted); }
.location-status-inside { color: var(--success); font-weight: 800; }
.location-status-outside { color: var(--danger); font-weight: 800; }

@media (max-width: 900px) {
    .calendar-grid { min-width: 760px; }
    .calendar-grid { border-radius: 10px; }
    .calendar-toolbar { position: sticky; left: 0; }
    section.calendar-grid { overflow: visible; }
}
@media (max-width: 640px) {
    .attendance-actions { flex-direction: column; align-items: stretch; }
    .attendance-actions form, .btn-attendance { width: 100%; }
    .calendar-toolbar h2 { font-size: 16px; }
    .calendar-toolbar .btn { padding-left: 9px; padding-right: 9px; }
}

/* v2.1.5 notifications */
.notification-menu { position: relative; }
.notification-menu > summary { list-style: none; }
.notification-menu > summary::-webkit-details-marker { display: none; }
.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    cursor: pointer;
    user-select: none;
}
.notification-bell:hover { background: #f8fafc; border-color: #ccd2df; }
.notification-bell-symbol { font-size: 18px; line-height: 1; }
.notification-count {
    position: absolute;
    right: -5px;
    top: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
}
.notification-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(390px, 88vw);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 18px 48px rgba(20,33,65,.18);
    overflow: hidden;
    z-index: 100;
}
.notification-dropdown-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 16px; border-bottom:1px solid var(--line); }
.notification-dropdown-head strong { color: var(--navy); }
.notification-dropdown-head a { font-size:12px; font-weight:800; }
.notification-mini { display:grid; grid-template-columns:12px 1fr; gap:10px; padding:12px 15px; border-bottom:1px solid var(--line); color:var(--ink); }
.notification-mini:last-child { border-bottom:0; }
.notification-mini.unread { background:#f6f8ff; }
.notification-mini strong, .notification-mini small, .notification-mini em { display:block; }
.notification-mini strong { font-size:12px; color:var(--navy); margin-bottom:2px; }
.notification-mini small { color:#4b5565; font-size:11px; line-height:1.35; }
.notification-mini em { margin-top:4px; color:var(--muted); font-size:10px; font-style:normal; }
.notification-dot { width:9px; height:9px; margin-top:5px; border-radius:50%; background:#64748b; }
.notification-info { background:var(--info); }
.notification-success { background:var(--success); }
.notification-warning { background:var(--warning); }
.notification-danger { background:var(--danger); }
.notification-empty { padding:22px 16px; text-align:center; color:var(--muted); font-size:12px; }
.notification-list-page { padding: 4px 0; }
.notification-row { display:grid; grid-template-columns:14px 1fr auto; gap:13px; align-items:start; padding:16px 20px; border-bottom:1px solid var(--line); color:var(--ink); }
.notification-row:last-child { border-bottom:0; }
.notification-row.unread { background:#f6f8ff; }
.notification-row-body strong, .notification-row-body span, .notification-row-body small { display:block; }
.notification-row-body strong { color:var(--navy); margin-bottom:3px; }
.notification-row-body span { color:#475467; }
.notification-row-body small { color:var(--muted); margin-top:5px; }
@media(max-width:760px){
    .notification-dropdown { position: fixed; top: 66px; right: 10px; left: 10px; width:auto; }
    .user-meta { display:none; }
}

/* OVALFOX internal chat v2.2.0 - WhatsApp-inspired business UI */
.chat-header-link {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--navy);
    line-height: 1;
}
.chat-header-link svg { width: 19px; height: 19px; display: block; fill: currentColor; }
.chat-header-link:hover { color: var(--orange); background: #fff8f5; border-color: #f3c1ae; }
.chat-header-count {
    position: absolute;
    right: -5px;
    top: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
}
.chat-page-heading { margin-bottom: 12px; }
.chat-page-unread {
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}
.chat-page-unread.has-unread { border-color: #f6c4b2; background: #fff6f2; color: #b93613; }
.chat-shell {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    height: calc(100vh - 150px);
    min-height: 620px;
    max-height: 900px;
    overflow: hidden;
    border: 1px solid #dfe3ea;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(23, 36, 71, .10);
}
.chat-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e8ee;
    background: #fff;
    overflow: hidden;
}
.chat-sidebar-head {
    min-height: 68px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #eceef2;
    background: #f8f9fb;
}
.chat-sidebar-brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.chat-sidebar-brand > span:last-child { min-width: 0; }
.chat-sidebar-brand strong { display: block; color: var(--navy); font-size: 13px; line-height: 1.2; }
.chat-sidebar-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.chat-sidebar-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
}
.chat-sidebar-mark svg { width: 19px; height: 19px; fill: currentColor; }
.chat-sidebar-unread {
    min-width: 23px;
    height: 23px;
    padding: 0 7px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
}
.chat-sidebar-search { padding: 10px 12px; border-bottom: 1px solid #eceef2; background: #fff; }
.chat-search-form, .chat-message-search { position: relative; display: flex; align-items: center; }
.chat-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: #8a93a3;
    pointer-events: none;
    z-index: 2;
}
.chat-search-icon svg { width: 16px; height: 16px; display: block; fill: currentColor; }
.chat-search-form .form-control,
.chat-message-search .form-control {
    min-height: 38px;
    padding: 8px 34px 8px 34px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #f0f2f5;
    box-shadow: none;
    font-size: 11px;
}
.chat-search-form .form-control:focus,
.chat-message-search .form-control:focus { border-color: #d7dce5; background: #fff; }
.chat-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 23px;
    height: 23px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #7e8796;
    font-size: 17px;
    line-height: 1;
}
.chat-search-clear:hover { background: #e6e8ec; color: var(--navy); }
.chat-sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.chat-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 7px;
    color: #7b8494;
    text-transform: uppercase;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .75px;
}
.chat-section-title small { color: var(--orange); font-size: 8px; }
.chat-people-title { margin-top: 4px; border-top: 1px solid #f0f1f4; }
.chat-conversation-list, .chat-contact-list { min-width: 0; }
.chat-conversation-item,
.chat-contact-item {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 64px;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid #f0f1f4;
    background: transparent;
    color: var(--ink);
    text-align: left;
}
.chat-contact-item { grid-template-columns: 44px minmax(0, 1fr); min-height: 60px; cursor: pointer; font: inherit; }
.chat-conversation-item:hover,
.chat-contact-item:hover { background: #f7f8fa; color: var(--ink); }
.chat-conversation-item.active { background: #eef1f5; box-shadow: inset 3px 0 0 var(--orange); }
.chat-avatar-wrap { position: relative; width: 42px; height: 42px; display: block; flex: 0 0 42px; }
.chat-avatar {
    width: 42px;
    height: 42px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    background: #e8ecf4;
    border: 1px solid #dfe3ea;
}
.chat-avatar.large { width: 44px; height: 44px; }
.chat-thread-avatar-wrap { width: 44px; height: 44px; flex-basis: 44px; }
.chat-avatar-status {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #48a868;
}
.chat-conversation-copy { min-width: 0; }
.chat-conversation-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-conversation-copy strong,
.chat-contact-item strong {
    display: block;
    min-width: 0;
    color: #17213a;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-conversation-name b {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 8px;
}
.chat-conversation-copy small,
.chat-contact-item small {
    display: block;
    margin-top: 3px;
    color: #7e8795;
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-conversation-tail { align-self: start; padding-top: 4px; }
.chat-conversation-tail time { color: #98a0ad; font-size: 8px; }
.chat-contact-form { margin: 0; }
.chat-sidebar-empty { padding: 22px 16px; color: var(--muted); text-align: center; font-size: 10px; }
.chat-sidebar-empty strong, .chat-sidebar-empty span { display: block; }
.chat-sidebar-empty strong { margin-bottom: 4px; color: var(--navy); font-size: 11px; }
.chat-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #efeae2; }
.chat-welcome { margin: auto; max-width: 520px; padding: 40px 28px; text-align: center; color: #6d7687; }
.chat-welcome-icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 19px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 10px 30px rgba(29, 44, 87, .18);
}
.chat-welcome-icon svg { width: 38px; height: 38px; fill: currentColor; }
.chat-welcome h3 { margin: 0 0 8px; color: var(--navy); font-size: 20px; }
.chat-welcome p { margin: 0 auto; max-width: 440px; font-size: 11px; line-height: 1.7; }
.chat-welcome-security { margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; color: #697384; font-size: 9px; }
.chat-welcome-security span { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: #e6f4ea; color: #2f7d4b; font-weight: 900; }
.chat-thread-header {
    min-height: 68px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #dde0e5;
    background: #f8f9fb;
}
.chat-thread-person { min-width: 0; display: flex; align-items: center; gap: 10px; }
.chat-thread-person-copy { min-width: 0; }
.chat-thread-person strong { display: block; color: #17213a; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-thread-person span { display: block; margin-top: 2px; color: #7b8492; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-mobile-back {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: none;
    place-items: center;
    border-radius: 50%;
    color: var(--navy);
}
.chat-mobile-back:hover { background: #e8ebf0; color: var(--navy); }
.chat-mobile-back svg { width: 20px; height: 20px; fill: currentColor; }
.chat-thread-tools { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.chat-message-search { width: 250px; }
.chat-connection-status { display: inline-flex; align-items: center; gap: 5px; color: #72808e; font-size: 8px; white-space: nowrap; }
.chat-connection-status i { width: 7px; height: 7px; border-radius: 50%; background: #48a868; }
.chat-connection-status.is-offline i { background: #d98b31; }
.chat-connection-status.is-offline span { color: #9a6426; }
.chat-search-notice { padding: 8px 16px; border-bottom: 1px solid #e4e6e9; background: #fff7e5; color: #7c5517; font-size: 10px; }
.chat-message-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 6.5% 16px;
    background-color: #efeae2;
    background-image:
        radial-gradient(circle at 20px 20px, rgba(29,44,87,.035) 1.2px, transparent 1.3px),
        radial-gradient(circle at 60px 60px, rgba(244,81,30,.025) 1.2px, transparent 1.3px);
    background-size: 80px 80px;
}
.chat-date-separator { margin: 8px 0 14px; display: flex; justify-content: center; }
.chat-date-separator span {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 1px 3px rgba(23,36,71,.08);
    color: #697383;
    font-size: 8px;
    font-weight: 800;
}
.chat-no-messages { margin: 80px auto; max-width: 320px; text-align: center; color: #6e7785; }
.chat-no-messages span,
.chat-no-messages strong,
.chat-no-messages small { display: block; }
.chat-no-messages-icon { margin-bottom: 8px; font-size: 28px; line-height: 1; }
.chat-no-messages strong { color: var(--navy); font-size: 12px; }
.chat-no-messages small { margin-top: 4px; font-size: 9px; }
.chat-message {
    position: relative;
    width: fit-content;
    max-width: min(72%, 680px);
    margin: 0 0 6px;
    padding: 7px 9px 5px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 1px 1px rgba(23,36,71,.10);
}
.chat-message.theirs { border-top-left-radius: 3px; }
.chat-message.mine { margin-left: auto; border-top-right-radius: 3px; background: #fff0e9; }
.chat-message.deleted { opacity: .78; }
.chat-message-sender { margin-bottom: 3px; color: var(--navy); font-size: 8px; font-weight: 900; }
.chat-message-text { color: #252f3f; font-size: 12px; line-height: 1.48; overflow-wrap: anywhere; }
.chat-message-deleted { color: #7a8390; font-style: italic; }
.chat-reply-quote {
    margin-bottom: 6px;
    padding: 6px 8px;
    border-left: 3px solid var(--orange);
    border-radius: 5px;
    background: rgba(29,44,87,.055);
}
.chat-message.mine .chat-reply-quote { background: rgba(255,255,255,.58); }
.chat-reply-quote strong,
.chat-reply-quote span { display: block; }
.chat-reply-quote strong { color: var(--navy); font-size: 8px; }
.chat-reply-quote span { margin-top: 1px; color: #687284; font-size: 9px; }
.chat-attachments { display: grid; gap: 6px; margin-top: 7px; }
.chat-file-attachment,
.chat-image-attachment {
    min-width: 0;
    max-width: 100%;
    border: 1px solid rgba(29,44,87,.10);
    border-radius: 7px;
    background: rgba(255,255,255,.76);
    color: var(--ink);
    overflow: hidden;
}
.chat-file-attachment { min-width: 230px; display: flex; align-items: center; gap: 9px; padding: 7px; }
.chat-file-attachment:hover,
.chat-image-attachment:hover { color: var(--ink); border-color: rgba(244,81,30,.35); }
.chat-file-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--navy);
    color: #fff;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .3px;
}
.chat-image-attachment { display: block; width: min(250px, 100%); }
.chat-image-frame {
    width: 100%;
    height: 0;
    padding-bottom: 66%;
    position: relative;
    display: block;
    overflow: hidden;
    background: #eef0f4;
}
.chat-image-frame img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover;
    display: block;
    border-radius: 0;
}
.chat-attachment-info { min-width: 0; display: block; }
.chat-image-attachment .chat-attachment-info { padding: 6px 8px 7px; }
.chat-file-attachment strong,
.chat-image-attachment strong {
    display: block;
    max-width: 230px;
    color: #22304b;
    font-size: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-file-attachment small,
.chat-image-attachment small { display: block; margin-top: 2px; color: #7d8795; font-size: 8px; }
.chat-message-footer { min-height: 17px; margin-top: 3px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.chat-message-actions { margin-right: auto; display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity .15s ease; }
.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions { opacity: 1; }
.chat-action-link { padding: 0; border: 0; background: transparent; color: #7a8390; cursor: pointer; font: inherit; font-size: 8px; font-weight: 700; }
.chat-action-link:hover { color: var(--orange); }
.chat-action-link.danger:hover { color: var(--danger); }
.chat-message-time { color: #8b93a0; font-size: 7px; white-space: nowrap; }
.chat-read-status { color: #7c8692; font-size: 9px; font-weight: 900; letter-spacing: -2px; white-space: nowrap; }
.chat-read-status.is-read { color: #2b7fcc; }
.chat-composer-wrap { border-top: 1px solid #dfe2e7; background: #f0f2f5; }
.chat-reply-preview { min-height: 50px; padding: 7px 12px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #e0e3e8; background: #fff; }
.chat-reply-preview[hidden] { display: none; }
.chat-reply-accent { width: 3px; align-self: stretch; border-radius: 3px; background: var(--orange); }
.chat-reply-copy { min-width: 0; flex: 1; }
.chat-reply-preview strong,
.chat-reply-preview small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview strong { color: var(--navy); font-size: 9px; }
.chat-reply-preview small { margin-top: 2px; color: #7b8492; font-size: 9px; }
.chat-reply-preview button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #7b8492; font-size: 18px; cursor: pointer; }
.chat-reply-preview button:hover { background: #f0f2f5; color: var(--navy); }
.chat-send-error { padding: 7px 14px; border-bottom: 1px solid #f0c5c0; background: #fff0ee; color: #a43225; font-size: 9px; }
.chat-send-error[hidden] { display: none; }
.chat-composer { padding: 9px 11px 5px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 44px; align-items: end; gap: 8px; }
.chat-attach-button {
    width: 42px;
    height: 42px;
    margin: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #687384;
    background: transparent;
    cursor: pointer;
}
.chat-attach-button:hover { background: #e4e7eb; color: var(--navy); }
.chat-attach-button svg { width: 21px; height: 21px; display: block; fill: currentColor; }
.chat-attach-button input { display: none; }
.chat-composer-center { min-width: 0; }
.chat-input-pill { min-height: 42px; display: flex; align-items: center; border-radius: 22px; background: #fff; border: 1px solid #e3e6ea; }
.chat-input-pill textarea {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 15px;
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    color: #263247;
    font: inherit;
    font-size: 12px;
    line-height: 20px;
}
.chat-input-pill textarea::placeholder { color: #9aa2ae; }
.chat-file-selection { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chat-file-chip {
    max-width: 220px;
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #dfe2e7;
    border-radius: 999px;
    background: #fff;
    color: #5d6675;
    font-size: 8px;
}
.chat-file-chip b { max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.chat-file-chip button { width: 16px; height: 16px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: #edf0f3; color: #7a8390; cursor: pointer; font-size: 11px; }
.chat-send-button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(244,81,30,.24);
}
.chat-send-button:hover { background: #dc4317; }
.chat-send-button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.chat-send-button svg { width: 19px; height: 19px; display: block; fill: currentColor; transform: translateX(1px); }
.chat-send-button.is-sending svg { animation: chatSendPulse .8s ease-in-out infinite alternate; }
@keyframes chatSendPulse { from { opacity: .45; transform: translateX(1px) scale(.92); } to { opacity: 1; transform: translateX(1px) scale(1); } }
.chat-composer-help { padding: 0 14px 8px 61px; color: #8a929e; font-size: 7px; }

@media (max-width: 1100px) {
    .chat-shell { grid-template-columns: 310px minmax(0, 1fr); }
    .chat-message-list { padding-left: 4%; padding-right: 4%; }
    .chat-message { max-width: 80%; }
    .chat-message-search { width: 210px; }
}

@media (max-width: 760px) {
    .chat-page-heading { display: none; }
    .chat-shell {
        grid-template-columns: 1fr;
        height: calc(100dvh - 78px);
        min-height: 520px;
        max-height: none;
        border-radius: 12px;
    }
    .chat-shell.has-thread .chat-sidebar { display: none; }
    .chat-shell.no-thread .chat-main { display: none; }
    .chat-sidebar { border-right: 0; }
    .chat-sidebar-head { min-height: 62px; }
    .chat-sidebar-scroll { overflow-y: auto; }
    .chat-main { min-height: 0; }
    .chat-thread-header { min-height: 62px; padding: 8px 9px; }
    .chat-mobile-back { display: grid; }
    .chat-thread-avatar-wrap { width: 40px; height: 40px; flex-basis: 40px; }
    .chat-avatar.large { width: 40px; height: 40px; }
    .chat-thread-tools { gap: 5px; }
    .chat-message-search { display: none; }
    .chat-connection-status span { display: none; }
    .chat-message-list { padding: 12px 9px 10px; }
    .chat-message { max-width: 88%; }
    .chat-message-text { font-size: 12px; }
    .chat-message-actions { opacity: 1; }
    .chat-image-attachment { width: min(220px, 100%); }
    .chat-composer { grid-template-columns: 38px minmax(0,1fr) 42px; gap: 5px; padding-left: 7px; padding-right: 7px; }
    .chat-attach-button { width: 38px; height: 42px; }
    .chat-send-button { width: 42px; height: 42px; }
    .chat-composer-help { display: none; }
}

@media (max-width: 430px) {
    .chat-shell { border-radius: 0; border-left: 0; border-right: 0; }
    .chat-conversation-item, .chat-contact-item { padding-left: 10px; padding-right: 10px; }
    .chat-message { max-width: 91%; }
    .chat-file-attachment { min-width: 210px; }
    .chat-thread-person-copy span { max-width: 180px; }
}
.sidebar-unread-badge { margin-left:auto; min-width:20px; height:20px; padding:0 6px; display:grid; place-items:center; border-radius:999px; background:var(--orange); color:#fff; font-size:9px; font-weight:900; }
.nav-link.active .sidebar-unread-badge { background:#fff; color:var(--orange); }

/* v2.2.1 chat/header hardening - cache-proof professional layout */
.topbar-utility-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    position: relative;
}
.topbar-icon-button,
.chat-header-link,
.notification-bell {
    box-sizing: border-box;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    position: relative;
    border: 1px solid #dfe3ea;
    border-radius: 11px;
    background: #fff;
    color: var(--navy);
    line-height: 1;
    vertical-align: middle;
    overflow: visible;
}
.topbar-icon-button:hover,
.chat-header-link:hover,
.notification-bell:hover {
    background: #fff7f3;
    border-color: #f1c2b1;
    color: var(--orange);
}
.topbar-icon-svg,
.chat-header-link > svg,
.notification-bell > svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    fill: currentColor !important;
    flex: 0 0 20px !important;
}
.topbar-icon-count,
.chat-header-count,
.notification-count {
    position: absolute !important;
    right: -6px !important;
    top: -7px !important;
    min-width: 19px !important;
    width: auto !important;
    height: 19px !important;
    max-height: 19px !important;
    padding: 0 5px !important;
    display: grid !important;
    place-items: center !important;
    border: 2px solid #fff !important;
    border-radius: 999px !important;
    background: var(--orange) !important;
    color: #fff !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    z-index: 4;
}
.notification-menu { margin: 0; flex: 0 0 40px; }
.notification-menu[open] > .notification-bell { color: var(--orange); border-color: #f1c2b1; background: #fff7f3; }
.notification-bell-symbol { display: none !important; }

/* Keep every icon inside the chat module physically bounded even if another stylesheet has generic svg rules. */
.chat-shell svg,
.chat-sidebar svg,
.chat-main svg,
.chat-composer svg {
    max-width: 24px !important;
    max-height: 24px !important;
}
.chat-welcome-icon {
    width: 86px !important;
    height: 86px !important;
    min-width: 86px !important;
    min-height: 86px !important;
    max-width: 86px !important;
    max-height: 86px !important;
    margin: 0 auto 20px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 24px !important;
    background: linear-gradient(145deg, #ffffff, #f4f6fa) !important;
    border: 1px solid #dfe4ec !important;
    box-shadow: 0 12px 34px rgba(29,44,87,.12) !important;
    overflow: hidden !important;
}
.chat-welcome-icon img {
    display: block !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
    object-fit: contain !important;
}
.chat-shell {
    grid-template-columns: 340px minmax(0,1fr);
    height: calc(100vh - 154px);
    min-height: 570px;
    max-height: 860px;
    border-radius: 14px;
    border-color: #dce1e8;
    box-shadow: 0 10px 30px rgba(23,36,71,.09);
}
.chat-sidebar-head { background: #f7f8fa; }
.chat-main { background: #efeae2; }
.chat-conversation-item.active { background: #f2f4f7; box-shadow: inset 3px 0 0 var(--orange); }
.chat-message-list {
    background-color: #f2eee8;
    background-image:
        radial-gradient(circle at 18px 18px, rgba(29,44,87,.028) 1px, transparent 1.1px),
        radial-gradient(circle at 54px 54px, rgba(244,81,30,.022) 1px, transparent 1.1px);
    background-size: 72px 72px;
}
.chat-message { box-shadow: 0 1px 2px rgba(28,38,57,.10); }
.chat-message.mine { background: #fff1ea; }
.chat-thread-header { background: #f8f9fa; }
.chat-composer-wrap { background: #eef1f4; }

@media (max-width: 1180px) {
    .user-menu { gap: 7px; }
    .topbar-utility-actions { gap: 6px; }
}
@media (max-width: 900px) {
    .topbar .user-menu .btn.btn-light.btn-sm:first-child { display: none; }
    .chat-shell { height: calc(100vh - 96px); min-height: 520px; }
}
@media (max-width: 760px) {
    .topbar-utility-actions { gap: 5px; }
    .topbar-icon-button,
    .chat-header-link,
    .notification-bell { width: 38px !important; height: 38px !important; min-width: 38px !important; max-width: 38px !important; min-height: 38px !important; max-height: 38px !important; }
    .chat-shell { height: calc(100dvh - 72px); min-height: 0; border-radius: 0; }
}
