﻿:root {
    --admin-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --admin-bg: #f1f5f9;
    --admin-text: #0f172a;
    --admin-muted: #475569;
    --admin-border: #e2e8f0;
    --admin-modal-gap: 0.85rem;
    --admin-modal-radius: 0.95rem;
    --admin-modal-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
    --admin-modal-header-bg: #f8fafc;
    --admin-modal-footer-bg: #ffffff;
    --admin-modal-input-radius: 0.72rem;
    --admin-modal-width-sm: 460px;
    --admin-modal-width-md: 640px;
    --admin-modal-width-lg: 820px;
    --admin-modal-width-xl: 940px;
}
html {
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: var(--admin-font);
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-size: 14px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

/* ─── Global weight softening ───────────────────────────────────────────────
   Tailwind utilities are overridden here (common.css loads after tailwind.min.css)
   to keep a calm hierarchy and drop the heavy 800–900 "strange" weights. */
.font-black { font-weight: 800; }
.font-extrabold { font-weight: 700; }
.font-bold { font-weight: 600; }
.tracking-wider { letter-spacing: 0.03em; }
.tracking-widest { letter-spacing: 0.06em; }

button,
input,
select,
textarea {
    font: inherit;
}

.modal.hidden {
    display: none;
}
.modal-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 0.85rem;
}
.modal-panel {
    background: #fff;
    border-radius: var(--admin-modal-radius);
    box-shadow: var(--admin-modal-shadow);
    width: min(var(--admin-modal-width-xl), 100%);
    max-height: calc(100vh - 1.7rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-body {
    padding: 0.95rem 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.modal-header,
.modal-footer {
    background: #fff;
    position: sticky;
    z-index: 1;
}
.modal-header {
    top: 0;
    border-bottom: 1px solid var(--admin-border);
    padding: 0.9rem 1rem;
    background: var(--admin-modal-header-bg);
}
.modal-header h2 {
    font-size: 1.03rem;
    line-height: 1.2;
    font-weight: 700;
}
.modal-footer {
    bottom: 0;
    border-top: 1px solid var(--admin-border);
    padding: 0.85rem 1rem;
}
.modal-body h3 {
    font-size: 0.92rem;
    line-height: 1.2;
    font-weight: 700;
}
.modal-body .rounded-2xl.border {
    border-color: var(--admin-border);
    border-radius: 0.9rem;
}
.modal-body .rounded-2xl.border.bg-slate-50 {
    background: var(--admin-modal-header-bg);
}
.modal-body .p-5,
.modal-body .p-4 {
    padding: 0.95rem !important;
}
.modal-body .text-lg {
    font-size: 0.96rem !important;
}
.modal-body label.block.text-sm {
    font-size: 0.75rem !important;
    font-weight: 600;
    color: var(--admin-muted);
}
.modal-body input:not([type=checkbox]):not([type=radio]),
.modal-body select,
.modal-body textarea {
    min-height: 2.55rem;
    border-radius: var(--admin-modal-input-radius) !important;
    padding: 0.56rem 0.78rem !important;
    font-size: 0.88rem !important;
}
.duty-type-manager-panel {
    width: min(760px, 100%);
}
.duty-type-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}
.duty-type-row__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}
.duty-type-row__meta {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: #64748b;
}
.duty-type-row__actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.duty-type-action {
    padding: 0.45rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    background: #fff;
}
.duty-type-action:hover {
    background: #f8fafc;
}
.duty-type-action--danger {
    border-color: #fecaca;
    color: #dc2626;
}
.duty-type-action--danger:hover {
    background: #fef2f2;
}
@media (max-width: 768px) {
    .modal-shell {
        padding: 0.5rem;
    }
    .modal-panel {
        width: min(100%, calc(100vw - 1rem));
        max-height: calc(100vh - 1rem);
        border-radius: 0.85rem;
    }
    .modal-header,
    .modal-footer,
    .modal-body {
        padding: 0.85rem;
    }
    .duty-type-row {
        align-items: flex-start;
        flex-direction: column;
    }
}
h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
}
.admin-shell-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.admin-shell-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: 16rem;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
}
.admin-shell-main {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
}
.admin-sidebar-scroll {
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.65) rgba(15, 23, 42, 0.08);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.admin-sidebar-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.admin-sidebar-scroll::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.12);
}
.admin-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.75);
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.12);
}
.admin-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(203, 213, 225, 0.9);
}
.admin-shell-brand {
    --admin-shell-brand-color: #3b82f6;
    gap: 0.6rem;
}
.admin-shell-brand--pending {
    visibility: hidden;
}
.admin-shell-brand-mark {
    flex: 0 0 auto;
    color: var(--admin-shell-brand-color) !important;
    line-height: 1;
}
.admin-shell-brand-mark--ready {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.2rem;
    font-size: 1rem !important;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
}
.admin-shell-brand-mark--image {
    background: #ffffff;
}
.admin-shell-brand-mark--image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.admin-shell-brand-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (min-width: 768px) {
    .admin-shell-sidebar {
        position: relative !important;
        inset: auto !important;
        flex: 0 0 16rem;
        transform: none !important;
    }
}
.page-shell {
    width: 100%;
}
.page-shell,
body > .max-w-7xl.mx-auto,
body > .mb-8 {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}
.page-intro h1,
.page-title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.15;
    color: #0f172a;
}
.page-intro p,
.page-subtitle {
    color: var(--admin-muted);
    font-size: 0.875rem;
}
.page-header,
.toolbar-stack,
body > .mb-8 > .flex.flex-col.md\:flex-row.md\:items-center.justify-between.gap-4.mb-6,
body > .max-w-7xl.mx-auto > .flex.flex-col.lg\:flex-row.lg\:items-center.lg\:justify-between.gap-4.mb-6,
body > .max-w-7xl.mx-auto > .flex.items-center.justify-between.mb-6 {
    margin-bottom: 1.5rem !important;
    gap: 1rem !important;
}

.page-header p,
.toolbar-stack p,
body > .mb-8 p.text-slate-500,
    body > .max-w-7xl.mx-auto p.text-slate-500 {
    font-size: 0.875rem;
    color: #64748b !important;
}
.admin-card {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}
.page-shell .bg-white.rounded-xl.shadow-sm.border,
.page-shell .bg-white.rounded-lg.shadow-sm,
.page-shell .bg-white.rounded-xl.shadow-md,
body > .max-w-7xl.mx-auto .bg-white.rounded-xl.shadow-sm.border,
body > .max-w-7xl.mx-auto .bg-white.rounded-xl.shadow-md,
body > .mb-8 .bg-white.rounded-xl.shadow-sm.border {
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}
.page-shell .overflow-x-auto,
body > .max-w-7xl.mx-auto .overflow-x-auto,
body > .mb-8 .overflow-x-auto {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.page-shell table,
body > .max-w-7xl.mx-auto table,
body > .mb-8 table {
    border-collapse: separate;
    border-spacing: 0;
}
.page-shell thead tr,
body > .max-w-7xl.mx-auto thead tr,
body > .mb-8 thead tr {
    background: #f8fafc !important;
}
.page-shell thead th,
body > .max-w-7xl.mx-auto thead th,
body > .mb-8 thead th {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    color: #64748b !important;
    text-transform: uppercase;
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
}
.page-shell tbody td,
body > .max-w-7xl.mx-auto tbody td,
body > .mb-8 tbody td {
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
    vertical-align: middle;
}
.page-shell tbody tr:hover,
body > .max-w-7xl.mx-auto tbody tr:hover,
body > .mb-8 tbody tr:hover {
    background: #fafcff;
}

/* Filter bars and form controls */
.page-shell .filter-grid input,
.page-shell .filter-grid select,
.page-shell .toolbar-actions input,
.page-shell .toolbar-actions select,
body > .max-w-7xl.mx-auto input[type="text"],
body > .max-w-7xl.mx-auto input[type="date"],
body > .max-w-7xl.mx-auto input[type="month"],
body > .max-w-7xl.mx-auto select,
body > .mb-8 input[type="month"],
body > .mb-8 select {
    min-height: 2.7rem;
    border-radius: 0.85rem !important;
    border-color: #d7dee8 !important;
    box-shadow: none !important;
}
.page-shell .filter-grid input:focus,
.page-shell .filter-grid select:focus,
.page-shell .toolbar-actions input:focus,
.page-shell .toolbar-actions select:focus,
body > .max-w-7xl.mx-auto input:focus,
body > .max-w-7xl.mx-auto select:focus,
body > .mb-8 input:focus,
body > .mb-8 select:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14) !important;
    outline: none;
}

/* Action buttons */
.page-shell button.bg-blue-600,
.page-shell a.bg-blue-600,
body > .max-w-7xl.mx-auto button.bg-blue-600,
body > .mb-8 button.bg-blue-600 {
    border-radius: 0.75rem !important;
    min-height: 2.35rem;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}
.page-shell button.bg-green-600,
body > .max-w-7xl.mx-auto button.bg-green-600,
body > .mb-8 button.bg-green-600 {
    border-radius: 0.75rem !important;
    min-height: 2.35rem;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.1);
}
.page-shell button.bg-slate-200,
.page-shell button.bg-gray-200,
body > .max-w-7xl.mx-auto button.bg-slate-200,
body > .max-w-7xl.mx-auto button.bg-gray-200,
body > .mb-8 button.bg-slate-200,
body > .mb-8 button.bg-gray-200 {
    border-radius: 0.75rem !important;
    min-height: 2.35rem;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    border: 1px solid #d7dee8;
}

/* Status badges and pills */
.page-shell .status-pill,
.page-shell .inline-flex.items-center.rounded-full,
body > .max-w-7xl.mx-auto .status-pill,
body > .mb-8 .status-pill {
    letter-spacing: 0.04em;
}

/* Summary/stat cards */
body > .mb-8 .grid.grid-cols-1.md\:grid-cols-3.gap-6 > div,
.page-shell .grid.grid-cols-1.md\:grid-cols-3.gap-6 > div {
    border-radius: 1rem !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}
.admin-alert {
    animation: adminAlertFadeIn 0.22s ease-out;
}

/* Shared modal tightening for legacy admin popups */
[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40:not(.hidden),
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--admin-modal-gap);
    overflow-y: auto;
}

[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative {
    top: auto !important;
    width: min(var(--admin-modal-width-md), calc(100vw - 1.7rem)) !important;
    max-height: calc(100vh - 1.7rem);
    margin: 0 auto;
    padding: 0 !important;
    border-radius: var(--admin-modal-radius) !important;
    border: 1px solid #dbe2ea;
    box-shadow: var(--admin-modal-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-between.items-center.pb-3.border-b,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-between.items-center.pb-3.border-b {
    padding: 0.9rem 1rem;
    margin: 0;
    border-color: #e2e8f0;
    flex: 0 0 auto;
}

[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .mt-5,
[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .mt-4,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .mt-5,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .mt-4 {
    padding: 0.9rem 1rem 0;
    margin-top: 0;
    overflow-y: auto;
    min-height: 0;
}

[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-end.pt-4.space-x-2.border-t.mt-4,
[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-end.pt-4.border-t.mt-4,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-end.pt-4.space-x-2.border-t.mt-4,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-end.pt-4.border-t.mt-4 {
    padding: 0.85rem 1rem;
    margin-top: 0;
    border-color: #e2e8f0;
    background: #fff;
    flex: 0 0 auto;
}

[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 h3.text-2xl,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 h3.text-2xl {
    font-size: 1.05rem;
    line-height: 1.2;
}

#cityModal > .relative { max-width: var(--admin-modal-width-sm) !important; }
#fareModal > .relative { max-width: var(--admin-modal-width-md) !important; }
#addDriverModal > .relative,
#viewDriverModal > .relative { max-width: 720px !important; }
#addVehicleModal > .relative { max-width: 860px !important; }
#addBookingModal > .relative,
#viewBookingModal > .relative { max-width: 880px !important; }
#allocationAlertModal > .relative { max-width: 760px !important; }

/* Lightweight modern modals already using flex layouts */
#customerModal:not(.hidden),
#deleteModal:not(.hidden),
#expenseModal:not(.hidden) {
    padding: var(--admin-modal-gap);
}

#customerModal > div,
#deleteModal > div,
#expenseModal > div {
    width: min(var(--admin-modal-width-md), calc(100vw - 1.7rem));
    max-height: calc(100vh - 1.7rem);
    overflow: auto;
    border-radius: var(--admin-modal-radius);
    box-shadow: var(--admin-modal-shadow);
}

/* Shared modal visual language */
[id$="Modal"].fixed:not(.hidden) .text-gray-400.hover\:text-gray-600,
[id$="Modal"].fixed:not(.hidden) .text-slate-400.hover\:text-slate-600,
#customerModal:not(.hidden) .text-slate-400.hover\:text-red-500,
#expenseModal:not(.hidden) .text-slate-400.hover\:text-slate-600,
#deleteModal:not(.hidden) .text-slate-400.hover\:text-slate-600 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[id$="Modal"].fixed:not(.hidden) .text-gray-400.hover\:text-gray-600:hover,
[id$="Modal"].fixed:not(.hidden) .text-slate-400.hover\:text-slate-600:hover,
#customerModal:not(.hidden) .text-slate-400.hover\:text-red-500:hover,
#expenseModal:not(.hidden) .text-slate-400.hover\:text-slate-600:hover,
#deleteModal:not(.hidden) .text-slate-400.hover\:text-slate-600:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb !important;
}

[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-between.items-center.pb-3.border-b,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-between.items-center.pb-3.border-b,
#customerModal > div > .flex.justify-between.items-center.mb-6.border-b.pb-4,
#expenseModal > div > .px-6.py-4.border-b.border-slate-100.flex.justify-between.items-center.bg-slate-50 {
    background: var(--admin-modal-header-bg);
}

[id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-between.items-center.pb-3.border-b h3,
[id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-between.items-center.pb-3.border-b h3,
#customerModal > div > .flex.justify-between.items-center.mb-6.border-b.pb-4 h2,
#expenseModal > div > .px-6.py-4.border-b.border-slate-100.flex.justify-between.items-center.bg-slate-50 h3 {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    line-height: 1.2;
    color: #0f172a;
}

[id$="Modal"].fixed:not(.hidden) label.block.text-sm,
[id$="Modal"].fixed:not(.hidden) .block.text-sm.font-medium,
#customerModal:not(.hidden) label.block.text-sm,
#expenseModal:not(.hidden) label.block.text-sm {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    letter-spacing: 0.01em;
}

[id$="Modal"].fixed:not(.hidden) input:not([type="checkbox"]):not([type="radio"]),
[id$="Modal"].fixed:not(.hidden) select,
[id$="Modal"].fixed:not(.hidden) textarea,
#customerModal:not(.hidden) input:not([type="checkbox"]):not([type="radio"]),
#customerModal:not(.hidden) select,
#customerModal:not(.hidden) textarea,
#expenseModal:not(.hidden) input:not([type="checkbox"]):not([type="radio"]),
#expenseModal:not(.hidden) select,
#expenseModal:not(.hidden) textarea {
    min-height: 2.55rem;
    border-radius: var(--admin-modal-input-radius) !important;
    border-color: #d7dee8 !important;
    padding: 0.56rem 0.78rem !important;
    font-size: 0.88rem !important;
    line-height: 1.35;
    box-shadow: none !important;
}

[id$="Modal"].fixed:not(.hidden) textarea,
#customerModal:not(.hidden) textarea,
#expenseModal:not(.hidden) textarea {
    min-height: auto;
}

[id$="Modal"].fixed:not(.hidden) input:focus,
[id$="Modal"].fixed:not(.hidden) select:focus,
[id$="Modal"].fixed:not(.hidden) textarea:focus,
#customerModal:not(.hidden) input:focus,
#customerModal:not(.hidden) select:focus,
#customerModal:not(.hidden) textarea:focus,
#expenseModal:not(.hidden) input:focus,
#expenseModal:not(.hidden) select:focus,
#expenseModal:not(.hidden) textarea:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14) !important;
    outline: none;
}

[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.space-x-2.border-t.mt-4,
[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.border-t.mt-4,
#customerModal:not(.hidden) form .mt-8.flex.justify-end.gap-3,
#expenseModal:not(.hidden) form .pt-4.flex.justify-end.gap-3,
#deleteModal:not(.hidden) .flex.justify-center.gap-3 {
    gap: 0.6rem !important;
}

[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.space-x-2.border-t.mt-4 button,
[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.border-t.mt-4 button,
#customerModal:not(.hidden) form .mt-8.flex.justify-end.gap-3 button,
#expenseModal:not(.hidden) form .pt-4.flex.justify-end.gap-3 button,
#deleteModal:not(.hidden) .flex.justify-center.gap-3 button {
    min-height: 2.15rem;
    padding: 0.45rem 0.75rem !important;
    border-radius: 0.65rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.space-x-2.border-t.mt-4 button.bg-gray-200,
[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.border-t.mt-4 button.bg-gray-200,
[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.space-x-2.border-t.mt-4 button.bg-slate-200,
[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.border-t.mt-4 button.bg-slate-200,
#customerModal:not(.hidden) form .mt-8.flex.justify-end.gap-3 button:not(.bg-blue-600),
#expenseModal:not(.hidden) form .pt-4.flex.justify-end.gap-3 button:not(.bg-blue-600),
#deleteModal:not(.hidden) .flex.justify-center.gap-3 button.border {
    background: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #d7dee8 !important;
}

[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.space-x-2.border-t.mt-4 button.bg-blue-600,
[id$="Modal"].fixed:not(.hidden) .flex.justify-end.pt-4.border-t.mt-4 button.bg-blue-600,
#customerModal:not(.hidden) form .mt-8.flex.justify-end.gap-3 button.bg-blue-600,
#expenseModal:not(.hidden) form .pt-4.flex.justify-end.gap-3 button.bg-blue-600,
#deleteModal:not(.hidden) .flex.justify-center.gap-3 button.bg-red-600 {
    border: 1px solid transparent !important;
}

#customerModal > div {
    max-width: 520px;
}

#expenseModal > div {
    max-width: 460px;
}

#deleteModal > div {
    max-width: 360px;
    padding: 1rem 0.95rem;
}

#companyUsersModal .tenant-modal {
    max-width: var(--admin-modal-width-xl);
}

#createInvoiceModal .modal-content,
#receiptModal .modal-content,
#dutySlipModal .modal-panel {
    max-width: var(--admin-modal-width-xl) !important;
}

#viewInvoiceModal .modal-content {
    max-width: var(--admin-modal-width-lg) !important;
}

@media (max-width: 1024px) {
    .admin-auto-responsive-table,
    .admin-auto-responsive-table thead,
    .admin-auto-responsive-table tbody,
    .admin-auto-responsive-table tr,
    .admin-auto-responsive-table th,
    .admin-auto-responsive-table td {
        display: block;
        width: 100% !important;
    }

    .admin-auto-responsive-table thead {
        display: none;
    }

    .admin-auto-responsive-table tbody {
        display: grid;
        gap: 0.95rem;
        padding: 1rem;
    }

    .admin-auto-responsive-table tr {
        border: 1px solid #e2e8f0;
        border-radius: 1rem;
        overflow: hidden;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
        background: #fff;
    }

    .admin-auto-responsive-table td[data-label] {
        display: grid;
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 0.72rem;
        align-items: start;
        padding: 0.78rem 1rem !important;
        border-bottom: 1px solid #f1f5f9;
    }

    .admin-auto-responsive-table td[data-label]::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        line-height: 1.35;
    }

    .admin-auto-responsive-table td[data-label]:last-child {
        border-bottom: 0;
    }

    .admin-auto-responsive-table td[data-label] > * {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    [id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40:not(.hidden),
    [id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40:not(.hidden),
    #customerModal:not(.hidden),
    #deleteModal:not(.hidden),
    #expenseModal:not(.hidden) {
        padding: 0.6rem;
    }

    [id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative,
    [id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative,
    #customerModal > div,
    #deleteModal > div,
    #expenseModal > div {
        max-height: calc(100vh - 1.2rem);
        border-radius: 0.9rem !important;
    }

    [id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-between.items-center.pb-3.border-b,
    [id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-between.items-center.pb-3.border-b,
    [id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .mt-5,
    [id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .mt-4,
    [id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .mt-5,
    [id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .mt-4,
    [id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-end.pt-4.space-x-2.border-t.mt-4,
    [id$="Modal"].fixed.inset-0.bg-gray-600.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-end.pt-4.border-t.mt-4,
    [id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-end.pt-4.space-x-2.border-t.mt-4,
    [id$="Modal"].fixed.inset-0.bg-gray-900.bg-opacity-50.overflow-y-auto.h-full.w-full.z-40 > .relative > .flex.justify-end.pt-4.border-t.mt-4 {
        padding-left: 0.95rem;
        padding-right: 0.95rem;
    }

    .admin-auto-responsive-table tbody {
        padding: 0.8rem;
        gap: 0.75rem;
    }

    .admin-auto-responsive-table td[data-label] {
        grid-template-columns: 86px minmax(0, 1fr);
        padding: 0.72rem 0.85rem !important;
    }
}

/* ─── Phone / small-screen tuning (Android-app-like density) ─────────────── */
@media (max-width: 640px) {
    .p-6 { padding: 1rem; }
    .p-8 { padding: 1.25rem; }
    .p-10 { padding: 1.5rem; }
    .px-6 { padding-left: 1rem; padding-right: 1rem; }
    .px-8 { padding-left: 1.25rem; padding-right: 1.25rem; }
    .py-6 { padding-top: 1rem; padding-bottom: 1rem; }
    .py-8 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
    .gap-6 { gap: 1rem; }
    .gap-8 { gap: 1.25rem; }
    .gap-4 { gap: 0.85rem; }

    .admin-shell-main,
    .admin-shell-content { overflow-x: hidden; }

    .page-intro h1,
    .page-title { font-size: 1.5rem; }

    .page-header,
    .toolbar-stack,
    body > .mb-8 > .flex,
    body > .max-w-7xl.mx-auto > .flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.85rem !important;
    }
}
@keyframes adminAlertFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin scrollbar theme */
html,
body,
* {
    scrollbar-width: thin;
    scrollbar-color: #2563eb #eaf1f8;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #eaf1f8;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border: 2px solid #eaf1f8;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1d4ed8 0%, #1e3a8a 100%);
}

::-webkit-scrollbar-corner {
    background: #eaf1f8;
}

.text-title-case-display {
    text-transform: none;
}

.sidebar,
.admin-sidebar,
aside {
    scrollbar-color: #60a5fa #1e293b;
}

.sidebar::-webkit-scrollbar-track,
.admin-sidebar::-webkit-scrollbar-track,
aside::-webkit-scrollbar-track {
    background: #1e293b;
}

.sidebar::-webkit-scrollbar-thumb,
.admin-sidebar::-webkit-scrollbar-thumb,
aside::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    border-color: #1e293b;
}
