/*
 * Okema dashboard theme.
 * Plain CSS on top of the compiled Tailwind build (there is no Node on the
 * server to rebuild it), scoped to .ok-dash so the client website is untouched.
 */

.ok-dash {
    --ok-primary: #ff6c36;
    --ok-primary-dark: #d94610;
    --ok-primary-soft: #fff1eb;
    --ok-ink: #17181a;
    --ok-muted: #6f6a64;
    --ok-bg: #f6f4f1;
    --ok-surface: #ffffff;
    --ok-line: #ebe7e2;
    --ok-sidebar: #121314;
    --ok-sidebar-line: #232427;
    --ok-sidebar-text: #a7a29c;
    --ok-success: #1f8a5b;
    --ok-success-soft: #e7f5ee;
    --ok-danger: #c8382c;
    --ok-danger-soft: #fdecea;
    --ok-shadow: 0 1px 2px rgba(23, 24, 26, .04), 0 8px 24px rgba(23, 24, 26, .06);

    font-family: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, sans-serif;
    color: var(--ok-ink);
    background: var(--ok-bg);
    min-height: 100vh;
}

.dark .ok-dash {
    --ok-primary-soft: rgba(255, 108, 54, .14);
    --ok-ink: #f2efeb;
    --ok-muted: #a29d97;
    --ok-bg: #0d0e0f;
    --ok-surface: #17181a;
    --ok-line: #26272a;
    --ok-sidebar: #0a0a0b;
    --ok-success-soft: rgba(31, 138, 91, .16);
    --ok-danger-soft: rgba(200, 56, 44, .16);
    --ok-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

.ok-main { padding: 1rem 0 3rem; }

.ok-dash .min-h-screen.bg-gray-100,
.dark .ok-dash .min-h-screen { background: var(--ok-bg); }

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

.ok-dash .ok-sidebar {
    background: var(--ok-sidebar);
    color: var(--ok-sidebar-text);
    width: 16rem;
    max-width: 16rem;
    border-radius: 1.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
    scrollbar-width: thin;
    scrollbar-color: #2c2d30 transparent;
}

.ok-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--ok-sidebar-line);
    margin-bottom: .75rem;
}

.ok-brand-mark {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .8rem;
    background: linear-gradient(135deg, var(--ok-primary), var(--ok-primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 0 6px 16px rgba(255, 108, 54, .35);
}

.ok-brand { flex-direction: column; align-items: flex-start; gap: .35rem; }
.ok-brand-logo { height: 2.4rem; width: auto; }

.ok-link { color: var(--ok-primary-dark); font-weight: 600; }
.ok-changes { display: grid; gap: .2rem; font-size: .78rem; }
.ok-changes b { font-weight: 600; }
.ok-from { color: var(--ok-danger); text-decoration: line-through; }
.ok-to { color: var(--ok-success); font-weight: 600; }
.ok-details summary { cursor: pointer; color: var(--ok-primary-dark); font-size: .75rem; margin-top: .25rem; }
.ok-details pre {
    margin-top: .4rem;
    padding: .6rem .75rem;
    max-height: 16rem;
    overflow: auto;
    background: var(--ok-bg);
    border-radius: .5rem;
    font-size: .72rem;
    white-space: pre-wrap !important;
    text-align: left;
}

.ok-brand-name { color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; line-height: 1.2; }
.ok-brand-sub { color: var(--ok-sidebar-text); font-size: .72rem; }

.ok-nav-group { padding: .25rem .75rem .5rem; }

.ok-nav-label {
    padding: .75rem .75rem .4rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: #6c6863;
}

.ok-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    margin: 2px 0;
    border-radius: .7rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--ok-sidebar-text);
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}

.ok-nav-link i { width: 1.1rem; text-align: center; font-size: .9rem; opacity: .85; }
.ok-nav-link:hover { background: #1c1d20; color: #fff; }

.ok-nav-link.is-active {
    background: linear-gradient(135deg, var(--ok-primary), var(--ok-primary-dark));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(255, 108, 54, .28);
}

.ok-nav-link.is-active i { opacity: 1; }

/* ---------- Top bar ---------- */

.ok-dash nav .rounded-full.border-2 {
    border: 1px solid var(--ok-line);
    background: var(--ok-surface);
    color: var(--ok-ink);
    box-shadow: var(--ok-shadow);
}

.ok-dash nav .rounded-full.border-2:hover {
    border-color: var(--ok-primary);
    background: var(--ok-primary-soft);
}

.ok-dash nav .rounded-full.border-2 button { background: transparent; color: inherit; }

/* ---------- Brand colour instead of indigo ---------- */

.ok-dash .bg-indigo-500,
.ok-dash .bg-indigo-600 { background-color: var(--ok-primary); }
.ok-dash .hover\:bg-indigo-600:hover,
.ok-dash .hover\:bg-indigo-700:hover { background-color: var(--ok-primary-dark); }
.ok-dash .bg-indigo-50,
.ok-dash .hover\:bg-indigo-50:hover,
.ok-dash .hover\:bg-indigo-100:hover { background-color: var(--ok-primary-soft); }
.ok-dash .text-indigo-500,
.ok-dash .text-indigo-600,
.ok-dash .text-indigo-700 { color: var(--ok-primary-dark); }
.ok-dash .border-indigo-400,
.ok-dash .border-indigo-500 { border-color: var(--ok-primary); }

.ok-dash input:not([type=checkbox]):not([type=radio]),
.ok-dash select,
.ok-dash textarea {
    border-radius: .7rem;
    border-color: var(--ok-line);
}

.ok-dash input:focus,
.ok-dash select:focus,
.ok-dash textarea:focus {
    border-color: var(--ok-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 108, 54, .18) !important;
    outline: none;
}

.ok-dash input[type=checkbox]:checked,
.ok-dash input[type=radio]:checked { background-color: var(--ok-primary); border-color: var(--ok-primary); }

.ok-dash button[type=submit],
.ok-dash .ok-btn {
    border-radius: .7rem;
    font-weight: 600;
}

/* ---------- Cards and tables ---------- */

.ok-dash main .bg-white,
.ok-dash main .dark\:bg-gray-800 {
    border-radius: 1rem;
}

.ok-dash main .bg-white { background: var(--ok-surface); }
.ok-dash main .shadow,
.ok-dash main .shadow-sm,
.ok-dash main .shadow-md,
.ok-dash main .shadow-xl { box-shadow: var(--ok-shadow); }

.ok-dash main table { border-collapse: separate; border-spacing: 0; }

.ok-dash main table thead th {
    background: #faf8f6;
    color: var(--ok-muted);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    border-bottom: 1px solid var(--ok-line);
}

.dark .ok-dash main table thead th { background: #1c1d20; }

.ok-dash main table tbody tr { transition: background-color .12s; }
.ok-dash main table tbody tr:hover { background: var(--ok-primary-soft); }
.ok-dash main table tbody td { border-color: var(--ok-line); }

/* ---------- Home page ---------- */

.ok-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    padding: 1.75rem 2rem;
    background: radial-gradient(120% 140% at 0% 0%, #2a1d17 0%, #141516 55%, #0e0f10 100%);
    color: #fff;
    box-shadow: var(--ok-shadow);
}

.ok-hero::after {
    content: "";
    position: absolute;
    inset-inline-start: -4rem;
    top: -4rem;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 108, 54, .45), transparent 70%);
}

.ok-hero h1 { font-size: 1.6rem; font-weight: 700; position: relative; }
.ok-hero p { color: #c9c3bc; margin-top: .35rem; position: relative; }

.ok-hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; position: relative; }

.ok-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.1rem;
    font-size: .875rem;
    transition: background-color .15s, transform .15s;
}

.ok-btn-primary { background: var(--ok-primary); color: #fff; }
.ok-btn-primary:hover { background: var(--ok-primary-dark); }
.ok-btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .14); }
.ok-btn-ghost:hover { background: rgba(255, 255, 255, .16); }

.ok-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.ok-stat {
    background: var(--ok-surface);
    border: 1px solid var(--ok-line);
    border-radius: 1rem;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--ok-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ok-stat-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: .9rem;
    background: var(--ok-primary-soft);
    color: var(--ok-primary-dark);
    font-size: 1.1rem;
}

.ok-stat-icon.is-success { background: var(--ok-success-soft); color: var(--ok-success); }
.ok-stat-icon.is-danger { background: var(--ok-danger-soft); color: var(--ok-danger); }
.ok-stat-icon.is-ink { background: #f0eeeb; color: var(--ok-ink); }
.dark .ok-stat-icon.is-ink { background: #222326; }

.ok-stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ok-stat-label { color: var(--ok-muted); font-size: .8rem; margin-top: .15rem; }

.ok-card {
    background: var(--ok-surface);
    border: 1px solid var(--ok-line);
    border-radius: 1rem;
    box-shadow: var(--ok-shadow);
    margin-top: 1.25rem;
    overflow: hidden;
}

.ok-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ok-line);
}

.ok-card-head h2 { font-weight: 700; font-size: 1rem; }
.ok-card-head a { color: var(--ok-primary-dark); font-size: .85rem; font-weight: 600; }

.ok-table { width: 100%; font-size: .875rem; }
.ok-table th { text-align: start; padding: .7rem 1.25rem; }
.ok-table td { padding: .8rem 1.25rem; border-top: 1px solid var(--ok-line); }
.ok-table td.ok-muted { color: var(--ok-muted); }

.ok-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--ok-primary-soft);
    color: var(--ok-primary-dark);
}

.ok-badge::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.ok-badge.is-success { background: var(--ok-success-soft); color: var(--ok-success); }
.ok-badge.is-danger { background: var(--ok-danger-soft); color: var(--ok-danger); }

.ok-empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--ok-muted); }

/* ---------- Page header, tabs, layout ---------- */

.ok-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ok-page-title { display: flex; align-items: center; gap: .9rem; }
.ok-page-title h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.ok-page-title p { color: var(--ok-muted); font-size: .875rem; margin-top: .2rem; }
.ok-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

.ok-btn-soft { background: var(--ok-surface); color: var(--ok-ink); border: 1px solid var(--ok-line); }
.ok-btn-soft:hover { border-color: var(--ok-primary); color: var(--ok-primary-dark); background: var(--ok-primary-soft); }
.ok-btn-sm { padding: .4rem .8rem; font-size: .8rem; }

.ok-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .35rem;
    margin-bottom: 1rem;
    background: var(--ok-surface);
    border: 1px solid var(--ok-line);
    border-radius: .9rem;
    width: fit-content;
    max-width: 100%;
}

.ok-tab {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .9rem;
    border-radius: .65rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ok-muted);
}

.ok-tab:hover { color: var(--ok-ink); background: var(--ok-bg); }
.ok-tab.is-active { background: var(--ok-ink); color: #fff; }
.dark .ok-dash .ok-tab.is-active { background: var(--ok-primary); }

.ok-tab-count {
    min-width: 1.6rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: rgba(127, 120, 112, .14);
    font-size: .72rem;
    text-align: center;
}

.ok-tab.is-active .ok-tab-count { background: rgba(255, 255, 255, .18); }

.ok-card-body { padding: 1.25rem; }
.ok-card-title { font-weight: 700; font-size: .95rem; margin-bottom: .9rem; }
.ok-muted { color: var(--ok-muted); }
.ok-small { font-size: .8rem; }
.ok-cell-main { font-weight: 600; }
.ok-cell-sub { color: var(--ok-muted); font-size: .78rem; }

.ok-split { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.25rem; align-items: start; }
.ok-split > .ok-card { margin-top: 0; }
.ok-side { display: grid; gap: 1.25rem; }
.ok-side > .ok-card { margin-top: 0; }
.ok-narrow { max-width: 46rem; }
.ok-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.ok-form { display: grid; gap: 1.25rem; }
.ok-form .ok-card { margin: 0; }
.ok-form-actions { display: flex; justify-content: flex-end; padding-top: .5rem; border-top: 1px solid var(--ok-line); }
.ok-field { display: grid; gap: .5rem; }
.ok-label { font-size: .875rem; font-weight: 600; }

.ok-dash label > span:first-child,
.ok-dash .ok-form label { font-weight: 600; }

.ok-segment { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.ok-segment label {
    display: inline-flex;
    align-items: center;
    padding: .5rem 1rem;
    border: 1px solid var(--ok-line);
    border-radius: .7rem;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    color: var(--ok-muted);
    background: var(--ok-surface);
}
.ok-segment input { position: absolute; opacity: 0; pointer-events: none; }
.ok-segment label.is-on { border-color: var(--ok-primary); background: var(--ok-primary-soft); color: var(--ok-primary-dark); }
.ok-segment label.is-on.is-success { border-color: var(--ok-success); background: var(--ok-success-soft); color: var(--ok-success); }
.ok-segment label.is-on.is-danger { border-color: var(--ok-danger); background: var(--ok-danger-soft); color: var(--ok-danger); }

.ok-part-row { display: grid; grid-template-columns: minmax(0, 1fr) 7rem auto; gap: .6rem; align-items: end; }
.ok-icon-btn {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: .7rem;
    border: 1px solid var(--ok-line);
    color: var(--ok-danger);
    background: var(--ok-surface);
}
.ok-icon-btn:hover { background: var(--ok-danger-soft); }

.ok-parts { display: grid; gap: .35rem; }
.ok-parts li {
    display: flex;
    justify-content: space-between;
    padding: .55rem .8rem;
    border-radius: .6rem;
    background: var(--ok-bg);
    font-size: .875rem;
}

.ok-person { display: flex; align-items: center; gap: .8rem; }
.ok-avatar {
    display: grid;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ok-primary), var(--ok-primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}
.ok-contact { display: flex; gap: .5rem; margin-top: .9rem; }
.ok-contact .fa-whatsapp { color: #1fa855; }

.ok-info { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--ok-line); font-size: .875rem; }
.ok-info dt { color: var(--ok-muted); }
.ok-info dd { font-weight: 600; text-align: end; }

.ok-note { white-space: pre-line; font-size: .875rem; line-height: 1.7; background: var(--ok-bg); border-radius: .7rem; padding: .8rem 1rem; }

.ok-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.ok-photos a { display: grid; gap: .3rem; text-align: center; font-size: .75rem; color: var(--ok-muted); }
.ok-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .7rem; border: 1px solid var(--ok-line); background: var(--ok-bg); }

.ok-stats-tight { margin-top: 0; margin-bottom: 1.25rem; }

.ok-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem;
    align-items: end;
    margin: 0 0 1.25rem;
    overflow: visible;
}
.ok-filters-actions { display: flex; gap: .5rem; }

/* Splade tables inside .ok-table-wrap become one card */
.ok-table-wrap table { width: 100%; font-size: .875rem; }
.ok-table-wrap table td { vertical-align: middle; }
.ok-table-wrap nav[aria-label] a,
.ok-table-wrap nav[aria-label] span { border-radius: .55rem; }
.ok-table-wrap input[type=search],
.ok-table-wrap input[name^=searchInput] { min-width: 18rem; }

/* Tables that must fit the page: no sideways scroll, long text wraps. */
.ok-stack { display: flex; flex-direction: column; gap: .1rem; }
.ok-fit table { table-layout: fixed; width: 100% !important; min-width: 0 !important; }
.ok-fit .overflow-x-auto { overflow-x: visible; }
.ok-fit table th,
.ok-fit table td {
    white-space: normal !important;
    overflow-wrap: break-word;   /* wrap between words; split a word only if it can't fit at all */
    padding-inline: .5rem !important;
    font-size: .8rem;
}
.ok-fit table th { line-height: 1.3; }
.ok-fit table th *,
.ok-fit table td * { white-space: normal !important; }
.ok-fit .ok-clamp { white-space: pre-line !important; line-height: 1.5; }
.ok-fit .ok-btn,
.ok-fit .ok-badge,
.ok-fit .ok-row-link,
.ok-fit .ok-btn *,
.ok-fit .ok-badge * { white-space: nowrap !important; overflow-wrap: normal; }

/* Orders: narrow "#" first column and action last column */
.ok-orders table th:first-child,
.ok-orders table td:first-child { width: 3.5rem; }
.ok-orders table th:last-child,
.ok-orders table td:last-child { width: 9.5rem; }

/* Orders list: one button for the next stage, with «فتح» under it */
.ok-quick-stages { display: grid; grid-template-columns: 1fr; gap: .3rem; }
.ok-qs {
    display: flex; align-items: center; justify-content: center; gap: .3rem; height: 1.95rem; padding: 0 .45rem;
    border-radius: .55rem; border: 1px solid var(--ok-line); background: var(--ok-surface);
    color: var(--ok-muted); font-size: .74rem; font-weight: 600; transition: all .12s; white-space: nowrap !important;
}
.ok-qs i { font-size: .78rem; }
.ok-qs.is-next, .ok-qs.is-next:hover { border-color: var(--ok-primary); color: #fff; background: var(--ok-primary); }
.ok-qs.is-next:hover { filter: brightness(.95); }
.ok-qs.is-open { color: var(--ok-ink); }
.ok-qs.is-silent { color: #1d7a46; }
.ok-qs.is-silent:hover { border-color: #1d7a46; color: #1d7a46; background: #e7f6ec; }
.ok-qs.is-open:only-child { grid-column: 1 / -1; }
.ok-qs:hover { border-color: var(--ok-primary); color: var(--ok-primary-dark); background: var(--ok-primary-soft); transform: translateY(-1px); }
.ok-qs.is-progress:hover { border-color: #2456b5; color: #2456b5; background: #eaf1fd; }
.ok-qs.is-ready:hover { border-color: #b88600; color: #8a6100; background: #fff5d6; }
.ok-qs.is-success:hover { border-color: var(--ok-success); color: var(--ok-success); background: var(--ok-success-soft); }
.ok-qs.is-on { color: #fff; cursor: default; }
.ok-qs.is-on.is-progress { background: #2456b5; border-color: #2456b5; }
.ok-qs.is-on.is-ready { background: #e0a100; border-color: #e0a100; }
.ok-qs.is-on.is-success { background: var(--ok-success); border-color: var(--ok-success); }
/* The closed phone sidebar sits off-screen; don't let it widen the page (it made phones zoom out). */
html:has(.ok-dash), body:has(.ok-dash) { overflow-x: hidden; }

/* Field labels inside order cells: only on phones, where rows become cards */
.ok-ml { display: none; }
.ok-tel { color: inherit; }

@media (max-width: 760px) {
    .ok-orders table, .ok-orders tbody, .ok-orders tr, .ok-orders td { display: block; width: 100% !important; }
    .ok-orders thead { display: none; }
    .ok-orders tr {
        position: relative; margin: 0 0 .8rem; padding: .7rem .2rem .5rem; border: 1px solid var(--ok-line);
        border-radius: .9rem; background: var(--ok-surface) !important; box-shadow: 0 1px 2px rgba(23, 24, 26, .04);
    }
    .ok-orders td { border: 0 !important; padding: .2rem .75rem !important; font-size: .85rem; }
    .ok-orders td:empty { display: none; }
    .ok-orders .ok-ml { display: inline-block; min-width: 6.2rem; color: var(--ok-muted); font-size: .75rem; }
    .ok-orders .ok-clamp { display: inline; }
    /* Order number and status float on the card's top corners */
    .ok-orders td:first-child { position: absolute; top: .65rem; inset-inline-end: .2rem; width: auto !important; }
    .ok-orders td:nth-child(2) .ok-cell-main { font-size: 1rem; }
    .ok-orders td:last-child { margin-top: .4rem; padding-top: .6rem !important; border-top: 1px dashed var(--ok-line) !important; }
    .ok-orders .ok-quick-stages { grid-template-columns: 2fr 1fr; }
    .ok-orders .ok-qs { height: 2.4rem; font-size: .8rem; }
    .ok-tel { color: var(--ok-primary-dark); font-weight: 600; }
}

/* Splade filter / column menus above the sidebar, never clipped */
.ok-dash [dusk="filters-dropdown"] + div, .ok-dash [dusk="filters-dropdown"] ~ div { z-index: 1200; }

/* Warranty requests: name column wide enough, buttons side by side */
.ok-requests table th:first-child,
.ok-requests table td:first-child { width: 16%; }
.ok-requests table th:last-child,
.ok-requests table td:last-child { width: 11.5rem; }
.ok-requests .ok-row-actions { flex-wrap: nowrap; }

.ok-map { height: 22rem; border-radius: .8rem; border: 1px solid var(--ok-line); z-index: 0; }
.ok-form-actions .ok-btn-danger { padding: .6rem 1rem; }

/* Order stages */
.ok-badge.is-progress { background: #eaf1fd; color: #2456b5; }
.ok-badge.is-ready { background: #fff5d6; color: #8a6100; }
.dark .ok-dash .ok-badge.is-progress { background: rgba(36, 86, 181, .2); color: #8fb0ef; }
.dark .ok-dash .ok-badge.is-ready { background: rgba(138, 97, 0, .25); color: #f0c95a; }

.ok-stages { display: flex; flex-wrap: wrap; gap: .4rem; }
.ok-stage {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .55rem .9rem; border: 1px solid var(--ok-line); border-radius: .7rem;
    background: var(--ok-surface); color: var(--ok-muted);
    font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
.ok-stage input { position: absolute; opacity: 0; pointer-events: none; }
.ok-stage:hover { border-color: var(--ok-primary); color: var(--ok-ink); }
.ok-stage.is-on { border-color: var(--ok-primary); background: var(--ok-primary-soft); color: var(--ok-primary-dark); }
.ok-stage.is-progress.is-on { border-color: #2456b5; background: #eaf1fd; color: #2456b5; }
.ok-stage.is-ready.is-on { border-color: #b88600; background: #fff5d6; color: #8a6100; }
.ok-stage.is-success.is-on { border-color: var(--ok-success); background: var(--ok-success-soft); color: var(--ok-success); }
.ok-stage.is-cancel { margin-inline-start: auto; }
.ok-stage.is-danger.is-on { border-color: var(--ok-danger); background: var(--ok-danger-soft); color: var(--ok-danger); }

.ok-timeline { display: grid; gap: .9rem; position: relative; }
.ok-timeline li { display: flex; gap: .75rem; align-items: flex-start; position: relative; }
.ok-timeline li:not(:last-child)::before {
    content: ""; position: absolute; inset-inline-start: .95rem; top: 2rem; bottom: -.9rem;
    border-inline-start: 2px dashed var(--ok-line);
}
.ok-timeline-dot {
    flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
    background: var(--ok-primary-soft); color: var(--ok-primary-dark); font-size: .75rem;
}
.ok-timeline-dot.is-progress { background: #eaf1fd; color: #2456b5; }
.ok-timeline-dot.is-ready { background: #fff5d6; color: #8a6100; }
.ok-timeline-dot.is-success { background: var(--ok-success-soft); color: var(--ok-success); }
.ok-timeline-dot.is-danger { background: var(--ok-danger-soft); color: var(--ok-danger); }

.ok-nav-badge {
    margin-inline-start: auto; min-width: 1.5rem; padding: 0 .4rem; border-radius: 999px;
    background: var(--ok-primary); color: #fff; font-size: .7rem; font-weight: 700; text-align: center; line-height: 1.4rem;
}
.ok-nav-link.is-active .ok-nav-badge { background: #fff; color: var(--ok-primary-dark); }

/* Alerts bell */
.ok-bell { position: relative; }
.ok-bell-count {
    position: absolute; top: -.35rem; inset-inline-end: -.35rem; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem;
    border-radius: 99px; background: var(--ok-danger); color: #fff; font-size: .68rem; font-weight: 700; line-height: 1.25rem; text-align: center;
    box-shadow: 0 0 0 2px var(--ok-surface);
}
.ok-bell-menu { width: 21rem; max-width: 92vw; margin-top: .5rem; background: var(--ok-surface); border: 1px solid var(--ok-line); border-radius: .9rem; box-shadow: 0 18px 40px rgba(0, 0, 0, .12); overflow: hidden; }
.ok-bell-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--ok-line); }
.ok-bell-item { display: flex; gap: .7rem; padding: .7rem 1rem; border-bottom: 1px solid var(--ok-line); font-size: .85rem; }
.ok-bell-item > span:last-child { display: grid; gap: .1rem; }
.ok-bell-item:hover { background: var(--ok-primary-soft); }
.ok-bell-item.is-unread { background: #fff8f4; }
.ok-bell-item.is-unread b::after { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-inline-start: .35rem; border-radius: 50%; background: var(--ok-primary); vertical-align: middle; }
.ok-bell-icon { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .6rem; background: var(--ok-primary-soft); color: var(--ok-primary-dark); }

/* Message templates */
.ok-section-title { font-weight: 700; font-size: 1rem; margin: 1.25rem 0 .7rem; color: var(--ok-muted); }
.ok-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .9rem; }
.ok-tpl { margin: 0; padding: 1rem; display: flex; gap: .8rem; align-items: flex-start; }
.ok-tpl-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ok-tpl-edit > .ok-card { margin: 0; }
.ok-tpl-preview { position: sticky; top: 1rem; overflow: hidden; }
.ok-tpl-preview-head { padding: .7rem 1rem; font-weight: 700; font-size: .85rem; border-bottom: 1px solid var(--ok-line); background: #faf8f6; }
.ok-tpl-preview iframe { width: 100%; height: 78vh; border: 0; background: #f4f2ef; }
.ok-sms-bubble { margin: 1.25rem; padding: .9rem 1.1rem; max-width: 22rem; border-radius: 1.1rem 1.1rem 1.1rem .3rem; background: #e9e9eb; color: #111; line-height: 1.7; font-size: .95rem; white-space: pre-wrap; }
.ok-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ok-chip { padding: .25rem .6rem; border: 1px dashed var(--ok-primary); border-radius: 99px; background: var(--ok-primary-soft); color: var(--ok-primary-dark); font-size: .75rem; font-weight: 700; cursor: pointer; }
.ok-chip:hover { background: var(--ok-primary); color: #fff; }
@media (max-width: 1100px) { .ok-tpl-edit { grid-template-columns: 1fr; } .ok-tpl-preview { position: static; } }

/* Reason picker (refuse warranty / cancel order) */
.ok-modal { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: 1rem; background: rgba(10, 10, 12, .55); }
.ok-modal[hidden] { display: none; }
.ok-modal-box { width: 100%; max-width: 28rem; display: grid; gap: .6rem; padding: 1.4rem; background: var(--ok-surface); border-radius: 1rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.ok-modal-box h3 { font-weight: 700; font-size: 1.05rem; }
.ok-modal-box h3 i { color: var(--ok-danger); }
.ok-modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .3rem; }
.ok-reason { display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; border: 1px solid var(--ok-line); border-radius: .7rem; cursor: pointer; font-weight: 600; font-size: .9rem; }
.ok-reason:hover { border-color: var(--ok-primary); }
.ok-reason input { accent-color: var(--ok-danger); }
.ok-reason:has(input:checked) { border-color: var(--ok-danger); background: var(--ok-danger-soft); color: var(--ok-danger); }
.ok-reason kbd { display: inline-block; min-width: 1.3rem; padding: 0 .3rem; border: 1px solid var(--ok-line); border-radius: .3rem; font: 600 .72rem/1.4 ui-monospace, monospace; text-align: center; color: var(--ok-muted); background: var(--ok-surface); }
.ok-cancel-reasons { display: grid; gap: .4rem; margin-top: .6rem; padding: .8rem; border-radius: .8rem; background: var(--ok-danger-soft); }

/* Settings */
.ok-settings { display: grid; gap: 1.25rem; max-width: 56rem; }
.ok-settings .ok-card { margin: 0; }
.ok-card-title i { color: var(--ok-primary-dark); margin-inline-end: .35rem; }
.ok-switch { display: flex; align-items: flex-start; gap: .8rem; cursor: pointer; line-height: 1.6; }
.ok-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ok-switch-ui { flex: none; position: relative; width: 2.8rem; height: 1.6rem; border-radius: 99px; background: #d9d4ce; transition: background-color .15s; margin-top: .15rem; }
.ok-switch-ui::after { content: ""; position: absolute; top: .2rem; inset-inline-start: .2rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: inset-inline-start .15s; }
.ok-switch input:checked + .ok-switch-ui { background: var(--ok-success); }
.ok-switch input:checked + .ok-switch-ui::after { inset-inline-start: 1.4rem; }
.ok-advanced summary { cursor: pointer; font-weight: 700; color: var(--ok-muted); }
.ok-advanced[open] summary { margin-bottom: 1rem; color: var(--ok-ink); }
.ok-settings-save { position: sticky; bottom: 1rem; display: flex; justify-content: flex-end; }
.ok-settings-save button { box-shadow: 0 8px 24px rgba(255, 108, 54, .35); }

/* Roles and permissions */
.ok-meter { height: .45rem; border-radius: 99px; background: var(--ok-bg); overflow: hidden; }
.ok-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok-primary), var(--ok-primary-dark)); border-radius: 99px; }
.ok-perm { overflow-x: auto; }
.ok-perm-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; gap: .5rem; }
.ok-perm-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.ok-perm-table th { background: #faf8f6; color: var(--ok-muted); font-size: .75rem; font-weight: 700; padding: .7rem .6rem; text-align: center; border-bottom: 1px solid var(--ok-line); }
.ok-perm-table th:first-child { text-align: start; }
.ok-perm-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--ok-line); text-align: center; vertical-align: middle; }
.ok-perm-table tr:hover td { background: var(--ok-primary-soft); }
.ok-perm-table td.ok-perm-area { text-align: start; font-weight: 700; white-space: nowrap; }
.ok-perm-area i { width: 1.2rem; color: var(--ok-primary-dark); }
.ok-perm-table td:nth-last-child(-n+2) { text-align: start; }
.ok-perm-box { display: inline-grid; cursor: pointer; }
.ok-perm-box input { position: absolute; opacity: 0; pointer-events: none; }
.ok-perm-box span {
    display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: .5rem;
    border: 1.5px solid var(--ok-line); background: var(--ok-surface); color: transparent; transition: all .12s;
}
.ok-perm-box:hover span { border-color: var(--ok-primary); }
.ok-perm-box input:checked + span { background: var(--ok-primary); border-color: var(--ok-primary); color: #fff; }
.ok-perm-chip { display: inline-flex; align-items: center; gap: .3rem; margin: .1rem; padding: .2rem .6rem; border: 1px solid var(--ok-line); border-radius: 99px; font-size: .78rem; cursor: pointer; white-space: nowrap; }
.ok-perm-chip input { accent-color: var(--ok-primary); }
.ok-role-chip { display: inline-block; margin: .1rem; padding: .1rem .55rem; border-radius: 99px; background: var(--ok-primary-soft); color: var(--ok-primary-dark); font-size: .72rem; font-weight: 700; white-space: nowrap; }

/* Map page */
.ok-map-tools { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 0 0 1rem; }
.ok-map-tools .ok-input { width: auto; min-width: 14rem; }
.ok-map-card { position: relative; margin: 0; overflow: hidden; }
#ok-big-map { height: 72vh; min-height: 30rem; z-index: 0; }
.ok-map-legend {
    position: absolute; bottom: 1rem; inset-inline-start: 1rem; z-index: 500; display: grid; gap: .25rem;
    padding: .7rem .9rem; background: rgba(255, 255, 255, .95); border-radius: .8rem; box-shadow: var(--ok-shadow);
    font-size: .75rem; color: #1d1e20;
}
.ok-map-legend > div { display: flex; align-items: center; gap: .45rem; }
.ok-pin {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); border: 2px solid #fff;
}
.ok-pin i { transform: rotate(45deg); font-size: 11px; }
.ok-map-legend .ok-pin { width: 18px; height: 18px; border-width: 1px; }
.ok-map-legend .ok-pin i { font-size: 8px; }
.ok-pin.is-bookable { background: #1f8a5b; }
.ok-pin.is-check { background: #ff6c36; }
.ok-pin.is-off { background: #8a847d; }
.ok-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.ok-dot.is-new, .ok-order-dot.is-new { background: #ff6c36; fill: #ff6c36; stroke: #fff; fill-opacity: .95; }
.ok-dot.is-received, .ok-order-dot.is-received,
.ok-dot.is-repairing, .ok-order-dot.is-repairing { background: #2456b5; fill: #2456b5; stroke: #fff; fill-opacity: .95; }
.ok-dot.is-ready, .ok-order-dot.is-ready { background: #e0a100; fill: #e0a100; stroke: #fff; fill-opacity: .95; }
.ok-dot.is-done, .ok-order-dot.is-done { background: #1f8a5b; fill: #1f8a5b; stroke: #fff; fill-opacity: .95; }
.ok-dot.is-canceled, .ok-order-dot.is-canceled { background: #c8382c; fill: #c8382c; stroke: #fff; fill-opacity: .95; }
.ok-pop { font-family: "IBM Plex Sans Arabic", sans-serif; direction: rtl; text-align: right; line-height: 1.7; min-width: 12rem; }
.ok-pop-tag { display: inline-block; padding: 0 .5rem; border-radius: 99px; font-size: .72rem; font-weight: 700; background: #fff1eb; color: #d94610; }
.ok-pop-tag.is-bookable, .ok-pop-tag.is-done { background: #e7f5ee; color: #1f8a5b; }
.ok-pop-tag.is-received, .ok-pop-tag.is-repairing { background: #eaf1fd; color: #2456b5; }
.ok-pop-tag.is-ready { background: #fff5d6; color: #8a6100; }
.ok-pop-tag.is-canceled, .ok-pop-tag.is-off { background: #fdecea; color: #c8382c; }
.ok-pop-links { margin-top: .35rem; }
.ok-pop-links a { color: #d94610; font-weight: 700; }

/* Warranty quick review */
.ok-input {
    width: 100%; padding: .55rem .8rem; border: 1px solid var(--ok-line); border-radius: .7rem;
    background: var(--ok-surface); color: var(--ok-ink); font-size: .85rem;
}
.ok-review-filters { display: grid; grid-template-columns: 2fr 1.3fr 1.1fr 1fr 1fr auto auto; gap: .6rem; align-items: end; margin: 0 0 1rem; }
.ok-date { display: grid; gap: .2rem; font-size: .72rem; color: var(--ok-muted); }
.ok-review-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.ok-review-bar-start, .ok-review-bar-end { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.ok-tabs-sm { margin: 0; padding: .25rem; }
.ok-tabs-sm .ok-tab { padding: .3rem .8rem; font-size: .8rem; }
.ok-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; cursor: pointer; }
.ok-btn:disabled { opacity: .5; cursor: not-allowed; }
.ok-shortcuts { font-size: .78rem; color: var(--ok-muted); margin-bottom: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.ok-shortcuts kbd {
    display: inline-block; min-width: 1.4rem; padding: .05rem .4rem; border: 1px solid var(--ok-line);
    border-bottom-width: 2px; border-radius: .35rem; background: var(--ok-surface); font: 600 .72rem/1.4 ui-monospace, monospace; text-align: center;
}

.ok-review-list { display: grid; gap: 1rem; }
.ok-review {
    display: grid; grid-template-columns: 22rem minmax(0, 1fr) 17rem; gap: 1.25rem; align-items: start;
    padding: 1rem; background: var(--ok-surface); border: 1px solid var(--ok-line); border-radius: 1rem;
    box-shadow: var(--ok-shadow); outline: none; transition: border-color .15s, box-shadow .15s, opacity .25s, transform .25s;
}
.ok-review.is-current { border-color: var(--ok-primary); box-shadow: 0 0 0 3px rgba(255, 108, 54, .18), var(--ok-shadow); }
.ok-review.is-busy { opacity: .55; pointer-events: none; }
.ok-review.is-gone { opacity: 0; transform: scale(.98); }

.ok-review-photos { display: grid; grid-template-columns: 1.4fr 1fr; gap: .5rem; }
.ok-photo-side { display: grid; gap: .5rem; }
.ok-photo {
    position: relative; display: block; width: 100%; overflow: hidden; border-radius: .7rem;
    border: 1px solid var(--ok-line); background: var(--ok-bg); cursor: zoom-in; padding: 0;
}
.ok-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ok-photo-main { aspect-ratio: 3 / 4; }
.ok-photo-main img { object-fit: contain; background: #fff; }
.ok-photo-side .ok-photo { aspect-ratio: 4 / 3; }
.ok-photo span {
    position: absolute; inset-inline: 0; bottom: 0; padding: 1.2rem .5rem .35rem; font-size: .72rem; font-weight: 600; color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .6)); text-align: start;
}
.ok-photo-missing { display: grid; place-items: center; align-content: center; gap: .3rem; color: var(--ok-danger); cursor: default; }
.ok-photo-missing span { position: static; background: none; color: var(--ok-danger); padding: 0; }

.ok-review-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 1rem; }
.ok-review-facts { margin-top: .6rem; padding-top: .6rem; }
.ok-review-facts dd { text-align: start; }
.ok-warning { margin-top: .8rem; padding: .55rem .8rem; border-radius: .7rem; background: #fff5d6; color: #8a6100; font-size: .82rem; font-weight: 600; }
.ok-review-actions { display: grid; gap: .55rem; }
.ok-review-buttons { display: flex; gap: .4rem; flex-wrap: wrap; }
.ok-review-buttons .ok-btn { flex: 1; justify-content: center; padding: .55rem .6rem; }
.ok-review-more { justify-content: center; }
.ok-pagination { margin-top: 1.25rem; }

.ok-lightbox {
    position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 2rem;
    background: rgba(10, 10, 12, .88); cursor: zoom-out;
}
.ok-lightbox[hidden] { display: none; }
.ok-lightbox img {
    display: block; width: auto; height: auto;
    max-width: min(760px, 88vw); max-height: 82vh; object-fit: contain;
    padding: .5rem; border-radius: .8rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff;
}
.ok-lightbox-close {
    position: absolute; top: 1rem; inset-inline-end: 1rem; width: 2.6rem; height: 2.6rem; border-radius: 50%;
    background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.1rem;
}

@media (max-width: 1200px) { .ok-review { grid-template-columns: 18rem minmax(0, 1fr); } .ok-review-actions { grid-column: 1 / -1; } .ok-review-filters { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .ok-review { grid-template-columns: 1fr; } .ok-review-filters { grid-template-columns: 1fr 1fr; } }

/* Older admin pages: section card, row actions */
.ok-section { margin-top: 0; }
.ok-section > .ok-section { box-shadow: none; border: 0; padding: 0; }
.ok-row-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    margin: .1rem;
    border-radius: .55rem;
    border: 1px solid var(--ok-line);
    background: var(--ok-surface);
    color: var(--ok-ink);
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color .15s, background-color .15s, color .15s;
}
.ok-row-link:hover { border-color: var(--ok-primary); background: var(--ok-primary-soft); color: var(--ok-primary-dark); }
.ok-row-link.text-red-600,
.ok-row-link[method="DELETE"] { color: var(--ok-danger); }
.ok-row-link.text-red-600:hover { border-color: var(--ok-danger); background: var(--ok-danger-soft); color: var(--ok-danger); }

/* Splade's own buttons (submit, table toolbar) in brand colours */
.ok-dash button[type=submit]:not(.ok-btn) {
    background: var(--ok-primary) !important;
    border-color: transparent !important;
    color: #fff !important;
    border-radius: .7rem;
    padding: .6rem 1.2rem;
}
.ok-dash button[type=submit]:not(.ok-btn):hover { background: var(--ok-primary-dark) !important; }

/* Spare parts pages */
.ok-empty-row { padding: .8rem 1rem; border: 1px dashed var(--ok-line); border-radius: .7rem; color: var(--ok-muted); font-size: .85rem; text-align: center; }
.ok-store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.25rem; }
.ok-store { margin: 0; padding: 1.25rem; display: grid; gap: 1rem; align-content: start; }
.ok-store-head { display: flex; align-items: center; gap: .8rem; }
.ok-store-head h2 { font-weight: 700; font-size: 1rem; }
.ok-store-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.ok-store-stats > div { background: var(--ok-bg); border-radius: .7rem; padding: .6rem; text-align: center; }
.ok-store-stats b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ok-store-stats span { font-size: .72rem; color: var(--ok-muted); }
.ok-store-stats .is-danger b { color: var(--ok-danger); }
.ok-store-items summary { cursor: pointer; color: var(--ok-primary-dark); font-size: .85rem; font-weight: 600; margin-bottom: .5rem; }
.ok-store-items .ok-parts { max-height: 16rem; overflow: auto; }
.ok-store-actions { display: flex; gap: .5rem; }
.ok-transfer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: end; }
.ok-transfer-box { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; border-radius: .7rem; background: var(--ok-primary-soft); color: var(--ok-primary-dark); font-weight: 600; margin-top: .5rem; }
.ok-transfer-arrow { color: var(--ok-muted); padding-bottom: .8rem; }
[dir="ltr"] .ok-transfer-arrow { transform: scaleX(-1); }
@media (max-width: 640px) { .ok-transfer { grid-template-columns: 1fr; } .ok-transfer-arrow { display: none; } }

/* Clickable cards: lift, orange edge and an arrow on hover */
.ok-stat-link { position: relative; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ok-stat-link::after {
    content: "←";
    position: absolute;
    inset-inline-end: 1.1rem;
    color: var(--ok-primary-dark);
    font-weight: 700;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity .15s, transform .15s;
}
[dir="ltr"] .ok-stat-link::after { content: "→"; transform: translateX(-6px); }
.ok-stat-link:hover {
    border-color: var(--ok-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(255, 108, 54, .16);
}
.ok-stat-link:hover::after { opacity: 1; transform: translateX(0); }
.ok-stat-link:hover .ok-stat-icon { transform: scale(1.06); }
.ok-stat-icon { transition: transform .15s; }
.ok-stat-link.is-active { border-color: var(--ok-primary); box-shadow: 0 0 0 3px rgba(255, 108, 54, .18); }

/* Branches: wide name, location column with an inline edit form */
.ok-branches table th:first-child,
.ok-branches table td:first-child { width: 22%; }
.ok-branches table th:nth-child(5),
.ok-branches table td:nth-child(5) { width: 32%; }
.ok-loc { display: grid; gap: .4rem; }
.ok-loc-status { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.ok-loc-form { display: flex; gap: .35rem; align-items: center; margin: 0; }
.ok-loc-form > div:first-child { flex: 1; min-width: 0; }
.ok-loc-form input { font-size: .75rem !important; padding: .35rem .5rem !important; }
.ok-loc-form .ok-btn { white-space: nowrap !important; flex: none; }

/* Activity log: date first, details last and widest */
.ok-log table th:first-child,
.ok-log table td:first-child { width: 7.5rem; }
.ok-log table td:first-child * { white-space: nowrap !important; overflow-wrap: normal; }
.ok-log table th:last-child,
.ok-log table td:last-child { width: 40%; }

.ok-thumbs { display: flex; gap: .3rem; }
.ok-thumbs img { width: 2.6rem; height: 2.6rem; object-fit: cover; border-radius: .5rem; border: 1px solid var(--ok-line); }

.ok-row-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.ok-row-actions form { margin: 0; }
.ok-btn-success { background: var(--ok-success-soft); color: var(--ok-success); border: 1px solid transparent; }
.ok-btn-success:hover { background: var(--ok-success); color: #fff; }
.ok-btn-danger { background: var(--ok-danger-soft); color: var(--ok-danger); border: 1px solid transparent; }
.ok-btn-danger:hover { background: var(--ok-danger); color: #fff; }

@media (max-width: 1024px) {
    .ok-split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .ok-grid-2 { grid-template-columns: 1fr; }
    .ok-page-title h1 { font-size: 1.25rem; }
    .ok-table-wrap input[type=search] { min-width: 0; }
    .ok-part-row { grid-template-columns: 1fr 5rem auto; }

    .ok-hero { padding: 1.4rem 1.25rem; }
    .ok-hero h1 { font-size: 1.3rem; }
    .ok-table .ok-hide-sm { display: none; }
}

/* Admin viewing the dashboard as another user */
.ok-dash .ok-impersonate { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: 0 0 1rem; padding: .7rem 1rem; border-radius: 12px; background: #fff4e5; color: #8a4b00; border: 1px solid #f5c98b; font-size: .92rem; }
.ok-dash .ok-impersonate button { background: #8a4b00; color: #fff; border: 0; border-radius: 8px; padding: .35rem .9rem; font-weight: 600; cursor: pointer; }

/* Users list: compact cells, actions stacked */
.ok-users .ok-cell-main { display: block; font-weight: 600; }
.ok-users .ok-cell-sub { display: block; }
.ok-users table th:last-child,
.ok-users table td:last-child { width: 8rem; }
.ok-users table td:last-child a { display: block; padding: .1rem 0; }
/* Performance report */
.ok-report-filter { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: end; }
.ok-report-filter label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--ok-muted); }
.ok-report-filter .ok-input { border: 1px solid var(--ok-line); border-radius: 10px; padding: .45rem .6rem; background: var(--ok-card, #fff); }
.ok-report-h { font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 .6rem; }
.ok-report-chart .ok-legend { display: flex; gap: 1rem; font-size: .8rem; margin-bottom: .6rem; }
.ok-report-chart .ok-legend span::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-inline-end: .3rem; vertical-align: -1px; }
.ok-report-chart .is-v, .ok-report-chart .ok-legend .is-v::before { background: #94a3b8; }
.ok-report-chart .is-s, .ok-report-chart .ok-legend .is-s::before { background: #f97316; }
.ok-report-chart .is-o, .ok-report-chart .ok-legend .is-o::before { background: #16a34a; }
.ok-bars { display: flex; align-items: flex-end; gap: 2px; height: 180px; direction: ltr; }
.ok-bar-day { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; min-width: 3px; }
.ok-bar-day span { flex: 1; border-radius: 2px 2px 0 0; min-height: 1px; }
.ok-bars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ok-muted); margin-top: .3rem; direction: ltr; }
.ok-rate { display: inline-block; width: 70px; height: 7px; border-radius: 4px; background: var(--ok-line); overflow: hidden; vertical-align: middle; }
.ok-rate span { display: block; height: 100%; background: #16a34a; }
/* Security guard */
.ok-guard-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.ok-guard-title { font-size: 1.15rem; font-weight: 700; }
.ok-guard-item { padding: .55rem .8rem; margin: .4rem 0; border-inline-start: 4px solid var(--ok-line); border-radius: 6px; }
.ok-guard-item.is-danger { border-color: #dc2626; background: rgba(220, 38, 38, .05); }
.ok-guard-item.is-warn { border-color: #f59e0b; background: rgba(245, 158, 11, .06); }
.ok-guard-item.is-success { border-color: #16a34a; }
/* Map: orders known only by city, one counted circle per city */
.ok-city-count { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(22, 163, 74, .85); color: #fff; font-weight: 700; font-size: .85rem; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.ok-city-count.has-open { background: rgba(249, 115, 22, .9); }
.ok-pop-stages { display: flex; flex-wrap: wrap; gap: .25rem .7rem; margin: .4rem 0; font-size: .8rem; }
.ok-pop-list { max-height: 220px; overflow-y: auto; border-top: 1px solid #eee; padding-top: .35rem; }
.ok-pop-list a { display: block; padding: .2rem 0; font-size: .8rem; }