html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    margin: 0;
    color: #212529;
}

/* ---- Sidebar layout (app-shell = sidebar + content-area, side by side on
   desktop; sidebar becomes an off-canvas drawer under 900px wide, toggled by
   a hidden checkbox - no JS required) ---- */

.sidebar-toggle-check {
    display: none;
}

.app-shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: #1b3a57;
    color: #cfe3f5;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    flex: 1;
}

.sidebar-section-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #7fa3c2;
    padding: 0.9rem 1.25rem 0.3rem;
}

.sidebar-nav a {
    color: #cfe3f5;
    text-decoration: none;
    padding: 0.55rem 1.25rem;
    font-size: 0.94rem;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-nav a.active {
    background-color: rgba(255, 255, 255, 0.12);
    color: white;
    border-left-color: #4fb0ff;
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem 1.25rem 1.25rem;
    font-size: 0.9rem;
}

.sidebar-user {
    color: #cfe3f5;
    margin-bottom: 0.5rem;
}

.sidebar-footer a,
.sidebar-footer .link-button {
    color: #cfe3f5;
    display: block;
    margin-top: 0.4rem;
    text-decoration: none;
    font-size: 0.92rem;
}

.sidebar-footer a:hover,
.sidebar-footer .link-button:hover {
    color: white;
    text-decoration: underline;
}

.sidebar-backdrop {
    display: none;
}

.content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 1.25rem;
    background: white;
    border-bottom: 1px solid #dce3ea;
}

.sidebar-toggle-btn {
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: #1b3a57;
}

.topbar-title {
    font-weight: 600;
    color: #1b3a57;
}

/* Login/Create Account (signed out) or the signed-in user's name + Log Out
   (signed in) - always right-aligned in the topbar, visible at every screen
   width so it's never tucked away, unlike the sidebar which can scroll. */
.topbar-auth {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.92rem;
    white-space: nowrap;
}

.topbar-auth a,
.topbar-auth .link-button {
    color: #0078d4;
    text-decoration: none;
    font-weight: 600;
}

.topbar-auth a:hover,
.topbar-auth .link-button:hover {
    text-decoration: underline;
}

.topbar-user {
    color: #5a6b7a;
}

@media (max-width: 899px) {
    .sidebar-toggle-check:checked ~ .app-shell .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle-check:checked ~ .app-shell .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 90;
    }
}

@media (min-width: 900px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        transform: none;
    }

    /* The topbar itself stays visible at every width (it's what carries the
       login/account menu) - only the hamburger toggle is unnecessary once the
       sidebar is permanently on-screen. */
    .sidebar-toggle-btn {
        display: none;
    }
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

h1 {
    color: #1b3a57;
    font-size: 1.8rem;
}

.btn-primary {
    background-color: #0078d4;
    color: white;
    border: none;
    padding: 0.6rem 1.4rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.btn-primary:hover:not(:disabled) {
    background-color: #005a9e;
}

.btn-primary:disabled {
    background-color: #99c5e8;
    cursor: not-allowed;
}

.status-message {
    margin-top: 1rem;
    color: #444;
    font-style: italic;
}

.status-error {
    color: #b3261e;
    font-style: normal;
    font-weight: 600;
}

.result-card {
    margin-top: 1.5rem;
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.result-card p {
    margin: 0.35rem 0;
}

#address-label {
    font-weight: 600;
    color: #0078d4;
}

.site-footer {
    margin-top: 3rem;
    padding: 1.25rem 0;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    border-top: 1px solid #dce3ea;
}

.text-danger {
    color: #b3261e;
}

/* ---- Attendance / Clock In-Out feature ---- */

.info-note {
    background-color: #eaf3fb;
    border: 1px solid #bcdcf4;
    border-left: 4px solid #0078d4;
    border-radius: 4px;
    padding: 0.85rem 1rem;
    margin: 1rem 0;
    font-size: 0.92rem;
    color: #1b3a57;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #1b3a57;
}

.form-control {
    width: 100%;
    max-width: 420px;
    padding: 0.55rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #c7d0d9;
    border-radius: 6px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

.field-error {
    display: block;
    color: #b3261e;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.validation-summary {
    color: #b3261e;
    margin-bottom: 1rem;
}

.validation-summary ul {
    margin: 0;
    padding-left: 1.2rem;
}

.button-row {
    display: flex;
    gap: 0.85rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.btn-clock-in {
    background-color: #1a8f4c;
}

.btn-clock-in:hover:not(:disabled) {
    background-color: #147a3f;
}

.btn-clock-out {
    background-color: #c9302c;
}

.btn-clock-out:hover:not(:disabled) {
    background-color: #a8241f;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

.badge-in {
    background-color: #1a8f4c;
}

.badge-out {
    background-color: #c9302c;
}

.detail-list {
    margin-top: 1rem;
}

.detail-list dt {
    font-weight: 600;
    color: #1b3a57;
    margin-top: 0.85rem;
}

.detail-list dd {
    margin: 0.2rem 0 0 0;
}

.muted {
    color: #6c757d;
    font-size: 0.88rem;
}

/* ---- Account (Register / Login / Logout) ---- */

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: #cfe3f5;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}

.link-button:hover {
    color: white;
    text-decoration: underline;
}

.status-banner {
    background-color: #eafaf1;
    border: 1px solid #a9dfbf;
    border-left: 4px solid #1a8f4c;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    color: #1b3a57;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group-inline {
    flex: 1 1 180px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.05rem;
    height: 1.05rem;
}

.form-check-label {
    margin-bottom: 0;
    font-weight: 400;
}

/* ---- Wide pages (Dashboard, Holiday, Employees) ---- */

.container-wide {
    max-width: 1100px;
}

.table-scroll {
    overflow-x: auto;
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e6ebf0;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background-color: #eef3f8;
    color: #1b3a57;
    font-weight: 600;
}

.data-table tbody tr:hover {
    background-color: #f7fafc;
}

.data-table td.numeric,
.data-table th.numeric {
    text-align: right;
}

.data-table td.total,
.data-table th.total {
    font-weight: 700;
}

/* ---- Week navigator (Dashboard) ---- */

.week-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.week-nav a {
    color: #0078d4;
    text-decoration: none;
    font-weight: 600;
}

.week-nav a:hover {
    text-decoration: underline;
}

.week-nav .week-label {
    font-weight: 600;
    color: #1b3a57;
}

.week-nav .badge-current {
    background-color: #eaf3fb;
    color: #0078d4;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---- Status badges (Holiday requests) ---- */

.badge-pending {
    background-color: #b7791f;
}

.badge-approved {
    background-color: #1a8f4c;
}

.badge-rejected {
    background-color: #c9302c;
}

.badge-cancelled {
    background-color: #6c757d;
}

/* ---- Holiday balance summary cards ---- */

.stat-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    padding: 0.9rem 1.25rem;
    min-width: 140px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1b3a57;
}

.stat-card .stat-label {
    font-size: 0.82rem;
    color: #6c757d;
    margin-top: 0.15rem;
}

.stat-card.stat-remaining .stat-value {
    color: #0078d4;
}

/* ---- Inline row actions (approve/reject, cancel) ---- */

.row-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 5px;
}

.btn-approve {
    background-color: #1a8f4c;
}

.btn-approve:hover:not(:disabled) {
    background-color: #147a3f;
}

.btn-reject {
    background-color: #c9302c;
}

.btn-reject:hover:not(:disabled) {
    background-color: #a8241f;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #565e64;
}

.section-heading {
    margin-top: 2rem;
    color: #1b3a57;
    font-size: 1.25rem;
}

.role-pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background-color: #eef3f8;
    color: #1b3a57;
}

.empty-state {
    color: #6c757d;
    font-style: italic;
    padding: 1rem 0;
}

/* ---- Settings hub ---- */

.breadcrumb {
    margin-bottom: 0.5rem;
}

.breadcrumb a {
    color: #0078d4;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.settings-card {
    display: block;
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    padding: 1.25rem 1.4rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.settings-card:hover {
    border-color: #0078d4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.settings-card-title {
    font-weight: 700;
    color: #1b3a57;
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.settings-card-desc {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
}
