/* ==========================================================================
   Hire Solution - Shift & Roster module
   Shared design system for the admin hub and the employee hub.
   ========================================================================== */

.sh-page {
    --sh-brand: #1967d2;
    --sh-brand-soft: #e8f1ff;
    --sh-ink: #0f172a;
    --sh-muted: #64748b;
    --sh-line: rgba(15, 23, 42, .09);
    --sh-soft: #f7f9fd;
    --sh-radius: 16px;
    padding: 1.75rem 0 3rem;
    color: var(--sh-ink);
}

    .sh-page *,
    .sh-page *::before,
    .sh-page *::after {
        box-sizing: border-box;
    }

/* ------------------------------------------------------------------ header */
.sh-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.sh-title {
    margin: 0 0 .25rem;
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

.sh-sub {
    margin: 0;
    color: var(--sh-muted);
    font-size: .93rem;
}

.sh-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.sh-stat {
    min-width: 6.5rem;
    padding: .65rem .9rem;
    border: 1px solid var(--sh-line);
    border-radius: 12px;
    background: #fff;
}

    .sh-stat span {
        display: block;
        font-size: .72rem;
        color: var(--sh-muted);
        text-transform: uppercase;
        letter-spacing: .08em;
        font-weight: 700;
    }

    .sh-stat strong {
        font-size: 1.15rem;
        font-weight: 800;
    }

/* -------------------------------------------------------------------- tabs */
.sh-tabs {
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    padding: .35rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--sh-line);
    border-radius: 14px;
    background: #fff;
    scrollbar-width: none;
}

    .sh-tabs::-webkit-scrollbar {
        display: none;
    }

.sh-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem .95rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

    .sh-tab:hover {
        background: var(--sh-soft);
        color: var(--sh-brand);
    }

    .sh-tab.is-active {
        background: var(--sh-brand);
        color: #fff;
    }

    .sh-tab .badge {
        background: rgba(255, 255, 255, .28);
        color: inherit;
        font-size: .68rem;
        border-radius: 999px;
        padding: .05rem .4rem;
    }

/* ------------------------------------------------------------------- cards */
.sh-card {
    border: 1px solid var(--sh-line);
    border-radius: var(--sh-radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.sh-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--sh-line);
}

    .sh-card-head h3 {
        margin: 0;
        font-size: 1rem;
        font-weight: 800;
    }

    .sh-card-head p {
        margin: .15rem 0 0;
        font-size: .82rem;
        color: var(--sh-muted);
    }

.sh-card-body {
    padding: 1.15rem;
}

.sh-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 2.5rem 1.25rem;
    border: 1px dashed rgba(15, 23, 42, .15);
    border-radius: 14px;
    background: var(--sh-soft);
    text-align: center;
    color: var(--sh-muted);
}

    .sh-empty i {
        font-size: 1.9rem;
        color: #9db4d8;
    }

    .sh-empty strong {
        color: var(--sh-ink);
    }

/* ----------------------------------------------------------------- buttons */
.sh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .55rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--sh-brand);
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}

    .sh-btn:hover {
        background: #14539f;
        color: #fff;
        transform: translateY(-1px);
    }

    .sh-btn:disabled {
        opacity: .6;
        cursor: not-allowed;
        transform: none;
    }

.sh-btn-ghost {
    background: #fff;
    border-color: rgba(25, 103, 210, .3);
    color: var(--sh-brand);
}

    .sh-btn-ghost:hover {
        background: var(--sh-brand-soft);
        color: var(--sh-brand);
    }

.sh-btn-sm {
    padding: .35rem .75rem;
    font-size: .8rem;
}

.sh-btn-danger {
    background: #fff;
    border-color: #fecaca;
    color: #b42318;
}

    .sh-btn-danger:hover {
        background: #fef2f2;
        color: #b42318;
    }

/* ------------------------------------------------------------------ inputs */
.sh-field {
    display: grid;
    gap: .3rem;
    min-width: 0;
}

.sh-label {
    font-size: .78rem;
    font-weight: 700;
    color: #334155;
}

.sh-input,
.sh-select,
.sh-textarea {
    width: 100%;
    padding: .55rem .8rem;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--sh-ink);
    font-size: .9rem;
}

    .sh-input:focus,
    .sh-select:focus,
    .sh-textarea:focus {
        outline: none;
        background: #fff;
        border-color: var(--sh-brand);
        box-shadow: 0 0 0 3px rgba(25, 103, 210, .14);
    }

.sh-textarea {
    min-height: 5rem;
    resize: vertical;
}

.sh-grid {
    display: grid;
    gap: .85rem;
}

.sh-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sh-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ------------------------------------------------------------------ badges */
.sh-badge {
    display: inline-flex;
    align-items: center;
    padding: .18rem .6rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.sh-badge-draft { background: #f1f5f9; color: #475569; }
.sh-badge-published { background: #dcfce7; color: #15803d; }
.sh-badge-completed { background: #e0e7ff; color: #4338ca; }
.sh-badge-cancelled { background: #fee2e2; color: #b91c1c; }
.sh-badge-pending { background: #fef3c7; color: #b45309; }
.sh-badge-approved { background: #dcfce7; color: #15803d; }
.sh-badge-declined { background: #fee2e2; color: #b91c1c; }

/* ------------------------------------------------------------------ roster */
.sh-roster {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .6rem;
}

.sh-day {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 15rem;
    padding: .55rem;
    border: 1px solid var(--sh-line);
    border-radius: 12px;
    background: var(--sh-soft);
    transition: background .15s ease, border-color .15s ease;
}

    .sh-day.is-drop {
        border-color: var(--sh-brand);
        background: var(--sh-brand-soft);
    }

    .sh-day.is-today {
        border-color: rgba(25, 103, 210, .5);
    }

.sh-day-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--sh-line);
}

    .sh-day-head strong {
        font-size: .8rem;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: #334155;
    }

    .sh-day-head span {
        font-size: .74rem;
        color: var(--sh-muted);
    }

.sh-shift {
    padding: .5rem .6rem;
    border-left: 3px solid var(--sh-brand);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .07);
    cursor: grab;
    transition: transform .15s ease, box-shadow .15s ease;
}

    .sh-shift:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
    }

    .sh-shift:active {
        cursor: grabbing;
    }

    .sh-shift.is-dragging {
        opacity: .45;
    }

.sh-shift-title {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--sh-ink);
}

.sh-shift-time {
    display: block;
    margin-top: .15rem;
    font-size: .72rem;
    color: var(--sh-muted);
}

.sh-shift-person {
    display: block;
    margin-top: .2rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--sh-brand);
}

/* ------------------------------------------------------------------- table */
.sh-table-wrap {
    overflow-x: auto;
}

.sh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

    .sh-table th {
        padding: .6rem .75rem;
        border-bottom: 1px solid var(--sh-line);
        background: var(--sh-soft);
        text-align: left;
        font-size: .74rem;
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: #475569;
        white-space: nowrap;
    }

    .sh-table td {
        padding: .65rem .75rem;
        border-bottom: 1px solid var(--sh-line);
        vertical-align: middle;
    }

    .sh-table tr:last-child td {
        border-bottom: 0;
    }

    .sh-table tbody tr:hover {
        background: #fafcff;
    }

/* -------------------------------------------------------------- list items */
.sh-list {
    display: grid;
    gap: .65rem;
}

.sh-item {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: .85rem 1rem;
    border: 1px solid var(--sh-line);
    border-radius: 12px;
    background: #fff;
}

    .sh-item:hover {
        border-color: rgba(25, 103, 210, .35);
    }

.sh-item-icon {
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--sh-brand-soft);
    color: var(--sh-brand);
}

.sh-item-main {
    flex: 1 1 auto;
    min-width: 0;
}

.sh-item-title {
    display: block;
    font-weight: 700;
    font-size: .93rem;
    color: var(--sh-ink);
}

.sh-item-meta {
    display: block;
    margin-top: .15rem;
    font-size: .8rem;
    color: var(--sh-muted);
}

.sh-item-body {
    margin: .45rem 0 0;
    font-size: .87rem;
    line-height: 1.65;
    color: #334155;
}

/* ---------------------------------------------------------------- clock UI */
.sh-clock {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
}

.sh-clock-card {
    padding: 1.5rem;
    border: 1px solid var(--sh-line);
    border-radius: var(--sh-radius);
    background: linear-gradient(160deg, #f8fbff 0%, #ffffff 100%);
    text-align: center;
}

.sh-clock-time {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.sh-clock-label {
    display: block;
    margin-bottom: .3rem;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sh-muted);
}

.sh-geo-note {
    display: flex;
    align-items: center;
    gap: .45rem;
    justify-content: center;
    margin-top: .75rem;
    font-size: .8rem;
    color: var(--sh-muted);
}

    .sh-geo-note.is-ok {
        color: #15803d;
    }

    .sh-geo-note.is-warn {
        color: #b45309;
    }

/* ------------------------------------------------------------------- pulse */
.sh-pulse {
    display: flex;
    gap: .4rem;
}

.sh-pulse-btn {
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--sh-line);
    border-radius: 10px;
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all .15s ease;
}

    .sh-pulse-btn:hover {
        border-color: var(--sh-brand);
    }

    .sh-pulse-btn.is-active {
        background: var(--sh-brand);
        border-color: var(--sh-brand);
        color: #fff;
    }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1199.98px) {
    .sh-roster {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sh-grid-2,
    .sh-grid-3,
    .sh-clock {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767.98px) {
    .sh-roster {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sh-day {
        min-height: 11rem;
    }

    .sh-header {
        align-items: flex-start;
    }
}

/* ------------------------------------------------------------- admin extras */
.sh-alert {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 600;
    position: relative;
}

.sh-alert.is-ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.sh-alert.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b42318;
}

.sh-alert-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: .6;
}

    .sh-alert-close:hover {
        opacity: 1;
    }

.sh-shift-actions {
    display: flex;
    gap: .25rem;
    margin-top: .35rem;
}

.sh-icon-btn {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sh-line);
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: .68rem;
    cursor: pointer;
}

    .sh-icon-btn:hover {
        border-color: var(--sh-brand);
        color: var(--sh-brand);
    }

.sh-icon-danger:hover {
    border-color: #fecaca;
    color: #b42318;
}

.sh-item-stack {
    flex-direction: column;
    align-items: stretch;
    gap: .7rem;
}

.sh-members {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    padding-top: .6rem;
    border-top: 1px dashed var(--sh-line);
}

.sh-member-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .3rem .25rem .7rem;
    border-radius: 999px;
    background: var(--sh-brand-soft);
    color: var(--sh-brand);
    font-size: .78rem;
    font-weight: 600;
}

    .sh-member-chip button {
        width: 1.15rem;
        height: 1.15rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 50%;
        background: rgba(25, 103, 210, .16);
        color: inherit;
        font-size: .85rem;
        line-height: 1;
        cursor: pointer;
    }

        .sh-member-chip button:hover {
            background: rgba(25, 103, 210, .32);
        }

.sh-member-add {
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}

    .sh-member-add .sh-select,
    .sh-member-add .sh-input {
        height: 2.15rem;
        padding: .25rem .6rem;
        font-size: .82rem;
    }

/* ------------------------------------------------------------------- modal */
.sh-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
}

.sh-modal {
    position: fixed;
    z-index: 10051;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(26rem, calc(100vw - 2rem));
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(15, 23, 42, .3);
    overflow: hidden;
}

.sh-modal-head {
    padding: 1.15rem 1.35rem .35rem;
}

    .sh-modal-head h3 {
        margin: 0;
        font-size: 1.02rem;
        font-weight: 800;
    }

.sh-modal-body {
    padding: 0 1.35rem 1rem;
    color: #475569;
    font-size: .9rem;
    line-height: 1.6;
}

    .sh-modal-body p {
        margin: 0;
    }

.sh-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: .9rem 1.35rem;
    border-top: 1px solid var(--sh-line, rgba(15,23,42,.09));
    background: #f8fafc;
}

.sh-btn-destructive {
    background: #dc2626;
}

    .sh-btn-destructive:hover {
        background: #b91c1c;
        color: #fff;
    }

/* ------------------------------------------------------------------ pager */
.sh-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .85rem 1.15rem;
    border-top: 1px solid var(--sh-line, rgba(15,23,42,.09));
    font-size: .84rem;
    color: #64748b;
}

.sh-pager-btns {
    display: flex;
    gap: .35rem;
}

/* ------------------------------------------------------------ modal sizing */
.sh-modal-lg {
    width: min(44rem, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.sh-modal-lg .sh-modal-body {
    overflow-y: auto;
}

.sh-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.sh-modal-sub {
    margin: .2rem 0 0;
    color: #64748b;
    font-size: .82rem;
}

.sh-modal-close {
    border: 0;
    background: transparent;
    font-size: 1.3rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0 .2rem;
}

    .sh-modal-close:hover {
        color: #0f172a;
    }

.sh-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.sh-section-tight {
    padding: 0 0 .35rem;
}
