/* =============================================================================================
   Self-service (employee portal)
   ---------------------------------------------------------------------------------------------
   These pages render inside the main application shell, so this sheet styles the page body only.
   It deliberately reuses the vocabulary of the Employee form (employee-editor.css) and the Daily
   attendance report (daily-attendance.css): a gradient heading strip, white hairline panels with
   tinted section headers, 34px floating-label fields, a strip of coloured totals, and 12px
   uppercase micro-labels over compact tables. One sheet for all thirteen pages keeps them from
   drifting apart as they are edited separately.
   ========================================================================================== */
.ss-main {
    --ss-accent: #2563eb;
    --ss-ink: #142d4e;
    --ss-muted: #64748b;
    --ss-line: #dce3eb;
    --ss-soft: #f8fafc;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
    color: #24364b;
    font-size: 12px;
}
.ss-main *,
.ss-main *::before,
.ss-main *::after { box-sizing: border-box; }

/* ---- heading strip ---------------------------------------------------------------------------
   Same gradient as .employee-hero so an employee crossing from the admin screens recognises the
   header. The page's own actions sit on the right and take the light button treatment. */
.ss-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    padding: 14px 18px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: linear-gradient(115deg, #142d56, #175c87);
    color: #fff;
    box-shadow: 0 6px 18px #142d561f;
}
.ss-hero-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ss-hero-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid #ffffff3d;
    border-radius: 50%;
    background: #ffffff26;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
}
.ss-hero-text { min-width: 0; }
.ss-hero h1,
.ss-h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
    color: var(--ss-ink);
}
.ss-hero h1 { color: #fff; }
.ss-sub {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ss-muted);
}
.ss-hero .ss-sub { color: #c5d9ee; }

/* Approval cards on the employee dashboard. */
.ss-approvals { margin-bottom: 16px; }
.ss-approvals h2 {
    margin: 0 0 10px;
    color: var(--ss-ink);
    font-size: 1rem;
    font-weight: 700;
}
.ss-approval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 14px;
}
.ss-approval-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 5px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 5px #142d5630;
}
.ss-approval-card--teal { background: #087c8d; }
.ss-approval-card--blue { background: #2165bc; }
.ss-approval-card--green { background: #217d3b; }
.ss-approval-body {
    position: relative;
    isolation: isolate;
    display: grid;
    align-content: start;
    gap: 8px;
    flex: 1;
    min-height: 106px;
    padding: 12px 16px 16px;
}
.ss-approval-count {
    font-size: 1.9rem;
    font-weight: 750;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.ss-approval-title { font-size: .92rem; font-weight: 600; }
.ss-approval-icon {
    position: absolute;
    z-index: -1;
    top: 14px;
    right: 14px;
    width: 70px;
    height: 70px;
    fill: none;
    stroke: #000;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .18;
    pointer-events: none;
}
.ss-approval-link {
    display: block;
    padding: 6px 12px;
    background: #0002;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
}
.ss-approval-card:hover,
.ss-approval-card:focus-visible { color: #fff; }
.ss-approval-card:hover .ss-approval-link,
.ss-approval-card:focus-visible .ss-approval-link { background: #0004; text-decoration: underline; }
.ss-hero .ss-sub a { color: #dbeaf9; }
.ss-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ss-hero .btn {
    --bs-btn-font-size: 12px;
    --bs-btn-padding-y: 6px;
    --bs-btn-padding-x: 11px;
    --bs-btn-border-radius: 6px;
    font-weight: 600;
}
/* site.css paints .btn-primary with a direct `background` shorthand, so the hero buttons are set
   the same way - overriding only Bootstrap's --bs-btn-* variables would lose the cascade. */
.ss-hero .btn-primary,
.ss-hero .btn-light {
    color: #142d56;
    background: #fff;
    border-color: #fff;
}
.ss-hero .btn-primary:hover,
.ss-hero .btn-primary:focus,
.ss-hero .btn-primary:active,
.ss-hero .btn-light:hover,
.ss-hero .btn-light:focus {
    color: #142d56;
    background: #e8f1fb;
    border-color: #e8f1fb;
}
.ss-hero .btn-outline-secondary,
.ss-hero .btn-outline-primary,
.ss-hero .btn-outline-light {
    color: #fff;
    background: transparent;
    border-color: #b5d8f5;
}
.ss-hero .btn-outline-secondary:hover,
.ss-hero .btn-outline-secondary:focus,
.ss-hero .btn-outline-primary:hover,
.ss-hero .btn-outline-primary:focus,
.ss-hero .btn-outline-light:hover,
.ss-hero .btn-outline-light:focus {
    color: #fff;
    background: #ffffff1f;
    border-color: #fff;
}
/* The relationship badge on a team member reads on the dark strip rather than on white. */
.ss-hero .ss-pill {
    background: #ffffff26;
    border: 1px solid #ffffff3d;
    color: #eaf3fc;
}

/* ---- panels ----------------------------------------------------------------------------------
   A white card with a tinted header band and a 4px accent, exactly the Employee form's card
   headers. The band repeats on every panel, so the panels read as one family. */
.ss-panel {
    margin-bottom: 12px;
    border: 1px solid var(--ss-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px #203d6108;
    overflow: hidden;
}
.ss-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 8px 12px;
    border-left: 4px solid #437be3;
    background: linear-gradient(100deg, #e8efff, #f4f8ff);
    color: #234c8a;
    font-size: 12px;
    font-weight: 700;
}
.ss-panel-head h2 { margin: 0; font-size: 12px; font-weight: 700; }
.ss-panel-meta { color: #5b6f8d; font-size: 11px; font-weight: 500; text-decoration: none; }
a.ss-panel-meta:hover { color: #234c8a; text-decoration: underline; }
.ss-panel-head .btn {
    --bs-btn-font-size: 11px;
    --bs-btn-padding-y: 3px;
    --bs-btn-padding-x: 9px;
}
.ss-panel-body { padding: 12px; }
.ss-panel-body > :last-child { margin-bottom: 0; }
.ss-panel-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #e9eef5;
    background: #fbfcfe;
    color: var(--ss-muted);
    font-size: 11px;
}
/* A second and third panel in a stack rotate hue the way the Employee form's cards do, so a long
   page has landmarks without adding decoration to every section. */
.ss-panel--mint .ss-panel-head { border-left-color: #25a58d; background: linear-gradient(100deg, #def5ef, #f2fbf8); color: #146958; }
.ss-panel--violet .ss-panel-head { border-left-color: #9470ce; background: linear-gradient(100deg, #eee7fc, #f8f5ff); color: #694898; }
.ss-panel--amber .ss-panel-head { border-left-color: #d99a20; background: linear-gradient(100deg, #fdf3dd, #fffaef); color: #7a5310; }

.ss-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.ss-cols > .ss-panel { margin-bottom: 0; }
@media (max-width: 900px) { .ss-cols { grid-template-columns: minmax(0, 1fr); } }
.ss-cols + .ss-panel { margin-top: 12px; }

/* ---- totals strip ----------------------------------------------------------------------------
   The Daily attendance report's summary line: a run of figures with a small caption under each.
   Colour is used to separate the counts rather than to decorate them. */
.ss-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    padding: 10px 12px;
}
.ss-summary .ss-stat { display: flex; flex-direction: column; gap: 1px; min-width: 84px; }
.ss-num {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--ss-ink);
    font-variant-numeric: tabular-nums;
}
.ss-cap {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ss-muted);
}
.ss-stat.is-good .ss-num { color: #15803d; }
.ss-stat.is-warn .ss-num { color: #b45309; }
.ss-stat.is-info .ss-num { color: #2563eb; }

/* ---- label / value facts ---------------------------------------------------------------------
   Today's figures and the profile details. Caption above, value below, no borders - the panel
   around them already draws the box. */
.ss-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 10px 18px;
}
.ss-fact { min-width: 0; }
.ss-fact-label {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ss-muted);
}
.ss-fact-value {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ss-ink);
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.ss-fact-value.is-muted { color: #94a3b8; font-weight: 500; }
.ss-fact-value.is-good { color: #15803d; }
.ss-fact-value.is-warn { color: #b45309; }

/* ---- filter bar ------------------------------------------------------------------------------
   The Daily report's filter row, rebuilt for two or three fields: floating captions on 34px
   controls, buttons pushed to the trailing edge. */
.ss-filterbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ss-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px #203d6108;
}
.ss-filterbar .ss-field { flex: 0 1 auto; width: var(--ss-field-width, 150px); }
.ss-filterbar .ss-field-month { --ss-field-width: 138px; }
.ss-filterbar .ss-field-year { --ss-field-width: 92px; }
.ss-filterbar .ss-field-date { --ss-field-width: 152px; }
.ss-filterbar .ss-filter-label {
    flex: 0 0 auto;
    color: var(--ss-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.ss-filter-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ss-filter-actions .btn {
    --bs-btn-font-size: 12px;
    --bs-btn-padding-y: 6px;
    --bs-btn-padding-x: 12px;
    height: 34px;
}

/* ---- fields ----------------------------------------------------------------------------------
   Same mechanics as .daily-field and .leave-floating: the caption sits in the top border of the
   control, which keeps a dense form readable. Selects always float because they never render a
   placeholder for :placeholder-shown to match. */
.ss-field { position: relative; min-width: 0; }
.ss-field > label {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 8px;
    transform: translateY(-50%);
    padding: 0 4px;
    margin: 0;
    background: #fff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    pointer-events: none;
}
.ss-field > .form-control,
.ss-field > .form-select {
    width: 100%;
    height: 34px;
    min-height: 34px;
    padding: 7px 9px 5px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    color: var(--ss-ink);
    font-size: 12px;
    line-height: 20px;
}
.ss-field > .form-select { padding-right: 27px; text-overflow: ellipsis; }
.ss-field > textarea.form-control {
    height: auto;
    min-height: 66px;
    padding-top: 12px;
    line-height: 1.5;
    resize: vertical;
}
.ss-field:focus-within > .form-control,
.ss-field:focus-within > .form-select {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #2563eb18;
    outline: none;
}
.ss-field > .form-control:disabled,
.ss-field > .form-select:disabled { background-color: #f1f5f9; color: #64748b; }

.ss-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.ss-form .ss-wide { grid-column: 1 / -1; }
.ss-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e9eef5;
}
.ss-form-actions .btn {
    --bs-btn-font-size: 12px;
    --bs-btn-padding-y: 7px;
    --bs-btn-padding-x: 14px;
}
.ss-form .text-danger { display: block; margin-top: 3px; font-size: 11px; }
.ss-form .field-validation-valid:empty { display: none; }

/* ---- tables ----------------------------------------------------------------------------------
   Compact, hairline rows with a sticky micro-label header. Numeric columns line up on the
   decimal, matching the tabular figures in the summary strip above. */
.ss-table-wrap { overflow: auto; max-height: 620px; }
.ss-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.ss-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 7px 10px;
    border-bottom: 1px solid #e5eaf1;
    background: #f7f9fc;
    color: var(--ss-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.ss-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
    color: #24364b;
}
.ss-table tbody tr:last-child td { border-bottom: 0; }
.ss-table tbody tr:hover { background: #f8fbff; }
.ss-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ss-table .ss-cell-strong { font-weight: 600; color: var(--ss-ink); }
.ss-reason { max-width: 240px; white-space: normal; overflow-wrap: anywhere; }
.ss-hint { display: block; margin-top: 2px; color: #94a3b8; font-size: 10.5px; line-height: 1.4; }
.ss-empty {
    margin: 0;
    padding: 26px 16px;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
}

/* ---- status pills ---------------------------------------------------------------------------- */
.ss-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #42546e;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.ss-pill.ss-pending { background: #fff4d6; color: #8a5a06; }
.ss-pill.ss-approved { background: #dcfce7; color: #15803d; }
.ss-pill.ss-rejected { background: #fee2e2; color: #b42318; }
.ss-pill.ss-cancelled,
.ss-pill.ss-withdrawn { background: #eef2f7; color: #64748b; }

/* ---- notes and feedback ----------------------------------------------------------------------
   An informational strip with a left rule, the reading treatment used by the leave and attendance
   screens. Warnings reuse it with the amber rule rather than shouting in a full alert block. */
.ss-note {
    margin: 0 0 12px;
    padding: 9px 12px;
    border: 1px solid #dfe9fa;
    border-left: 3px solid #93b4e8;
    border-radius: 8px;
    background: #f5f9ff;
    color: #405775;
    font-size: 11.5px;
    line-height: 1.6;
}
.ss-note strong { color: #234c8a; }
.ss-note.is-warning { border-color: #fde68a; border-left-color: #d99a20; background: #fffbeb; color: #7a5310; }
.ss-note.is-warning strong { color: #8a5a06; }
.ss-panel-body > .ss-note:last-child { margin-bottom: 0; }

.ss-main .alert {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
}

/* ---- profile --------------------------------------------------------------------------------- */
.ss-profile { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; }
.ss-profile-photo img,
.ss-initials {
    width: 112px;
    height: 112px;
    border: 1px solid var(--ss-line);
    border-radius: 12px;
    object-fit: cover;
    background: #eef3fa;
}
.ss-initials {
    display: grid;
    place-items: center;
    color: #3b6ea8;
    font-size: 2rem;
    font-weight: 700;
}
@media (max-width: 620px) {
    .ss-profile { grid-template-columns: minmax(0, 1fr); }
    .ss-profile-photo img,
    .ss-initials { width: 84px; height: 84px; font-size: 1.5rem; }
}

/* ---- decision form (approvals) ---------------------------------------------------------------- */
.ss-decide { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.ss-decide .form-control { height: 30px; min-height: 30px; padding: 4px 8px; font-size: 11.5px; }
.ss-decide .ss-decide-actions { display: flex; gap: 5px; }
.ss-decide .btn { --bs-btn-font-size: 11.5px; --bs-btn-padding-y: 4px; --bs-btn-padding-x: 10px; }

/* ---- footer ---------------------------------------------------------------------------------- */
.ss-foot {
    margin: 8px 0 0;
    padding: 14px 4px 0;
    border-top: 1px solid #e4eaf2;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
}

/* ---- responsive ------------------------------------------------------------------------------ */
@media (max-width: 640px) {
    .ss-main { padding: .75rem .6rem 1.5rem; }
    .ss-hero { padding: 12px 14px; border-radius: 10px; }
    .ss-hero h1, .ss-h1 { font-size: 1rem; }
    .ss-hero-actions { width: 100%; }
    .ss-hero-actions .btn { flex: 1 1 auto; }
    .ss-filterbar .ss-field { flex: 1 1 calc(50% - 8px); width: auto; }
    .ss-filter-actions { width: 100%; margin-left: 0; }
    .ss-filter-actions .btn { flex: 1; }
    .ss-form { grid-template-columns: minmax(0, 1fr); }
    .ss-summary { gap: 8px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .ss-field > label { transition: none; }
}

/* Visible focus on every interactive element inside the portal. */
.ss-main a:focus-visible,
.ss-main button:focus-visible,
.ss-main input:focus-visible,
.ss-main select:focus-visible,
.ss-main textarea:focus-visible,
.ss-main summary:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
