/* Kochi Taxi CRM — small custom layer on top of Tailwind */
[x-cloak] { display: none !important; }

/* ---------------------------------------------------------------------------
   Responsive tables (§ mobile optimisation).
   >= 640px (sm): the real table renders as before.
   < 640px: each row becomes a card; each cell shows its column name from
   data-label, so nothing is clipped or needs sideways scrolling.
--------------------------------------------------------------------------- */
@media (max-width: 639px) {
    .rtable thead { display: none; }
    .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
    .rtable tr {
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        margin: 0 0 0.75rem;
        padding: 0.25rem 0;
    }
    .rtable td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        padding: 0.45rem 0.9rem;
        text-align: right;
        border: 0;
        white-space: normal;
    }
    .rtable td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-weight: 600;
        color: #64748b;
        text-align: left;
    }
    .rtable td.no-label::before,
    .rtable td[colspan]::before { content: none; }
    .rtable td[colspan] { display: block; text-align: center; }
    /* Rows that are a card header: full-width, left-aligned, no label */
    .rtable td.card-head { display: block; text-align: left; font-weight: 600; }
    .rtable td.card-head::before { content: none; }

    /* Form grids (modals / builders): stack to one column on phones.
       .form-grid is added to a `grid grid-cols-2/3` block; children with
       col-span-2 then become full-width single-column rows. */
    .form-grid { grid-template-columns: 1fr !important; }
    .form-grid > .col-span-2,
    .form-grid > .col-span-3 { grid-column: auto !important; }
}

/* ---------------------------------------------------------------------------
   Header notification panel.
   The bell is NOT at the screen edge (profile name / role / Logout sit to its
   right), so an absolutely-positioned 320px popover runs off the left of a
   phone (measured left = -144px at 375px). Phones get a viewport-anchored
   sheet below the header; >= 640px keeps the desktop popover.
--------------------------------------------------------------------------- */
.notif-panel {
    position: fixed;
    left: 0.5rem;
    right: 0.5rem;
    top: 4rem;
}
@media (min-width: 640px) {
    .notif-panel {
        position: absolute;
        left: auto;
        right: 0;
        top: auto;
        margin-top: 0.5rem;
        width: 20rem;
        max-width: 90vw;
    }
}

/* booking-confirmation content (imported from the agents portal) — HTML lists
   rendered inside the confirmed-booking modal (admin + guest). PLAN §6f. */
.confirm-content ul { list-style: disc; padding-left: 1.25rem; margin: 0.35rem 0; }
.confirm-content ul ul { list-style: circle; margin: 0.2rem 0; }
.confirm-content li { margin: 0.15rem 0; }
.confirm-content p { margin: 0.4rem 0; }
.confirm-content strong { font-weight: 600; color: #334155; }

/* ---------------------------------------------------------------------------
   Trip pages (§6e): keep the REAL TABLE at every screen width.
   The phone card-collapse above is skipped for `.rtable--table` — on narrow
   screens the wrapper scrolls sideways instead. Owner 2026-10.
--------------------------------------------------------------------------- */
@media (max-width: 639px) {
    .rtable.rtable--table { display: table; min-width: 820px; }
    .rtable.rtable--table thead { display: table-header-group; }
    .rtable.rtable--table tbody { display: table-row-group; }
    .rtable.rtable--table tr {
        display: table-row;
        border: 0; border-radius: 0; margin: 0; padding: 0;
    }
    .rtable.rtable--table td {
        display: table-cell;
        width: auto;
        padding: 0.75rem 1rem;
        text-align: left;
        border: 0;
        white-space: nowrap;
    }
    .rtable.rtable--table td::before { content: none; }
    .rtable.rtable--table td.card-head { display: table-cell; text-align: left; }
}

/* ---------------------------------------------------------------------------
   Form fields — visible by default (owner 2026-10).
   The panel forms are dense: labels were 12px pale grey and controls gave no
   focus cue, so fields were easy to miss while scanning. Labels are upgraded
   in markup (text-sm / slate-700); this adds one consistent, obvious focus
   state and placeholder colour to every control. Public pages set their own
   amber focus with Tailwind utilities, which win on specificity.
   (Deliberately a single low-specificity layer so Tailwind utilities override.)
--------------------------------------------------------------------------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]),
select,
textarea {
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #818cf8;                       /* indigo-400 */
    box-shadow: 0 0 0 3px rgba(129, 140, 248, .20);
}
input::placeholder,
textarea::placeholder { color: #94a3b8; }        /* slate-400 */

/* Disabled / read-only fields must look flat — never like an editable box. */
input:disabled, select:disabled, textarea:disabled,
input[readonly] {
    background-color: #f1f5f9;                   /* slate-100 */
    color: #475569;                              /* slate-600 */
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Date & time controls — make the picker obvious and easy to hit (owner 2026-10).
   The native calendar/clock indicator is a tiny, faint glyph at the right edge
   of the field; users missed it and couldn't tell the field was a picker at all.
   We hide that glyph and stretch an invisible hit-area across the whole field,
   so clicking anywhere opens the picker. Each date field also carries a visible
   calendar icon in the markup and echoes the chosen date in words beneath it.
--------------------------------------------------------------------------- */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    position: relative;
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;                                  /* hide the faint native glyph */
    cursor: pointer;
}
/* NOTE: left padding for the visible icon is NOT set here — it is applied with
   the Tailwind `pl-11` utility only on the fields that actually render an icon,
   so the panel's plain date fields keep their normal padding. */

/* The required marker used on labels (public forms and panel forms). */
.req { color: #e11d48; }                         /* rose-600 */

/* ---------------------------------------------------------------------------
   Notification arrival alert (bell swing + badge pop).
   Fired by the bell when the polled unread count genuinely rises. The alert
   tone itself lives in JS (Web Audio, includes/header.php). Motion is dropped
   for prefers-reduced-motion; the tone is unaffected.
--------------------------------------------------------------------------- */
@keyframes kt-ring {
    0%, 100% { transform: rotate(0deg); }
    15%      { transform: rotate(14deg); }
    30%      { transform: rotate(-12deg); }
    45%      { transform: rotate(9deg); }
    60%      { transform: rotate(-6deg); }
    75%      { transform: rotate(3deg); }
}
.kt-ring { animation: kt-ring 0.9s ease-in-out; transform-origin: 50% 15%; }

@keyframes kt-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.45); }
    100% { transform: scale(1); }
}
.kt-pop { animation: kt-pop 0.55s ease-out; }

@media (prefers-reduced-motion: reduce) {
    .kt-ring, .kt-pop { animation: none !important; }
}
