/*
 * SwifterPOS – Filament-inspired visual polish
 * Loaded AFTER custom.css.  Safe override layer — no color changes, no layout breakage.
 * Only spacing, typography, softness, and readability refinements.
 */

/* ───────────────────────────── 1. GLOBAL TYPOGRAPHY ─────────────────────── */
body,
.wrapper,
.sidebar-wrapper,
.page-wrapper,
.topbar,
.card,
input,
textarea,
select,
button,
.btn,
.form-control,
.form-select,
.dropdown-menu,
.nav-link,
.metismenu a,
.table {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-size: 13.5px;
    line-height: 1.6;
    letter-spacing: 0.01em;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

p {
    line-height: 1.65;
}

small, .small, .text-muted {
    font-size: 0.8125rem;
}

/* ───────────────────────────── 2. SOFTER CARDS ──────────────────────────── */
.card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.15s ease;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.875rem 1.25rem;
}

/* ───────────────────────────── 3. TOPBAR & PAGE CONTENT SPACING ─────────── */
.topbar {
    height: 54px;
}

.topbar .navbar {
    height: 54px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.page-wrapper {
    margin-top: 54px;
}

.page-wrapper .page-content {
    padding: 0.875rem 1.5rem 0.7rem 1.5rem;
}

.page-breadcrumb .breadcrumb {
    margin-bottom: 0.375rem;
}

/* Consistent section gaps */
.page-content > .row,
.page-content > .card {
    margin-bottom: 0.75rem;
}

/* Tighten gutter between cards/widgets in rows */
.row > [class*="col-"] > .card {
    margin-bottom: 0.75rem;
}

.row.g-3 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.row:not([class*="g-"]) {
    --bs-gutter-y: 0.75rem;
}

/* ───────────────────────────── 4. FORM REFINEMENTS ──────────────────────── */
.form-control,
.form-select {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label,
label:not(.form-check-label) {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: #374151;
}

.dark-theme .form-label,
.dark-theme label:not(.form-check-label) {
    color: #d1d5db;
}

.dark-theme .form-control,
.dark-theme .form-select {
    border-color: #4b5563;
}

.dark-theme .form-control:focus,
.dark-theme .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.input-group-text {
    font-size: 0.8125rem;
    border-radius: 0.5rem;
}

/* ───────────────────────────── 5. TABLE REFINEMENTS ─────────────────────── */
.table {
    font-size: 0.8125rem;
}

.table > thead > tr > th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #374151;
    border-bottom-width: 1px;
    padding: 0.75rem 0.875rem;
    white-space: nowrap;
}

.dark-theme .table > thead > tr > th {
    color: #9ca3af;
}

.table > tbody > tr > td {
    padding: 0.625rem 0.875rem;
    vertical-align: middle;
}

.table > tbody > tr {
    transition: background-color 0.1s ease;
}

.table-hover > tbody > tr:hover {
    background-color: rgba(59, 130, 246, 0.03);
}

.dark-theme .table-hover > tbody > tr:hover {
    background-color: rgba(96, 165, 250, 0.05);
}

/* ───────────────────────────── 6. BUTTONS ───────────────────────────────── */
.btn {
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.4375rem 1rem;
    letter-spacing: 0.01em;
    transition: all 0.15s ease;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.3125rem 0.75rem;
    border-radius: 0.375rem;
}

.btn-lg {
    font-size: 0.9375rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
}

/* ───────────────────────────── 7. BADGES & PILLS ────────────────────────── */
.badge {
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    padding: 0.3em 0.65em;
    border-radius: 0.375rem;
}

.rounded-pill.badge,
.badge.rounded-pill {
    border-radius: 50rem;
}

/* ───────────────────────────── 8. SIDEBAR POLISH ────────────────────────── */
.sidebar-wrapper {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-header {
    padding: 1rem 1.15rem;
}

.sidebar-header .logo-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.metismenu li a {
    font-size: 0.75rem;
    padding: 0.5rem 1.15rem;
    border-radius: 0.375rem;
    margin: 1px 0.5rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.metismenu li ul li a {
    font-size: 0.72rem;
    padding: 0.375rem 1.15rem 0.375rem 2.5rem;
}

.metismenu li a:hover {
    background-color: rgba(59, 130, 246, 0.06);
}

.dark-theme .sidebar-wrapper {
    border-right-color: rgba(255, 255, 255, 0.06);
}

.dark-theme .metismenu li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ───────────────────────────── 9. TOP HEADER ────────────────────────────── */
.topbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dark-theme .topbar {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.user-box .user-info .user-name {
    font-size: 0.8125rem;
    font-weight: 600;
}

.user-box .user-info .designattion {
    font-size: 0.6875rem;
    opacity: 0.7;
}

.user-box .user-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* ───────────────────────────── 10. DROPDOWN MENUS ───────────────────────── */
.dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 0.375rem;
    font-size: 0.8125rem;
}

.dropdown-item {
    border-radius: 0.375rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
    transition: background-color 0.1s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(59, 130, 246, 0.06);
}

.dark-theme .dropdown-menu {
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-theme .dropdown-item:hover,
.dark-theme .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.06);
}

/* ───────────────────────────── 11. MODALS ───────────────────────────────── */
.modal-content {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-header .modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ───────────────────────────── 12. ALERTS ───────────────────────────────── */
.alert {
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    padding: 0.75rem 1rem;
    border-width: 1px;
}

/* ───────────────────────────── 13. PAGINATION ───────────────────────────── */
.pagination .page-link {
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    margin: 0 2px;
    padding: 0.375rem 0.75rem;
}

.pagination .page-item.active .page-link {
    font-weight: 600;
}

/* ───────────────────────────── 14. BREADCRUMB ───────────────────────────── */
.breadcrumb {
    font-size: 0.8125rem;
    background: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
}

/* ───────────────────────────── 15. SELECT2 ALIGN ────────────────────────── */
.select2-container .select2-selection--single {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    height: calc(1.6em + 1rem + 2px);
    font-size: 0.8125rem;
}

.select2-container--open .select2-dropdown {
    border-radius: 0.5rem;
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dark-theme .select2-container .select2-selection--single {
    border-color: #4b5563;
}

/* ───────────────────────────── 15b. DATATABLES LENGTH SELECT ────────────── */
.dataTables_wrapper .dataTables_length select,
div.dataTables_length select {
    min-width: 5rem;
    padding-right: 2rem;
}

/* ───────────────────────────── 15c. WIDGET ICONS ────────────────────────── */
.widgets-icons-2 {
    width: 46px;
    height: 46px;
}

/* ───────────────────────────── 16. AUTH PAGES ───────────────────────────── */
.section-authentication-cover .auth-cover-right .card-body {
    padding: 2.5rem;
}

.section-authentication-cover .auth-cover-right h5 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ───────────────────────────── 17. PAGE FOOTER ──────────────────────────── */
.page-footer {
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 0.75rem 1.5rem;
}

/* ───────────────────────────── 18. MOBILE RESPONSIVE ────────────────────── */
@media (max-width: 991.98px) {
    .page-wrapper .page-content {
        padding: 0.75rem 1rem 0.7rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: 0.5rem 0.625rem;
    }
}

@media (max-width: 575.98px) {
    .page-wrapper .page-content {
        padding: 0.5rem 0.75rem 0.7rem 0.75rem;
    }

    .card {
        border-radius: 0.5rem;
    }

    .modal-content {
        border-radius: 0.5rem;
    }

    .section-authentication-cover .auth-cover-right .card-body {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
    }
}

/* ───────────────────────────── 19. SCROLLBAR POLISH ─────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.dark-theme ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ───────────────────────────── 20. UTILITY HELPERS ──────────────────────── */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.rounded-lg {
    border-radius: 0.75rem;
}

.text-xs {
    font-size: 0.75rem;
}
