/* ═══════════════════════════════════════════════════════════════════════════════
   Dashboard Beautiful UI Enhancements - Device Friendly
   All sections: Vendors, Orders, Packaging, Barcode Logs, Reports, Plans,
   Roles, Referral, Subscription, Settings, Videos
   ═════════════════════════════════════════════════════════════════════════════== */

/* ──────────────────────────────────────────────────────────────────────────────
   GLOBAL PAGE IMPROVEMENTS
   ────────────────────────────────────────────────────────────────────────────── */

.app-main {
    background: var(--brand-bg);
}

/* Improved page header with gradient text */
.page-header-title {
    background: linear-gradient(135deg, var(--brand-ink) 0%, var(--brand-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.7rem;
}

/* Section heading style */
.section-heading {
    font-size: 1rem;
    font-weight: 800;
    color: var(--brand-ink);
    letter-spacing: -0.01em;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-heading::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.2em;
    background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-strong));
    border-radius: 4px;
    flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────────────────────────
   SIDEBAR ENHANCEMENTS
   ────────────────────────────────────────────────────────────────────────────── */

.app-sidebar {
    background: linear-gradient(180deg, #0a0f1e 0%, #0f172a 40%, #131a2d 100%) !important;
}

.app-sidebar .nav-link {
    position: relative;
    overflow: hidden;
}

.app-sidebar .nav-link::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.app-sidebar .nav-link.active::after {
    opacity: 1;
}

.app-sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
}

.app-sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(91,108,255,0.35), rgba(20,184,166,0.2)) !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(91,108,255,0.3), inset 0 0 0 1px rgba(91,108,255,0.2) !important;
}

/* Mobile topbar improvement */
.mobile-topbar {
    background: linear-gradient(135deg, #0a0f1e 0%, #0f172a 100%) !important;
    border-bottom: 1px solid rgba(91,108,255,0.2);
}

/* ──────────────────────────────────────────────────────────────────────────────
   FLASH ALERTS - Enhanced
   ────────────────────────────────────────────────────────────────────────────── */

.alert {
    border-radius: 0.85rem;
    border-left-width: 4px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 500;
    animation: alertSlideIn 0.35s ease-out;
}

@keyframes alertSlideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-success {
    background: #f0fdf4;
    border-color: var(--brand-success);
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border-color: var(--brand-danger);
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: var(--brand-warning);
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-color: var(--brand-info);
    color: #1e40af;
}

/* ──────────────────────────────────────────────────────────────────────────────
   METRIC / STAT CARDS - Enhanced for all pages
   ────────────────────────────────────────────────────────────────────────────── */

.metric-card,
.card.metric-card {
    background: #fff !important;
    border: 1px solid rgba(229,231,235,0.8) !important;
    border-radius: 1.1rem !important;
    box-shadow: 0 4px 20px rgba(15,23,42,0.06), 0 1px 4px rgba(15,23,42,0.04) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    overflow: hidden;
}

.metric-card:hover,
.card.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(15,23,42,0.1), 0 2px 8px rgba(15,23,42,0.06) !important;
}

.metric-card h5 {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--brand-ink);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--brand-border);
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-ink);
    line-height: 1;
    letter-spacing: -0.03em;
    margin: 0.5rem 0;
}

.metric-card small {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-muted);
}

/* Colored metric cards */
.bg-soft-success { background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(16,185,129,0.04)) !important; border-color: rgba(16,185,129,0.2) !important; }
.bg-soft-warning { background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(245,158,11,0.04)) !important; border-color: rgba(245,158,11,0.2) !important; }
.bg-soft-danger  { background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(239,68,68,0.04)) !important; border-color: rgba(239,68,68,0.2) !important; }
.bg-soft-info    { background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(14,165,233,0.04)) !important; border-color: rgba(14,165,233,0.2) !important; }
.bg-soft-secondary { background: linear-gradient(135deg, rgba(107,114,128,0.08), rgba(107,114,128,0.04)) !important; border-color: rgba(107,114,128,0.2) !important; }

/* ──────────────────────────────────────────────────────────────────────────────
   TABLES - Beautiful modern style
   ────────────────────────────────────────────────────────────────────────────── */

.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table thead th {
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%) !important;
    color: var(--brand-ink) !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 0.9rem 1rem !important;
    border-bottom: 2px solid rgba(91,108,255,0.15) !important;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.82rem 1rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid rgba(229,231,235,0.6) !important;
    font-size: 0.92rem;
    color: var(--brand-ink-light);
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: rgba(91,108,255,0.03) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(248,250,255,0.5);
}

/* Empty table state */
.table-empty-state {
    text-align: center;
    padding: 3rem 1rem !important;
    color: var(--brand-muted) !important;
}

.table td.text-center.text-muted.py-3 {
    padding: 2.5rem 1rem !important;
    font-size: 0.9rem;
}

/* ──────────────────────────────────────────────────────────────────────────────
   BUTTONS - Polished & device-friendly
   ────────────────────────────────────────────────────────────────────────────── */

.btn {
    min-height: 40px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 0.75rem;
    border: none;
    transition: all 0.2s ease !important;
    letter-spacing: 0.3px;
    white-space: nowrap;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-1px) !important;
}

.btn:active {
    transform: translateY(0) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-accent-strong) 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(91,108,255,0.35) !important;
    border: none !important;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(91,108,255,0.5) !important;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(16,185,129,0.3) !important;
    border: none !important;
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16,185,129,0.5) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(239,68,68,0.3) !important;
    border: none !important;
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239,68,68,0.5) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(245,158,11,0.3) !important;
    border: none !important;
}

.btn-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(15,23,42,0.3) !important;
    border: none !important;
}

.btn-outline-primary {
    border: 2px solid var(--brand-accent) !important;
    color: var(--brand-accent) !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background: var(--brand-accent-light) !important;
    color: var(--brand-accent-strong) !important;
    box-shadow: none !important;
}

.btn-outline-danger {
    border: 2px solid var(--brand-danger) !important;
    color: var(--brand-danger) !important;
    background: transparent !important;
}

.btn-outline-danger:hover {
    background: var(--brand-danger-light) !important;
    box-shadow: none !important;
    transform: translateY(-1px) !important;
}

.btn-outline-success {
    border: 2px solid var(--brand-success) !important;
    color: var(--brand-success) !important;
    background: transparent !important;
}

.btn-outline-success:hover {
    background: var(--brand-success-light) !important;
    box-shadow: none !important;
}

.btn-outline-dark {
    border: 2px solid #334155 !important;
    color: #334155 !important;
    background: transparent !important;
}

.btn-outline-dark:hover {
    background: #1e293b !important;
    color: white !important;
    box-shadow: none !important;
}

.btn-outline-secondary {
    border: 2px solid var(--brand-border) !important;
    color: var(--brand-muted) !important;
    background: transparent !important;
}

.btn-outline-secondary:hover {
    background: #f8faff !important;
    color: var(--brand-ink) !important;
    box-shadow: none !important;
}

.btn-sm {
    min-height: 34px;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 0.6rem;
}

.btn-lg {
    min-height: 48px;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    border-radius: 0.9rem;
}

/* ──────────────────────────────────────────────────────────────────────────────
   FORM CONTROLS - Beautiful
   ────────────────────────────────────────────────────────────────────────────── */

.form-control,
.form-select {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    padding: 0.65rem 0.9rem !important;
    font-size: 0.92rem !important;
    color: var(--brand-ink) !important;
    background: #fafbff !important;
    transition: all 0.2s ease !important;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-accent) !important;
    box-shadow: 0 0 0 3px rgba(91,108,255,0.12) !important;
    background: #fff !important;
}

.form-control::placeholder {
    color: #a0aec0 !important;
}

.form-label {
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    color: #374151 !important;
    margin-bottom: 0.45rem !important;
    letter-spacing: 0.2px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.input-group .form-control:not(:last-child) {
    border-right: none !important;
    border-radius: 0.75rem 0 0 0.75rem !important;
}

.input-group .btn:last-child {
    border-radius: 0 0.75rem 0.75rem 0 !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   BADGES / STATUS
   ────────────────────────────────────────────────────────────────────────────── */

.badge {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    letter-spacing: 0.3px;
}

.badge.bg-success, .badge.text-bg-success {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.badge.bg-danger, .badge.text-bg-danger {
    background: #fee2e2 !important;
    color: #7f1d1d !important;
}

.badge.bg-warning, .badge.text-bg-warning {
    background: #fef3c7 !important;
    color: #78350f !important;
}

.badge.bg-info, .badge.text-bg-info {
    background: #cffafe !important;
    color: #155e75 !important;
}

.badge.bg-primary, .badge.text-bg-primary {
    background: var(--brand-accent-light) !important;
    color: var(--brand-accent-strong) !important;
}

.badge.bg-secondary, .badge.text-bg-secondary {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.badge.bg-dark {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* Status-specific text colors */
.text-success { color: #059669 !important; font-weight: 700; }
.text-danger { color: #dc2626 !important; font-weight: 700; }
.text-warning { color: #d97706 !important; font-weight: 700; }
.text-info { color: #0284c7 !important; font-weight: 700; }

/* ──────────────────────────────────────────────────────────────────────────────
   ORDERS PAGE
   ────────────────────────────────────────────────────────────────────────────── */

/* Orders filter card */
.orders-filter-card {
    background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
    border: 1.5px solid rgba(91,108,255,0.12);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 10px rgba(15,23,42,0.04);
}

/* Order status column highlight */
.order-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ──────────────────────────────────────────────────────────────────────────────
   BARCODE LOGS PAGE
   ────────────────────────────────────────────────────────────────────────────── */

.barcode-logs-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.barcode-logs-header h4 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
}

/* ──────────────────────────────────────────────────────────────────────────────
   REPORTS PAGE
   ────────────────────────────────────────────────────────────────────────────── */

.report-metric-card {
    background: #fff;
    border-radius: 1.1rem;
    padding: 1.5rem;
    border: 1px solid var(--brand-border);
    box-shadow: 0 4px 16px rgba(15,23,42,0.06);
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.report-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-accent), var(--brand-info));
}

.report-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(15,23,42,0.1);
}

/* ──────────────────────────────────────────────────────────────────────────────
   REFERRAL PAGE
   ────────────────────────────────────────────────────────────────────────────── */

.referral-link-box {
    background: linear-gradient(135deg, var(--brand-accent-light) 0%, rgba(14,165,233,0.1) 100%);
    border: 1.5px solid rgba(91,108,255,0.2);
    border-radius: 0.85rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.referral-link-url {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--brand-accent-strong);
    word-break: break-all;
}

.referral-stat-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.referral-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(15,23,42,0.1);
}

/* ──────────────────────────────────────────────────────────────────────────────
   ROLES PAGE
   ────────────────────────────────────────────────────────────────────────────── */

.role-form-card {
    background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
    border: 1.5px solid rgba(91,108,255,0.15);
    border-radius: 1rem;
    padding: 1.5rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: var(--brand-accent-light);
    color: var(--brand-accent-strong);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: monospace;
}

/* ──────────────────────────────────────────────────────────────────────────────
   SUBSCRIPTION / PLANS PAGE
   ────────────────────────────────────────────────────────────────────────────── */

.plan-card {
    background: #fff;
    border: 2px solid var(--brand-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-accent), var(--brand-info));
    opacity: 0;
    transition: opacity 0.25s;
}

.plan-card:hover {
    border-color: var(--brand-accent);
    box-shadow: 0 16px 40px rgba(91,108,255,0.15);
    transform: translateY(-4px);
}

.plan-card:hover::before {
    opacity: 1;
}

.plan-card.featured {
    border-color: var(--brand-accent);
    box-shadow: 0 16px 40px rgba(91,108,255,0.15);
}

.plan-card.featured::before {
    opacity: 1;
}

.plan-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-ink);
    margin-bottom: 0.35rem;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-accent);
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 0.75rem 0;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-features li {
    padding: 0.45rem 0;
    font-size: 0.9rem;
    color: var(--brand-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-features li::before {
    content: '✓';
    width: 18px;
    height: 18px;
    background: var(--brand-success-light);
    color: var(--brand-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* Wallet card */
.wallet-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 1.25rem;
    padding: 1.75rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(91,108,255,0.3) 0%, transparent 70%);
}

.wallet-balance {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: white;
    line-height: 1;
}

.wallet-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.5rem;
}

/* ──────────────────────────────────────────────────────────────────────────────
   PACKAGING PAGE
   ────────────────────────────────────────────────────────────────────────────── */

.packaging-session-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15,23,42,0.25);
}

.packaging-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(16,185,129,0.15);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.25);
}

.packaging-status-badge.recording {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border-color: rgba(239,68,68,0.25);
    animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* ──────────────────────────────────────────────────────────────────────────────
   USERS / VENDORS PAGE
   ────────────────────────────────────────────────────────────────────────────── */

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-strong));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.user-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-card:hover {
    border-color: var(--brand-accent);
    box-shadow: 0 8px 24px rgba(91,108,255,0.1);
    transform: translateY(-1px);
}

/* ──────────────────────────────────────────────────────────────────────────────
   SETTINGS PAGE
   ────────────────────────────────────────────────────────────────────────────── */

.settings-section {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.settings-section-header {
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--brand-border);
    font-weight: 700;
    color: var(--brand-ink);
    font-size: 0.95rem;
}

.settings-section-body {
    padding: 1.5rem;
}

/* Toggle switches */
.form-check-input:checked {
    background-color: var(--brand-accent) !important;
    border-color: var(--brand-accent) !important;
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.3em;
    cursor: pointer;
}

/* ──────────────────────────────────────────────────────────────────────────────
   PAGINATION
   ────────────────────────────────────────────────────────────────────────────── */

.pagination {
    gap: 0.35rem;
}

.page-link {
    border-radius: 0.65rem !important;
    border: 1.5px solid var(--brand-border) !important;
    color: var(--brand-ink) !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.85rem !important;
    font-size: 0.875rem !important;
    transition: all 0.15s ease !important;
}

.page-link:hover {
    background: var(--brand-accent-light) !important;
    border-color: var(--brand-accent) !important;
    color: var(--brand-accent-strong) !important;
}

.page-item.active .page-link {
    background: var(--brand-accent) !important;
    border-color: var(--brand-accent) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(91,108,255,0.35) !important;
}

.page-item.disabled .page-link {
    opacity: 0.45;
}

/* ──────────────────────────────────────────────────────────────────────────────
   MODALS
   ────────────────────────────────────────────────────────────────────────────── */

.modal-content {
    border: none !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 30px 80px rgba(15,23,42,0.25) !important;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border-bottom: 1px solid var(--brand-border) !important;
    padding: 1.25rem 1.5rem !important;
}

.modal-title {
    font-weight: 800;
    color: var(--brand-ink);
    font-size: 1.05rem;
}

.modal-body {
    padding: 1.5rem !important;
}

.modal-footer {
    border-top: 1px solid var(--brand-border) !important;
    padding: 1rem 1.5rem !important;
}

.modal-backdrop.show {
    opacity: 0.6 !important;
    backdrop-filter: blur(4px);
}

/* ──────────────────────────────────────────────────────────────────────────────
   NAV TABS
   ────────────────────────────────────────────────────────────────────────────── */

.nav-tabs {
    border-bottom: 2px solid var(--brand-border) !important;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none !important;
    background: transparent !important;
    color: var(--brand-muted) !important;
    font-weight: 700 !important;
    padding: 0.7rem 1.2rem !important;
    border-radius: 0.7rem 0.7rem 0 0 !important;
    transition: all 0.2s ease !important;
}

.nav-tabs .nav-link:hover {
    color: var(--brand-ink) !important;
    background: rgba(91,108,255,0.05) !important;
}

.nav-tabs .nav-link.active {
    color: var(--brand-accent) !important;
    background: white !important;
    border-bottom: 2px solid var(--brand-accent) !important;
    margin-bottom: -2px;
    font-weight: 800 !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   RESPONSIVE - MOBILE FIRST
   ────────────────────────────────────────────────────────────────────────────── */

@media (max-width: 991px) {
    .app-main {
        padding: 1rem;
        margin-left: 0 !important;
    }

    .page-header {
        margin-bottom: 1.25rem;
    }

    .page-header-title {
        font-size: 1.35rem;
    }

    .metric-value {
        font-size: 1.6rem;
    }

    .btn {
        min-height: 44px; /* Touch-friendly */
    }
}

@media (max-width: 768px) {
    .app-main {
        padding: 0.75rem;
        padding-top: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-header .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.55rem 0.9rem;
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
    }

    .metric-card {
        padding: 1rem !important;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.65rem 0.6rem !important;
        font-size: 0.82rem;
    }

    .form-control,
    .form-select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    .modal-content {
        margin: 0.5rem !important;
    }

    .plan-card {
        margin-bottom: 1rem;
    }

    .wallet-balance {
        font-size: 2rem;
    }

    .referral-link-box {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Stack table headers for mobile */
    .table-mobile-stack thead {
        display: none;
    }

    .table-mobile-stack tr {
        display: block;
        border: 1px solid var(--brand-border);
        border-radius: 0.85rem;
        margin-bottom: 0.75rem;
        padding: 0.85rem;
        background: #fff;
    }

    .table-mobile-stack td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.3rem 0 !important;
        border: none !important;
        font-size: 0.85rem;
    }

    .table-mobile-stack td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.7rem;
        color: var(--brand-muted);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }

    /* Role page two-col stack */
    .roles-grid {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 0.5rem;
        padding-top: 0.75rem;
    }

    .page-header-title {
        font-size: 1.2rem;
    }

    .metric-value {
        font-size: 1.35rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.35rem;
    }

    .btn-sm {
        width: auto;
    }

    .d-flex.gap-2 .btn,
    .d-flex.gap-3 .btn {
        width: auto;
    }

    h5 {
        font-size: 0.95rem;
    }

    .plan-price {
        font-size: 1.75rem;
    }
}

/* ──────────────────────────────────────────────────────────────────────────────
   LOADING / EMPTY STATES
   ────────────────────────────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--brand-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-muted);
    margin-bottom: 0.5rem;
}

.empty-state-sub {
    font-size: 0.875rem;
    color: var(--brand-muted-light);
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #f0f4ff 25%, #e8eeff 50%, #f0f4ff 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease infinite;
    border-radius: 0.5rem;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ──────────────────────────────────────────────────────────────────────────────
   COPY-TO-CLIPBOARD BUTTON  (Referral page)
   ────────────────────────────────────────────────────────────────────────────── */

.btn-copy {
    background: white;
    border: 2px solid var(--brand-accent);
    color: var(--brand-accent);
    border-radius: 0.65rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--brand-accent-light);
}

.btn-copy.copied {
    background: var(--brand-success-light);
    border-color: var(--brand-success);
    color: #065f46;
}

/* ──────────────────────────────────────────────────────────────────────────────
   PRINT STYLES
   ────────────────────────────────────────────────────────────────────────────── */

@media print {
    .app-sidebar,
    .mobile-topbar,
    .sidebar-backdrop,
    .btn-print-hide,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin: 0 !important;
        padding: 1rem !important;
    }

    .metric-card,
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
