/**
 * Dashboard Pro — Dark Red Premium Theme
 * Modern Red color scheme with glassmorphism effects
 * Typography: Inter (primary font)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   GOOGLE TRANSLATE UI HIDING - Global (Maximum Priority)
   ========================================================================== */
.goog-te-banner-frame,
.goog-te-balloon-frame,
.goog-te-menu-frame,
.goog-te-menu-value,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-combo,
iframe.goog-te-banner-frame,
iframe.goog-te-menu-frame,
#goog-gt-tt,
.goog-te-spinner-pos,
.goog-tooltip,
div.skiptranslate,
.skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-l4eHX-hSRGPd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe-OiiCO,
#google_translate_element,
[id^="goog-gt-"],
[class^="goog-te-"],
[class*="skiptranslate"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    overflow: hidden !important;
    z-index: -1 !important;
}

body {
    top: 0 !important;
}

html.translated-ltr,
html.translated-rtl {
    margin-top: 0 !important;
}

.goog-text-highlight {
    background: transparent !important;
    box-shadow: none !important;
}

/* ==========================================================================
   1. CSS VARIABLES - Dark Red Premium Theme
   ========================================================================== */
:root {
    /* Backgrounds - Pure Dark base */
    --bg-body: #0a0a0a;
    --bg-sidebar: rgba(20, 20, 20, 0.98);
    --bg-header: rgba(20, 20, 20, 0.95);
    --bg-card: rgba(20, 20, 20, 0.9);
    --bg-card-hover: rgba(26, 26, 26, 0.95);
    --bg-elevated: rgba(26, 26, 26, 0.95);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* Primary Accent Colors - Red Theme */
    --accent-primary: #e53935;
    --accent-secondary: #b71c1c;
    --accent-blue: #e53935;
    --accent-cyan: #ff5252;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #e53935;
    --accent-orange: #ff5252;
    --accent-purple: #b71c1c;
    --accent-pink: #ff5252;

    /* Gradients - Red Theme */
    --gradient-primary: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
    --gradient-pink-purple: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
    --gradient-blue-cyan: linear-gradient(135deg, #e53935 0%, #ff5252 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-orange: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
    --gradient-red: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;

    /* Glassmorphism Properties */
    --glass-blur: blur(20px);
    --glass-border: 1px solid rgba(229, 57, 53, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);

    /* Borders & Shadows */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(229, 57, 53, 0.4);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow-pink: 0 0 30px rgba(229, 57, 53, 0.3);
    --shadow-glow-blue: 0 0 30px rgba(229, 57, 53, 0.4);

    /* Spacing */
    --gap: 16px;
    --radius-card: 24px;
    --radius-btn: 12px;
    --radius-input: 12px;

    /* Sidebar - Full Width */
    --sidebar-width: 250px;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html,
body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    /* iOS Safari Fix: Use dvh with vh fallback */
    min-height: 100vh !important;
    min-height: 100dvh !important;
    -webkit-overflow-scrolling: touch;
    /* iOS: Allow normal scrolling */
    overscroll-behavior-y: auto;
    position: relative;
}

body {
    background: var(--bg-body) !important;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 400;
    font-size: 15px;
    position: relative;
    touch-action: pan-y pan-x;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #ff5252;
    transition: color .3s ease;
}

a:hover {
    color: #e53935;
    text-decoration: none;
}

hr {
    border-color: var(--border-color) !important;
}

code {
    background: rgba(229, 57, 53, 0.15) !important;
    color: #ff5252 !important;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
}

/* ==========================================================================
   3. TYPOGRAPHY - Nunito for headings, Inter for body
   ========================================================================== */
h1,
.h1 {
    font-size: clamp(1.5rem, 4vw, 1.75rem);
}

h2,
.h2 {
    font-size: clamp(1.3rem, 3.5vw, 1.5rem);
}

h3,
.h3 {
    font-size: clamp(1.15rem, 3vw, 1.25rem);
}

h4,
.h4 {
    font-size: 1.125rem;
}

h5,
.h5 {
    font-size: 1rem;
}

h6,
.h6 {
    font-size: 0.9rem;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: 'Nunito', sans-serif !important;
    font-weight: 700;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    color: var(--text-primary);
}

/* ==========================================================================
   4. LAYOUT — WRAPPER
   ========================================================================== */
.wrapper {
    overflow-x: hidden !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    background: var(--bg-body) !important;
    min-height: calc(100vh - 57px);
    min-height: calc(100dvh - 57px);
    overflow-y: auto !important;
    flex: 1;
    /* iOS: Ensure content is scrollable */
    -webkit-overflow-scrolling: touch;
}

.content {
    padding: var(--gap);
    width: 100%;
    max-width: 100%;
}

.content-header {
    padding: 15px var(--gap);
}

.content-header h1 {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: clamp(20px, 4vw, 28px);
    color: var(--text-primary);
}

.container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* ==========================================================================
   5. LAYOUT — HEADER / NAVBAR (Glassmorphism)
   ========================================================================== */
.main-header.navbar {
    background: var(--bg-header) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-primary) !important;
}

.navbar .navbar-brand,
.main-header .brand-text {
    font-family: 'Nunito', sans-serif !important;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   6. LAYOUT — SIDEBAR (Glassmorphism)
   ========================================================================== */
.main-sidebar {
    background: var(--bg-sidebar) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1038 !important;
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    position: fixed !important;
    top: 0;
    left: 0;
    /* iOS Safari Fix: Use dvh with vh fallback */
    height: 100vh !important;
    height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* iOS: Better scroll performance */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.main-sidebar::-webkit-scrollbar {
    width: 6px;
}

.main-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.main-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Desktop sidebar margin */
.sidebar-mini:not(.sidebar-collapse) .content-wrapper,
.sidebar-mini:not(.sidebar-collapse) .main-footer,
.sidebar-mini:not(.sidebar-collapse) .main-header {
    margin-left: var(--sidebar-width) !important;
    transition: margin-left .3s ease-in-out !important;
}

.sidebar-mini:not(.sidebar-collapse) .content-wrapper {
    width: calc(100% - var(--sidebar-width)) !important;
    min-width: 0 !important;
}

/* Sidebar collapsed */
.sidebar-collapse .main-sidebar {
    margin-left: calc(-1 * var(--sidebar-width)) !important;
    width: 0 !important;
}

.sidebar-collapse .content-wrapper,
.sidebar-collapse .main-footer,
.sidebar-collapse .main-header {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Brand link */
.brand-link {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 18px 20px !important;
}

.brand-link .brand-text {
    font-family: 'Nunito', sans-serif !important;
    font-weight: 700;
    font-size: 18px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar nav */
.nav-sidebar .nav-item {
    margin: 4px 12px;
}

.nav-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    border-radius: var(--radius-btn) !important;
    padding: 12px 16px !important;
    transition: all .3s ease;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    overflow: visible;
}

.nav-sidebar .nav-link:hover {
    background: rgba(229, 57, 53, 0.15) !important;
    color: var(--text-primary) !important;
}

.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active,
.nav-sidebar .nav-link.active {
    background: var(--gradient-primary) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.nav-sidebar .nav-icon {
    color: var(--text-muted);
    font-size: 18px;
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

.nav-sidebar .nav-link.active .nav-icon,
.nav-sidebar .nav-link:hover .nav-icon {
    color: var(--text-primary);
}

.nav-header {
    color: var(--text-muted) !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 15px 20px 8px !important;
    font-family: 'Inter', sans-serif;
}

/* ==========================================================================
   7. LAYOUT — FOOTER
   ========================================================================== */
.main-footer {
    background: var(--bg-header) !important;
    border-top: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    padding: 15px 20px;
    position: relative;
    z-index: 10;
}

.main-footer a {
    color: var(--accent-pink) !important;
}

/* ==========================================================================
   8. CARDS (Glassmorphism)
   ========================================================================== */
.card {
    background: var(--bg-card) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-card) !important;
    box-shadow: var(--glass-shadow) !important;
    overflow: hidden;
    transition: box-shadow .2s ease;
    /* animation disabled for performance */
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(229, 57, 53, 0.3) !important;
}

.card-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 16px 20px;
}

.card-title {
    color: var(--text-primary) !important;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

.card-title i {
    color: var(--accent-primary);
    margin-right: 10px;
}

.card-body {
    padding: 20px;
    color: var(--text-secondary);
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.card-footer {
    background: rgba(255, 255, 255, 0.03) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Dashboard stat cards */
.small-box {
    border-radius: var(--radius-card) !important;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all .3s ease;
}

.small-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.small-box.bg-info {
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.15), rgba(183, 28, 28, 0.15)) !important;
    border-left: 4px solid var(--accent-primary);
}

.small-box.bg-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15)) !important;
    border-left: 4px solid var(--accent-green);
}

.small-box.bg-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.15)) !important;
    border-left: 4px solid var(--accent-yellow);
}

.small-box.bg-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15)) !important;
    border-left: 4px solid var(--accent-red);
}

.small-box h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3.5vw, 2rem);
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.small-box p {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.small-box .icon {
    color: rgba(255, 255, 255, 0.15);
    font-size: 70px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.small-box .inner {
    padding: 20px;
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

/* Info box */
.info-box {
    background: var(--bg-card) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-card) !important;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    min-width: 0;
}

.info-box-content {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.info-box-number {
    font-size: clamp(16px, 3vw, 24px) !important;
    word-break: break-word;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

.info-box-icon {
    border-radius: 12px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-box-icon.bg-info {
    background: var(--gradient-primary) !important;
}

.info-box-icon.bg-success {
    background: var(--gradient-green) !important;
}

.info-box-icon.bg-warning {
    background: var(--gradient-orange) !important;
}

.info-box-icon.bg-danger {
    background: var(--gradient-red) !important;
}

/* Stock overview */
.stock-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-cyan);
}

.stock-item.critical {
    border-left-color: var(--accent-red);
}

.stock-item.low {
    border-left-color: var(--accent-orange);
}

.stock-item .stock-count {
    font-family: 'Nunito', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

/* ==========================================================================
   9. TABLES
   ========================================================================== */
.table-responsive {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table {
    color: var(--text-secondary) !important;
    width: 100%;
}

.table thead th {
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--text-muted) !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px;
    white-space: nowrap;
}

.table td,
.table th {
    border-color: var(--border-color) !important;
    padding: 12px;
    vertical-align: middle;
    word-break: break-word;
    max-width: 300px;
}

.table td:last-child {
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background: rgba(229, 57, 53, 0.08) !important;
}

.table-bordered {
    border: 1px solid var(--border-color) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   10. FORMS (Glassmorphism)
   ========================================================================== */
.form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-input) !important;
    color: var(--text-primary) !important;
    padding: 12px 15px;
    font-size: 16px !important;
    /* Prevent mobile zoom */
    transition: all .3s ease;
    max-width: 100% !important;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-input) !important;
    color: var(--accent-secondary) !important;
}

label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
}

/* Select styling — custom arrow, no native VVVV */
select,
select.form-control,
select.custom-select,
select.form-select,
.form-group select,
.modal select,
.card select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    padding-right: 35px !important;
    cursor: pointer;
}

select::-ms-expand {
    display: none !important;
}

select option,
.custom-select option {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Switches */
.custom-switch .custom-control-input:checked~.custom-control-label::before {
    background: var(--gradient-primary) !important;
    border-color: var(--accent-primary) !important;
}

.custom-control-label::before {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Input groups */
.input-group {
    display: flex;
    flex-wrap: nowrap;
    max-width: 100%;
}

.input-group>.form-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* ==========================================================================
   11. BUTTONS
   ========================================================================== */
.btn {
    border-radius: var(--radius-btn) !important;
    font-weight: 600;
    padding: 10px 20px;
    transition: all .3s ease;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: .5px;
    white-space: nowrap;
    max-width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Button hover lift effect */
.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Focus states for accessibility */
.btn:focus,
.btn:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.3) !important;
}

/* Primary button */
.btn-primary {
    background: var(--gradient-primary) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(229, 57, 53, 0.4);
}

.btn-primary:active {
    box-shadow: 0 2px 10px rgba(229, 57, 53, 0.3);
}

/* Success button */
.btn-success {
    background: var(--gradient-green) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Info button */
.btn-info {
    background: var(--gradient-blue-cyan) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

/* Warning button */
.btn-warning {
    background: var(--gradient-orange) !important;
    border: none !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* Danger button */
.btn-danger {
    background: var(--gradient-red) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Secondary button */
.btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Outline buttons */
.btn-outline-primary {
    background: transparent !important;
    border: 2px solid var(--accent-primary) !important;
    color: var(--accent-primary) !important;
}

.btn-outline-primary:hover {
    background: var(--gradient-primary) !important;
    color: var(--text-primary) !important;
}

.btn-outline-secondary {
    background: transparent !important;
    border: 2px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

/* Block button */
.btn-block {
    width: 100%;
    display: flex;
}

/* Small button */
.btn-sm {
    padding: 6px 14px !important;
    font-size: 11px !important;
    min-height: 36px !important;
}

/* Extra small button */
.btn-xs {
    padding: 4px 10px !important;
    font-size: 10px !important;
    min-height: 28px !important;
}

/* MOBILE: Larger touch targets for btn-xs - minimum 40px for touch devices */
@media (max-width: 991.98px) {
    .btn-xs {
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 40px !important;
        min-width: 40px !important;
    }
    
    .action-buttons {
        justify-content: flex-start;
    }
    
    .action-buttons .btn {
        min-height: 40px !important;
        min-width: 40px !important;
        padding: 8px !important;
    }
    
    .action-buttons .btn i {
        font-size: 14px !important;
    }
    
    .actions-cell {
        min-width: auto !important;
    }
}

/* Action buttons container - for table action columns */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    pointer-events: auto !important;
}

.action-buttons .btn {
    flex-shrink: 0;
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 10;
}

.action-buttons form {
    display: inline-flex !important;
    margin: 0;
    pointer-events: auto !important;
}

.action-buttons form button {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.actions-cell {
    min-width: 140px;
    white-space: normal !important;
    pointer-events: auto !important;
}

/* Large button */
.btn-lg {
    padding: 14px 28px !important;
    font-size: 15px !important;
    min-height: 52px !important;
}

/* ==========================================================================
   12. MODALS (Glassmorphism)
   ========================================================================== */
.modal-content {
    background: var(--bg-card) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 20px;
}

.modal-header.bg-primary {
    background: var(--gradient-primary) !important;
}

.modal-header.bg-success {
    background: var(--gradient-green) !important;
}

.modal-header.bg-danger {
    background: var(--gradient-red) !important;
}

.modal-header.bg-info {
    background: var(--gradient-blue-cyan) !important;
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Nunito', sans-serif;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 15px 20px;
}

.close {
    color: var(--text-primary) !important;
    text-shadow: none !important;
    opacity: .7;
}

.close:hover {
    opacity: 1;
}

.modal-dialog {
    max-width: calc(100% - 20px) !important;
    margin: 10px auto;
}

/* Modal Z-Index Fix - Ensure modals appear above sidebar on ALL screens */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.modal-backdrop.show {
    opacity: 1 !important;
}

/* Ensure modal content is interactive and not blocked */
.modal.show .modal-dialog {
    z-index: 1061 !important;
    pointer-events: auto !important;
}

/* When modal is open, ensure sidebar doesn't block it */
.modal.show ~ .main-sidebar,
body.modal-open .main-sidebar {
    z-index: 1030 !important;
}

.modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: 1062 !important;
}

/* Ensure all modal form elements are interactive */
.modal-content input,
.modal-content select,
.modal-content textarea,
.modal-content button,
.modal-content .btn,
.modal-content .form-control,
.modal-content .custom-control-input,
.modal-content .custom-switch {
    pointer-events: auto !important;
}

/* Modal select dropdown fix */
.modal-content select {
    cursor: pointer !important;
}

.modal-content select option {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
}

/* Ensure modal body is scrollable and clickable */
.modal-body {
    pointer-events: auto !important;
    overflow-y: auto;
}

/* Fix for modal forms */
.modal-content form {
    pointer-events: auto !important;
}

.modal-content .form-group {
    pointer-events: auto !important;
}

/* ==========================================================================
   13. BADGES
   ========================================================================== */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-success,
.badge.bg-success {
    background: var(--gradient-green) !important;
}

.badge-danger,
.badge-critical {
    background: var(--gradient-red) !important;
}

.badge-warning,
.badge.bg-warning {
    background: var(--gradient-orange) !important;
    color: var(--text-primary) !important;
}

.badge-info,
.badge.bg-info {
    background: var(--gradient-blue-cyan) !important;
}

.badge-primary,
.badge.bg-primary {
    background: var(--gradient-primary) !important;
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-secondary) !important;
}

/* ==========================================================================
   14. ALERTS
   ========================================================================== */
.alert {
    border-radius: 12px !important;
    border: none !important;
    padding: 15px 20px;
    word-wrap: break-word;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15) !important;
    color: var(--accent-green) !important;
    border-left: 4px solid var(--accent-green) !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--accent-red) !important;
    border-left: 4px solid var(--accent-red) !important;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: var(--accent-yellow) !important;
    border-left: 4px solid var(--accent-yellow) !important;
}

.alert-info {
    background: rgba(6, 182, 212, 0.15) !important;
    color: var(--accent-cyan) !important;
    border-left: 4px solid var(--accent-cyan) !important;
}

/* ==========================================================================
   15. PROGRESS BARS
   ========================================================================== */
.progress {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px;
    height: 8px;
}

.progress-bar {
    border-radius: 10px;
}

.progress-bar.bg-info {
    background: var(--gradient-blue-cyan) !important;
}

.progress-bar.bg-success {
    background: var(--gradient-green) !important;
}

.progress-bar.bg-warning {
    background: var(--gradient-orange) !important;
}

.progress-bar.bg-danger {
    background: var(--gradient-red) !important;
}

/* ==========================================================================
   16. DROPDOWNS (Glassmorphism)
   ========================================================================== */
.dropdown-menu {
    background: var(--bg-card) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
    color: var(--text-secondary) !important;
    padding: 10px 20px;
}

.dropdown-item:hover {
    background: rgba(229, 57, 53, 0.15) !important;
    color: var(--text-primary) !important;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   17. NAV PILLS / TABS
   ========================================================================== */
.nav-pills .nav-link {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 10px;
    margin: 3px;
    font-weight: 500;
}

.nav-pills .nav-link.active {
    background: var(--gradient-primary) !important;
    color: var(--text-primary) !important;
}

.nav-pills .nav-link:hover:not(.active) {
    background: rgba(229, 57, 53, 0.15);
    color: var(--accent-primary);
}

/* ==========================================================================
   18. BREADCRUMBS
   ========================================================================== */
.breadcrumb {
    background: transparent !important;
    margin: 0;
    flex-wrap: wrap;
}

.breadcrumb-item a {
    color: var(--accent-primary) !important;
}

.breadcrumb-item.active {
    color: var(--text-muted) !important;
}

/* ==========================================================================
   19. PAGINATION & DATATABLES
   ========================================================================== */
.page-link {
    background: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-secondary) !important;
    border-radius: 8px !important;
    margin: 0 3px;
}

.page-link:hover {
    background: rgba(229, 57, 53, 0.15) !important;
    color: var(--accent-primary) !important;
}

.page-item.active .page-link {
    background: var(--gradient-primary) !important;
    border-color: var(--accent-primary) !important;
    color: var(--text-primary) !important;
}

/* DataTables */
.dataTables_wrapper {
    width: 100% !important;
    overflow-x: auto !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: var(--bg-input) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-secondary) !important;
    border-radius: 6px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--gradient-primary) !important;
    border-color: var(--accent-primary) !important;
    color: var(--text-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(229, 57, 53, 0.2) !important;
    color: var(--accent-primary) !important;
}

.dataTables_wrapper .dataTable {
    width: 100% !important;
}

/* ==========================================================================
   20. TEXT UTILITIES
   ========================================================================== */
.text-primary {
    color: var(--accent-primary) !important;
}

.text-success {
    color: var(--accent-green) !important;
}

.text-danger {
    color: var(--accent-red) !important;
}

.text-warning {
    color: var(--accent-yellow) !important;
}

.text-info {
    color: var(--accent-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Background utilities */
.bg-primary {
    background: var(--gradient-primary) !important;
}

.bg-success {
    background: var(--gradient-green) !important;
}

.bg-info {
    background: var(--gradient-blue-cyan) !important;
}

.bg-warning {
    background: var(--gradient-orange) !important;
}

.bg-danger {
    background: var(--gradient-red) !important;
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
}

.text-break {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

/* ==========================================================================
   21. SCROLLBARS
   ========================================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.card-body::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.card-body::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.card-body::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ==========================================================================
   22. LOGIN / REGISTER / AUTH PAGES (Glassmorphism)
   ========================================================================== */
.login-page {
    background: var(--bg-body) !important;
}

.login-box {
    width: 400px;
    max-width: 95%;
}

.login-card-body,
.card-body.login-card-body {
    background: rgba(30, 41, 59, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 57, 53, 0.2) !important;
    border-radius: 20px !important;
    padding: 40px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 50px rgba(229, 57, 53, 0.1);
}

.login-logo a {
    font-family: 'Nunito', sans-serif !important;
    font-weight: 700;
    font-size: 28px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box-msg {
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==========================================================================
   23. LANDING PAGE (Blue/Cyan Theme)
   ========================================================================== */
body.landing-page {
    background: #03070e !important;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

body.landing-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 40% 30% at 20% 30%, rgba(229, 57, 53, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 35% 25% at 80% 70%, rgba(183, 28, 28, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 30% 20% at 50% 50%, rgba(255, 82, 82, 0.08) 0%, transparent 50%);
    /* animation disabled for performance */
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .9;
    }
}

/* Glass cards */
.glass-card {
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(229, 57, 53, 0.2) !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Hero */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 80px 20px;
}

.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #94a3b8;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Feature cards */
.feature-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 30px rgba(229, 57, 53, 0.3);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    margin-bottom: 20px;
}

.feature-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-description {
    color: #94a3b8;
    font-size: .95rem;
    line-height: 1.6;
}

/* Pricing cards */
.pricing-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px 30px;
    position: relative;
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
    height: 100%;
}

.pricing-card.featured {
    border-color: var(--accent-primary);
    box-shadow: 0 0 40px rgba(229, 57, 53, 0.2);
    transform: scale(1.05);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--gradient-primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.pricing-name {
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.pricing-price {
    font-family: 'Nunito', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.pricing-price small {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.pricing-features li {
    padding: 12px 0;
    color: #94a3b8;
    font-size: .95rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features li i {
    color: #10b981;
    margin-right: 12px;
}

/* Landing buttons */
.btn-gaming {
    background: var(--gradient-primary) !important;
    border: none !important;
    color: #fff !important;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(229, 57, 53, 0.3);
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gaming:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(229, 57, 53, 0.4);
}

.btn-gaming-outline {
    background: transparent !important;
    border: 2px solid var(--accent-primary) !important;
    color: var(--accent-primary) !important;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    transition: all .3s ease;
}

.btn-gaming-outline:hover {
    background: var(--accent-primary) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* Landing stats */
.stats-card {
    text-align: center;
    padding: 30px 20px;
}

.stats-number {
    font-family: 'Nunito', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e53935, #ff5252);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-label {
    color: #94a3b8;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Landing navbar */
.navbar-gaming {
    background: rgba(3, 7, 14, 0.9) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand-gaming {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #e53935, #ff5252);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link-gaming {
    color: #94a3b8 !important;
    font-weight: 500;
    padding: 8px 16px !important;
    transition: color .3s ease;
}

.nav-link-gaming:hover {
    color: var(--accent-primary) !important;
}

/* Glass panel utility */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

/* ==========================================================================
   24. ANIMATIONS - REDUCED for performance
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in-up {
    opacity: 1;
}

.fade-in-up-delay-1 {
    opacity: 1;
}

.fade-in-up-delay-2 {
    opacity: 1;
}

/* ==========================================================================
   25. ROW / GRID
   ========================================================================== */
.row {
    display: flex;
    flex-wrap: wrap;
}

.row>* {
    flex-shrink: 0;
    min-width: 0 !important;
}

[class*="col-"] {
    min-width: 0 !important;
}

/* ==========================================================================
   26. ACCESSIBILITY & PERFORMANCE
   ========================================================================== */
*:focus-visible {
    outline: 2px solid #6366f1 !important;
    outline-offset: 2px !important;
}

.main-sidebar,
.modal-dialog,
.dropdown-menu {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   27. PRINT
   ========================================================================== */
@media print {

    .sidebar,
    .main-sidebar,
    .navbar,
    .main-header,
    .main-footer,
    .btn,
    .mobile-only {
        display: none !important;
    }

    .content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   28. RESPONSIVE — TABLET (max-width: 991.98px)
   ========================================================================== */
@media (max-width: 991.98px) {

    /* Sidebar: slide-in overlay using LEFT positioning (unified approach) */
    .main-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -260px !important;
        /* iOS Safari Fix: Use dvh with vh fallback */
        height: 100vh !important;
        height: 100dvh !important;
        width: var(--sidebar-width) !important;
        z-index: 1050 !important;
        transition: left .3s ease-in-out !important;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5) !important;
        /* iOS: Force GPU acceleration */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* Sidebar open state */
    body.sidebar-open .main-sidebar,
    .sidebar-open .main-sidebar {
        left: 0 !important;
    }

    /* Overlay backdrop when sidebar is open */
    body.sidebar-open::before,
    .sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 1;
        transition: opacity 0.3s ease;
        pointer-events: auto;
    }

    body:not(.sidebar-open)::before {
        opacity: 0;
        pointer-events: none;
    }

    /* Content stays full-width and doesn't move */
    .content-wrapper,
    .main-header,
    .main-footer {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body.sidebar-open .content-wrapper,
    body.sidebar-open .main-header,
    body.sidebar-open .main-footer,
    .sidebar-open .content-wrapper,
    .sidebar-open .main-header,
    .sidebar-open .main-footer {
        margin-left: 0 !important;
        width: 100% !important;
        transform: none !important;
    }

    .content-wrapper {
        padding: 15px !important;
        min-height: calc(100vh - 60px) !important;
    }

    .content-header {
        padding: 10px 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    /* Navbar */
    .navbar {
        padding: 10px 15px !important;
        flex-wrap: wrap;
    }

    .navbar-brand {
        font-size: 18px !important;
    }

    .navbar-nav {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }

    .navbar-nav .nav-item {
        flex-shrink: 0;
    }

    .navbar-nav .nav-link {
        white-space: nowrap;
        padding: 8px 12px !important;
        font-size: 14px !important;
    }

    .navbar-nav::-webkit-scrollbar {
        display: none;
    }

    /* Tables must scroll */
    .card-body>table,
    .table-responsive>table {
        min-width: 600px;
    }

    .table th,
    .table td {
        white-space: nowrap;
        padding: 10px 8px !important;
        font-size: 13px !important;
    }

    /* Forms — touch friendly */
    .form-control,
    .btn,
    .custom-select,
    select {
        min-height: 48px !important;
    }

    /* Mobile utility */
    .mobile-hidden {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }
}

/* ==========================================================================
   29. RESPONSIVE — SMALL TABLETS / LANDSCAPE (max-width: 767.98px)
   ========================================================================== */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 16px;
    }

    .card-header {
        padding: 15px !important;
    }

    .card-body {
        padding: 15px !important;
    }

    .card-footer {
        padding: 15px !important;
    }

    .small-box .inner {
        padding: 15px;
    }

    .small-box h3 {
        font-size: clamp(18px, 5vw, 24px) !important;
        margin-bottom: 5px;
    }

    .small-box p {
        font-size: 12px;
    }

    .small-box .icon {
        display: none;
    }

    .info-box-number {
        font-size: clamp(16px, 4vw, 20px) !important;
    }

    .btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .content-header h1 {
        font-size: 20px !important;
    }

    .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .modal-content {
        border-radius: 20px 20px 0 0 !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-body {
        padding: 15px !important;
    }

    .login-box,
    .register-box {
        width: 100% !important;
        padding: 15px !important;
        margin-top: 20px !important;
    }

    .login-card-body,
    .register-card-body {
        padding: 25px !important;
        border-radius: 20px !important;
    }

    /* Landing page */
    .hero-section {
        padding: 60px 15px;
        min-height: auto;
    }

    .hero-title {
        font-size: 2rem;
    }

    .feature-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .pricing-card {
        padding: 30px 20px;
        margin-bottom: 20px;
    }

    .pricing-card.featured {
        transform: scale(1);
    }

    .pricing-price {
        font-size: 2rem;
    }

    .stats-number {
        font-size: 2rem;
    }

    .btn-gaming,
    .btn-gaming-outline {
        width: 100%;
        padding: 12px 24px;
        font-size: .9rem;
    }

    /* Text overflow */
    p,
    span,
    div,
    td,
    th {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 12px;
        padding: 8px 10px;
    }

    /* Pagination — only show prev/next */
    .pagination {
        justify-content: center;
    }

    .page-link {
        padding: 8px 12px;
    }

    /* Alerts */
    .alert {
        font-size: 14px;
        padding: 12px 15px;
    }

    /* Select */
    select.form-control,
    .custom-select {
        max-width: 100% !important;
        width: 100% !important;
        font-size: 14px !important;
    }
}

/* ==========================================================================
   30. RESPONSIVE — PHONE (max-width: 575.98px)
   ========================================================================== */
@media (max-width: 575.98px) {
    .content-wrapper {
        padding: 8px !important;
        padding-bottom: 80px !important;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 12px !important;
    }

    .small-box .inner h3 {
        font-size: 1.1rem !important;
    }

    .small-box .inner p {
        font-size: .8rem !important;
    }

    .small-box .icon {
        font-size: 50px;
    }

    .table td,
    .table th {
        padding: 8px !important;
        font-size: 12px !important;
    }

    .btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }

    .content-header h1 {
        font-size: 18px !important;
    }

    .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
    }

    .login-card-body {
        padding: 25px !important;
    }

    .form-control,
    .input-group-text {
        padding: 8px 10px !important;
    }

    .main-header .navbar-nav.ml-auto .nav-link {
        max-width: 100px;
        font-size: .75rem !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Keep col-6 as 50% for stat cards */
    .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* ==========================================================================
   31. ANDROID SPECIFIC (360px - 480px)
   ========================================================================== */
@media (max-width: 480px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100vw !important;
    }

    /* overscroll-behavior-y removed: was blocking normal scroll on Android */

    .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .row>[class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }

    .container,
    .container-fluid {
        padding-right: 10px;
        padding-left: 10px;
    }

    label {
        margin-bottom: 8px !important;
        font-size: 14px !important;
    }

    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 4px;
    }
}

/* Android Chrome input zoom fix */
@media screen and (max-width: 767px) {

    select:focus,
    textarea:focus,
    input:focus,
    .form-control:focus {
        font-size: 16px !important;
    }
}

/* Landscape compact mode */
@media (orientation: landscape) and (max-height: 500px) {
    .content-wrapper {
        padding: 10px !important;
    }

    .card-body {
        padding: 12px !important;
    }

    .modal-dialog {
        max-height: 95vh;
    }
}

/* Mobile action buttons - wrap nicely on small screens */
@media (max-width: 768px) {
    .action-buttons {
        gap: 3px;
        justify-content: flex-start;
    }
    
    .action-buttons .btn-xs {
        padding: 6px 8px !important;
        min-height: 32px !important;
        min-width: 32px !important;
    }
    
    .actions-cell {
        min-width: 120px;
        padding: 8px 4px !important;
    }
    
    /* Make table scroll horizontally on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Hide less important columns on mobile */
    .table th.hide-mobile,
    .table td.hide-mobile {
        display: none !important;
    }
}

/* Extra small mobile devices (phones in portrait) */
@media (max-width: 576px) {
    /* Hide more columns on very small screens */
    .table th.hide-mobile-sm,
    .table td.hide-mobile-sm {
        display: none !important;
    }
    
    /* Compact action buttons - 2 rows of 3 */
    .action-buttons {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px !important;
        max-width: 110px;
    }
    
    .action-buttons .btn-xs {
        padding: 5px !important;
        min-height: 28px !important;
        min-width: 28px !important;
        font-size: 11px !important;
    }
    
    .action-buttons .btn-xs i {
        font-size: 11px !important;
    }
    
    .action-buttons form {
        display: contents !important;
    }
    
    .actions-cell {
        min-width: 115px !important;
        max-width: 120px !important;
        padding: 6px 4px !important;
    }
    
    /* Compact table cells */
    .table td, .table th {
        padding: 8px 4px !important;
        font-size: 12px !important;
    }
    
    /* Customer name column */
    .table td:first-child {
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .table td:first-child strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 90px;
    }
    
    .table td:first-child small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 90px;
    }
    
    /* Balance column compact */
    .table td .diamond-emoji {
        font-size: 10px !important;
    }
    
    /* Badge compact */
    .badge {
        padding: 3px 6px !important;
        font-size: 9px !important;
    }
    
    /* Card header compact */
    .card-header {
        padding: 10px !important;
    }
    
    .card-header .card-title {
        font-size: 14px !important;
    }
    
    .card-header .btn-sm {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }
}

/* ==========================================================================
   32. MISC FIXES
   ========================================================================== */
/* Table inline forms */
.table td form[style*="display:inline"],
.table td form[style*="display: inline"] {
    display: inline-block !important;
}

/* Plan cards */
.plan-card,
.pricing-card {
    width: 100% !important;
}

/* Language widget */
.premium-lang-widget {
    position: relative !important;
    display: inline-flex !important;
}

.lang-toggle-btn {
    min-height: 34px !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
}

/* Balance/username overflow in navbar */
.navbar-nav.ml-auto .nav-link {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .85rem;
}

@media (max-width: 575.98px) {
    .navbar-nav.ml-auto .nav-link {
        max-width: 120px;
        font-size: .75rem;
    }
}

/* ==========================================================================
   33. MOBILE CONTENT & TEXT FIXES
   ========================================================================== */
/* Additional mobile fixes - complements Section 28 */
@media (max-width: 991.98px) {

    /* Prevent text rotation in stat boxes */
    .small-box,
    .info-box,
    .card {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .small-box .inner h3,
    .small-box .inner p,
    .info-box-text,
    .info-box-number {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
    }

    .small-box-footer {
        writing-mode: horizontal-tb !important;
    }

    /* Hide desktop elements */
    .d-none-mobile {
        display: none !important;
    }

    /* Form adjustments */
    .form-row {
        margin-left: 0;
        margin-right: 0;
    }

    .form-row>.col,
    .form-row>[class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* Button groups stack */
    .btn-group-mobile {
        flex-direction: column;
        width: 100%;
    }

    .btn-group-mobile .btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* ==========================================================================
   34. TABLET BREAKPOINT (768px - 991px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container-fluid {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .card-body {
        padding: 18px !important;
    }

    .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .col-md-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .col-md-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .table th,
    .table td {
        font-size: 13px !important;
        padding: 10px !important;
    }

    .btn {
        padding: 10px 16px !important;
        font-size: 12px !important;
    }
}

/* ==========================================================================
   35. PHONE LANDSCAPE (425px - 767px)
   ========================================================================== */
@media (min-width: 425px) and (max-width: 767.98px) {
    .content-wrapper {
        padding: 12px !important;
    }

    .container-fluid {
        padding: 0 12px !important;
    }

    .row {
        margin-left: -8px;
        margin-right: -8px;
    }

    .row>[class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* 2 columns for stat boxes */
    .col-6,
    .col-sm-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .card {
        margin-bottom: 15px;
    }

    .card-body {
        padding: 15px !important;
    }

    .small-box .inner h3 {
        font-size: 1.3rem !important;
    }

    .small-box .icon {
        font-size: 55px !important;
    }

    /* Form inputs full width */
    .form-control {
        width: 100% !important;
    }

    .form-group {
        margin-bottom: 15px;
    }

    /* Buttons */
    .btn {
        min-height: 44px;
        font-size: 12px !important;
    }

    .btn-sm {
        min-height: 38px;
        font-size: 11px !important;
    }

    /* Tables */
    .table {
        font-size: 12px;
    }

    .table td,
    .table th {
        padding: 10px 8px !important;
    }
}

/* ==========================================================================
   36. PHONE PORTRAIT (375px - 424px)
   ========================================================================== */
@media (min-width: 375px) and (max-width: 424.98px) {
    html {
        font-size: 15px;
    }

    .content-wrapper {
        padding: 10px !important;
    }

    .container-fluid {
        padding: 0 10px !important;
    }

    .row {
        margin-left: -6px;
        margin-right: -6px;
    }

    .row>[class*="col-"] {
        padding-left: 6px;
        padding-right: 6px;
    }

    /* 2 column layout */
    .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .card {
        margin-bottom: 12px;
        border-radius: 10px !important;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 12px !important;
    }

    .card-title {
        font-size: 14px !important;
    }

    .small-box {
        margin-bottom: 12px;
    }

    .small-box .inner {
        padding: 15px;
    }

    .small-box .inner h3 {
        font-size: 1.2rem !important;
    }

    .small-box .inner p {
        font-size: 0.7rem !important;
    }

    .small-box .icon {
        font-size: 45px !important;
        right: 10px;
    }

    .content-header h1 {
        font-size: 16px !important;
    }

    .breadcrumb {
        font-size: 11px;
    }

    /* Navbar */
    .main-header .navbar-nav .nav-link {
        padding: 8px 6px !important;
        font-size: 12px !important;
    }

    .navbar-nav.ml-auto .nav-link {
        max-width: 80px !important;
    }

    /* Tables */
    .table {
        font-size: 11px;
    }

    .table td,
    .table th {
        padding: 8px 6px !important;
    }

    /* Forms */
    .form-control {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }

    label {
        font-size: 11px !important;
    }

    /* Buttons */
    .btn {
        padding: 8px 12px !important;
        font-size: 11px !important;
        min-height: 42px;
    }

    .btn-sm {
        padding: 6px 10px !important;
        font-size: 10px !important;
        min-height: 36px;
    }

    .btn-xs {
        padding: 4px 8px !important;
        font-size: 9px !important;
        min-height: 30px;
    }

    /* Badges */
    .badge {
        padding: 4px 8px;
        font-size: 9px !important;
    }

    /* Modal */
    .modal-dialog {
        margin: 8px !important;
    }

    .modal-content {
        border-radius: 15px !important;
    }

    .modal-body {
        padding: 15px !important;
    }
}

/* ==========================================================================
   37. SMALL PHONE (320px - 374px)
   ========================================================================== */
@media (max-width: 374.98px) {
    html {
        font-size: 14px;
    }

    .content-wrapper {
        padding: 8px !important;
        padding-bottom: 70px !important;
    }

    .container-fluid {
        padding: 0 8px !important;
    }

    .row {
        margin-left: -5px;
        margin-right: -5px;
    }

    .row>[class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* Stack everything */
    .col-6,
    .col-sm-6,
    .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .card {
        margin-bottom: 10px;
        border-radius: 8px !important;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 10px !important;
    }

    .card-title {
        font-size: 13px !important;
    }

    .small-box {
        margin-bottom: 10px;
    }

    .small-box .inner {
        padding: 12px;
    }

    .small-box .inner h3 {
        font-size: 1.1rem !important;
    }

    .small-box .inner p {
        font-size: 0.65rem !important;
        letter-spacing: 0;
    }

    .small-box .icon {
        font-size: 40px !important;
        opacity: 0.5;
    }

    .content-header {
        padding: 10px 8px !important;
    }

    .content-header h1 {
        font-size: 14px !important;
    }

    .breadcrumb {
        display: none;
    }

    /* Navbar compact */
    .main-header {
        padding: 0 !important;
    }

    .main-header .navbar-nav .nav-link {
        padding: 6px 4px !important;
        font-size: 11px !important;
    }

    .navbar-nav.ml-auto .nav-link {
        max-width: 65px !important;
        font-size: 10px !important;
    }

    .brand-text {
        font-size: 12px !important;
    }

    /* Tables scroll */
    .table-responsive {
        margin: 0 -10px;
        padding: 0 10px;
    }

    .table {
        font-size: 10px !important;
        min-width: 500px;
    }

    .table td,
    .table th {
        padding: 6px 4px !important;
    }

    /* Forms */
    .form-control {
        font-size: 14px !important;
        padding: 8px 10px !important;
    }

    label {
        font-size: 10px !important;
        margin-bottom: 4px !important;
    }

    .form-group {
        margin-bottom: 12px;
    }

    /* Buttons */
    .btn {
        padding: 6px 10px !important;
        font-size: 10px !important;
        min-height: 40px;
        letter-spacing: 0;
    }

    .btn-sm {
        padding: 5px 8px !important;
        min-height: 34px;
    }

    .btn-xs {
        padding: 3px 6px !important;
        min-height: 28px;
    }

    .btn-block {
        padding: 10px !important;
    }

    /* Actions column */
    td .btn+.btn,
    td form+form,
    td .btn+form,
    td form+.btn {
        margin-left: 2px !important;
    }

    /* Badges */
    .badge {
        padding: 3px 6px;
        font-size: 8px !important;
    }

    /* Modal */
    .modal-dialog {
        margin: 5px !important;
        max-width: calc(100% - 10px) !important;
    }

    .modal-content {
        border-radius: 12px !important;
    }

    .modal-header {
        padding: 12px !important;
    }

    .modal-body {
        padding: 12px !important;
    }

    .modal-title {
        font-size: 14px !important;
    }

    /* Alerts */
    .alert {
        padding: 10px !important;
        font-size: 12px !important;
    }

    /* Hide non-essential on very small screens */
    .d-xs-none {
        display: none !important;
    }
}

/* ==========================================================================
   38. RESPONSIVE UTILITIES
   ========================================================================== */
/* Mobile-friendly action buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.action-buttons .btn {
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .action-buttons {
        flex-direction: row;
        justify-content: flex-start;
    }

    .action-buttons .btn {
        padding: 6px 8px !important;
    }
}

/* Responsive grid helpers */
.mobile-full {
    width: 100%;
}

@media (max-width: 767.98px) {
    .mobile-full {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .mobile-half {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .mobile-stack {
        flex-direction: column !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    .mobile-hide {
        display: none !important;
    }
}

/* Touch-friendly spacing */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .form-control {
        min-height: 44px;
    }

    .custom-select {
        min-height: 44px;
    }

    /* Increase tap targets */
    .table td .btn,
    .table td a {
        padding: 8px 10px !important;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .main-header {
        padding-left: max(15px, env(safe-area-inset-left)) !important;
        padding-right: max(15px, env(safe-area-inset-right)) !important;
    }

    .content-wrapper {
        padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
    }
}

/* ==========================================================================
   39. PRODUCT CARDS (Mobile)
   ========================================================================== */
.product-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-card) !important;
    transition: all 0.3s ease;
}

.product-card:hover {
    border-color: var(--accent-primary) !important;
    box-shadow: var(--shadow-glow-pink) !important;
}

.product-card .card-body {
    background: transparent !important;
}

.product-card h6 {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.product-card .btn-block {
    border-radius: var(--radius-btn) !important;
}

/* Product filter dropdown */
#deviceFilter {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-input) !important;
}

#deviceFilter:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 10px rgba(229, 57, 53, 0.2) !important;
}

/* ==========================================================================
   40. RESPONSIVE DATA TABLES
   ========================================================================== */
/* Make DataTables mobile-friendly */
.dataTables_wrapper {
    overflow-x: auto;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

@media (max-width: 767.98px) {

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        text-align: left !important;
        float: none !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 8px;
    }

    .dataTables_wrapper .dataTables_length select {
        width: auto !important;
    }

    .dataTables_wrapper .dataTables_info {
        text-align: center;
        padding-top: 10px;
    }

    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        float: none !important;
        margin-top: 10px;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 8px 12px !important;
    }
}

/* ==========================================================================
   41. RESPONSIVE FORMS
   ========================================================================== */
@media (max-width: 767.98px) {

    /* Stack form groups */
    .form-row>.col,
    .form-row>[class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    /* Input groups */
    .input-group {
        flex-wrap: wrap;
    }

    .input-group>.form-control {
        flex: 1 1 100%;
        margin-bottom: 8px;
        border-radius: var(--radius-input) !important;
    }

    .input-group>.input-group-append,
    .input-group>.input-group-prepend {
        flex: 1 1 100%;
    }

    .input-group>.input-group-append .btn,
    .input-group-append>.btn {
        width: 100%;
        border-radius: var(--radius-input) !important;
    }

    /* Inline forms stack */
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline .form-control {
        width: 100%;
        margin-bottom: 10px;
    }

    .form-inline .btn {
        width: 100%;
    }
}

/* ==========================================================================
   42. LOGIN & PUBLIC PAGES RESPONSIVE
   ========================================================================== */
.login-page,
.register-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box,
.register-box {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

@media (max-width: 480px) {

    .login-box,
    .register-box {
        max-width: 100%;
    }

    .login-card-body,
    .register-card-body {
        padding: 25px 20px !important;
    }

    .login-box-msg,
    .register-box-msg {
        font-size: 14px;
    }
}

/* ==========================================================================
   DIAMOND ANIMATIONS & EFFECTS
   ========================================================================== */

/* Diamond Floating Particles Container */
.diamond-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Individual Diamond Particle - DISABLED for performance */
.diamond-particle {
    display: none !important;
    /* Disabled for iOS performance */
}

.diamond-particle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

/* Different diamond sizes and delays */
.diamond-particle:nth-child(1) {
    left: 5%;
    animation-delay: 0s;
    width: 8px;
    height: 8px;
}

.diamond-particle:nth-child(2) {
    left: 15%;
    animation-delay: 2s;
    width: 12px;
    height: 12px;
}

.diamond-particle:nth-child(3) {
    left: 25%;
    animation-delay: 4s;
    width: 6px;
    height: 6px;
}

.diamond-particle:nth-child(4) {
    left: 35%;
    animation-delay: 1s;
    width: 14px;
    height: 14px;
}

.diamond-particle:nth-child(5) {
    left: 45%;
    animation-delay: 3s;
    width: 8px;
    height: 8px;
}

.diamond-particle:nth-child(6) {
    left: 55%;
    animation-delay: 5s;
    width: 10px;
    height: 10px;
}

.diamond-particle:nth-child(7) {
    left: 65%;
    animation-delay: 2.5s;
    width: 7px;
    height: 7px;
}

.diamond-particle:nth-child(8) {
    left: 75%;
    animation-delay: 4.5s;
    width: 11px;
    height: 11px;
}

.diamond-particle:nth-child(9) {
    left: 85%;
    animation-delay: 1.5s;
    width: 9px;
    height: 9px;
}

.diamond-particle:nth-child(10) {
    left: 95%;
    animation-delay: 3.5s;
    width: 13px;
    height: 13px;
}

.diamond-particle:nth-child(11) {
    left: 10%;
    animation-delay: 6s;
    width: 8px;
    height: 8px;
}

.diamond-particle:nth-child(12) {
    left: 30%;
    animation-delay: 7s;
    width: 6px;
    height: 6px;
}

.diamond-particle:nth-child(13) {
    left: 50%;
    animation-delay: 8s;
    width: 10px;
    height: 10px;
}

.diamond-particle:nth-child(14) {
    left: 70%;
    animation-delay: 9s;
    width: 12px;
    height: 12px;
}

.diamond-particle:nth-child(15) {
    left: 90%;
    animation-delay: 10s;
    width: 7px;
    height: 7px;
}

@keyframes diamondFloat {
    0% {
        opacity: 0;
        transform: rotate(45deg) translateY(100vh) scale(0.5);
    }

    10% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
        transform: rotate(45deg) translateY(-100vh) scale(1.2);
    }
}

/* Diamond Sparkle Effect on Cards */
.card {
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(229, 57, 53, 0.1) 40%,
            rgba(183, 28, 28, 0.15) 50%,
            rgba(255, 82, 82, 0.1) 60%,
            transparent 70%);
    transform: rotate(45deg) translateY(100%);
    transition: transform 0.8s ease;
    pointer-events: none;
    z-index: 1;
}

.card:hover::before {
    transform: rotate(45deg) translateY(-100%);
}

/* Diamond Border Glow Animation */
.diamond-border {
    position: relative;
    border: 2px solid transparent;
    background: var(--bg-card);
    background-clip: padding-box;
}

.diamond-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #e53935, #b71c1c, #ff5252, #b71c1c, #e53935);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    /* animation disabled for performance */
}

@keyframes diamondBorderGlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Diamond Icon Animation */
.diamond-icon {
    display: inline-block;
    /* animation disabled for performance */
}

@keyframes diamondPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 5px rgba(229, 57, 53, 0.5));
    }

    25% {
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.7));
    }

    50% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.6));
    }

    75% {
        transform: scale(1.1) rotate(-5deg);
        filter: drop-shadow(0 0 15px rgba(229, 57, 53, 0.7));
    }
}

/* Diamond Sparkle Button Effect */
.btn-diamond {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
    border: none;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-diamond::before {
    content: '💎';
    position: absolute;
    top: 50%;
    left: -30px;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0;
    transition: all 0.4s ease;
}

.btn-diamond::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-diamond:hover::before {
    left: 15px;
    opacity: 1;
}

.btn-diamond:hover::after {
    left: 100%;
}

.btn-diamond:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(229, 57, 53, 0.4);
}

/* Diamond Stat Card */
.stat-diamond {
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.1) 0%, rgba(183, 28, 28, 0.1) 100%);
    border: 1px solid rgba(229, 57, 53, 0.2);
    position: relative;
    overflow: hidden;
}

.stat-diamond::after {
    content: '💎';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    opacity: 0.15;
    /* animation disabled for performance */
}

@keyframes diamondRotate {
    0% {
        transform: translateY(-50%) rotate(0deg) scale(1);
    }

    25% {
        transform: translateY(-50%) rotate(90deg) scale(1.1);
    }

    50% {
        transform: translateY(-50%) rotate(180deg) scale(1);
    }

    75% {
        transform: translateY(-50%) rotate(270deg) scale(1.1);
    }

    100% {
        transform: translateY(-50%) rotate(360deg) scale(1);
    }
}

/* Diamond Loading Spinner */
.diamond-loader {
    width: 40px;
    height: 40px;
    position: relative;
    animation: diamondSpin 1.5s linear infinite;
}

.diamond-loader::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e53935, #ff5252);
    transform: rotate(45deg);
    border-radius: 4px;
}

.diamond-loader::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: white;
    border-radius: 50%;
}

@keyframes diamondSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Diamond Text Gradient */
.diamond-text {
    background: linear-gradient(135deg, #e53935 0%, #b71c1c 25%, #ff5252 50%, #b71c1c 75%, #e53935 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* animation disabled for performance */
}

@keyframes diamondTextShine {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* Diamond Hover Glow for Sidebar Items */
.nav-sidebar .nav-link:hover {
    position: relative;
}

.nav-sidebar .nav-link:hover::before {
    content: '💎';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    animation: diamondAppear 0.3s ease forwards;
    font-size: 12px;
}

@keyframes diamondAppear {
    0% {
        transform: translateY(-50%) scale(0) rotate(0deg);
        opacity: 0;
    }

    100% {
        transform: translateY(-50%) scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* Diamond Corner Decoration */
.diamond-corner {
    position: relative;
}

.diamond-corner::before,
.diamond-corner::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #e53935, #ff5252);
    transform: rotate(45deg);
    opacity: 0.6;
}

.diamond-corner::before {
    top: -10px;
    left: -10px;
}

.diamond-corner::after {
    bottom: -10px;
    right: -10px;
}

/* ==========================================================================
   DIAMOND CREDIT DISPLAY - Main Animation Component
   ========================================================================== */

/* Diamond Credit Container */
.diamond-credit-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 25px;
    background: rgba(20, 22, 39, 0.9);
    border-radius: 50px;
    border: 1px solid rgba(229, 57, 53, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.diamond-credit-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent,
            rgba(59, 130, 246, 0.1),
            transparent,
            rgba(6, 182, 212, 0.1),
            transparent);
    animation: creditBackgroundSpin 10s linear infinite;
}

@keyframes creditBackgroundSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Diamond Icon with Rotating Ring */
.diamond-credit-icon {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diamond-credit-icon .diamond-core {
    font-size: 28px;
    z-index: 2;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.6));
    /* animation disabled for performance */
}

@keyframes diamondCorePulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.6));
    }

    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.8)) drop-shadow(0 0 30px rgba(6, 182, 212, 0.4));
    }
}

.diamond-credit-icon .rotating-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55px;
    height: 55px;
    border: 3px solid transparent;
    border-top-color: #e53935;
    border-right-color: #ff5252;
    border-radius: 50%;
    animation: ringRotate 2s linear infinite;
}

.diamond-credit-icon .rotating-ring::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid transparent;
    border-bottom-color: #ff5252;
    border-left-color: #10b981;
    border-radius: 50%;
    animation: ringRotateReverse 3s linear infinite;
}

@keyframes ringRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes ringRotateReverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* Outer Glow Ring */
.diamond-credit-icon .glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: transparent;
    box-shadow:
        0 0 10px rgba(59, 130, 246, 0.3),
        0 0 20px rgba(6, 182, 212, 0.2),
        0 0 30px rgba(6, 182, 212, 0.1);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow:
            0 0 10px rgba(59, 130, 246, 0.3),
            0 0 20px rgba(6, 182, 212, 0.2),
            0 0 30px rgba(6, 182, 212, 0.1);
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        box-shadow:
            0 0 20px rgba(59, 130, 246, 0.5),
            0 0 40px rgba(6, 182, 212, 0.4),
            0 0 60px rgba(6, 182, 212, 0.2);
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Credit Amount Display */
.diamond-credit-amount {
    font-family: 'Nunito', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    z-index: 2;
    position: relative;
}

.diamond-credit-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Compact Diamond Credit for Navbar */
.diamond-credit-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-radius: 25px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
}

.diamond-credit-compact:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
}

.diamond-credit-compact .diamond-mini {
    font-size: 18px;
    /* animation disabled for performance */
}

@keyframes diamondMiniPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }
}

.diamond-credit-compact .credit-value {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 14px;
    background: linear-gradient(135deg, #e53935, #ff5252);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Small Screen Diamond Adjustments */
@media (max-width: 768px) {
    .diamond-particle {
        width: 6px !important;
        height: 6px !important;
    }

    .stat-diamond::after {
        font-size: 30px;
        right: 10px;
    }
}

/* ==========================================================================
   43. ADDITIONAL MOBILE UTILITIES
   ========================================================================== */
/* Force horizontal text on all devices */
* {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

/* Prevent iOS zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {

    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="url"] {
        font-size: 16px !important;
    }
}

/* Better text truncation */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Improved touch targets */
@media (hover: none) and (pointer: coarse) {

    /* Mobile devices - larger touch targets */
    .btn-sm {
        min-height: 40px !important;
        padding: 8px 14px !important;
    }

    .btn-xs {
        min-height: 36px !important;
        padding: 6px 10px !important;
    }

    .nav-link,
    .dropdown-item {
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
    }

    .form-check-label {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding-left: 30px;
    }

    .form-check-input {
        width: 20px;
        height: 20px;
    }
}

/* Card action buttons on mobile */
@media (max-width: 575.98px) {
    .card-header .card-tools {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 10px;
    }

    .card-header .card-tools .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Stack card header on very small screens */
    .card-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .card-header .card-title {
        margin-bottom: 8px;
    }
}

/* Better table action columns */
@media (max-width: 767.98px) {
    .table td:last-child {
        min-width: 100px;
    }

    .table .action-buttons,
    .table .btn-group {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .table .action-buttons .btn,
    .table .btn-group .btn {
        flex: 0 0 auto;
        padding: 6px 8px !important;
        font-size: 10px !important;
    }
}

/* Ensure all long text breaks properly */
.table td,
.card-body p,
.alert,
.modal-body {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Responsive spacing utilities */
@media (max-width: 575.98px) {
    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .mb-5 {
        margin-bottom: 1.5rem !important;
    }

    .mt-4 {
        margin-top: 1rem !important;
    }

    .mt-5 {
        margin-top: 1.5rem !important;
    }

    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Improved select visibility on dark theme */
select.form-control {
    color: var(--text-primary) !important;
    background-color: var(--bg-input) !important;
}

select.form-control option {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    padding: 10px;
}

/* Loading state for buttons */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton loading placeholder */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-card);
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

@media (max-width: 575.98px) {
    .empty-state {
        padding: 30px 15px;
    }

    .empty-state i {
        font-size: 36px;
    }
}

/* Better modal on landscape phones */
@media (orientation: landscape) and (max-height: 500px) {
    .modal-dialog {
        margin: 5px auto !important;
        max-height: calc(100vh - 10px);
    }

    .modal-content {
        max-height: calc(100vh - 10px);
        overflow-y: auto;
    }

    .modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Improved focus states for accessibility */
.form-control:focus,
.btn:focus,
.nav-link:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* Smooth transitions everywhere */
.card,
.btn,
.form-control,
.nav-link,
.table tr,
.alert {
    transition: all 0.2s ease-in-out;
}

/* Prevent FOUC (Flash of Unstyled Content) */
html {
    visibility: visible;
    opacity: 1;
}

/* ===============================================
   iOS SIDEBAR FIX - Touch handling
   =============================================== */

/* Force clickable cursor for all sidebar navigation */
.main-sidebar,
.main-sidebar .nav-link,
.main-sidebar .nav-item,
.main-sidebar .nav-item a,
.main-sidebar .brand-link,
.nav-sidebar .nav-link,
.small-box-footer {
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3) !important;
    touch-action: manipulation !important;
}

/* iOS touch active state */
.ios-touch-active {
    background-color: rgba(59, 130, 246, 0.2) !important;
    transform: scale(0.98);
}

/* Ensure sidebar links are properly clickable on iOS */
.main-sidebar .nav-link,
.main-sidebar .nav-item>a {
    position: relative;
    z-index: 10;
    display: block;
    width: 100%;
    -webkit-user-select: none;
    user-select: none;
}

/* iOS Safari safe area support for sidebar */
@supports (padding: max(0px)) {
    .main-sidebar {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    .main-sidebar .nav-sidebar {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* iOS-specific media query for touch devices */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets for sidebar links */
    .main-sidebar .nav-link {
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        padding: 12px 15px !important;
    }

    /* Ensure icons and text are vertically centered */
    .main-sidebar .nav-link .nav-icon {
        margin-right: 10px !important;
        font-size: 18px !important;
    }

    /* Better tap feedback */
    .main-sidebar .nav-link:active,
    .main-sidebar .nav-item>a:active {
        background-color: rgba(59, 130, 246, 0.3) !important;
        transition: background-color 0.1s ease;
    }

    /* Small boxes tap improvement */
    .small-box {
        -webkit-tap-highlight-color: transparent;
    }

    .small-box-footer {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Prevent long-press context menu on iOS */
    .main-sidebar,
    .main-sidebar * {
        -webkit-touch-callout: none !important;
    }
}

/* Submenu improvements for touch */
.nav-treeview {
    touch-action: manipulation !important;
}

.nav-treeview .nav-link {
    padding-left: 30px !important;
}

/* Ensure treeview arrow is tappable */
.nav-link .right.fas {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px;
    margin: -10px;
}

/* ===============================================
   iOS SAFARI CRITICAL FIXES
   =============================================== */

/* Ensure sidebar is always on top when open (iOS Safari) */
@media (max-width: 991.98px) {
    .sidebar-open .main-sidebar {
        z-index: 9999 !important;
        pointer-events: auto !important;
    }

    /* Backdrop must be below sidebar */
    .sidebar-open::before {
        z-index: 9998 !important;
        pointer-events: auto !important;
    }

    /* Ensure all sidebar children are clickable */
    .sidebar-open .main-sidebar * {
        pointer-events: auto !important;
    }

    /* iOS Safari: Force GPU acceleration for smooth animation */
    .main-sidebar {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* iOS Safari specific: Ensure nav-links are tappable */
@supports (-webkit-touch-callout: none) {

    .main-sidebar .nav-link,
    .main-sidebar .nav-item>a,
    .main-sidebar a {
        /* Force tappable area */
        position: relative !important;
        z-index: 100 !important;
        pointer-events: auto !important;

        /* iOS needs explicit sizing */
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;

        /* Prevent iOS delay */
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
    }

    /* Ensure sidebar wrapper allows touch */
    .main-sidebar .sidebar,
    .main-sidebar .nav-sidebar,
    .main-sidebar nav {
        pointer-events: auto !important;
        touch-action: auto !important;
    }
}

/* ==========================================================================
   PAGE ANIMATIONS & TRANSITIONS
   ========================================================================== */

/* Page Fade In Animation */
.content-wrapper {
    animation: pageFadeIn 0.4s ease-out;
}

@keyframes pageFadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Card Animation */
.card {
    animation: cardSlideIn 0.5s ease-out backwards;
}

.row .col-lg-3:nth-child(1) .card,
.row .col-lg-3:nth-child(1) .small-box {
    animation-delay: 0.05s;
}

.row .col-lg-3:nth-child(2) .card,
.row .col-lg-3:nth-child(2) .small-box {
    animation-delay: 0.1s;
}

.row .col-lg-3:nth-child(3) .card,
.row .col-lg-3:nth-child(3) .small-box {
    animation-delay: 0.15s;
}

.row .col-lg-3:nth-child(4) .card,
.row .col-lg-3:nth-child(4) .small-box {
    animation-delay: 0.2s;
}

.row .col-6:nth-child(1) .small-box {
    animation-delay: 0.05s;
}

.row .col-6:nth-child(2) .small-box {
    animation-delay: 0.1s;
}

.row .col-6:nth-child(3) .small-box {
    animation-delay: 0.15s;
}

.row .col-6:nth-child(4) .small-box {
    animation-delay: 0.2s;
}

@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card Hover Lift Effect */
.card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(59, 130, 246, 0.1);
}

/* Small Box Hover Effect */
.small-box {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.small-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: left 0.5s ease;
}

.small-box:hover::after {
    left: 100%;
}

.small-box:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   BUTTON ANIMATIONS
   ========================================================================== */

/* Button Press Animation */
.btn {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.96);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* Primary Button Glow */
.btn-primary {
    background: var(--gradient-primary) !important;
    border: none !important;
    position: relative;
}

.btn-primary:hover {
    box-shadow:
        0 5px 20px rgba(59, 130, 246, 0.4),
        0 0 30px rgba(6, 182, 212, 0.2);
}

/* ==========================================================================
   MENU SLIDE ANIMATION
   ========================================================================== */

/* Smooth Menu Slide */
@media (max-width: 991.98px) {
    .main-sidebar {
        transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar-open .main-sidebar {
        animation: menuSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes menuSlideIn {
        0% {
            margin-left: calc(-1 * var(--sidebar-width));
            opacity: 0.5;
        }

        100% {
            margin-left: 0;
            opacity: 1;
        }
    }

    /* Backdrop fade */
    .sidebar-open::before {
        animation: backdropFade 0.3s ease-out;
    }

    @keyframes backdropFade {
        0% {
            opacity: 0;
        }

        100% {
            opacity: 1;
        }
    }
}

/* ==========================================================================
   TABLE ROW HOVER
   ========================================================================== */

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(229, 57, 53, 0.08) !important;
    transform: scale(1.005);
}

/* ==========================================================================
   ALERT ANIMATIONS
   ========================================================================== */

.alert {
    animation: alertSlideIn 0.4s ease-out;
}

@keyframes alertSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   MODAL ANIMATIONS
   ========================================================================== */

.modal.fade .modal-dialog {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.fade.show .modal-dialog {
    animation: modalPopIn 0.3s ease-out;
}

@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   FORM INPUT FOCUS ANIMATION
   ========================================================================== */

.form-control {
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-primary) !important;
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.15),
        0 5px 20px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   BADGE PULSE ANIMATION
   ========================================================================== */

.badge-warning,
.badge-danger {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    }
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.loading-skeleton {
    background: linear-gradient(90deg,
            var(--bg-card) 25%,
            var(--bg-card-hover) 50%,
            var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeletonShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ==========================================================================
   NAVBAR CREDIT DISPLAY ENHANCEMENT
   ========================================================================== */

.navbar-nav .nav-link {
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-1px);
}

/* Diamond Credit in Navbar */
.nav-link.diamond-credit-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    padding: 6px 14px !important;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    margin-right: 8px;
}

.nav-link.diamond-credit-nav:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
    border-color: rgba(59, 130, 246, 0.4);
}

.nav-link.diamond-credit-nav .diamond-emoji {
    animation: navDiamondSpin 3s ease-in-out infinite;
}

@keyframes navDiamondSpin {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(15deg) scale(1.1);
    }

    75% {
        transform: rotate(-15deg) scale(1.1);
    }
}

/* ==========================================================================
   REDUCED MOTION PREFERENCE
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .card:hover,
    .small-box:hover,
    .btn:hover {
        transform: none !important;
    }
}

/* ==========================================================================
   iOS SAFARI SPECIFIC FIXES - CRITICAL FOR MOBILE MENU
   ========================================================================== */

/* iOS Safari: Force all clickable elements to be tappable */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari detected */

    /* Sidebar Navigation - CRITICAL */
    .main-sidebar,
    .main-sidebar .sidebar,
    .main-sidebar .nav-sidebar,
    .main-sidebar .nav-item,
    .main-sidebar .nav-link,
    .main-sidebar a {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3) !important;
        cursor: pointer !important;
    }

    /* Force pointer-events on all sidebar links */
    .main-sidebar .nav-link,
    .main-sidebar .nav-item>a,
    .main-sidebar a[href] {
        pointer-events: auto !important;
        position: relative !important;
        z-index: 100 !important;
        display: block !important;
    }

    /* Touch active state */
    .main-sidebar .nav-link.ios-touch-active,
    .main-sidebar a.ios-touch-active {
        background-color: rgba(59, 130, 246, 0.2) !important;
        opacity: 0.9 !important;
    }

    /* Ensure buttons are tappable */
    .btn,
    button,
    [role="button"] {
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3) !important;
        cursor: pointer !important;
    }

    /* Fix for sidebar overlay on iOS */
    body.sidebar-open::before {
        -webkit-backdrop-filter: blur(4px) !important;
        backdrop-filter: blur(4px) !important;
    }

    /* iOS scroll fix */
    .main-sidebar {
        -webkit-overflow-scrolling: touch !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    /* Prevent rubber-banding causing issues */
    html,
    body {
        overscroll-behavior-y: none !important;
    }

    /* Content wrapper should scroll */
    .content-wrapper {
        overscroll-behavior-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ==========================================================================
   MOBILE SIDEBAR TOUCH IMPROVEMENTS
   ========================================================================== */

/* Make sidebar links have larger touch targets */
@media (max-width: 991.98px) {
    .nav-sidebar .nav-link {
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        padding: 12px 15px !important;
    }

    .nav-sidebar .nav-treeview .nav-link {
        min-height: 44px !important;
        padding: 10px 15px 10px 35px !important;
    }

    /* Ensure submenu items are tappable */
    .nav-sidebar .nav-treeview {
        display: none;
    }

    .nav-sidebar .nav-item.menu-open>.nav-treeview {
        display: block;
    }

    /* Make brand link tappable */
    .brand-link {
        min-height: 50px !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* ==========================================================================
   BUTTON HOVER/ACTIVE STATES FOR TOUCH DEVICES
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {

    /* Touch device - no hover effects */
    .btn:hover {
        transform: none !important;
    }

    /* Use active state instead */
    .btn:active,
    .btn.btn-touch-active {
        transform: scale(0.98) !important;
        opacity: 0.9 !important;
    }

    .nav-sidebar .nav-link:active {
        background: rgba(229, 57, 53, 0.2) !important;
    }

    .card:hover {
        transform: none !important;
    }

    .small-box:hover {
        transform: none !important;
    }
}

/* ==========================================================================
   FORM ELEMENTS TOUCH IMPROVEMENTS
   ========================================================================== */

/* Ensure form elements are touch-friendly */
@media (pointer: coarse) {

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select,
    .form-control,
    .custom-select {
        min-height: 48px !important;
        font-size: 16px !important;
        /* Prevent iOS zoom */
        padding: 12px 15px !important;
    }

    .btn {
        min-height: 48px !important;
        padding: 12px 20px !important;
    }

    .btn-sm {
        min-height: 40px !important;
        padding: 8px 16px !important;
    }

    /* Checkbox/radio touch targets */
    .custom-control {
        min-height: 44px !important;
        padding-left: 2rem !important;
    }

    .custom-control-label::before,
    .custom-control-label::after {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
}

/* ==========================================================================
   FINAL POLISH - CONSISTENT SHADOWS & BORDERS
   ========================================================================== */

/* Consistent card shadows */
.card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.1) !important;
}

/* Consistent button shadows */
.btn-primary {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

.btn-success {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

.btn-danger {
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
}

.btn-info {
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3) !important;
}

.btn-warning {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3) !important;
}

/* Header consistency */
.main-header.navbar {
    height: 57px !important;
    min-height: 57px !important;
}

/* Consistent spacing */
.content {
    padding: 16px !important;
}

.content-header {
    padding: 15px 16px !important;
}

@media (max-width: 767.98px) {
    .content {
        padding: 12px !important;
    }

    .content-header {
        padding: 12px !important;
    }
}

@media (max-width: 575.98px) {
    .content {
        padding: 8px !important;
    }

    .content-header {
        padding: 10px 8px !important;
    }
}

/* ==========================================================================
   21. iOS & MOBILE RENDERING FIXES
   ========================================================================== */
@media (max-width: 991.98px) {

    /* 
       CRITICAL IOS FIX:
       Disable ALL backdrop-filters on mobile.
       The blur effect causes massive z-index and rendering issues on Safari/iOS.
    */
    .card,
    .small-box,
    .info-box,
    .dropdown-menu,
    .modal-content,
    .main-sidebar,
    .main-header,
    .form-control,
    .content-wrapper,
    body {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Force solid backgrounds to prevent bleed-through */
    .card,
    .small-box,
    .info-box,
    .dropdown-menu,
    .modal-content {
        background: #1e293b !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;
    }

    .form-control {
        background: rgba(255, 255, 255, 0.1) !important;
    }

    /* FIXED: Sidebar Rendering & Z-Index */
    .main-sidebar {
        background: #0f172a !important;
        /* Solid dark blue */
        z-index: 1100 !important;
        /* Extremely high to sit above everything */
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5) !important;
        height: 100vh !important;
        height: 100dvh !important;
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        /* Remove transform which creates new stacking context */
        transform: none !important;
    }

    /* FIXED: Sidebar Overlay - REMOVED */
    #sidebar-overlay,
    .sidebar-overlay {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        opacity: 0 !important;
    }

    /* KILL ANY PSEUDO-ELEMENT OVERLAYS */
    body.sidebar-open::before,
    body.sidebar-open::after,
    .wrapper::before,
    .wrapper::after,
    .content-wrapper::before,
    .content-wrapper::after {
        display: none !important;
        content: none !important;
        width: 0 !important;
        height: 0 !important;
        pointer-events: none !important;
    }

    .sidebar-open #sidebar-overlay {
        display: none !important;
    }

    /* FIXED: Header Z-Index */
    .main-header {
        background: #0f172a !important;
        /* Solid background */
        z-index: 1040 !important;
        position: relative !important;
    }

    /* FIXED: Content Wrapper */
    .content-wrapper {
        z-index: 1 !important;
        background: #0a0f1a !important;
    }

    /* FIXED: Modals */
    .modal {
        z-index: 10000 !important;
        /* Highest priority */
    }

    .modal-backdrop {
        z-index: 9990 !important;
        /* Below modal, above sidebar */
        background-color: #000 !important;
        opacity: 0.7 !important;
    }

    /* Input Visibility Fix */
    input,
    select,
    textarea {
        -webkit-appearance: none;
        appearance: none;
        /* Removes iOS shadow/gradient */
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Modal form elements must be interactive on mobile */
    .modal-content,
    .modal-content form,
    .modal-content .form-group,
    .modal-content .modal-body,
    .modal-content input,
    .modal-content select,
    .modal-content textarea,
    .modal-content button,
    .modal-content .btn {
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }

    /* Ensure modal dialog is properly positioned */
    .modal.show .modal-dialog {
        pointer-events: auto !important;
        z-index: 10001 !important;
    }

    .modal-content {
        pointer-events: auto !important;
        z-index: 10002 !important;
    }
}