/*
 * Small additions on top of the ported admin theme. Everything the theme
 * already styles (contentbox, table-main, switch, badge, row-actions …) is
 * left alone; only markup the theme has no rule for lives here.
 */

/* Row actions are hover-revealed by the theme; some tables want them always on. */
.row-actions.is-visible { visibility: visible; opacity: 1; }
.row-actions form { display: inline; margin: 0; }
.row-actions button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

/* Status list on the dashboard. */
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.status-list li + li { border-top: 1px solid rgba(0, 0, 0, .06); }

/*
 * Ride-status badges. The theme carries a circular 20x20 `.badge` rule for
 * notification counts, so the box has to be reset alongside the colour.
 */
.badge-SCHEDULED, .badge-REQUESTED, .badge-ACCEPTED, .badge-ARRIVED, .badge-IN_PROGRESS, .badge-COMPLETED, .badge-CANCELLED {
    display: inline-block;
    width: max-content;
    height: auto;
    padding: 5px 10px;
    border-radius: .3125rem;
    line-height: 1.1;
}
.badge-SCHEDULED { background: #e5e7eb; color: #374151; }
.badge-REQUESTED { background: #ffe6b3; color: #6b4b00; }
.badge-ACCEPTED { background: #cfe3ff; color: #0b3a82; }
.badge-ARRIVED { background: #c8f1f4; color: #0b5560; }
.badge-IN_PROGRESS { background: #d6ccff; color: #35207a; }
.badge-COMPLETED { background: #c9f0d5; color: #14532d; }
.badge-CANCELLED { background: #ffd3d3; color: #7a1414; }

/* Dashboard tiles carry the theme's own SVGs. */
.ride-icon img { width: 24px; height: 24px; object-fit: contain; }

/* Zone pricing cards. */
.zone-price-card { margin-bottom: 12px; }
.price-summary { display: grid; gap: 8px 24px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); font-size: 13px; }
.price-summary div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed rgba(0, 0, 0, .06); }
.price-summary span { opacity: .7; }

.surge-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.surge-cell { border: 1px solid rgba(0, 0, 0, .08); border-radius: 10px; padding: 10px 12px; }
.surge-cell label { display: block; font-size: 12px; margin-bottom: 4px; opacity: .8; }

/* The permission matrix reuses the theme's .permission-section list. */
.permission-section .form-group label { margin-right: 14px; }

/* ── SMS log detail (page and modal share this markup) ─────────────────── */
.log-detail-table th { width: 150px; white-space: nowrap; vertical-align: top; }
.log-detail-table td.wrap { white-space: pre-wrap; word-break: break-word; }

.log-response {
    margin: 6px 0 0;
    padding: 12px;
    max-height: 300px;
    overflow: auto;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    color: #e2e8f0;
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Vehicle artwork in list rows: contain rather than crop. */
.vehicle-table .table-image { object-fit: contain; background: #fff; padding: 3px; }

/* ── Field hints and the fare explainer ────────────────────────────────── */
.field-hint { margin-left: 4px; opacity: .55; cursor: help; font-size: 14px; }
.field-hint:hover { opacity: 1; color: rgb(var(--primary-color, 25, 150, 117)); }

.fare-formula {
    margin: 0;
    padding: 14px 16px;
    border-radius: 8px;
    background: #f7f8f9;
    border: 1px solid rgba(0, 0, 0, .06);
    font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre-wrap;
}
.fare-calculation-modal code { font-size: 12px; }

/* ── Surge screen ──────────────────────────────────────────────────────── */
.preview-zone { margin: 16px 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.vehicles-list li.total { border-top: 1px solid rgba(0, 0, 0, .1); margin-top: 6px; padding-top: 10px; }
.vehicles-list li.surged span { color: rgb(var(--primary-color, 25, 150, 117)); font-weight: 600; }
.explain-list { padding-left: 18px; }
.explain-list li { margin-bottom: 6px; }
.timer-price { font-size: 14px; margin-bottom: 8px; }

/* ── Zone map editor ───────────────────────────────────────────────────── */
.map-warper { border: 1px solid rgba(0, 0, 0, .1); }
.map-container { height: 420px; width: 100%; }
.leaflet-container { font: inherit; }

/* ── Peak zone map legend ──────────────────────────────────────────────── */
.peak-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.peak-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.peak-legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.peak-legend li span:last-child { margin-left: auto; font-weight: 600; }

/*
 * Media library. The theme styles the picker modal and the grid cards; these
 * cover the library screen's own bulk mode and the file captions.
 */
.media-files .media-card .form-check-input { display: none; }
.media-bulk .media-files .media-card .form-check-input { display: block; }
.media-files .media-card .filename {
    padding: 8px 4px 0;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}
.media-files .media-card .filename small { display: block; }
.media-files .media-card .view-img { object-fit: cover; border-radius: 6px; }
.media-dropzone .dz-message { text-align: center; }
.media-dropzone .dz-message input[type="file"] { max-width: 420px; margin: 12px auto 0; }

/* The theme capitalises person cells; an address must keep its own case. */
.table-main .table-responsive .table .user-detail .email { text-transform: none; }

/*
 * Form switches.
 *
 * Thymeleaf writes a hidden companion input straight after a checkbox bound
 * with th:field, so the theme's `input:checked + .switch-state` no longer
 * matches and every switch on a form looked permanently off. The same rules
 * again, reaching past that hidden input.
 */
.switch input:checked ~ .switch-state { background-color: #eff1ee; }
.switch input:checked ~ .switch-state:before {
    transform: translate(20px);
    background-color: var(--primary-color);
}
.switch.switch-sm input:checked ~ .switch-state:before { transform: translate(17px); }
.dark .switch input:checked ~ .switch-state { background-color: #404040b3; border-color: #404040b3; }

/*
 * Coloured badges.
 *
 * The theme's bare `.badge` is a round 20x20 notification dot, and its
 * `.bg-light-*` helpers only set colours — so a status or priority badge came
 * out as a dot with invisible text. These give the same box the ride-status
 * badges get, and a legible grey for `light`, whose theme colour is white.
 */
.badge[class*="bg-light-"] {
    display: inline-block;
    width: max-content;
    height: auto;
    padding: 5px 10px;
    border-radius: .3125rem;
    line-height: 1.1;
    font-weight: 500;
}
.badge.bg-light-light { background-color: rgba(23, 28, 38, .07) !important; color: #4a5160; }
.badge.bg-light-primary { background-color: rgba(25, 150, 117, .12) !important; }

/* A timestamp is one thing, so it stays on one line. Left to wrap, the
   report tables broke "01 Sep 2026, 09:36 PM" over five lines and every
   row grew to match. */
.table td.when,
.table th.when {
    white-space: nowrap;
}

/* The dashboard's status cards mask their icon file rather than referencing an
   external <use> symbol, which Chrome refuses to follow. Masking also means the
   icon takes the theme's current primary, which the files ask for with a CSS
   variable an <img> could never resolve. */
.bg-image .status-icon {
    display: block;
    width: 33px;
    height: 33px;
    background-color: var(--primary-color);
    /* Longhands, not the `mask` shorthand: a var() in the shorthand's
       position/size slot is dropped by some engines, and the icon then paints
       nothing at all. */
    -webkit-mask-image: var(--icon);
    mask-image: var(--icon);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.bg-image .btn .status-icon.arrow {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Which app offers a payment method sits inside the card header, because the
   theme gives that the card's full height and the card clips the rest. */
.payment-card .app-switches {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(238, 238, 238, .8);
}

.payment-card .app-switches .status-div span {
    font-size: 13px;
    color: #777;
}

/* A ledger reads at a glance when money in and money out are told apart by
   more than a word: the column is figures, so it is lined up and signed. */
.table td.amount {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.table td.amount.credit { color: #199675; }
.table td.amount.debit { color: #d93025; }

/* Bootstrap's display utilities are `!important`, so a `d-flex` row that the
   page hides with the `hidden` attribute — the custom date range on every
   report — would otherwise stay on screen. */
[hidden] {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────
   Server Health — the developer panel's own styling, copied from
   the Laravel dashboard's `srvh-*` block rather than inlined in
   the page. The dark overrides at the end are the one addition:
   this panel has a dark switch and the Blade one did not.
   ───────────────────────────────────────────────────────────── */
.srvh-wrap { margin-top: 0; }

.srvh-headbar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.srvh-headbar h4 { color: #fff; margin: 0; font-size: 16px; font-weight: 600; }
.srvh-headbar h4 .srvh-live {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e; margin-right: 8px; vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(34,197,94,0.6); animation: srvh-pulse 1.8s infinite;
}
@keyframes srvh-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
    70%  { box-shadow: 0 0 0 12px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.srvh-meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: #cbd5e1; flex-wrap: wrap; }
.srvh-meta .srvh-meta-item { display: inline-flex; align-items: center; gap: 5px; }
.srvh-meta .srvh-meta-item strong { color: #fff; font-weight: 600; }
.srvh-meta .srvh-chip {
    background: rgba(255,255,255,0.1); padding: 2px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.srvh-meta .srvh-pause {
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 11px;
    cursor: pointer; transition: background 0.2s;
}
.srvh-meta .srvh-pause:hover { background: rgba(255,255,255,0.22); }

/* Stat cards */
.srvh-stat {
    border: 0; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.15s, box-shadow 0.15s; height: 100%; background: #fff;
}
.srvh-stat:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.srvh-stat .card-body { padding: 18px 18px 12px; }
.srvh-stat .srvh-label {
    font-size: 11px; color: #64748b; text-transform: uppercase;
    letter-spacing: 0.7px; font-weight: 700;
}
.srvh-stat .srvh-value {
    font-size: 28px; font-weight: 700; line-height: 1.1;
    color: #0f172a; margin-top: 2px; font-feature-settings: 'tnum';
}
.srvh-stat .srvh-value.is-warn   { color: #d97706; }
.srvh-stat .srvh-value.is-danger { color: #dc2626; }
.srvh-stat .srvh-sub { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.srvh-stat .srvh-icon { font-size: 28px; opacity: 0.7; }
.srvh-stat .progress { height: 6px; border-radius: 3px; background: #f1f5f9; }

/* Cards */
.srvh-card {
    border: 0; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 100%; background: #fff;
}
.srvh-card .card-header {
    background: #fff; border-bottom: 1px solid #f1f5f9;
    padding: 12px 18px; border-radius: 12px 12px 0 0;
}
.srvh-card .card-header strong { color: #0f172a; font-weight: 600; }
.srvh-card .card-header small { color: #94a3b8; }

/* The reading a person actually wants: what it is right now, in the header,
   so the line underneath is free to be a shape rather than a wall of badges. */
.srvh-card .card-header .srvh-now {
    font-size: 20px; font-weight: 700; color: #0f172a; margin-left: 10px;
    font-variant-numeric: tabular-nums; letter-spacing: -0.2px;
}

/* Services */
.srvh-svc {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.srvh-svc:last-child { border-bottom: 0; }
.srvh-svc .srvh-svc-label { display: flex; align-items: center; gap: 9px; color: #0f172a; font-weight: 500; }
.srvh-svc .srvh-svc-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #cbd5e1; display: inline-block; flex-shrink: 0;
}
.srvh-svc.is-up   .srvh-svc-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.srvh-svc.is-down .srvh-svc-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.srvh-svc.is-unknown .srvh-svc-dot { background: #cbd5e1; box-shadow: 0 0 0 3px rgba(148,163,184,0.18); }
.srvh-svc .srvh-svc-count { color: #64748b; font-size: 11px; font-variant-numeric: tabular-nums; }

/* Disk mounts */
.srvh-mount { padding: 10px 16px; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.srvh-mount:last-child { border-bottom: 0; }
.srvh-mount .srvh-mount-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.srvh-mount .srvh-mount-path { font-family: ui-monospace, SFMono-Regular, monospace; color: #0f172a; font-weight: 600; }
.srvh-mount .srvh-mount-stat { color: #64748b; font-variant-numeric: tabular-nums; }
.srvh-mount .progress { height: 5px; border-radius: 3px; background: #f1f5f9; }

/* Processes table */
.srvh-proc-tbl { font-size: 12px; }
.srvh-proc-tbl thead { background: #f8fafc; }
.srvh-proc-tbl th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; font-weight: 600; border-bottom: 1px solid #e2e8f0; padding: 8px 12px; }
.srvh-proc-tbl td { padding: 6px 12px; vertical-align: middle; font-variant-numeric: tabular-nums; border-bottom: 1px solid #f1f5f9; }
.srvh-proc-tbl tr:last-child td { border-bottom: 0; }
.srvh-proc-tbl .srvh-cpu-cell { position: relative; }
.srvh-proc-tbl .srvh-cpu-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(13,110,253,0.08); border-right: 2px solid rgba(13,110,253,0.4); }
.srvh-proc-tbl .srvh-cpu-bar.hot { background: rgba(220,38,38,0.1); border-right-color: rgba(220,38,38,0.5); }

/* Info list */
.srvh-info { font-size: 12.5px; }
.srvh-info .srvh-info-row { display: flex; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid #f1f5f9; }
.srvh-info .srvh-info-row:last-child { border-bottom: 0; }
.srvh-info .srvh-info-row .srvh-info-key { color: #64748b; }
.srvh-info .srvh-info-row .srvh-info-val { color: #0f172a; font-weight: 600; font-variant-numeric: tabular-nums; max-width: 60%; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.srvh-info .srvh-info-row .srvh-info-val.is-danger { color: #dc2626; }
.srvh-info .srvh-info-row code, .srvh-info .srvh-info-row .font-monospace { font-family: ui-monospace, SFMono-Regular, monospace; }

/* Log table */
.srvh-log-tbl { font-size: 12px; }
.srvh-log-tbl thead { background: #f8fafc; }
.srvh-log-tbl th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; font-weight: 600; padding: 8px 14px; border-bottom: 1px solid #e2e8f0; }
.srvh-log-tbl td { padding: 9px 14px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.srvh-log-tbl tr.lvl-error,
.srvh-log-tbl tr.lvl-critical,
.srvh-log-tbl tr.lvl-emergency,
.srvh-log-tbl tr.lvl-alert       { background: rgba(220,38,38,0.04); }
.srvh-log-tbl tr.lvl-warn,
.srvh-log-tbl tr.lvl-warning      { background: rgba(245,158,11,0.04); }
.srvh-log-tbl .srvh-lvl {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
}
.srvh-log-tbl .srvh-lvl.error,
.srvh-log-tbl .srvh-lvl.critical,
.srvh-log-tbl .srvh-lvl.emergency,
.srvh-log-tbl .srvh-lvl.alert   { background: #fee2e2; color: #991b1b; }
.srvh-log-tbl .srvh-lvl.warn,
.srvh-log-tbl .srvh-lvl.warning  { background: #fef3c7; color: #92400e; }

.srvh-log-empty {
    padding: 32px; text-align: center; color: #94a3b8;
    background: #f8fafc; border-radius: 0 0 12px 12px;
}

/* Skeleton */
.srvh-skel { background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%); background-size: 200% 100%; animation: srvh-shimmer 1.4s infinite; border-radius: 4px; display: inline-block; height: 1em; min-width: 40px; }
@keyframes srvh-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* A figure the host would not give up. Never a zero pretending to be one. */
.srvh-unknown { color: #94a3b8 !important; font-weight: 500; font-size: 0.8em; letter-spacing: 0.3px; }

/* Socket state. The strip says so the moment the stream stops arriving. */
.srvh-conn {
    display: none; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
    border-radius: 8px; padding: 9px 14px; margin-bottom: 14px;
}
.srvh-conn.is-shown { display: flex; }
.srvh-conn.is-lost { background: #fee2e2; color: #991b1b; }
.srvh-conn.is-back { background: #dcfce7; color: #166534; }
.srvh-headbar.is-stale h4 .srvh-live { background: #ef4444; animation: none; }
.srvh-headbar.is-paused h4 .srvh-live { background: #94a3b8; animation: none; }

/* Dark mode — the panel has a switch, so the light-only Blade palette needs
   the same surfaces restated. The dark header strip is already dark. */
body.dark .srvh-stat,
body.dark .srvh-card,
body.dark .srvh-card .card-header { background: #1d1e26; }
body.dark .srvh-card .card-header { border-bottom-color: rgba(255,255,255,.08); }
body.dark .srvh-card .card-header .srvh-now,
body.dark .srvh-card .card-header strong,
body.dark .srvh-stat .srvh-value,
body.dark .srvh-svc .srvh-svc-label,
body.dark .srvh-mount .srvh-mount-path,
body.dark .srvh-info .srvh-info-row .srvh-info-val { color: #dfdfdf; }
body.dark .srvh-svc,
body.dark .srvh-mount,
body.dark .srvh-info .srvh-info-row,
body.dark .srvh-proc-tbl td,
body.dark .srvh-log-tbl td { border-bottom-color: rgba(255,255,255,.08); }
body.dark .srvh-proc-tbl thead,
body.dark .srvh-log-tbl thead,
body.dark .srvh-log-empty { background: rgba(255,255,255,.04); }
body.dark .srvh-proc-tbl th,
body.dark .srvh-log-tbl th { border-bottom-color: rgba(255,255,255,.1); }
body.dark .srvh-stat .progress,
body.dark .srvh-mount .progress { background: rgba(255,255,255,.08); }
body.dark .srvh-skel { background: linear-gradient(90deg, #26272f 0%, #33343d 50%, #26272f 100%); background-size: 200% 100%; }

/* ── Clickable things say so ───────────────────────────────────────────────
   The theme gives a pointer to buttons and links but not to the controls it
   builds out of a label or a div, so a toggle, a dropdown or a card that
   opens a dialog all sat under a text caret. Field labels are deliberately
   left alone: a caret over "Email" is right, because clicking it only moves
   focus into the box beneath. */
.switch,
.switch .switch-state,
.row-actions li,
select.form-select,
select.form-control,
input[type="checkbox"],
input[type="radio"],
label:has(input[type="checkbox"]),
label:has(input[type="radio"]),
/* A field whose control is a switch: the caption toggles it, so it is as
   clickable as the switch itself. */
.form-group:has(.switch) > label,
.payment-card .contain,
[data-bs-toggle="modal"],
[data-bs-toggle="tab"],
[data-bs-toggle="pill"] {
    cursor: pointer;
}

/* A media tile is picked by clicking its thumbnail — the checkbox that does
   the work is a sibling, so the label needs saying for itself. */
.media-card > label {
    cursor: pointer;
}

.media-card > input:disabled + label {
    cursor: not-allowed;
}

/* A control nobody can use should not invite a click. */
.switch input:disabled ~ .switch-state,
select:disabled,
input:disabled {
    cursor: not-allowed;
}
