/* ==========================================================
   ShowTrack styles. Loaded AFTER bootstrap, Radzen, Syncfusion
   and avops-overrides.css (copied from AVOpsWeb: .av-form,
   .av-form-actions, .av-field-pair and the data-weight rules).
   @media rules belong in .css files, never in a Razor <style>
   block (see AVOpsWeb CLAUDE.md - they fail on real phones).
   ========================================================== */

:root {
    --st-navy: #0a256e;
    --st-steel: #738db5;
    --st-panel: #F5F5F5;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
}

h1:focus { outline: none; }

/* ---------- Shell ---------- */

.st-layout { min-height: 100vh; }

.st-header {
    width: 100%;
    padding-right: 12px;
}

.st-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--st-navy);
    white-space: nowrap;
}

.st-company {
    font-weight: 600;
    color: var(--st-steel);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.st-company-switch {
    cursor: pointer;
    text-decoration: underline dotted;
}

.st-spacer { flex: 1 1 auto; }

.st-user {
    white-space: nowrap;
    font-size: 0.9rem;
}

.st-content {
    padding: 12px clamp(8px, 2vw, 24px) 24px;
}

.st-sidebar-company {
    font-weight: 700;
    text-align: center;
    padding: 12px 8px;
    color: var(--st-navy);
}

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

.st-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.st-page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--st-navy);
}

.st-page-header .st-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

/* ---------- Panels / forms ---------- */

.st-panel {
    background: var(--st-panel);
}

.st-notes textarea {
    min-height: 110px !important;
    resize: vertical !important;
}

.st-muted { color: #6c757d; }

.st-inactive { color: #999; font-style: italic; }

/* ---------- Busy overlay (markup-driven; see AVOpsWeb notes on SfSpinner) ---------- */

.st-busy-host { position: relative; }

.st-busy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
}

.st-page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

/* ---------- Sign-in pages ---------- */

.st-auth {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 16px 16px;
    background: linear-gradient(180deg, var(--st-navy) 0%, #2b3f7a 100%);
}

.st-auth-card {
    width: 100%;
    max-width: 420px;
}

.st-auth-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--st-navy);
    margin-bottom: 4px;
}

.st-company-list .rz-button {
    width: 100%;
    justify-content: flex-start;
}

/* ---------- Lists / cards ---------- */

.st-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.st-show-card {
    cursor: pointer;
}

.st-show-card .st-date {
    font-weight: 700;
    color: var(--st-navy);
}

/* ---------- Contact links editor ---------- */

.st-links-table {
    width: 100%;
}

.st-links-table td {
    padding: 4px 6px;
    vertical-align: middle;
}

/* ---------- Scheduler ---------- */

.st-scheduler {
    height: calc(100vh - 170px);
    min-height: 480px;
}

/* ---------- Map links ---------- */

.st-map-link {
    display: inline-flex;
    align-items: flex-start;
    gap: 2px;
}

.st-map-icon {
    font-size: 1.1em !important;
    color: var(--st-steel);
}

/* ---------- Show sheet (read-only, phone first) ---------- */

.st-sheet {
    max-width: 760px;
}

.st-sheet-section {
    background: #fff;
    border: 1px solid #e3e6ec;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.st-sheet-section h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--st-navy);
    margin: 0 0 8px;
}

.st-sheet-date {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--st-navy);
}

.st-sheet-times {
    margin: 4px 0;
    font-size: 1.05rem;
}

.st-sheet-label {
    display: inline-block;
    min-width: 76px;
    font-weight: 600;
    color: var(--st-steel);
}

.st-sheet-notes {
    white-space: pre-wrap;
}

.st-sheet-act,
.st-sheet-crew {
    padding: 8px 0;
    border-top: 1px solid #eef0f4;
}

.st-sheet-act:first-of-type,
.st-sheet-crew:first-of-type {
    border-top: none;
}

.st-sheet-act-time {
    font-weight: 600;
    white-space: nowrap;
}

.st-sheet a {
    word-break: break-word;
}

/* ---------- Phones ---------- */

/* ---------- Phone views (calendar agenda, card lists) ---------- */

.st-agenda-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.st-agenda-month {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--st-navy);
}

.st-agenda-day {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid #e3e6ec;
}

.st-agenda-day:first-of-type { border-top: none; }

.st-agenda-date {
    flex: 0 0 44px;
    text-align: center;
    line-height: 1.1;
    color: var(--st-steel);
}

.st-agenda-date .st-dow { font-size: 0.75rem; text-transform: uppercase; }
.st-agenda-date .st-dom { font-size: 1.35rem; font-weight: 700; }
.st-agenda-today .st-agenda-date { color: var(--st-navy); }

.st-agenda-items { flex: 1 1 auto; min-width: 0; }

.st-card-item {
    display: block;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: var(--st-panel);
    border-left: 4px solid var(--st-navy);
    cursor: pointer;
    overflow-wrap: anywhere;
}

.st-card-item:last-child { margin-bottom: 0; }
.st-card-item:active { background: #e6eaf2; }
.st-card-title { font-weight: 700; }

.st-card-list .st-card-item { margin-bottom: 8px; }
.st-card-inactive { border-left-color: #bbb; color: #888; font-style: italic; }
.st-card-selected { background: #dfe6f3; border-left-color: var(--st-steel); }

@media (max-width: 640px) {
    /* avops-overrides.css hides Radzen's sidebar toggle on phones (AVOps has its own menu button);
       ShowTrack's only way to the menu is that toggle, so bring it back. */
    .rz-header .st-header .rz-sidebar-toggle,
    .rz-header .st-header button.rz-sidebar-toggle {
        display: inline-flex !important;
    }

    .st-user { display: none; }
    .st-brand { font-size: 1rem; }
    .st-page-header .st-actions { margin-left: 0; width: 100%; }
    .st-scheduler { height: calc(100vh - 210px); }
}

/* Blazor's built-in error banner */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
