/* partner-dashboard.css - Premium Design System for GoNet Partners */

:root {
    /* Colors */
    --primary: #0052FF;
    --primary-soft: rgba(0, 82, 255, 0.1);
    --secondary: #64748b;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;

    --success: #10b981;
    --success-soft: #dcfce7;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --info: #0ea5e9;
    --info-soft: #e0f2fe;

    /* Slate Grays */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Spacing & Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.5rem;

    --sidebar-width: 230px;
    --topbar-height: 70px;
    --topbar-bg: rgba(255, 255, 255, 0.8);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Alert Banners */
.alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    margin: 1rem 1.5rem 0 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    animation: slideDown 0.4s ease-out;
}

.warning-banner {
    background: var(--warning-soft);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.alert-banner .banner-btn {
    background: var(--warning);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.partner-balance-badge.low-balance .value {
    color: var(--danger);
    animation: balancePulse 1.5s infinite;
}

@keyframes balancePulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }

    100% {
        opacity: 1;
    }
}

body.dark-mode {
    --primary: #3b82f6;
    --primary-soft: rgba(59, 130, 246, 0.15);

    --white: #1e293b;
    /* Card Background */
    --slate-50: #0f172a;
    --light: #0f172a;
    /* Page Background match */
    /* Page Background */
    --slate-100: #1e293b;
    --slate-200: #334155;
    --slate-300: #475569;
    --slate-400: #94a3b8;
    --slate-500: #cbd5e1;
    /* Text Muted */
    --slate-600: #e2e8f0;
    --slate-700: #f1f5f9;
    --slate-800: #f8fafc;
    --slate-900: #ffffff;
    /* Main Text */

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);

    --topbar-bg: rgba(30, 41, 59, 0.95);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--light);
    color: var(--slate-800);
    overflow-x: hidden;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--slate-900);
    font-weight: 700;
}

a {
    transition: var(--transition);
    text-decoration: none;
}

/* Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--slate-200);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--slate-200);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--slate-600);
    border-radius: var(--radius);
    font-weight: 600;
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: var(--slate-50);
    color: var(--primary);
}

.nav-link.active {
    background: rgba(0, 82, 255, 0.08);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--slate-100);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-width: 0;
    transition: var(--transition);
}

[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 900;
    margin: -2rem -2rem 2rem -2rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--slate-600);
    cursor: pointer;
}

.page-title {
    font-size: 1.5rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* User Profile in Navigation */
.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    text-align: right;
}

[dir="rtl"] .user-info {
    text-align: left;
}

.user-name {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--slate-800);
}

.user-role {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    background: var(--slate-100);
    color: var(--slate-600);
    border-radius: 50px;
    font-weight: 600;
}

/* Balance Badge */
/* Balance Badge */
.partner-balance-badge {
    background: rgba(0, 82, 255, 0.08);
    /* Unified transparent blue */
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    /* Standard radius matching buttons */
    border: 2px solid var(--primary);
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    align-items: center;
    gap: 0.5rem;
    height: 42px;
    /* Fixed height to match inputs/selectors roughly */
    box-sizing: border-box;
}

.partner-balance-badge .label {
    font-size: 0.8rem;
    font-weight: 600;
}

.partner-balance-badge .value {
    font-size: 1rem;
    font-weight: 800;
}

/* Selectors */
.currency-select {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 2px solid var(--slate-300);
    font-weight: 600;
    background: var(--white);
    color: var(--slate-800);
    /* Ensure text color adapts to theme */
    font-family: 'Cairo', sans-serif;
}

.lang-toggle-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 2px solid var(--slate-300);
    background: var(--white);
    color: var(--slate-800);
    /* Ensure text color adapts to theme */
    font-weight: 700;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.bg-success-soft {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 2px solid rgba(16, 185, 129, 0.2);
}

.bg-info-soft {
    background: rgba(14, 165, 233, 0.1);
    color: var(--info);
    border: 2px solid rgba(14, 165, 233, 0.2);
}

.bg-warning-soft {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.stat-data h3 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.stat-data p {
    color: var(--slate-500);
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-growth {
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-growth.up {
    color: var(--success);
}

.stat-growth.down {
    color: var(--danger);
}

.stat-growth.up::before {
    content: '↑';
}

.stat-growth.down::before {
    content: '↓';
}

/* Welcome Banner */
.welcome-banner {
    background: rgba(0, 82, 255, 0.2);
    /* Soft Blue */
    color: var(--primary);
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 82, 255, 0.2);
}

.welcome-banner::after {
    content: '';
    position: absolute;
    inset-inline-start: -5%;
    /* English: Left, Arabic: Right */
    top: -20%;
    width: 200px;
    height: 200px;
    background: rgba(0, 82, 255, 0.1);
    /* Faint blue circle */
    border-radius: 50%;
}

.welcome-banner h2 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 0;
}

.welcome-banner .banner-icon {
    font-size: 2.5rem;
    color: var(--primary);
    opacity: 0.3;
    /* Reduced opacity */
    margin-inline-end: 1.5rem;
}

/* Grid & Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 1.5rem;
}

.grid-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 1rem 0.75rem;
    color: var(--slate-500);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--slate-100);
}

[dir="rtl"] .table th {
    text-align: right;
}

.table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--slate-50);
}

.hover-table tbody tr:hover {
    background: var(--slate-50);
}

.badge-staff {
    background: rgba(0, 82, 255, 0.08);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--primary);
    white-space: nowrap;
    display: inline-block;
    line-height: 1.2;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--primary);
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(0, 82, 255, 0.08);
    color: var(--primary);
}

.btn:hover {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 82, 255, 0.2);
    transform: translateY(-1px);
}

.btn-primary,
.btn-success,
.btn-warning,
.btn-info {
    background: rgba(0, 82, 255, 0.08);
    /* Matches Quick Links transparent style */
    color: var(--primary) !important;
    border: 2px solid var(--primary);
}

.btn-primary.active,
.btn-primary:active {
    background: var(--primary) !important;
    color: white !important;
}

.btn-primary:hover,
.btn-success:hover,
.btn-warning:hover,
.btn-info:hover {
    background: var(--primary);
    color: white !important;
    opacity: 1;
}

.btn-outline-primary,
.btn-outline-info {
    background: rgba(0, 82, 255, 0.08);
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-danger {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 2px solid var(--danger) !important;
    color: var(--danger) !important;
}

.btn-outline-success {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 2px solid var(--success) !important;
    color: var(--success) !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    padding: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-logout-sidebar {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 2px solid rgba(239, 68, 68, 0.3);
    width: 100%;
}

.btn-logout-sidebar:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 2px solid var(--slate-400);
    background-color: var(--white) !important;
    color: var(--slate-800);
    /* Ensure text is visible in dark mode */
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    border-bottom: 2px solid var(--slate-100);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate-400);
}

[dir="rtl"] .close-modal {
    right: auto;
    left: 1.5rem;
}

/* eSIM Share Modal - Premium Design */
.esim-share-modal {
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.esim-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    color: var(--slate-500);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.esim-modal-close:hover {
    background: var(--white);
    color: var(--danger);
    box-shadow: var(--shadow-sm);
}

[dir="rtl"] .esim-modal-close {
    right: auto;
    left: 12px;
}

.esim-modal-qr {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    padding: 2rem 2rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.esim-qr-frame {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: 0 4px 20px rgba(0, 82, 255, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    display: inline-flex;
}

.esim-qr-frame img {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-sm);
    display: block;
}

.esim-modal-info {
    padding: 1.25rem 1.75rem 0.75rem;
    text-align: center;
}

.esim-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
}

.esim-modal-badge i {
    font-size: 0.65rem;
}

.esim-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0 0 0.25rem;
}

.esim-modal-subtitle {
    font-size: 0.8rem;
    color: var(--slate-400);
    margin: 0 0 1rem;
}

.esim-iccid-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 6px 14px;
    direction: ltr;
}

.esim-iccid-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.esim-iccid-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-700);
    font-family: 'Courier New', monospace;
}

.esim-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 1rem 1.75rem 1.5rem;
}

.esim-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1.5px solid var(--slate-200);
    background: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--slate-600);
}

.esim-action-btn:hover {
    border-color: var(--slate-300);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.esim-action-btn i {
    font-size: 1rem;
}

/* WhatsApp - full width top row */
.esim-action-whatsapp {
    grid-column: 1 / -1;
    background: #25D366;
    border-color: #25D366;
    color: var(--white);
    padding: 12px 14px;
    font-size: 0.85rem;
}

.esim-action-whatsapp:hover {
    background: #1fb855;
    border-color: #1fb855;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.esim-action-whatsapp i {
    font-size: 1.2rem;
}

.esim-action-print {
    color: var(--slate-600);
}

.esim-action-print:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.esim-action-copy {
    color: var(--slate-600);
}

.esim-action-copy:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .esim-share-modal {
        max-width: 95vw;
        margin: 0 10px;
    }

    .esim-qr-frame img {
        width: 150px;
        height: 150px;
    }

    .esim-modal-actions {
        padding: 0.75rem 1.25rem 1.25rem;
    }
}

/* Sell Page Styles */
.search-select-wrapper {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    border: 1px solid var(--slate-100);
}

.search-results.active {
    display: block;
}

.search-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--slate-50);
}

.search-item:hover {
    background: var(--slate-50);
}

.flag-img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
}

.filter-tags-wrapper {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-tag {
    background: var(--white);
    border: 1px solid var(--slate-200);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 600;
    color: var(--slate-600);
}

.filter-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.bundle-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.bundle-opt {
    border: 2px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    background: var(--white);
}

.bundle-opt:hover {
    border-color: var(--primary-soft);
}

.bundle-opt.active {
    border-color: var(--primary);
    background: rgba(0, 82, 255, 0.08) !important;
    border-width: 2px;
}

.summary-box {
    background: var(--slate-50);
    padding: 1.5rem;
    border-radius: var(--radius);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

/* Wallet Page */
.recharge-options {
    display: flex;
    gap: 1rem;
}

.recharge-opt {
    flex: 1;
    border: 2px solid var(--slate-200);
    padding: 2rem 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.recharge-opt.active {
    border-color: var(--primary);
    background: rgba(0, 82, 255, 0.08);
    /* Unified transparent blue */
}

/* Utilities */
.mb-4 {
    margin-bottom: 1rem !important;
}

.mt-4 {
    margin-top: 1rem !important;
}

.p-0 {
    padding: 0 !important;
}

.text-danger {
    color: var(--danger);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--slate-100);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    [dir="rtl"] .main-content {
        margin-right: 0;
    }

    .topbar {
        padding: 0 1rem;
    }

    .sidebar-toggle {
        display: block;
    }

    .topbar-right .user-profile-nav,
    .topbar-right .partner-balance-badge .label {
        display: none;
    }

    .partner-balance-badge {
        padding: 0.5rem 0.75rem;
    }

    .partner-balance-badge .value {
        font-size: 1rem;
    }
}

/* Animation Classes Used in JS */
.page-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Quick Actions Button Uniformity */
.quick-actions-btns {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-actions-btns .btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.875rem 1.25rem;
}

/* Stopped Staff Styling */
.staff-stopped td {
    color: rgba(239, 68, 68, 0.5) !important;
}

.staff-stopped .status-pill {
    opacity: 0.7;
}

/* Password Requirements Compact Styling */
.password-requirements {
    font-size: 0.75rem;
    /* Smaller font as requested */
    color: var(--slate-500);
    list-style: none;
    /* Remove bullets for clean look */
    padding: 0;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    /* Grid layout to save vertical space */
    gap: 0.25rem 0.5rem;
    background: var(--slate-50);
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--slate-200);
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.2;
}

.password-requirements li::before {
    content: '';
    color: var(--slate-400);
}

.password-requirements li.valid {
    color: var(--success);
}

.password-requirements li.valid::before {
    content: '';
    color: var(--success);
    font-weight: bold;
}

.password-requirements li.invalid {
    color: var(--slate-500);
}


/* Password Requirements Compact Styling */
.password-requirements {
    font-size: 0.75rem;
    color: var(--slate-500);
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.25rem 0.5rem;
    background: var(--slate-50);
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--slate-200);
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.2;
}

.password-requirements li.valid {
    color: var(--success);
}

.password-requirements li.valid::before {
    content: '';
    color: var(--success);
    font-weight: bold;
    margin-right: 4px;
}

/* =========================================
    Thermal Printer Styles (80mm / 58mm)
   ========================================= */
@media print {

    /* Hide EVERYTHING by default */
    body * {
        visibility: hidden;
    }

    /* Show ONLY the receipt */
    #thermalReceipt,
    #thermalReceipt * {
        visibility: visible;
    }

    /* Position the receipt at top-left */
    #thermalReceipt {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 80mm;
        /* Standard Thermal Width */
        margin: 0;
        padding: 0;
        font-family: 'Courier New', Courier, monospace;
        /* Monospace for alignment */
        color: black;
        background: white;
    }

    /* Reset page margins */
    @page {
        size: auto;
        margin: 0;
    }

    /* Receipt Styling */
    .receipt-header {
        text-align: center;
        margin-bottom: 10px;
    }

    .receipt-logo {
        width: 40px;
        height: auto;
        margin-bottom: 5px;
        filter: grayscale(100%);
        /* Thermal printers are B&W */
    }

    .receipt-title {
        font-weight: bold;
        font-size: 1.2rem;
        margin: 5px 0;
    }

    .receipt-date {
        font-size: 0.8rem;
        margin: 0;
    }

    .receipt-body {
        font-size: 0.9rem;
    }

    .receipt-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 5px;
    }

    .receipt-divider {
        text-align: center;
        margin: 10px 0;
        overflow: hidden;
        white-space: nowrap;
    }

    .receipt-qr {
        text-align: center;
        margin: 10px 0;
    }

    .receipt-qr img {
        width: 80%;
        max-width: 150px;
        height: auto;
    }

    .receipt-iccid {
        font-size: 0.8rem;
        text-align: center;
        word-break: break-all;
    }

    .receipt-footer {
        text-align: center;
        margin-top: 20px;
        font-size: 0.8rem;
        border-top: 1px dashed black;
        padding-top: 10px;
    }

    .receipt-footer p {
        margin: 2px 0;
    }
}

/* Utilities */
.gap-2 {
    gap: 0.5rem !important;
}

.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--slate-100);
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 1px solid var(--slate-300);
    color: var(--slate-700);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--slate-50);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    :root {
        --sidebar-width: 70px;
    }

    .nav-link span,
    .sidebar-footer span,
    .logo-text,
    .user-info {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 0.875rem;
    }

    .logo-container {
        padding: 1rem;
        justify-content: center;
    }
}

/* Quick Actions Buttons */
.quick-actions-btns {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.quick-actions-btns .btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.5rem 0.6rem;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-actions-btns .btn i {
    font-size: 1.1rem;
    margin-inline-end: 0.5rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--slate-500);
    margin: 0 1rem;
    font-weight: 600;
}