/*
 * Staff back office theme, from the design prototype (docs/design/index.html).
 *
 * Plain CSS loaded after Filament's stylesheet (PanelsRenderHook::HEAD_END). Filament keeps its rules in
 * @layer blocks, so these unlayered rules win without !important. Selectors are Filament's own fi-* classes.
 *
 * Design tokens
 *   navy    #123A7A  sidebar          ink     #18202B  text
 *   blue    #1F5FD1  primary          slate   #5A6475  secondary text
 *   amber   #F5A524  badges, avatar   muted   #8A93A3  labels, hints
 *   page    #F4F6F9  background       line    #E5EAF0  card borders, #EEF1F5 row rules
 */

:root {
    --st-navy: #123a7a;
    --st-ink: #18202b;
    --st-slate: #5a6475;
    --st-muted: #8a93a3;
    --st-page: #f4f6f9;
    --st-line: #e5eaf0;
    --st-rule: #eef1f5;
    --st-amber: #f5a524;
    --st-on-amber: #1b1300;
}

/* ---------- Page ---------- */

.fi-body {
    background-color: var(--st-page);
    color: var(--st-ink);
}

.fi-main {
    padding-inline: 32px;
}

.fi-page-header-main-ctn {
    padding-block: 28px 48px;
    row-gap: 24px;
}

.fi-page-content {
    row-gap: 14px;
}

.fi-header-heading {
    font-size: 28px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--st-ink);
}

.fi-header-subheading {
    margin-top: 6px;
    font-size: 14px;
    color: var(--st-slate);
}

/* Breadcrumbs sit above the title, like the prototype's small grey eyebrow. */
.fi-header .fi-breadcrumbs {
    margin-bottom: 4px;
}

.fi-breadcrumbs ol li {
    font-size: 13px;
    font-weight: 400;
    color: var(--st-muted);
}

/* ---------- Sidebar ---------- */

.fi-sidebar,
.fi-sidebar.fi-sidebar-open {
    background-color: var(--st-navy);
    color: #fff;
    box-shadow: none;
}

.fi-sidebar-header {
    height: auto;
    padding: 20px 22px 6px;
    justify-content: flex-start;
}

.fi-sidebar-header-controls:after {
    display: none;
}

.st-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.st-brand-tile {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #fff;
    color: var(--st-navy);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    flex: none;
}

.st-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.st-brand-name {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
}

.st-brand-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
}

/* Global search, sitting on the navy. */
.fi-sidebar .fi-global-search-ctn {
    margin-inline: 14px;
}

.fi-sidebar .fi-global-search-field .fi-input-wrp {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    --tw-ring-color: transparent;
}

.fi-sidebar .fi-global-search-field .fi-input-wrp:focus-within {
    background-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.fi-sidebar .fi-global-search-field .fi-input {
    color: #fff;
}

.fi-sidebar .fi-global-search-field .fi-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.fi-sidebar .fi-global-search-field .fi-icon {
    color: rgba(255, 255, 255, 0.6);
}

.fi-sidebar-nav {
    padding: 8px 14px 20px;
    row-gap: 4px;
}

.fi-sidebar-nav-groups {
    margin-inline: 0;
    row-gap: 4px;
}

.fi-sidebar-group-btn {
    padding: 14px 10px 6px;
}

.fi-sidebar-group-label {
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.fi-sidebar-group-btn .fi-icon,
.fi-sidebar-group-collapse-btn .fi-icon {
    color: rgba(255, 255, 255, 0.5);
}

.fi-sidebar-group-items {
    row-gap: 2px;
}

.fi-sidebar-item-btn {
    padding: 9px 10px;
    border-radius: 8px;
    gap: 10px;
}

.fi-sidebar-item-btn:hover,
.fi-sidebar-item-btn:focus-visible {
    background-color: rgba(255, 255, 255, 0.08);
}

.fi-sidebar-item-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.86);
}

.fi-sidebar-item-btn > .fi-icon {
    color: rgba(255, 255, 255, 0.62);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: #fff;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: var(--st-navy);
    font-weight: 600;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon {
    color: var(--st-navy);
}

.fi-sidebar-item-badge-ctn .fi-badge {
    border-radius: 999px;
    background: var(--st-amber);
    color: var(--st-on-amber);
    font-weight: 600;
}

/* Signed-in staff member at the foot of the sidebar. */
.fi-sidebar-footer {
    margin: 0 14px;
    padding: 12px 0 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.fi-sidebar-footer .fi-user-menu-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #fff;
}

.fi-sidebar-footer .fi-user-menu-trigger:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.fi-sidebar-footer .fi-user-menu-trigger-text {
    flex: 1;
    min-width: 0;
    text-align: start;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.fi-sidebar-footer .fi-user-menu-trigger > .fi-icon {
    color: rgba(255, 255, 255, 0.62);
}

/* Phone and tablet: the menu button that replaces the hidden top bar. */
.fi-layout-sidebar-toggle-btn-ctn .fi-icon-btn {
    background: #fff;
    border: 1px solid var(--st-line);
    border-radius: 10px;
}

/* ---------- Cards: sections, tables, widgets ---------- */

.fi-section:not(.fi-section-not-contained):not(.fi-aside),
.fi-section:not(.fi-section-not-contained).fi-aside > .fi-section-content-ctn,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-widget > .fi-section {
    border-radius: 14px;
    border: 1px solid var(--st-line);
    box-shadow: none;
}

.fi-section .fi-section-header-heading,
.fi-ta-ctn .fi-ta-header .fi-ta-header-heading {
    font-size: 15px;
    font-weight: 600;
    color: var(--st-ink);
}

.fi-section .fi-section-header-description {
    font-size: 13px;
    color: var(--st-muted);
}

.fi-section:not(.fi-section-not-contained):not(.fi-aside).fi-section-has-header:not(.fi-collapsed) > .fi-section-content-ctn,
.fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn > .fi-section-footer {
    border-color: var(--st-rule);
}

/* ---------- Tables ---------- */

.fi-ta-ctn .fi-ta-header-toolbar,
.fi-ta-ctn .fi-ta-header,
.fi-ta-ctn .fi-ta-filter-indicators {
    border-color: var(--st-rule);
}

.fi-ta-table > thead > tr {
    background-color: var(--gray-50);
}

.fi-ta-header-cell {
    padding-block: 11px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--st-muted);
}

.fi-ta-header-cell .fi-ta-header-cell-sort-btn {
    text-transform: inherit;
    letter-spacing: inherit;
}

.fi-ta-table > tbody > tr {
    border-color: var(--st-rule);
}

.fi-ta-row:hover {
    background-color: var(--gray-50);
}

.fi-ta-text-item {
    font-size: 14px;
}

/* ---------- Status pills (tables and detail pages) ---------- */

.fi-ta-text-item .fi-badge,
.fi-in-text-item .fi-badge {
    border-radius: 999px;
    padding: 3px 10px 3px 8px;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: none;
}

.fi-ta-text-item .fi-badge.fi-color::before,
.fi-in-text-item .fi-badge.fi-color::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

/* ---------- Buttons and inputs ---------- */

.fi-btn {
    border-radius: 10px;
    font-weight: 600;
}

.fi-btn.fi-color-gray,
.fi-btn:not(.fi-color) {
    font-weight: 500;
}

.fi-input-wrp {
    border-radius: 10px;
}

.fi-modal-window {
    border-radius: 18px;
}

/* ---------- Sign-in page ---------- */

.fi-simple-main {
    border-radius: 18px;
    border: 1px solid var(--st-line);
    box-shadow: none;
    max-width: 400px;
}

.fi-simple-layout .st-brand {
    justify-content: center;
}

.fi-simple-layout .st-brand-tile {
    background: var(--st-navy);
    color: #fff;
}

.fi-simple-layout .st-brand-name {
    color: var(--st-ink);
}

.fi-simple-layout .st-brand-sub {
    color: var(--st-muted);
}


/* ---------- Permit verification: progress tracker and documents ---------- */

.st-tracker {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
}

.st-tracker-step {
    flex: 1 1 0;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    padding-right: 12px;
}

.st-tracker-step::after {
    content: "";
    position: absolute;
    top: 14px;
    left: 34px;
    right: 6px;
    height: 2px;
    background: var(--st-line);
}

.st-tracker-step:last-child::after {
    display: none;
}

.st-tracker-done::after {
    background: #1f5fd1;
}

.st-tracker-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    background: var(--st-rule);
    color: var(--st-muted);
    position: relative;
    z-index: 1;
}

.st-tracker-done .st-tracker-dot {
    background: #1f5fd1;
    color: #fff;
}

.st-tracker-current .st-tracker-dot {
    background: #fff;
    color: #1f5fd1;
    box-shadow: inset 0 0 0 2px #1f5fd1;
}

.st-tracker-rejected .st-tracker-dot {
    background: #fdecea;
    color: #b42318;
    box-shadow: inset 0 0 0 2px #b42318;
}

.st-tracker-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--st-ink);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.st-tracker-todo .st-tracker-label {
    color: var(--st-muted);
}

.st-tracker-note {
    font-size: 12px;
    font-weight: 400;
    color: var(--st-muted);
}

.st-docs {
    margin: 0;
    padding: 0;
    list-style: none;
}

.st-doc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--st-rule);
    font-size: 14px;
}

.st-doc:first-child {
    border-top: 0;
    padding-top: 0;
}

.st-doc-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.st-doc-meta {
    font-size: 12px;
    color: var(--st-muted);
}

.st-doc-link {
    color: #1f5fd1;
    font-weight: 600;
    font-size: 13px;
    flex: none;
}

.st-doc-missing {
    color: var(--st-muted);
    font-size: 12px;
    flex: none;
}

/* ---------- Booking progress timeline ---------- */

.st-timeline {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0 0 4px;
    list-style: none;
    overflow-x: auto;
}

.st-timeline-step {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    padding-right: 12px;
}

.st-timeline-step::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 16px;
    right: 0;
    height: 2px;
    background: #1f5fd1;
}

.st-timeline-step:last-child::before {
    display: none;
}

.st-timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1f5fd1;
    position: relative;
    z-index: 1;
}

.st-timeline-step.is-current .st-timeline-dot {
    background: #fff;
    box-shadow: inset 0 0 0 3px #1f5fd1;
}

.st-timeline-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--st-ink);
}

.st-timeline-time,
.st-timeline-note,
.st-muted-text {
    font-size: 12px;
    color: var(--st-muted);
}

/* ---------- Operations dashboard ---------- */

.st-dash {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.st-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.st-kpi {
    background: #fff;
    border: 1px solid var(--st-line);
    border-top: 3px solid var(--tone);
    border-radius: 14px;
    padding: 18px 20px;
}

.st-tone-blue { --tone: #1f5fd1; }
.st-tone-violet { --tone: #7c4dcc; }
.st-tone-amber { --tone: #f5a524; }
.st-tone-green { --tone: #2f9e5b; }

.st-kpi-label { font-size: 13px; color: var(--st-slate); }
.st-kpi-value { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 2px; color: var(--st-ink); }
.st-kpi-sub { font-size: 12px; color: var(--st-muted); }

.st-panel {
    background: #fff;
    border: 1px solid var(--st-line);
    border-radius: 14px;
    padding: 20px;
}

.st-panel-list { padding: 8px 0; }
.st-panel-list .st-panel-head { padding: 12px 20px 8px; margin: 0; }
.st-pad { padding: 12px 20px; }

.st-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.st-panel-title { font-weight: 600; font-size: 15px; color: var(--st-ink); }
.st-panel-meta { font-size: 12px; color: var(--st-muted); }

.st-pipeline {
    display: flex;
    gap: 4px;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 14px;
}

.st-pipeline-part { opacity: 0.85; }

.st-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--st-slate); }
.st-legend-item { display: flex; align-items: center; gap: 8px; }
.st-legend-item strong { color: var(--st-ink); }
.st-legend-dot { width: 8px; height: 8px; border-radius: 2px; }

.st-c-warning { background: #f5a524; }
.st-c-danger { background: #d9453b; }
.st-c-teal { background: #1e9bb0; }
.st-c-info { background: #1f5fd1; }
.st-c-violet { background: #7c4dcc; }
.st-c-success { background: #2f9e5b; }
.st-c-gray { background: #a3abb8; }

.st-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 14px;
}

.st-attention {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-top: 1px solid var(--st-rule);
}

.st-attention-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st-attention-text { flex: 1; min-width: 0; }
.st-attention-title { font-size: 14px; font-weight: 500; color: var(--st-ink); }
.st-attention-detail { font-size: 12px; color: var(--st-muted); margin-top: 2px; }

.st-attention-btn {
    border: 1px solid var(--st-line);
    background: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--st-ink);
}

.st-attention-btn:hover { border-color: #1f5fd1; color: #1f5fd1; }

.st-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 170px;
}

.st-bar-col {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.st-bar { width: 100%; border-radius: 5px 5px 2px 2px; background: #1f5fd1; }
.st-bar.is-future { background: var(--st-line); }
.st-bar-label { font-size: 11px; color: var(--st-muted); }

.st-latest {
    display: grid;
    grid-template-columns: 90px minmax(0, 1.4fr) minmax(0, 1fr) 90px 150px;
    gap: 16px;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--st-rule);
    font-size: 14px;
    color: var(--st-ink);
}

.st-latest:hover { background: var(--gray-50); }
.st-latest-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-latest-loc { color: var(--st-slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: var(--st-slate); }
.st-link { color: #1f5fd1; font-size: 13px; font-weight: 600; }

@media (max-width: 720px) {
    .st-latest { grid-template-columns: 70px minmax(0, 1fr) 110px; }
    .st-latest-loc, .st-latest > span:nth-child(4) { display: none; }
}

/* ---------- Release vouchers ---------- */

.st-timeline-step.is-current::before,
.st-timeline-step.is-todo::before { background: #d9dee7; }
.st-timeline-step.is-todo .st-timeline-dot { background: #d9dee7; }
.st-timeline-step.is-todo .st-timeline-label { color: var(--st-muted); font-weight: 500; }
.st-timeline-step.is-failed .st-timeline-dot { background: #fff; box-shadow: inset 0 0 0 3px #d64545; }

.st-kpi-value.is-money { font-size: 24px; }

.st-tds-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.st-tds-filter label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--st-ink); }
.st-month { border: 1px solid var(--st-line); border-radius: 10px; padding: 8px 12px; font-size: 14px; background: #fff; }
.st-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--st-muted); padding: 8px 20px; border-bottom: 1px solid var(--st-line); }
.st-table td { padding: 10px 20px; border-bottom: 1px solid #eef1f5; color: var(--st-ink); }
.st-table tfoot td { font-weight: 600; border-bottom: 0; }
.st-table .st-num { text-align: right; font-variant-numeric: tabular-nums; }
