/* ============================================================
   AL-Murshid — brand layer on top of Tailwind CDN
   Loaded after Tailwind in layouts/app.blade.php
   ============================================================ */

:root {
    --primary: #005380;
    --primary-700: #003F66;
    --primary-100: #E6EEF3;
    --gold: #FFBF00;
    --gold-light: #FFD966;
    --gold-50: #FFF9E5;
    --bg: #F7F9FA;
    --surface: #FFFFFF;
    --border: #E0E6EB;
    --border-strong: #D1D9E0;
    --text: #0D0D0D;
    --muted: #737373;
    --muted-2: #595959;

    --status-pending: #94A3B8;
    --status-contacted: #2563EB;
    --status-date_selected: #FFBF00;
    --status-done: #16A34A;
    --status-ignored: #DC2626;
}

html { background: var(--bg); }
body {
    font-family: 'Tajawal', 'Poppins', system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Latin numerals & code-like accents in Poppins for clarity */
.font-display, .font-num { font-family: 'Poppins', system-ui, sans-serif; font-feature-settings: 'tnum' 1; }
.tabular { font-variant-numeric: tabular-nums; }

/* Gold underline — used under page titles as a signature accent */
.title-rule {
    position: relative;
    display: inline-block;
    padding-bottom: 0.45rem;
}
.title-rule::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 2.25rem;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.card-hover:hover {
    border-color: var(--border-strong);
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .625rem 1rem; border-radius: 10px; font-weight: 600;
    font-size: .9375rem; line-height: 1; border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    cursor: pointer; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-700); border-color: var(--primary-700); }
.btn-gold { background: var(--gold); color: #1A1A1A; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-light); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-ghost:hover { background: var(--primary-100); border-color: var(--primary); }
.btn-danger { background: #fff; color: #DC2626; border-color: #FECACA; }
.btn-danger:hover { background: #FEF2F2; border-color: #DC2626; }
.btn-sm { padding: .375rem .625rem; font-size: .8125rem; border-radius: 8px; }
.btn-xs { padding: .25rem .5rem; font-size: .75rem; border-radius: 6px; }
.btn-icon { padding: .5rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Form controls */
.field-label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--muted-2);
    margin-bottom: .375rem;
}
.input, .select, .textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .625rem .75rem;
    font-size: .9375rem;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    min-height: 42px;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,83,128,.12);
}
.textarea { min-height: 96px; resize: vertical; }
.input-sm { padding: .375rem .5rem; font-size: .8125rem; min-height: 34px; }

/* Status pills */
.status {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: .25rem .625rem;
    font-size: .75rem; font-weight: 700;
    border-radius: 9999px;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}
.status::before {
    content: ''; width: .375rem; height: .375rem; border-radius: 9999px;
}
.status-pending { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.status-pending::before { background: var(--status-pending); }
.status-contacted { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.status-contacted::before { background: var(--status-contacted); }
.status-date_selected { background: var(--gold-50); color: #92400E; border-color: var(--gold); }
.status-date_selected::before { background: var(--gold); }
.status-done { background: #ECFDF5; color: #166534; border-color: #BBF7D0; }
.status-done::before { background: var(--status-done); }
.status-done2 { background: #D1FAE5; color: #064E3B; border-color: #6EE7B7; }
.status-done2::before { background: #047857; }
.status-ignored { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.status-ignored::before { background: var(--status-ignored); }

/* Tier marker */
.tier-mark {
    display: inline-flex; align-items: center;
    font-weight: 700; font-size: .75rem;
    padding: .125rem .375rem;
    border-radius: 4px;
    letter-spacing: .03em;
}
.tier-high { color: #92400E; background: var(--gold-50); border: 1px solid var(--gold); }
.tier-standard { color: var(--muted); border: 1px solid var(--border); }

/* Tables */
.table {
    width: 100%; border-collapse: separate; border-spacing: 0;
}
.table th, .table td {
    padding: .75rem .875rem;
    text-align: start;
    font-size: .875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.table th {
    background: #FAFBFC;
    font-weight: 700; font-size: .75rem;
    color: var(--muted-2);
    text-transform: uppercase; letter-spacing: .04em;
    position: sticky; top: 0; z-index: 5;
}
.table tr:hover td { background: #FAFBFC; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }

/* Side panel / drawer */
.drawer-backdrop {
    position: fixed; inset: 0; background: rgba(13, 13, 13, .35);
    backdrop-filter: blur(2px); z-index: 40;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed; top: 0; bottom: 0;
    inset-inline-end: 0;
    width: 100%; max-width: 560px;
    background: var(--surface);
    z-index: 41;
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto;
    box-shadow: -16px 0 48px rgba(0,0,0,.10);
}
[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.open { transform: translateX(0); }

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--primary-700) 0%, var(--primary) 100%);
    color: rgba(255, 255, 255, .92);
}
.sidebar-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .625rem .875rem;
    border-radius: 10px;
    font-size: .9375rem; font-weight: 500;
    color: rgba(255,255,255,.85);
    transition: background .15s, color .15s;
    position: relative;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active {
    background: rgba(255, 191, 0, .12);
    color: #FFE9A0;
    font-weight: 700;
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    inset-inline-start: -.5rem;
    top: 30%;
    bottom: 30%;
    width: 3px;
    background: var(--gold);
    border-radius: 2px;
}

/* Toast */
.toast-container {
    position: fixed; bottom: 1rem;
    inset-inline-end: 1rem;
    z-index: 100;
    display: flex; flex-direction: column; gap: .5rem;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--gold);
    border-radius: 12px;
    padding: .75rem 1rem;
    font-size: .875rem; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    min-width: 260px;
    animation: slideIn .25s ease;
}
.toast-error { border-inline-start-color: #DC2626; }
.toast-success { border-inline-start-color: #16A34A; }
@keyframes slideIn {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Stat cards: oversized numerals */
.stat-num {
    font-family: 'Poppins', system-ui, sans-serif;
    font-weight: 700;
    font-size: 2.25rem;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.stat-num-gold { color: var(--text); border-bottom: 3px solid var(--gold); padding-bottom: 2px; display: inline-block; }
.stat-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em;
}

/* Avatar circle */
.avatar {
    width: 2.25rem; height: 2.25rem;
    border-radius: 9999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff;
    font-weight: 700; font-size: .875rem;
    text-transform: uppercase;
}
.avatar-gold { background: var(--gold); color: #1A1A1A; }
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: .75rem; }
.avatar-xs { width: 1.5rem; height: 1.5rem; font-size: .6875rem; }

/* Timeline (activity log) */
.timeline {
    position: relative;
    padding-inline-start: 1.25rem;
}
.timeline::before {
    content: '';
    position: absolute;
    top: .5rem; bottom: .5rem;
    inset-inline-start: .3rem;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-block: .5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    inset-inline-start: -1rem;
    top: .85rem;
    width: 11px; height: 11px;
    border-radius: 9999px;
    background: var(--gold);
    border: 2px solid var(--bg);
}
.timeline-item.is-create::before { background: var(--status-done); }
.timeline-item.is-delete::before { background: var(--status-ignored); }
.timeline-item.is-update::before { background: var(--status-contacted); }

/* Mobile sidebar drawer */
@media (max-width: 1023.98px) {
    .sidebar {
        position: fixed; top: 0; bottom: 0;
        inset-inline-start: 0;
        width: 17rem;
        transform: translateX(-100%);
        z-index: 41;
        transition: transform .22s ease;
        box-shadow: 12px 0 36px rgba(0,0,0,.12);
    }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
}

/* RTL fixes for Tailwind utilities that aren't logical by default */
[dir="rtl"] .leaflet-popup-content-wrapper { text-align: right; }
.leaflet-popup-content { font-family: inherit !important; }

/* Page entrance */
.page-fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* KPI variants */
.kpi {
    display: flex; align-items: baseline; gap: .5rem;
}
.kpi .num { font-family: 'Poppins'; font-weight: 700; font-size: 1.75rem; color: var(--primary); letter-spacing: -.02em; }
.kpi .delta { font-size: .75rem; font-weight: 600; padding: .125rem .375rem; border-radius: 4px; background: var(--gold-50); color: #92400E; }

/* Provider name in tables */
.provider-name {
    font-weight: 700;
    color: var(--text);
    font-size: .9375rem;
    line-height: 1.3;
}
.provider-meta { font-size: .75rem; color: var(--muted); margin-top: .125rem; }

/* Phone link */
.phone-link {
    font-family: 'Poppins', monospace;
    color: var(--primary);
    font-weight: 600;
    font-size: .8125rem;
    direction: ltr;
    text-decoration: none;
    background: var(--primary-100);
    padding: .125rem .5rem;
    border-radius: 6px;
    display: inline-block;
}
.phone-link:hover { background: var(--primary); color: #fff; }

/* Sticky header */
.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,.92);
}

/* Hide scrollbar but keep scroll */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Filter chip */
.chip {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: .25rem .625rem;
    border-radius: 9999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: .8125rem;
    color: var(--muted-2);
    font-weight: 600;
}
.chip-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Map */
#provider-map { height: calc(100vh - 64px); border-radius: 14px; overflow: hidden; }
@media (max-width: 1023.98px) { #provider-map { height: 60vh; } }

/* Inline edit */
.inline-edit-trigger {
    cursor: pointer;
    border-bottom: 1px dashed var(--border-strong);
}
.inline-edit-trigger:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* Print-friendly */
@media print { .no-print { display: none; } }

/* ============================================================
   Type-to-confirm modal (destructive actions)
   ============================================================ */
.am-confirm-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
    z-index: 9998;
}
.am-confirm-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.25rem;
    z-index: 9999;
    box-shadow: 0 24px 64px rgba(0,0,0,.30);
    animation: amConfirmPop .15s ease-out;
}
@keyframes amConfirmPop {
    from { transform: translate(-50%, -50%) scale(.94); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}
.am-confirm-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #DC2626;
    margin: 0 0 .5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.am-confirm-title::before {
    content: '';
    width: 1.5rem;
    height: 1.5rem;
    background: #FEE2E2;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 9v4M12 17h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: .9rem;
}
.am-confirm-message {
    font-size: .9rem;
    color: var(--muted-2);
    margin: 0 0 .75rem;
    line-height: 1.5;
}
.am-confirm-hint {
    font-size: .8125rem;
    color: var(--muted);
    margin: 0 0 .375rem;
}
.am-confirm-hint code {
    background: var(--gold-50);
    color: #92400E;
    padding: .125rem .375rem;
    border-radius: 4px;
    font-family: 'Poppins', monospace;
    font-weight: 700;
    border: 1px solid var(--gold);
}
.am-confirm-input {
    width: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9375rem;
    margin-bottom: .875rem;
    font-family: inherit;
    background: var(--bg);
}
.am-confirm-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,83,128,.12);
}
.am-confirm-actions {
    display: flex; gap: .5rem; justify-content: flex-end;
}
html[data-theme="dark"] .am-confirm-modal { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .am-confirm-input { background: #0F1419; color: var(--text); }
html[data-theme="dark"] .am-confirm-title { color: #FCA5A5; }
html[data-theme="dark"] .am-confirm-title::before { background: rgba(220,38,38,.15); }

/* ============================================================
   Dark mode — opt-in via [data-theme="dark"] on <html>
   ============================================================ */
html[data-theme="dark"] {
    --bg: #0F1419;
    --surface: #161D26;
    --border: #243040;
    --border-strong: #2F3D52;
    --text: #E6EEF3;
    --muted: #9BA5B0;
    --muted-2: #B7C0CC;
    --primary-100: #1A2A3A;
    --gold-50: #2A2410;
}
html[data-theme="dark"] body { color: var(--text); background: var(--bg); }
html[data-theme="dark"] .card { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .textarea { background: #0F1419; color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .table th { background: #0F1419; color: var(--muted); }
html[data-theme="dark"] .table tr:hover td { background: #1A2230; }
html[data-theme="dark"] .table-wrap { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .app-header { background: rgba(22,29,38,.92); border-color: var(--border); }
html[data-theme="dark"] .chip { background: var(--surface); border-color: var(--border); color: var(--muted-2); }
html[data-theme="dark"] .toast { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .btn-ghost { color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .btn-ghost:hover { background: var(--primary-100); }
html[data-theme="dark"] .stat-box { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .am-pager-btns { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .am-pager-btn { color: var(--text); }
/* Phone-link readability — dark backgrounds need a much lighter blue + light text. */
html[data-theme="dark"] .phone-link {
    background: rgba(56, 189, 248, .18) !important;
    color: #7DD3FC !important;
    border: 1px solid rgba(56, 189, 248, .35) !important;
}
html[data-theme="dark"] .phone-link:hover {
    background: #38BDF8 !important;
    color: #0F1419 !important;
    border-color: #38BDF8 !important;
}
/* Override the inline-styled "secondary phone" (landline) link in dark mode. */
html[data-theme="dark"] .phone-link[style*="F3F5F7"],
html[data-theme="dark"] .phone-link[style*="f3f5f7"] {
    background: rgba(148, 163, 184, .20) !important;
    color: #CBD5E1 !important;
    border: 1px solid rgba(148, 163, 184, .30) !important;
}
html[data-theme="dark"] tr.tier-high td { background: linear-gradient(to right, rgba(255,191,0,.07), transparent 30%); }
html[data-theme="dark"] .inline-notes:hover { background: #0F1419; }
html[data-theme="dark"] .inline-notes:focus { background: #0F1419; }

/* Override Tailwind-utility hardcoded colors when in dark mode.
   These are listed by frequency-of-use in the views — add to this list when adopting new utility classes. */
html[data-theme="dark"] body { background: var(--bg) !important; color: var(--text); }

/* Backgrounds */
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] [class*="bg-\[\#F7F9FA\]"]                    { background-color: var(--surface) !important; }
html[data-theme="dark"] .bg-gray-50                                   { background-color: #1A2230 !important; }
html[data-theme="dark"] .bg-gray-100                                  { background-color: #1F2937 !important; }
html[data-theme="dark"] .bg-primary\/5                                { background-color: rgba(0, 110, 165, .12) !important; }
html[data-theme="dark"] .bg-primary\/10                               { background-color: rgba(0, 110, 165, .18) !important; }
html[data-theme="dark"] .bg-amber-50\/30                              { background-color: rgba(146, 64, 14, .15) !important; }

/* Text */
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-black                                   { color: var(--text) !important; }
html[data-theme="dark"] .text-gray-700                                { color: #C3CCD8 !important; }
html[data-theme="dark"] .text-gray-600                                { color: #AAB3BE !important; }
html[data-theme="dark"] .text-gray-500                                { color: var(--muted) !important; }
html[data-theme="dark"] .text-gray-400                                { color: #6B7480 !important; }
html[data-theme="dark"] .text-gray-300                                { color: #4A5566 !important; }
html[data-theme="dark"] .text-amber-700                               { color: #FCD34D !important; }
html[data-theme="dark"] .text-green-700,
html[data-theme="dark"] .text-green-600                               { color: #34D399 !important; }
html[data-theme="dark"] .text-blue-700,
html[data-theme="dark"] .text-blue-600                                { color: #60A5FA !important; }

/* Borders */
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-amber-300,
html[data-theme="dark"] .border-amber-400                             { border-color: var(--border) !important; }
html[data-theme="dark"] .divide-gray-100 > * + *                      { border-color: var(--border) !important; }
html[data-theme="dark"] .divide-y > * + *                             { border-color: var(--border) !important; }

/* Hovers */
html[data-theme="dark"] .hover\:bg-gray-50:hover                      { background-color: #1A2230 !important; }
html[data-theme="dark"] .hover\:bg-gray-100:hover                     { background-color: #1F2937 !important; }
html[data-theme="dark"] .hover\:border-primary:hover                  { border-color: #38BDF8 !important; }
html[data-theme="dark"] .hover\:text-primary:hover                    { color: #38BDF8 !important; }

/* Logo / brand */
html[data-theme="dark"] .text-primary                                 { color: #38BDF8 !important; }
html[data-theme="dark"] .bg-primary                                   { background-color: #006BA1 !important; }

/* Forms — Tailwind utility tints */
html[data-theme="dark"] .bg-green-50                                  { background-color: rgba(20, 83, 45, .25) !important; }
html[data-theme="dark"] .bg-red-50                                    { background-color: rgba(127, 29, 29, .25) !important; }

/* Code chips (audit log) */
html[data-theme="dark"] code                                          { background-color: #1F2937 !important; color: #E6EEF3; }

/* ============================================================
   Pagination — custom branded
   ============================================================ */
.am-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem .25rem;
    flex-wrap: wrap;
}
.am-pager-info {
    color: var(--muted);
    font-size: .8125rem;
}
.am-pager-btns {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.am-pager-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .625rem;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: .875rem;
    color: var(--text);
    text-decoration: none;
    transition: background .15s, color .15s, transform .05s;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.am-pager-btn:hover {
    background: var(--primary-100);
    color: var(--primary);
}
.am-pager-btn:active { transform: scale(.96); }
.am-pager-btn.is-current {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,83,128,.18), 0 6px 16px rgba(0,83,128,.18);
}
.am-pager-btn.is-current:hover { color: #fff; background: var(--primary); }
.am-pager-btn.is-disabled {
    color: var(--gray-300);
    cursor: not-allowed;
    background: transparent;
}
.am-pager-btn.is-disabled:hover { background: transparent; color: var(--gray-300); }
.am-pager-ellipsis {
    display: inline-flex; align-items: center;
    padding: 0 .25rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 1px;
}
[dir="rtl"] .am-pager-btn { font-family: 'Tajawal', 'Poppins', sans-serif; }

/* ============================================================
   Provider table — inline editing + extras
   ============================================================ */
.inline-status {
    appearance: none;
    -webkit-appearance: none;
    padding: .25rem 1.5rem .25rem .625rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='currentColor' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .5rem center;
    background-size: 8px;
    min-width: 110px;
}
[dir="rtl"] .inline-status {
    padding: .25rem .625rem .25rem 1.5rem;
    background-position: left .5rem center;
}
.inline-status.s-pending       { background-color: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.inline-status.s-contacted     { background-color: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.inline-status.s-date_selected { background-color: var(--gold-50); color: #92400E; border-color: var(--gold); }
.inline-status.s-done          { background-color: #ECFDF5; color: #166534; border-color: #BBF7D0; }
.inline-status.s-done2         { background-color: #D1FAE5; color: #064E3B; border-color: #6EE7B7; }
.inline-status.s-ignored       { background-color: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.inline-status:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.inline-notes {
    width: 100%;
    min-height: 38px;
    max-height: 80px;
    padding: .375rem .5rem;
    font-size: .8125rem;
    color: var(--text);
    background: transparent;
    border: 1px dashed transparent;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    transition: border-color .15s, background .15s;
}
.inline-notes:hover { border-color: var(--border); background: #FAFBFC; }
.inline-notes:focus {
    outline: none;
    border-color: var(--primary);
    border-style: solid;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,83,128,.08);
}
.inline-notes.is-saving { border-color: var(--gold); }
.inline-notes.is-saved  { border-color: #16A34A; background: #ECFDF5; }

/* Done 2 — a distinct, greenish inline notes textarea below the regular notes */
.inline-notes-done2 {
    background: linear-gradient(to right, #D1FAE5 0%, #ECFDF5 70%, transparent 100%) !important;
    border: 1px dashed #6EE7B7 !important;
    color: #064E3B;
    font-weight: 500;
}
.inline-notes-done2::placeholder { color: #047857; opacity: .7; }
.inline-notes-done2:hover { border-style: solid !important; }
.inline-notes-done2:focus {
    background: #ECFDF5 !important;
    border-color: #047857 !important;
    box-shadow: 0 0 0 3px rgba(6,78,59,.10) !important;
}
html[data-theme="dark"] .inline-notes-done2 {
    background: rgba(6, 78, 59, .25) !important;
    border-color: rgba(110, 231, 183, .35) !important;
    color: #6EE7B7 !important;
}
html[data-theme="dark"] .inline-notes-done2:focus {
    background: rgba(6, 78, 59, .35) !important;
    border-color: #6EE7B7 !important;
}

/* Tier-high row tint */
tr.tier-high td { background: linear-gradient(to right, rgba(255,191,0,.04), transparent 30%); }
[dir="rtl"] tr.tier-high td { background: linear-gradient(to left, rgba(255,191,0,.04), transparent 30%); }

/* Stats bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .625rem;
    margin-bottom: 1rem;
}
@media (min-width: 768px) { .stats-bar { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .75rem 1rem;
    text-align: center;
    transition: border-color .15s, transform .05s;
    text-decoration: none;
    color: inherit;
}
.stat-box:hover { border-color: var(--primary); transform: translateY(-1px); }
.stat-box.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,83,128,.12); }
.stat-box .stat-num-md {
    font-family: 'Poppins';
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.stat-box.s-pending       .stat-num-md { color: #475569; }
.stat-box.s-contacted     .stat-num-md { color: #1D4ED8; }
.stat-box.s-date_selected .stat-num-md { color: #92400E; }
.stat-box.s-done          .stat-num-md { color: #166534; }
.stat-box.s-done2         .stat-num-md { color: #047857; }
.stat-box.s-ignored       .stat-num-md { color: #991B1B; }
.stat-box .stat-lbl {
    font-size: .6875rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: .25rem;
}

/* Quick action buttons (call, whatsapp, map) */
.qa-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.75rem; height: 1.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted-2);
    transition: background .15s, color .15s, border-color .15s;
}
.qa-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.qa-btn.qa-whatsapp:hover { background: #25D366; border-color: #25D366; }
.qa-btn.qa-map:hover { background: var(--gold); color: #000; border-color: var(--gold); }
.qa-btn.qa-delete:hover { background: #DC2626; color: #fff; border-color: #DC2626; }
