/* ============================================================
   StarPOS Client Portal — base styles
   Brand: StarrPOS Light (Inter + JetBrains Mono, navy + blue)
   ============================================================ */

:root {
    --sp-blue:       #00A3E0;
    --sp-light-blue: #99D6EA;
    --sp-navy:       #1E2A5E;
    --sp-light-bg:   #E5F5FB;
    --sp-white:      #ffffff;
    --sp-grey-50:    #f9fafb;
    --sp-grey-100:   #f3f4f6;
    --sp-grey-200:   #e5e7eb;
    --sp-grey-300:   #d1d5db;
    --sp-grey-500:   #6b7280;
    --sp-grey-700:   #374151;
    --sp-grey-900:   #111827;
    --sp-success:    #059669;
    --sp-warning:    #d97706;
    --sp-danger:     #dc2626;
    --sp-gradient:   linear-gradient(135deg, #00A3E0 0%, #1E2A5E 100%);
    --sp-page-bg:    #eef3f7;
}

html, body {
    font-family: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--sp-grey-700);
    background-color: var(--sp-page-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--sp-navy);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

code, pre, .monospace {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85em;
}

a, .btn-link {
    color: var(--sp-blue);
    text-decoration: none;
}

a:hover {
    color: var(--sp-navy);
    text-decoration: underline;
}

.btn-primary {
    color: #fff;
    background-color: var(--sp-blue);
    border-color: var(--sp-blue);
    font-weight: 600;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--sp-navy);
    border-color: var(--sp-navy);
}

.btn-outline-primary {
    color: var(--sp-blue);
    border-color: var(--sp-blue);
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--sp-blue);
    border-color: var(--sp-blue);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(0, 163, 224, 0.4);
}

.form-control:focus, .form-select:focus {
    border-color: var(--sp-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 163, 224, 0.15);
}

.form-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--sp-grey-500);
    margin-bottom: 0.3rem;
}

/* CARDS */
.card {
    border: 1px solid var(--sp-grey-200);
    border-top: 3px solid var(--sp-blue);
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(30, 42, 94, 0.06);
}

.card-title {
    color: var(--sp-navy);
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* HERO BAND */
.sp-hero {
    background: var(--sp-white);
    border: 1px solid var(--sp-grey-200);
    border-top: 4px solid var(--sp-blue);
    border-radius: 6px;
    padding: 32px 36px 28px 36px;
    margin-bottom: 24px;
    box-shadow: 0 4px 18px rgba(30, 42, 94, 0.08);
}

.sp-hero .eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
    color: var(--sp-blue);
    margin-bottom: 6px;
}

.sp-hero h1 {
    margin: 0 0 6px 0;
    font-size: 1.9rem;
    line-height: 1.1;
}

.sp-hero .sub {
    color: var(--sp-grey-500);
    font-size: 0.98rem;
    margin: 0;
    max-width: 720px;
}

/* DOC-PILL BADGES */
.sp-pill {
    display: inline-block;
    background: var(--sp-light-bg);
    color: var(--sp-navy);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* TAB BAR (Blazor state-driven, no JS) */
.sp-tabs {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--sp-grey-200);
    flex-wrap: wrap;
}

.sp-tabs li { margin: 0; }

.sp-tab {
    background: none;
    border: none;
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--sp-grey-500);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all .12s;
}

.sp-tab:hover {
    color: var(--sp-navy);
}

.sp-tab.active {
    color: var(--sp-navy);
    border-bottom-color: var(--sp-blue);
}

.sp-tab .tab-count {
    display: inline-block;
    background: var(--sp-grey-100);
    color: var(--sp-grey-500);
    font-size: 0.72rem;
    padding: 1px 8px;
    border-radius: 999px;
    margin-left: 6px;
    font-weight: 700;
}

.sp-tab.active .tab-count {
    background: var(--sp-blue);
    color: #fff;
}

/* TABLE-LIKE SYNCFUSION GRID OVERRIDES
   Flat navy header in a single row — matches the brand hero band so
   the grid reads as a deliberate continuation rather than its own
   chrome. Filter UI is moved to a menu icon (set on the grid in
   markup) so we keep just one dense, intentional row. */
.e-grid {
    border: 1px solid var(--sp-grey-200) !important;
    border-radius: 6px !important;
    overflow: hidden;
}

.e-grid .e-gridheader {
    background: var(--sp-navy) !important;
    border-bottom: none !important;
    padding: 0 !important;
}

.e-grid .e-headercell,
.e-grid .e-detailheadercell {
    background: var(--sp-navy) !important;
    color: #fff !important;
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.08) !important;
    border-top: none !important;
    border-bottom: none !important;
    height: 42px;
    padding: 0 6px !important;
}

.e-grid .e-headercelldiv {
    color: #fff !important;
    font-weight: 600 !important;
    padding: 0 !important;
}

.e-grid .e-headertext {
    color: #fff !important;
}

/* Sorted column: subtle band of brand blue along the bottom, no box. */
.e-grid .e-headercell.e-ascending,
.e-grid .e-headercell.e-descending {
    background: var(--sp-navy) !important;
    box-shadow: inset 0 -3px 0 var(--sp-blue);
}

.e-grid .e-sortfilter .e-icon-ascending,
.e-grid .e-sortfilter .e-icon-descending,
.e-grid .e-sortnumber,
.e-grid .e-icon-filter,
.e-grid .e-icons {
    color: var(--sp-light-blue) !important;
    background: transparent !important;
}

.e-grid .e-headercell:hover {
    background: #2A3870 !important;  /* slightly lifted navy */
}

/* Filter input row immediately under the navy header band. Off-white
   background reads as a clear "search here" row without competing with
   the header. Inputs are full-width, light-bordered, with a placeholder
   hint. */
.e-grid .e-filterbar {
    background: var(--sp-grey-50) !important;
    border-bottom: 1px solid var(--sp-grey-200) !important;
}

.e-grid .e-filterbarcell {
    background: var(--sp-grey-50) !important;
    border-color: var(--sp-grey-200) !important;
    padding: 6px 6px !important;
}

.e-grid .e-filterbarcell input.e-input {
    background: #ffffff !important;
    border: 1px solid var(--sp-grey-300) !important;
    border-radius: 4px !important;
    color: var(--sp-grey-900) !important;
    font-size: 0.82rem !important;
    padding: 4px 8px !important;
    height: 30px;
}

.e-grid .e-filterbarcell input.e-input::placeholder {
    color: var(--sp-grey-500);
    font-style: italic;
}

.e-grid .e-filterbarcell input.e-input:focus {
    border-color: var(--sp-blue) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 163, 224, 0.15);
}

/* Body rows: thin separators, brand-blue hover, generous height. */
.e-grid .e-rowcell {
    border-color: var(--sp-grey-200) !important;
    padding: 10px 12px !important;
    color: var(--sp-grey-900);
}

.e-grid .e-row:hover .e-rowcell {
    background: var(--sp-light-bg) !important;
}

.e-grid .e-altrow .e-rowcell {
    background: var(--sp-grey-50);
}

/* Pager: quiet white footer instead of grey block. */
.e-grid .e-gridpager {
    background: #fff !important;
    border-top: 1px solid var(--sp-grey-200) !important;
}

/* ============ SYNCFUSION SCHEDULE — INSTALL CALENDAR ============
   The default Month view squashes events into a single-line ~24px bar,
   which crops both the client name and the installer pill. Forcing
   each event to expand to fit its template + bumping the day-cell
   height gives us enough room for the two-line tile pattern. */
.e-schedule .e-month-view .e-work-cells,
.e-schedule .e-month-view .e-other-month {
    height: 130px !important;
}

.e-schedule .e-month-view .e-appointment {
    height: auto !important;
    min-height: 50px !important;
}

.e-schedule .e-month-view .e-appointment .e-appointment-details {
    height: auto !important;
    padding: 0 !important;
}

.e-schedule .e-month-view .e-appointment .e-subject {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.25;
}

.e-schedule .e-month-view .e-more-indicator {
    font-size: 0.72rem;
    font-weight: 600;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

/* FORM VALIDATION */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--sp-success);
}

.invalid {
    outline: 1px solid var(--sp-danger);
}

.validation-message {
    color: var(--sp-danger);
    font-size: 0.82rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1.5rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Sortable table headings: they respond to a click, so they should look like it. */
th[role="button"] {
    cursor: pointer;
    user-select: none;
}

th[role="button"]:hover {
    color: #00A3E0;
}

/* ===== Rich-text editor (RichTextEditor.razor) ===== */
/* A contenteditable box shows no placeholder of its own, so an empty one is a blank
   rectangle with no hint what belongs in it. The prompt is drawn from the element's
   data-placeholder and disappears the moment anything is typed. */
.sp-rte-surface:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

/* Focus ring on the surface, not the wrapper — the toolbar sits above it and a ring
   around both reads as though the buttons were part of the text. */
.sp-rte-surface:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(0, 163, 224, 0.35);
}

/* Lists inside the editor keep their markers. The app resets list styling globally,
   which made a bulleted list look identical to plain paragraphs while editing. */
.sp-rte-surface ul {
    list-style: disc outside;
    padding-left: 1.5rem;
}

.sp-rte-surface ol {
    list-style: decimal outside;
    padding-left: 1.5rem;
}

.sp-rte-surface p:last-child {
    margin-bottom: 0;
}
