:root {
    --bg-0: #0a1020;
    --bg-1: #101a33;
    --panel: rgba(19, 30, 56, 0.78);
    --panel-strong: rgba(17, 27, 50, 0.92);
    --border: rgba(139, 169, 255, 0.2);
    --text: #dce7ff;
    --muted: #9fb3df;
    --accent: #68a3ff;
    --accent-2: #80b6ff;
    --success: #43d084;
    --danger: #ff5d73;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 12% 10%, #1a2950 0%, transparent 35%),
        radial-gradient(circle at 86% 12%, #162846 0%, transparent 32%),
        linear-gradient(135deg, var(--bg-0), var(--bg-1));
}

a { color: inherit; }

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20, 33, 63, 0.95), rgba(14, 24, 45, 0.95));
    backdrop-filter: blur(8px);
    padding: 16px 0;
}

.brand {
    font-size: 34px;
    color: #7dc59f;
    font-weight: 700;
    text-align: center;
    margin-bottom: 14px;
    letter-spacing: 5px;
}

.nav-section-title {
    color: #7f95c7;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 10px 16px 6px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.nav-item {
    text-decoration: none;
    color: #c8d8fa;
    padding: 10px 16px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(115, 157, 255, 0.1);
}

.nav-item.active {
    background: rgba(107, 154, 255, 0.2);
    border-left-color: var(--accent);
    color: #f3f7ff;
    font-weight: 700;
}

.main-content {
    flex: 1;
    padding: 24px;
}

.topbar {
    max-width: 1200px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(15, 24, 44, 0.72);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 24px rgba(3, 8, 20, 0.45);
}

.business-banner {
    max-width: 1200px;
    margin: 0 auto 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(15, 24, 44, 0.6);
    box-shadow: 0 10px 24px rgba(3, 8, 20, 0.35);
}

.business-banner-name {
    font-size: 15px;
    font-weight: 700;
    color: #e5efff;
}

.business-banner-address {
    margin-top: 4px;
    font-size: 13px;
    color: #bfd0f7;
    white-space: pre-line;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bcd2ff;
}

.topbar-title {
    font-weight: 700;
    letter-spacing: 0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(129, 163, 242, 0.35);
    background: rgba(35, 54, 96, 0.45);
    color: #cfe0ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
}

.icon-btn:hover {
    background: rgba(82, 126, 224, 0.45);
}

.user-pill {
    border: 1px solid rgba(129, 163, 242, 0.35);
    background: rgba(35, 54, 96, 0.45);
    color: #e6efff;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
}

.container,
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 30px rgba(2, 8, 22, 0.45);
    position: relative;
}

.container::before,
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(160, 188, 255, 0.18);
}

.header,
.card h3 {
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: #e5efff;
    letter-spacing: 0.3px;
}

.body,
.content {
    padding: 18px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 14px;
    color: #bfd0f7;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(135, 165, 236, 0.28);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #edf3ff;
    background: rgba(9, 18, 37, 0.72);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #7f95c7;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(104, 163, 255, 0.18);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.full { grid-column: 1 / -1; }

.actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.btn {
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #061226;
    font-weight: 700;
    padding: 9px 14px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(80, 140, 255, 0.32);
}

.btn.secondary {
    background: rgba(110, 151, 245, 0.2);
    color: #dce9ff;
    border: 1px solid rgba(125, 165, 255, 0.35);
}

.btn.green {
    background: linear-gradient(135deg, #37c976, #58dea2);
    color: #052415;
}

.btn.danger {
    background: linear-gradient(135deg, #f35c72, #ff7d8f);
    color: #2b0210;
}

.alert,
.status {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 14px;
}

.success,
.ok {
    background: rgba(67, 208, 132, 0.16);
    color: #b8ffd6;
    border: 1px solid rgba(76, 231, 146, 0.35);
}

.error,
.bad {
    background: rgba(255, 93, 115, 0.14);
    color: #ffd3da;
    border: 1px solid rgba(255, 117, 137, 0.4);
}

.error ul {
    margin: 6px 0 0 18px;
}

.layout {
    max-width: 1140px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
}

.menu a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #c8d8fa;
    border-left: 3px solid transparent;
}

.menu a.active {
    background: rgba(107, 154, 255, 0.2);
    border-left-color: var(--accent);
    color: #f3f7ff;
    font-weight: 700;
}

.menu a:hover {
    background: rgba(115, 157, 255, 0.1);
}

.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.date-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-input-wrap input[type="date"] {
    flex: 1;
}

.calendar-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    border: 1px solid rgba(135, 165, 236, 0.28);
    border-radius: 10px;
    background: rgba(9, 18, 37, 0.72);
    color: #dce7ff;
    cursor: pointer;
}

.calendar-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(104, 163, 255, 0.18);
}

.table-wrap { overflow: auto; }

.table-wrap::-webkit-scrollbar {
    height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: rgba(116, 151, 236, 0.45);
    border-radius: 999px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    border-bottom: 1px solid rgba(131, 160, 230, 0.2);
    padding: 9px 10px;
    text-align: left;
    white-space: nowrap;
}

th {
    color: #cbe0ff;
    background: rgba(13, 24, 45, 0.75);
}

.empty {
    padding: 20px;
    color: var(--muted);
}

.inline-form { margin: 0; }

.section-title {
    margin: 18px 0 10px;
    color: #dce7ff;
    font-size: 16px;
}

.payroll-entry-table input {
    min-width: 90px;
    padding: 8px 10px;
}

.payroll-summary-grid {
    margin-top: 10px;
}

.payroll-summary-grid input {
    font-weight: 700;
}

.deduction-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.deduct-switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.deduct-toggle-state {
    min-width: 28px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--muted);
}

.deduct-toggle-state::before {
    content: "OFF";
}

.deduct-switch-wrap input[type="checkbox"].deduct-toggle {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: inline-block;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
    min-width: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-strong);
    position: relative;
    cursor: pointer;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.deduct-switch-wrap input[type="checkbox"].deduct-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 0.2s ease, background 0.2s ease;
}

.deduct-switch-wrap input[type="checkbox"].deduct-toggle:checked {
    border-color: var(--accent);
    background: rgba(104, 163, 255, 0.24);
}

.deduct-switch-wrap input[type="checkbox"].deduct-toggle:checked + .deduct-toggle-state {
    color: var(--accent-2);
}

.deduct-switch-wrap input[type="checkbox"].deduct-toggle:checked + .deduct-toggle-state::before {
    content: "ON";
}

.deduct-switch-wrap input[type="checkbox"].deduct-toggle:checked::after {
    transform: translateX(20px);
    background: var(--accent-2);
}

.deduct-switch-wrap input[type="checkbox"].deduct-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(104, 163, 255, 0.18);
}

@media (max-width: 1100px) {
    .app-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .layout { grid-template-columns: 1fr; }
    .topbar { max-width: 100%; }
}

@media (max-width: 780px) {
    .grid { grid-template-columns: 1fr; }
    .actions { flex-direction: column; align-items: stretch; }
}
