:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #eef2f6;
    --border: #d9e1ea;
    --text: #18212f;
    --muted: #647287;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #0f766e;
    --danger: #dc2626;
    --success: #14804a;
    --warning: #a16207;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    background: #172033;
    color: #e5e7eb;
    padding: 22px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-weight: 700;
    font-size: 18px;
}

.brand-mark {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 400;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #d1d5db;
}

.nav-label {
    font-weight: 700;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
}

.nav-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav a.active,
.nav a:hover {
    background: #243047;
    color: #fff;
}

.nav a.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon {
    color: #fff;
    background: rgba(15, 118, 110, 0.35);
}

.main {
    min-width: 0;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.content {
    padding: 24px;
}

.branch-switcher {
    display: grid;
    grid-template-columns: auto minmax(220px, 320px);
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
}

.branch-switcher label {
    grid-row: auto;
}

.branch-switcher select {
    min-height: 40px;
    border-color: #bfdbfe;
    background: #eff6ff;
    font-weight: 700;
}

.branch-note {
    grid-column: 2;
    color: var(--muted);
    font-size: 12px;
}

.page-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-title h1 {
    margin: 0;
    font-size: 24px;
}

.page-title p {
    margin: 4px 0 0;
    color: var(--muted);
}

.toolbar,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}

.field {
    display: grid;
    gap: 6px;
    min-width: 180px;
}

.field.compact {
    min-width: 130px;
}

label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
}

input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 14px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

button.secondary,
.button.secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

button.secondary:hover,
.button.secondary:hover {
    background: var(--surface-muted);
}

button.danger {
    background: var(--danger);
}

button.success-button,
.success-button {
    background: #15803d;
    color: #fff;
}

button.success-button:hover,
.success-button:hover {
    background: #166534;
}

button.ghost {
    background: transparent;
    color: #d1d5db;
    border-color: #374151;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #f8fafc;
}

.muted {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
}

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.employee-flags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.notice {
    display: none;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
}

.notice.show {
    display: block;
}

.notice.error {
    border-color: #fecaca;
    color: #991b1b;
    background: #fef2f2;
}

.notice.success {
    border-color: #bbf7d0;
    color: #166534;
    background: #f0fdf4;
}

.modal {
    border: 0;
    border-radius: 8px;
    width: min(560px, calc(100vw - 32px));
    padding: 0;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.3);
}

.modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.modal-header,
.modal-body,
.modal-footer {
    padding: 16px;
}

.modal-header {
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.segmented-control label {
    position: relative;
    display: inline-flex;
    text-transform: none;
}

.segmented-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-control span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
}

.segmented-control input:checked + span {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.rate-employee-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rate-employee-cell .employee-flags {
    margin-top: 0;
}

.locked-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    font-weight: 700;
}

#ratesTable tr.row-fired td {
    background: #fff1f2;
}

#usersTable tr.row-fired td {
    background: #f8fafc;
    color: #64748b;
}

#ratesTable tr.row-working-off td {
    background: #fffbeb;
}

#ratesTable tr.row-no-rate td {
    box-shadow: inset 0 -2px 0 #fecaca;
}

.day-alert {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.day-alert-warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.day-alert-danger {
    border-color: #fecaca;
    background: #fff1f2;
}

.day-alert-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.day-alert-title svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.day-alert-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.day-alert-list span {
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.72);
    font-weight: 700;
    font-size: 12px;
}

.attendance-chat-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
    gap: 16px;
    align-items: start;
}

.attendance-chat-panel {
    display: grid;
    gap: 12px;
}

.chat-bubble {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.chat-bubble strong {
    font-size: 14px;
}

.chat-bubble span {
    color: var(--muted);
}

.attendance-chat-panel textarea {
    width: 100%;
    min-height: 230px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    line-height: 1.55;
}

.attendance-chat-panel textarea:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 0;
    border-color: #2563eb;
}

.chat-preview-panel h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.chat-preview {
    display: grid;
    gap: 12px;
}

.chat-summary,
.chat-time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
}

.chat-summary div,
.chat-time-grid div {
    min-height: 68px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.chat-summary span,
.chat-time-grid span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.chat-summary strong,
.chat-time-grid strong {
    display: block;
    font-size: 15px;
}

.chat-summary small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.chat-change-list {
    display: grid;
    gap: 8px;
}

.chat-change-row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(64px, auto) 24px minmax(64px, auto);
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.chat-change-row span {
    color: #1e3a8a;
    font-weight: 800;
}

.chat-change-row b {
    color: var(--muted);
    text-align: center;
}

.day-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.day-stat {
    padding: 16px;
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
}

.day-stat span {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    opacity: 0.92;
}

.day-stat strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.day-stat-primary {
    background: #2563eb;
}

.day-stat-danger {
    background: #dc2626;
}

.day-stat-success {
    background: #15803d;
}

.day-stat-muted {
    background: #475569;
}

.day-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 16px;
}

.day-grid h2,
.current-table-panel h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.vertical-chart {
    display: grid;
    grid-template-columns: repeat(30, minmax(28px, 1fr));
    align-items: end;
    gap: 6px;
    min-height: 230px;
    overflow-x: auto;
    padding: 8px 2px 2px;
}

.vertical-chart-item {
    position: relative;
    display: grid;
    grid-template-rows: 22px 150px 20px;
    align-items: end;
    justify-items: center;
    gap: 4px;
    min-width: 28px;
    font-size: 10px;
}

.vertical-chart-item > strong {
    color: #0f172a;
    font-size: 11px;
}

.vertical-chart-bar {
    display: flex;
    align-items: end;
    width: 18px;
    height: 150px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.vertical-chart-bar i {
    display: block;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.vertical-chart-item em {
    position: absolute;
    top: 18px;
    right: -2px;
    min-width: 16px;
    min-height: 16px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-style: normal;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.top-hours-list {
    display: grid;
    gap: 10px;
}

.top-hours-list div {
    display: grid;
    grid-template-columns: 28px minmax(120px, 1fr) minmax(80px, 0.8fr) 58px;
    align-items: center;
    gap: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border);
}

.top-hours-list .rank {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 800;
}

.top-hours-list small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.top-hours-list i {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.top-hours-list i b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #15803d;
}

.current-day-table tr.row-late td {
    background: #fef3c7;
}

.current-day-table tr.row-working-off td {
    background: #fff1f2;
}

.access-modal {
    width: min(920px, calc(100vw - 32px));
}

.access-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.access-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.access-grid h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.access-list {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.advanced-settings {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.advanced-settings summary {
    cursor: pointer;
    font-weight: 800;
}

.advanced-settings .grid {
    margin-top: 12px;
}

.advanced-check {
    align-self: end;
    min-height: 38px;
}

.log-table td {
    vertical-align: top;
}

.log-details {
    margin-top: 6px;
}

.log-details summary {
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
}

.log-details pre {
    max-width: 520px;
    max-height: 240px;
    margin: 8px 0 0;
    padding: 10px;
    overflow: auto;
    border-radius: 8px;
    background: #0f172a;
    color: #e5e7eb;
    font-size: 12px;
    white-space: pre-wrap;
}

.pagination-wrap {
    margin-top: 14px;
}

.compact-ui {
    font-size: 13px;
}

.compact-ui .content {
    padding: 16px;
}

.compact-ui th,
.compact-ui td {
    padding: 7px 8px;
}

.compact-ui .toolbar,
.compact-ui .panel {
    padding: 12px;
    margin-bottom: 12px;
}

.hide-help-text .page-title p,
.hide-help-text .branch-note {
    display: none;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.stat strong {
    display: block;
    font-size: 22px;
}

.time-pair {
    display: grid;
    grid-template-columns: 60px 60px;
    gap: 4px;
    justify-content: center;
}

.time-pair input,
.order-input {
    min-width: 60px;
    min-height: 30px;
    padding: 4px;
    border-radius: 6px;
    font-size: 12px;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    display: none;
}

input[type="time"] {
    appearance: textfield;
}

.changed {
    border-color: var(--warning);
    background: #fefce8;
}

.saved {
    border-color: var(--success);
}

.excel-wrap {
    max-height: none;
    border-color: #cbd5e1;
}

.excel-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    font-size: 12px;
}

.excel-table th,
.excel-table td {
    padding: 5px 6px;
    border-right: 1px solid var(--border);
    background: #fff;
    text-align: center;
    vertical-align: middle;
}

.excel-table th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #eaf1f8;
    font-size: 11px;
    vertical-align: middle;
}

.excel-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.excel-table tbody tr:hover td {
    background: #eef6ff;
}

.excel-table tr.row-fired td {
    background: #fff1f2;
}

.excel-table tr.row-working-off td {
    background: #fffbeb;
}

.excel-table tr.row-no-rate td {
    box-shadow: inset 0 -2px 0 #fecaca;
}

.excel-table td.missing-departure {
    background: #fee2e2;
    box-shadow: inset 0 0 0 2px #ef4444;
}

.excel-table td.missing-departure input {
    border-color: #ef4444;
}

.date-label {
    display: block;
    font-weight: 800;
}

.excel-table th small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.excel-table .sticky-col {
    position: sticky;
    z-index: 3;
    background: #fff;
}

.excel-table th.sticky-col {
    z-index: 8;
    background: #eaf1f8;
}

.excel-table .code-col {
    left: 0;
    min-width: 64px;
    max-width: 64px;
}

.excel-table .name-col {
    left: 64px;
    min-width: 174px;
    max-width: 174px;
    white-space: normal;
    overflow: hidden;
    box-shadow: 1px 0 0 var(--border);
    text-align: left;
}

.excel-table td.position-col {
    text-align: center;
}

.excel-table .position-col {
    min-width: 106px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excel-table td.name-col strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excel-table tbody tr:nth-child(even) td.sticky-col {
    background: #fbfdff;
}

.excel-table tbody tr:hover td.sticky-col {
    background: #eef6ff;
}

.excel-table td.missing-departure.sticky-col,
.excel-table tr.row-fired td.sticky-col {
    background: #fff1f2;
}

.excel-table tr.row-working-off td.sticky-col {
    background: #fffbeb;
}

.excel-table input:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 0;
    border-color: #2563eb;
    background: #eff6ff;
}

.salary-page .page-title {
    align-items: center;
    margin-bottom: 14px;
}

.salary-page .page-title h1 {
    font-size: 26px;
    font-weight: 500;
}

.salary-filter-card,
.salary-table-card {
    background: var(--surface);
    border: 1px solid #cfd6de;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    margin-bottom: 16px;
}

.filter-title,
.salary-table-title {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #d8dee6;
    font-size: 17px;
}

.filter-title::before {
    content: "▽";
    transform: rotate(-45deg);
    display: inline-block;
    color: #111827;
}

.salary-filters {
    display: grid;
    grid-template-columns: minmax(150px, 250px) minmax(150px, 250px) minmax(220px, 1fr) minmax(260px, 380px) minmax(180px, 250px);
    gap: 16px 24px;
    align-items: start;
    padding: 18px 16px 16px;
}

.salary-filters .field {
    min-width: 0;
}

.salary-search input {
    min-width: 220px;
}

.positions-field {
    align-self: stretch;
}

.position-checklist {
    height: 120px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    padding: 6px 8px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
}

.check-row input {
    flex: 0 0 auto;
}

.salary-filter-actions {
    display: grid;
    gap: 8px;
    align-self: end;
}

.salary-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.salary-stat {
    min-height: 100px;
    border-radius: 6px;
    padding: 16px 18px;
    color: #fff;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.22);
}

.salary-stat span {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
}

.salary-stat strong {
    display: block;
    font-size: 26px;
    font-weight: 500;
}

.salary-stat-total {
    background: #7160c8;
}

.salary-stat-employees {
    background: #1677f2;
}

.salary-stat-hours {
    background: #168a55;
}

.salary-stat-orders {
    background: #f5b80b;
}

.salary-alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-color: #fecaca;
    background: #fff7f7;
    color: #991b1b;
}

.salary-table-title {
    font-size: 18px;
}

.salary-table-title::before {
    content: "▦";
    color: #111827;
}

.salary-table-meta {
    padding: 3px 8px;
    border-radius: 5px;
    background: #6b7280;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.salary-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
}

.salary-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 11px;
    line-height: 1.22;
}

.salary-table th,
.salary-table td {
    padding: 6px 8px;
    border-right: 1px solid #d8dee6;
    border-bottom: 1px solid #d8dee6;
    white-space: nowrap;
    vertical-align: middle;
}

.salary-table th {
    position: static;
    background: #f8fafc;
    color: #111827;
    font-size: 11px;
    font-weight: 800;
    text-transform: none;
    text-align: center;
}

.salary-table th.weekend-col {
    background: #fff1c9;
}

.salary-table th small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
}

.salary-table tbody tr:hover td {
    background: #eef6ff;
}

.salary-table tr.row-fired td {
    background: #fff1f2;
}

.salary-table tr.row-working-off td {
    background: #fff8db;
}

.salary-table tr.row-no-rate td {
    box-shadow: inset 0 -2px 0 #ef4444;
}

.salary-employee-cell {
    min-width: 190px;
    white-space: normal;
}

.salary-employee-cell strong {
    display: inline-block;
    margin-right: 6px;
    font-size: 12px;
}

.salary-code {
    color: var(--muted);
    font-size: 10px;
}

.salary-rate-cell {
    min-width: 150px;
    font-size: 10px;
}

.salary-day-cell {
    min-width: 86px;
    text-align: center;
}

.salary-day-cell.empty {
    color: #94a3b8;
    background: #f8fafc;
}

.salary-day-cell.worked {
    background: #eaf8ef;
}

.salary-day-cell.weekend-col {
    background: #fff8dc;
}

.salary-day-cell.open-today {
    background: #e0f2fe;
    box-shadow: inset 0 0 0 1px #38bdf8;
}

.salary-day-cell.missing-close {
    background: #fee2e2;
    box-shadow: inset 0 0 0 2px #ef4444;
}

.salary-day-cell span,
.salary-day-cell small {
    display: block;
    color: #64748b;
    font-size: 10px;
}

.salary-day-cell strong {
    display: block;
    font-size: 11px;
    color: #0f172a;
}

.salary-day-cell .cell-note {
    margin-top: 2px;
    font-size: 9px;
    font-weight: 800;
}

.salary-day-cell .cell-note.danger {
    color: #991b1b;
}

.salary-day-cell .cell-note.info {
    color: #0369a1;
}

.salary-total-cell {
    min-width: 110px;
    text-align: center;
    font-size: 14px;
}

.salary-total-cell strong {
    display: inline-block;
    min-width: 88px;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid currentColor;
}

.status-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.status-icon-fired,
.status-icon-no-rate {
    color: #b91c1c;
    background: #fee2e2;
}

.status-icon-working-off {
    color: #92400e;
    background: #fef3c7;
}

.mini-flag {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.mini-danger {
    background: #fee2e2;
    color: #991b1b;
}

.mini-warning {
    background: #fef3c7;
    color: #92400e;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.auth-card h1 {
    margin: 0 0 16px;
    font-size: 24px;
}

.error-list {
    margin: 0 0 16px;
    padding-left: 18px;
    color: #991b1b;
}

@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .nav {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .topbar {
        height: auto;
        padding: 14px;
        align-items: flex-start;
        flex-direction: column;
    }

    .branch-switcher {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .branch-switcher label,
    .branch-note {
        grid-column: auto;
    }

    .content {
        padding: 16px;
    }

    .salary-filters,
    .salary-summary,
    .day-stats,
    .day-grid,
    .attendance-chat-grid,
    .access-grid {
        grid-template-columns: 1fr;
    }

    .chat-summary,
    .chat-time-grid {
        grid-template-columns: 1fr;
    }
}
