/* ================================================================
   Workshop ERP – Master Stylesheet
   Supports LTR & RTL, responsive for mobile/tablet/desktop
   ================================================================ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    --primary:        #1e3a5f;
    --primary-dark:   #152b47;
    --primary-light:  #2e5086;
    --accent:         #f97316;
    --accent-dark:    #ea6a0a;
    --sidebar-width:  260px;
    --topbar-height:  60px;
    --font:           'Cairo', system-ui, sans-serif;
    --radius:         10px;
    --shadow:         0 2px 12px rgba(0,0,0,.10);
    --shadow-lg:      0 8px 24px rgba(0,0,0,.14);
    --transition:     0.22s ease;
    --bg:             #dde3ea;
    --card-bg:        #f2f5f9;
    --text:           #1a2332;
    --text-muted:     #6b7a8d;
    --border:         #dee2e6;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background:  var(--bg);
    color:       var(--text);
    font-size:   0.9rem;
    overflow-x:  hidden;
    min-height:  100vh;
}

/* prevent zoom on all inputs */
input, select, textarea, button {
    touch-action: manipulation;
    font-size: max(16px, 0.875rem) !important;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text); }
.fw-600 { font-weight: 600; }

/* ── Layout: Sidebar + Main ─────────────────────────────────── */
.sidebar {
    position:   fixed;
    top:        0;
    bottom:     0;
    width:      var(--sidebar-width);
    background: var(--primary);
    color:      #fff;
    display:    flex;
    flex-direction: column;
    z-index:    1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

/* LTR: sidebar on left */
.ltr-body .sidebar { left: 0; right: auto; }
/* RTL: sidebar on right */
.rtl-body .sidebar { right: 0; left: auto; }

.main-content {
    min-height:     100vh;
    padding-top:    calc(var(--topbar-height) + 16px);
    padding-bottom: 56px;
    transition:     margin var(--transition);
}

.ltr-body .main-content { margin-left:  var(--sidebar-width); margin-right: 0; }
.rtl-body .main-content { margin-right: var(--sidebar-width); margin-left:  0; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
    position:   fixed;
    top:        0;
    height:     var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display:    flex;
    align-items: center;
    gap:        12px;
    padding:    0 20px;
    z-index:    1030;
    box-shadow: var(--shadow);
    transition: left var(--transition), right var(--transition);
}

.ltr-body .topbar { left: var(--sidebar-width); right: 0; }
.rtl-body .topbar { right: var(--sidebar-width); left: 0; }

.topbar-toggler {
    background: none;
    border:     none;
    color:      var(--text);
    font-size:  1.4rem;
    cursor:     pointer;
    padding:    4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background var(--transition);
}
.topbar-toggler:hover { background: var(--bg); }

.topbar-title {
    font-weight: 700;
    font-size:   1.05rem;
    color:       var(--primary);
    flex:        1;
}

.topbar-actions {
    display:     flex;
    align-items: center;
    gap:         8px;
    margin-left: auto;
}
.rtl-body .topbar-actions { margin-left: 0; margin-right: auto; }

.topbar-icon {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           38px;
    height:          38px;
    border-radius:   50%;
    color:           var(--text-muted);
    font-size:       1.1rem;
    text-decoration: none;
    position:        relative;
    transition:      background var(--transition), color var(--transition);
}
.topbar-icon:hover { background: var(--bg); color: var(--primary); }
.topbar-icon .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    padding: 2px 4px;
}

.topbar-user-btn {
    display:     flex;
    align-items: center;
    gap:         8px;
    background:  none;
    border:      1px solid var(--border);
    border-radius: 8px;
    padding:     6px 12px;
    font-size:   0.875rem;
    cursor:      pointer;
    transition:  background var(--transition);
}
.topbar-user-btn:hover { background: var(--bg); }

/* ── Sidebar Brand ──────────────────────────────────────────── */
.sidebar-brand {
    display:     flex;
    align-items: center;
    padding:     20px 18px 16px;
    font-size:   1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    color: #fff;
    white-space: nowrap;
}

.sidebar-user {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.10);
}
.sidebar-avatar { font-size: 2rem; color: rgba(255,255,255,.7); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }

/* ── Sidebar Nav ────────────────────────────────────────────── */
.sidebar-nav {
    list-style: none;
    padding:    10px 0;
    margin:     0;
    flex:       1;
}

.sidebar-nav li a {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     11px 18px;
    color:       rgba(255,255,255,.78);
    text-decoration: none;
    font-size:   0.88rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition:  all var(--transition);
    white-space: nowrap;
}

.rtl-body .sidebar-nav li a {
    border-left:  none;
    border-right: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    background:  rgba(255,255,255,.12);
    color:       #fff;
    border-left-color: var(--accent);
}

.rtl-body .sidebar-nav li a:hover,
.rtl-body .sidebar-nav li.active a {
    border-left-color:  transparent;
    border-right-color: var(--accent);
}

.sidebar-nav li a i { font-size: 1rem; min-width: 18px; }

.nav-label {
    font-size:      0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color:          rgba(255,255,255,.4);
    padding:        12px 18px 4px;
    pointer-events: none;
}

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
    padding:       14px 16px;
    border-top:    1px solid rgba(255,255,255,.12);
}

/* ── Sidebar Overlay (mobile) ───────────────────────────────── */
.sidebar-overlay {
    display:    none;
    position:   fixed;
    inset:      0;
    background: rgba(0,0,0,.5);
    z-index:    1039;
}
.sidebar-overlay.active { display: block; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    border:        none;
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    background:    var(--card-bg);
}
.card-header {
    background:    transparent;
    border-bottom: 1px solid var(--border);
    font-weight:   700;
    padding:       14px 20px;
}
.card-body { padding: 20px; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
    border-radius: var(--radius);
    padding:       18px 16px;
    display:       flex;
    align-items:   center;
    gap:           14px;
    color:         #fff;
    box-shadow:    var(--shadow);
    transition:    transform var(--transition), box-shadow var(--transition);
    overflow:      hidden;
    position:      relative;
    min-width:     0;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-card > div {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.stat-card .stat-icon {
    font-size:   2rem;
    opacity:     .9;
    flex-shrink: 0;
}
.stat-card .stat-value {
    font-size:     clamp(1.15rem, 3.5vw, 1.75rem);
    font-weight:   800;
    line-height:   1.1;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}
.stat-card .stat-label {
    font-size:   0.8rem;
    opacity:     .88;
    font-weight: 500;
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}
.stat-card small {
    font-size:   0.72rem;
    opacity:     .78;
    display:     block;
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}

.stat-blue    { background: linear-gradient(135deg, #1e3a5f, #2e5086); }
.stat-orange  { background: linear-gradient(135deg, #f97316, #ea580c); }
.stat-green   { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-purple  { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.stat-teal    { background: linear-gradient(135deg, #0891b2, #0e7490); }
.stat-red     { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ── Compact stat card (dashboard 6-col narrow layout) ───────── */
.stat-card-compact {
    flex-direction:  column;
    align-items:     center;
    text-align:      center;
    padding:         20px 10px 16px;
    gap:             4px;
    justify-content: center;
}
.stat-card-compact .stat-icon {
    font-size:   1.9rem;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.stat-card-compact .stat-value {
    font-size:   1.55rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
    max-width:   100%;
}
.stat-card-compact .stat-label {
    font-size:  0.75rem;
    opacity:    .9;
    font-weight: 600;
    line-height: 1.3;
}
.stat-card-compact small {
    font-size:  0.68rem;
    opacity:    .78;
    line-height: 1.3;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table { font-size: 0.875rem; }
.table thead th {
    background:    var(--primary);
    color:         #fff;
    font-weight:   600;
    border:        none;
    white-space:   nowrap;
    padding:       10px 14px;
}
.table tbody tr:hover { background: rgba(30,58,95,.04); }
.table td { vertical-align: middle; padding: 10px 14px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    border-radius: 7px;
    font-weight:   600;
    font-size:     0.85rem;
    transition:    all var(--transition);
}
.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-accent    { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-sm { font-size: 0.78rem !important; padding: 4px 10px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; }
.form-control, .form-select {
    border-radius:    8px;
    border:           2px solid #a8b4c0;
    font-size:        0.875rem !important;
    padding:          8px 12px;
    background-color: #f8fafc;
    transition:       border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow:   0 0 0 0.2rem rgba(30,58,95,.2);
    background-color: #fff;
}
.form-text { font-size: 0.78rem; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    flex-wrap:     wrap;
    gap:           12px;
    margin-bottom: 20px;
}
.page-header h1 { font-size: 1.4rem; margin: 0; color: var(--primary); }
.page-header .breadcrumb { font-size: 0.82rem; margin: 0; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { font-size: 0.75rem; font-weight: 600; border-radius: 6px; padding: 4px 8px; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { border-radius: var(--radius); border: none; }

/* ── Pagination ──────────────────────────────────────────────── */
.page-link { color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── Select2 ─────────────────────────────────────────────────── */
.select2-container--bootstrap-5 .select2-selection {
    border-radius:    8px !important;
    border:           2px solid #a8b4c0 !important;
    min-height:       40px !important;
    background-color: #f8fafc !important;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--primary) !important;
    box-shadow:   0 0 0 0.2rem rgba(30,58,95,.2) !important;
}

/* ── Dynamic Rows (services/parts table in job card) ─────────── */
.dynamic-table th { background: var(--primary); color: #fff; }
.dynamic-table .btn-remove-row { color: #dc3545; }
.dynamic-table input, .dynamic-table select { background: #f8fafc; border: 2px solid #a8b4c0; }
.row-total { font-weight: 700; color: var(--primary); }

/* ── Invoice Print Styles ────────────────────────────────────── */
.invoice-wrap {
    max-width:     900px;
    margin:        0 auto;
    background:    #fff;
    padding:       40px;
    border-radius: var(--radius);
    box-shadow:    var(--shadow-lg);
}
.invoice-header { border-bottom: 3px solid var(--primary); padding-bottom: 20px; margin-bottom: 20px; }
.invoice-logo-area { display: flex; align-items: center; gap: 16px; }
.invoice-logo-icon { font-size: 3rem; color: var(--primary); }
.invoice-workshop-name { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.invoice-title { font-size: 1.6rem; font-weight: 800; color: var(--accent); text-align: center; margin: 16px 0; }
.invoice-meta-row { display: flex; justify-content: space-between; margin-bottom: 20px; }
.invoice-meta-box { background: var(--bg); border-radius: 8px; padding: 14px 18px; flex: 1; margin: 0 6px; }
.invoice-meta-box:first-child { margin-left: 0; }
.invoice-meta-box:last-child  { margin-right: 0; }
.invoice-meta-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.invoice-meta-value { font-weight: 700; font-size: 0.95rem; margin-top: 2px; }
.invoice-totals td { font-size: 0.9rem; }
.invoice-totals .total-row td { font-size: 1.05rem; font-weight: 800; color: var(--primary); border-top: 2px solid var(--primary); }
.invoice-sig { margin-top: 50px; display: flex; justify-content: space-around; }
.invoice-sig-box { text-align: center; min-width: 150px; }
.invoice-sig-box .sig-line { border-top: 1.5px solid var(--text); width: 140px; margin: 30px auto 4px; }
.invoice-footer { text-align: center; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-muted); }
.invoice-watermark { color: var(--accent); font-weight: 800; }

/* ── Login Page ──────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display:    flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #3b6fa0 100%);
}
.login-card {
    width:         100%;
    max-width:     420px;
    background:    #fff;
    border-radius: 16px;
    box-shadow:    var(--shadow-lg);
    padding:       40px 36px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 3rem; color: var(--primary); }
.login-logo h1 { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin: 8px 0 4px; }
.login-logo p  { font-size: .8rem; color: var(--text-muted); margin: 0; }

/* ── Footer Bar ──────────────────────────────────────────────── */
.footer-bar {
    position:   fixed;
    bottom:     0;
    left:       0;
    right:      0;
    height:     36px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display:    flex;
    align-items: center;
    justify-content: center;
    z-index:    900;
    font-size:  0.78rem;
}

/* ── Col-xl-2 supplement ─────────────────────────────────────── */
@media (min-width: 1200px) {
    .col-xl-2 { flex: 0 0 auto; width: 16.66667%; }
}

/* ── Responsive: Sidebar collapse (≤992px) ───────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .rtl-body .sidebar { transform: translateX(100%); }

    .sidebar.open { transform: translateX(0); }

    .ltr-body .main-content { margin-left: 0; }
    .rtl-body .main-content { margin-right: 0; }

    .ltr-body .topbar { left: 0; }
    .rtl-body .topbar { right: 0; }
}

/* ── Responsive: Tablet (≤768px) ────────────────────────────── */
@media (max-width: 767.98px) {
    /* Page header */
    .page-header h1 { font-size: 1.18rem; }

    /* Topbar: shrink title */
    .topbar-title { font-size: 0.9rem; }

    /* Stat cards: tablet — icon shrinks, value uses clamp so no override needed */
    .stat-card .stat-icon { font-size: 1.7rem; }
    .stat-card-compact .stat-value { font-size: 1.35rem; }

    /* Profit waterfall row: stack vertically */
    .profit-waterfall-row {
        flex-direction: column !important;
        gap: 10px;
    }
    .profit-waterfall-row .col {
        flex: none !important;
        width: 100% !important;
        border-top: 1px solid rgba(255,255,255,.15);
        padding-top: 10px !important;
    }
    .profit-waterfall-row .col:first-child { border-top: none; padding-top: 0 !important; }
    .profit-waterfall-row .col-auto { display: none !important; }

    /* Charts: constrain height */
    canvas { max-height: 240px !important; }

    /* Tables */
    .table { font-size: 0.83rem; }
    .table td, .table th { padding: 8px 10px; }

    /* Nav tabs/pills: horizontal scroll on tablet */
    .nav-tabs, .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar,
    .nav-pills::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-item, .nav-pills .nav-item { white-space: nowrap; }
}

/* ── Responsive: Mobile (≤576px) ────────────────────────────── */
@media (max-width: 575.98px) {
    /* Topbar: hide title, compact user button */
    .topbar-title { display: none !important; }
    .topbar-user-btn { padding: 4px 8px; }
    .topbar-user-btn .topbar-user-name { display: none; }
    .main-content { padding-left: 12px; padding-right: 12px; }

    /* Page header: stack vertically */
    .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .page-header > div:last-child { width: 100%; }
    .page-header .d-flex.flex-wrap { width: 100%; }
    .page-header .btn { flex: 1 1 auto; justify-content: center; }
    .page-header h1 { font-size: 1.1rem; }
    .breadcrumb { display: none !important; }

    /* Stat cards: mobile — tighter padding, icon smaller, value uses clamp */
    .stat-card { padding: 12px 12px; gap: 10px; }
    .stat-card .stat-icon { font-size: 1.4rem; }
    .stat-card small { display: none; }
    /* Compact cards on mobile: even tighter */
    .stat-card-compact { padding: 14px 8px 12px; gap: 2px; }
    .stat-card-compact .stat-icon { font-size: 1.4rem; margin-bottom: 2px; }
    .stat-card-compact .stat-value { font-size: 1.2rem; }
    .stat-card-compact small { display: none; }

    /* Tables: smaller font & padding */
    .table { font-size: 0.78rem; }
    .table td, .table th { padding: 6px 8px; }
    .badge.fs-6 { font-size: 0.72rem !important; }
    .btn-icon { width: 28px; height: 28px; }

    /* Cards */
    .card-body { padding: 12px !important; }
    .card-header { padding: 10px 14px; font-size: 0.86rem; }

    /* Charts: smaller */
    canvas { max-height: 200px !important; }

    /* Modals: full screen */
    .modal-dialog { margin: 0; max-width: 100%; }
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl { max-width: 100%; margin: 0; }
    .modal-content { border-radius: 0; min-height: 100dvh; }

    /* Nav tabs/pills: scrollable */
    .nav-tabs, .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .nav-tabs::-webkit-scrollbar,
    .nav-pills::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-item,
    .nav-pills .nav-item { white-space: nowrap; }

    /* Schedule calendar */
    .cal-cell { min-height: 36px !important; padding: 2px !important; }
    .cal-day-num { font-size: 0.72rem !important; }
    .cal-badge { display: none !important; }
    .cal-dow { font-size: 0.62rem !important; letter-spacing: 0 !important; }

    /* Login */
    .login-card { padding: 24px 16px; margin: 12px; max-width: calc(100% - 24px); }

    /* Footer */
    .footer-bar { font-size: 0.7rem; }

    /* Invoice */
    .invoice-wrap { padding: 14px; }
    .invoice-meta-row { flex-direction: column; }
    .invoice-meta-box { margin: 3px 0; }

    /* Filter form rows: stack */
    .filter-row-mobile > .col-auto {
        width: 100%;
        flex: 1 1 100%;
    }
    .filter-row-mobile > .col-auto .btn {
        width: 100%;
    }
    .filter-row-mobile > .col-auto .d-flex {
        flex-wrap: wrap;
        gap: 4px !important;
    }
    .filter-row-mobile > .col-auto .d-flex .btn { flex: 1; }
}

/* ── Print Styles ────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .footer-bar,
    .btn, .topbar-toggler, .no-print { display: none !important; }
    .main-content { margin: 0 !important; padding-top: 0 !important; }
    body { background: #fff; }
    .invoice-wrap { box-shadow: none; padding: 0; }
    .card { box-shadow: none; }
    @page { margin: 20mm; }
}

/* ── Dark Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #bbb; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* ── Reports Page ────────────────────────────────────────────── */
.report-tab-card {
    background:    var(--card-bg);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow:    var(--shadow);
    padding:       24px;
}
.nav-tabs .nav-link { font-weight: 600; font-size: .88rem; }
.section-label {
    font-size:      .75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color:          var(--primary);
    font-weight:    700;
    margin-bottom:  12px;
    padding-bottom: 6px;
    border-bottom:  2px solid var(--primary);
}
.kpi-box {
    background:    var(--bg);
    border-radius: 10px;
    padding:       14px 16px;
    border-left:   4px solid var(--primary);
}
.rtl-body .kpi-box { border-left: none; border-right: 4px solid var(--primary); }
.kpi-box .kpi-value { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.kpi-box .kpi-label { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ── Schedule Calendar ───────────────────────────────────────── */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.cal-dow {
    text-align:     center;
    font-size:      .72rem;
    font-weight:    700;
    color:          #6b7280;
    padding:        4px 2px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.cal-cell {
    position:        relative;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    min-height:      52px;
    border-radius:   8px;
    text-decoration: none;
    color:           inherit;
    padding:         4px 2px;
    transition:      background .15s;
    border:          2px solid transparent;
    gap:             2px;
}
.cal-cell:hover {
    background:      #f1f5f9;
    border-color:    #cbd5e1;
    text-decoration: none;
}
.cal-empty     { pointer-events: none; }
.cal-today     { background: #eff6ff; border-color: #3b82f6 !important; }
.cal-today .cal-day-num { color: #2563eb; font-weight: 800; }
.cal-selected  { background: #1e40af !important; border-color: #1e40af !important; }
.cal-selected .cal-day-num { color: #fff !important; font-weight: 800; }
.cal-selected:hover { background: #1d4ed8 !important; }
.cal-day-num   { font-size: .85rem; font-weight: 600; line-height: 1; }
.cal-dot {
    display:      inline-block;
    width:        10px; height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.cal-dot-inline {
    display:      block;
    width:        6px; height: 6px;
    border-radius: 50%;
}
.cal-badge {
    display:      inline-block;
    font-size:    .6rem;
    font-weight:  800;
    border-radius: 10px;
    padding:      0px 4px;
    line-height:  1.4;
}

/* ── RTL Overrides ───────────────────────────────────────────── */
.rtl-body .me-1 { margin-right: 0    !important; margin-left: .25rem !important; }
.rtl-body .me-2 { margin-right: 0    !important; margin-left: .5rem  !important; }
.rtl-body .ms-1 { margin-left:  0    !important; margin-right: .25rem !important; }
.rtl-body .ms-2 { margin-left:  0    !important; margin-right: .5rem  !important; }
.rtl-body .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
.rtl-body .text-end { text-align: start !important; }
.rtl-body .text-start { text-align: end !important; }
.rtl-body .dropdown-menu-end { --bs-position: start; }
