/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #F8FAFC;
    --text-heading: #0F172A;
    --text-desc: #64748B;
    --accent-color: #4F46E5;
    --accent-hover: #4338CA;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
}

body {
    background-color: var(--bg-color) !important;
    font-family: 'Inter', sans-serif !important;
    color: var(--text-heading);
}

/* Sidebar Structural Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-heading);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    color: var(--text-desc);
    padding: 0.75rem 1.25rem;
    margin: 0.25rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    text-decoration: none;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--border-light);
    color: var(--text-heading);
}

.sidebar-nav .nav-link.active {
    background-color: #EEF2FF;
    color: var(--accent-color);
}

.sidebar-nav .nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    font-size: 1.1em;
}

/* Main Content Structural Styles */
.main-content {
    margin-left: 260px;
    padding: 2rem;
}

.navbar {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 6px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02) !important;
}

@media (max-width: 991px) {
    /* Mobile viewport containment */
    html, body {
        max-width: 100% !important;
        overflow-x: hidden !important;
        position: relative;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1060;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    /* Prevent background scroll when sidebar is open */
    body:has(.sidebar.show) {
        overflow: hidden !important;
    }

    html, body {
        max-width: 100% !important;
        overflow-x: hidden !important;
        position: relative;
    }

    .main-content {
        margin-left: 0;
        padding: calc(4.5rem + env(safe-area-inset-top)) 1rem 1rem 1rem;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .dataTables_wrapper {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* Mobile Top Bar Styles */
.mobile-top-bar > a > img {
    display: none;
}

.mobile-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--text-heading);
    color: #fff;
    padding: calc(1rem + env(safe-area-inset-top)) 1.25rem 0.75rem calc(1.25rem + env(safe-area-inset-left));
    z-index: 1050;
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.25rem;
}

.mobile-toggle-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Cards */
.card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
    margin-bottom: 1.5rem !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-heading) !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-heading);
    font-weight: 600;
}

.text-muted,
p,
.stat-label {
    color: var(--text-desc) !important;
}

/* Accent Color */
.text-primary {
    color: var(--accent-color) !important;
}

.bg-primary {
    background-color: var(--accent-color) !important;
}

/* Buttons & Forms: Corporate Premium Design */
.btn {
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 0.625rem 1.25rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

/* Respect inline display:none on buttons (overrides !important above) */
.btn[style*="display: none"],
.btn[style*="display:none"] {
    display: none !important;
}

.btn-sm {
    padding: 0.375rem 0.75rem !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
}

.form-control,
.form-select {
    border-radius: 6px !important;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-heading);
}

.form-group,
.mb-3 {
    margin-bottom: 1rem !important;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* Information Density for Stat Cards */
.stat-card-b2c {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    height: 100%;
}

.stat-card-b2c .stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-desc);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card-b2c .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}

/* DataTables Styling */
.table-hover tbody tr:hover {
    background-color: var(--bg-color) !important;
}

.table> :not(caption)>*>* {
    border-bottom-color: var(--border-light);
}

.table th {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    color: var(--text-desc) !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color) !important;
}

.table td {
    vertical-align: middle;
    color: var(--text-heading);
    font-size: 0.875rem;
}

/* Status dots vs full row coloring */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot-success {
    background-color: #10B981;
}

.status-dot-danger {
    background-color: #EF4444;
}

.status-dot-warning {
    background-color: #F59E0B;
}

.status-dot-info {
    background-color: #3B82F6;
}

/* Status Labels (badges) */
.badge {
    border-radius: 4px;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Modal tweaks */
.modal-content {
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--card-bg) !important;
    color: var(--text-heading) !important;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
    background: var(--bg-color) !important;
}

/* Login Card Override */
.login-body {
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-b2c {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--border-color);
}

.login-card-b2c h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-card-b2c p {
    color: var(--text-desc);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Print Mode */
@media print {

    .no-print,
    .sidebar,
    .navbar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    body {
        background-color: #fff !important;
    }

    .card,
    .report-table {
        border: none !important;
        box-shadow: none !important;
    }
}

/* Table Text Wrapping Fixes */
.table td,
.dataTable td {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 400px;
}

/* Minimalist B2C Outline Buttons */
.btn-k-indigo-outline {
    color: var(--accent-color) !important;
    background-color: transparent !important;
    border: 1px solid var(--accent-color) !important;
    border-radius: 6px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-k-indigo-outline:hover {
    color: #FFFFFF !important;
    background-color: var(--accent-color) !important;
}

.btn-k-indigo {
    color: #FFFFFF !important;
    background-color: var(--accent-color) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 0.5rem 1.25rem !important;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-k-indigo:hover {
    background-color: #4338CA !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.btn-k-slate-outline {
    color: var(--text-desc) !important;
    background-color: transparent !important;
    border: 1px solid var(--text-desc) !important;
    border-radius: 6px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-k-slate-outline:hover {
    color: #FFFFFF !important;
    background-color: var(--text-desc) !important;
}

.btn-k-danger-outline {
    color: #EF4444 !important;
    background-color: transparent !important;
    border: 1px solid #EF4444 !important;
    border-radius: 6px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-k-danger-outline:hover {
    color: #FFFFFF !important;
    background-color: #DC2626 !important;
}

/* DataTable Action Icons */
.btn-icon {
    color: #64748B;
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    font-size: 1.1rem;
    transition: color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-icon:hover {
    transform: translateY(-1px);
}

.btn-icon-view:hover {
    color: var(--accent-color);
}

.btn-icon-edit:hover {
    color: #EAB308;
}

.btn-icon-delete:hover {
    color: #EF4444;
}

/* === PREMIUM CORPORATE BUTTON STYLES === */

/* Primary Action (Indigo) */
.btn-primary,
.btn-k-indigo {
    background: linear-gradient(180deg, #6366F1 0%, #4F46E5 100%) !important;
    border-color: #4338CA !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover,
.btn-k-indigo:hover {
    background: linear-gradient(180deg, #4F46E5 0%, #4338CA 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Info/Secondary Action (Premium Cyan/Sky) */
.btn-info {
    background: linear-gradient(180deg, #0EA5E9 0%, #0284C7 100%) !important;
    border-color: #0369A1 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-info:hover {
    background: linear-gradient(180deg, #0284C7 0%, #0369A1 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.2), 0 2px 4px -1px rgba(14, 165, 233, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Success Action (Emerald) */
.btn-success {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%) !important;
    border-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-success:hover {
    background: linear-gradient(180deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2), 0 2px 4px -1px rgba(16, 185, 129, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Danger Action (Rose/Red) */
.btn-danger {
    background: linear-gradient(180deg, #F43F5E 0%, #E11D48 100%) !important;
    border-color: #BE123C !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #E11D48 0%, #BE123C 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.2), 0 2px 4px -1px rgba(225, 29, 72, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Warning Action (Amber) */
.btn-warning {
    background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%) !important;
    border-color: #B45309 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-warning:hover {
    background: linear-gradient(180deg, #D97706 0%, #B45309 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2), 0 2px 4px -1px rgba(245, 158, 11, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Secondary/Outline/Subtle Action (Slate/White) */
.btn-secondary,
.btn-outline-secondary,
.btn-light {
    background: #ffffff !important;
    color: #334155 !important;
    border-color: #CBD5E1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-light:hover {
    background: #F8FAFC !important;
    color: #4F46E5 !important;
    border-color: #94A3B8 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

/* Ikon Bosluklari ve Action Butonlar (Reset) */
.btn i,
.btn svg {
    margin-right: 0 !important;
    /* Managed by gap in .btn */
}

.btn-icon,
.btn-icon i {
    gap: 0 !important;
    margin-right: 0 !important;
}

/* =========================================
   MOBILE-FIRST APP THEME OPTIMIZATIONS
   ========================================= */

@media (max-width: 991px) {
    body {
        font-size: 0.875rem !important;
        /* 14px base */
    }

    h1,
    .h1 {
        font-size: 1.25rem !important;
    }

    h2,
    .h2 {
        font-size: 1.1rem !important;
    }

    h3,
    .h3 {
        font-size: 1rem !important;
    }

    h4,
    .h4 {
        font-size: 0.95rem !important;
    }

    h5,
    .h5 {
        font-size: 0.9rem !important;
    }

    /* Optimize Touch Targets for 'Fat Fingers' with slightly smaller font */
    .form-control,
    .form-select,
    .btn:not(.btn-sm) {
        min-height: 42px;
        /* Reduced from 48px */
        font-size: 0.9rem;
        /* Reduced from 1rem */
        padding: 0.5rem 1rem !important;
    }

    .btn-sm {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Stat Cards Optimization */
    .stat-card-b2c .stat-value {
        font-size: 1.25rem !important;
    }

    .stat-card-b2c .stat-title {
        font-size: 0.65rem !important;
    }

    /* Table & Badge Font Reductions */
    .table td,
    .table th,
    .dataTable td,
    .dataTable th {
        font-size: 0.75rem !important;
        /* ~12px */
        padding: 0.5rem 0.25rem !important;
        /* Denser padding */
    }

    /* Further targeting DataTables elements */
    .dataTables_info,
    .dataTables_paginate,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_filter input {
        font-size: 0.7rem !important;
    }

    .dataTables_filter input {
        min-height: 32px !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* DataTables Controls Refinement */
    .dataTables_length,
    .dataTables_filter {
        text-align: center !important;
        float: none !important;
        margin-bottom: 0.5rem !important;
    }

    .dataTables_filter label,
    .dataTables_length label {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.25rem !important;
    }

    /* Constrain content to viewport — table-responsive handles table scroll */
    .main-content {
        max-width: 100% !important;
    }

    /* DataTables wrapper contained */
    .dataTables_wrapper {
        max-width: 100% !important;
    }
    .dataTables_wrapper .dataTables_info {
        width: 100% !important;
        float: none !important;
        text-align: center !important;
    }
    .dataTables_wrapper .dataTables_paginate {
        width: 100% !important;
        float: none !important;
        text-align: center !important;
        overflow-x: auto !important;
        display: block !important;
        padding: 0.5rem 0 !important;
        -webkit-overflow-scrolling: touch;
    }
    .dataTables_wrapper .dataTables_paginate .pagination {
        display: inline-flex !important;
        white-space: nowrap !important;
        justify-content: center !important;
        margin: 0 auto !important;
    }

    table.dataTable {
        margin: 0 !important;
    }

    .badge {
        font-size: 0.65rem !important;
        padding: 0.25em 0.5em !important;
    }

    /* Optimize Screen Real Estate */
    .card {
        margin-bottom: 0.75rem !important;
        border-radius: 12px !important;
    }

    .card-body {
        padding: 1rem !important;
    }

    .card-header {
        padding: 1rem 1rem 0.5rem 1rem !important;
    }

    /* Main Content padding - adjusted for fixed header */
    .main-content {
        padding-top: calc(4.5rem + env(safe-area-inset-top)) !important;
        padding-bottom: 4rem !important;
    }

    /* Hide large individual page navbars on mobile screens since we use Mobile Top Bar */
    .page-title-row {
        display: none !important;
    }
    /* ===== MOBILE TABLE STRATEGY: DataTables Responsive (+ icon) ===== */

    /* Tables fill container — DataTables Responsive collapses excess columns */
    .table-responsive > .table,
    .table-responsive > table.dataTable {
        width: 100% !important;
    }

    /* "+" icon: proper positioning without overlapping text */
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control {
        position: relative !important;
        padding-left: 1.75rem !important;
    }
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before {
        position: absolute !important;
        left: 0.3rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 0.65rem !important;
        width: 14px !important;
        height: 14px !important;
        line-height: 14px !important;
    }

    /* Child row (expanded details) styling */
    table.dataTable > tbody > tr.child td.child {
        padding: 0.5rem 0.75rem !important;
    }
    table.dataTable > tbody > tr.child ul.dtr-details {
        width: 100% !important;
    }
    table.dataTable > tbody > tr.child .dtr-details li {
        padding: 0.35rem 0 !important;
        border-bottom: 1px solid var(--border-light);
    }


    /* Security Cards Optimization */
    .security-info-row {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        margin-bottom: 0.75rem !important;
    }
    .security-info-row i {
        margin-top: 2px;
    }
    .security-info-row span {
        font-size: 0.75rem !important;
        margin-right: 0 !important;
        flex: 1;
    }
    .security-info-row strong {
        flex: 0 0 100%;
        padding-left: 26px;
        font-size: 0.85rem !important;
        display: block;
        margin-top: -2px;
    }

    /* Sub-page Form & Layout Optimizations */
    .card-header.d-flex,
    .card-header > .d-flex {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    /* Search bar row: input + button spacing */
    .card-body > form > .row > [class*="col-md-1"],
    .card-body > form > .row > [class*="col-md-2"] {
        margin-top: 0.5rem;
    }

    /* Table action button groups — tighter on mobile */
    td .d-flex.gap-2 {
        gap: 0.125rem !important;
    }
    td .btn-icon {
        padding: 0.2rem 0.35rem !important;
        font-size: 0.95rem !important;
    }

    /* Inline forms inside table cells */
    td form[style*="inline"] {
        display: inline-block;
    }

    /* Custom popup overlay (servis.php) */
    .popup-overlay .popup-box {
        width: 92vw !important;
        max-width: 92vw !important;
        padding: 1.25rem !important;
    }

    /* Profile header mobile layout */
    .profile-header .d-flex.justify-content-between {
        flex-direction: column !important;
        gap: 0.75rem;
    }

    /* Servis.php inline styles with product/customer search wrappers */
    .customer-search-wrapper,
    .product-search-wrapper,
    .supplier-search-wrapper {
        position: relative;
    }

    /* CSV wizard steps: full-width buttons */
    .step-container .row .col-sm-4,
    .step-container .row .col-sm-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Table Density for Small Screens */
    @media (max-width: 576px) {
        .table td, .table th {
            padding: 0.5rem 0.25rem !important;
            font-size: 0.7rem !important;
        }
        
        /* Minimalist Pagination */
        .dataTables_paginate {
            margin-top: 0.75rem !important;
            display: flex !important;
            justify-content: center !important;
            flex-wrap: wrap !important;
            gap: 1px !important;
            float: none !important;
        }
        .dataTables_paginate .paginate_button {
            padding: 0.15rem 0.35rem !important;
            font-size: 0.6rem !important;
            margin: 0 !important;
            min-width: 22px !important;
            text-align: center !important;
            border-radius: 4px !important;
            border: none !important;
            background: transparent !important;
            color: #94a3b8 !important;
            box-shadow: none !important;
        }
        .dataTables_paginate .paginate_button.current {
            background: var(--accent-color) !important;
            color: white !important;
            border-radius: 4px !important;
        }
        .dataTables_paginate .paginate_button.disabled {
            color: #cbd5e1 !important;
        }
    }
}

/* Floating Action Button (FAB) Base Styles */
.fab-button {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    z-index: 1040;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.fab-button:hover {
    color: white;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.fab-button:active {
    transform: scale(0.9) translateY(2px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    color: white;
}

.fab-button i {
    margin: 0 !important;
}

/* Fullscreen Modals & Mobile Layout on Small Screens */
@media (max-width: 767.98px) {
    /* Make ALL modals fullscreen on mobile */
    .modal-dialog {
        width: 90vw !important;
        max-width: 90vw !important;
        height: auto !important;
        max-height: 82vh !important;
        margin: 9vh auto !important;
    }

    .modal-content {
        height: auto !important;
        max-height: 82vh !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        overflow: hidden;
    }

    .modal-body {
        overflow-y: auto;
        max-height: calc(82vh - 120px);
    }

    .modal-header {
        border-radius: 12px 12px 0 0 !important;
    }

    /* Stack form elements vertically inside modals */
    .modal-body .row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Stat cards 2-per-row on small mobile */
    [class*="col-md-6"]:has(> .stat-card-b2c) {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .stat-card-b2c {
        padding: 0.75rem !important;
    }

    /* Hide Floating Action Button on Mobile */
    .fab-button {
        display: none !important;
    }

    /* Show security/login card on mobile (override d-none d-md-block) */
    .card.d-md-block {
        display: block !important;
    }
}