/* JDOC Holiday Rota — site styles */

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 0;
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar-brand img {
    border-radius: 4px;
}

/* ── Shift table ─────────────────────────────────────────────────────────────── */
.shift-table th {
    white-space: nowrap;
    font-weight: 600;
}

.shift-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.shift-amount {
    font-variant-numeric: tabular-nums;
}

/* ── Shift table — tablet layout (576px – 991px) ────────────────────────────── */
/*  Each row becomes a named-area grid:                                          */
/*    date | dayname  / amount   | actions                                       */
/*    date | shiftname / assigned | actions                                      */
@media (min-width: 576px) and (max-width: 991.98px) {
    .shift-table-wrapper { overflow-x: visible; }

    .shift-table,
    .shift-table tbody { display: block; }

    .shift-table thead { display: none; }

    .shift-table tr {
        display: grid;
        grid-template-areas:
            "date dayname  amount   actions"
            "date shiftname assigned actions";
        grid-template-columns: max-content 1fr auto auto;
        column-gap: 0.75rem;
        row-gap: 0.1rem;
        padding: 0.4rem 0.25rem;
        border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    }

    .shift-table td {
        border: none;
        padding: 0;
        white-space: normal;
    }

    .shift-table td:nth-child(1) { /* Date */
        grid-area: date;
        align-self: center;
        white-space: nowrap;
        font-size: 0.875rem;
    }

    .shift-table td:nth-child(2) { /* Day name */
        grid-area: dayname;
        font-size: 0.8rem;
        color: var(--bs-secondary-color, #6c757d);
        align-self: end;
    }

    .shift-table td:nth-child(3) { /* Shift name */
        grid-area: shiftname;
        font-weight: 500;
        align-self: start;
    }

    .shift-table td:nth-child(4) { /* Amount */
        grid-area: amount;
        text-align: right;
        align-self: end;
    }

    .shift-table td:nth-child(5) { /* Assigned to */
        grid-area: assigned;
        font-size: 0.875rem;
        text-align: right;
        align-self: start;
    }

    .shift-table td:nth-child(6) { /* Actions */
        grid-area: actions;
        align-self: center;
    }
}

/* ── Shift table — mobile card layout (<576px) ──────────────────────────────── */
/*  Each row becomes a rounded card; cells display as label : value lines.      */
@media (max-width: 575.98px) {
    .shift-table-wrapper { overflow-x: visible; }

    .shift-table,
    .shift-table tbody { display: block; }

    .shift-table thead { display: none; }

    .shift-table tr {
        display: block;
        border: 1px solid var(--bs-border-color, #dee2e6);
        border-radius: 0.375rem;
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.6rem;
        background-color: #fff;
    }

    .shift-table td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 0.15rem 0;
        border: none;
        white-space: normal;
        font-size: 0.875rem;
    }

    /* Label shown before each cell's value */
    .shift-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        flex-shrink: 0;
        margin-right: 0.75rem;
    }

    /* Actions cell: no label; separator line above; buttons right-aligned */
    .shift-table td[data-cell="actions"] {
        justify-content: flex-end;
        padding-top: 0.4rem;
        margin-top: 0.25rem;
        border-top: 1px solid var(--bs-border-color, #dee2e6);
    }

    .shift-table td[data-cell="actions"]::before { content: ""; }

    .shift-table .btn {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Row highlight when updated by SignalR */
@keyframes rowHighlight {
    0%   { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

.row-updated {
    animation: rowHighlight 1.5s ease-out;
}

/* ── Toggle buttons ──────────────────────────────────────────────────────────── */
.filter-toggles .btn {
    min-width: 130px;
}

/* ── Auth forms ──────────────────────────────────────────────────────────────── */
.auth-card {
    max-width: 440px;
    margin: 0 auto;
}

/* ── Admin tables ────────────────────────────────────────────────────────────── */
.admin-table td {
    vertical-align: middle;
}

/* ── Transfer confirmation pages ─────────────────────────────────────────────── */
.transfer-confirmation {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

/* ── Responsive action button wrapping ───────────────────────────────────────── */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ── Focus styles ────────────────────────────────────────────────────────────── */
.btn:focus, .btn:active:focus,
.form-control:focus, .form-check-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.4);
}
