/* ------------------------------------------------------- */
/* ========== 1. Font-Face Declarations ========== */
/* ------------------------------------------------------- */

@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-Black.woff') format('woff');
    font-weight: 900; /* Black weight */
    font-style: normal;
}
  
@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-ExtraBold.woff') format('woff');
    font-weight: 800; /* Extra Bold */
    font-style: normal;
}
  
@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-Bold.woff') format('woff');
    font-weight: 700; /* Bold */
    font-style: normal;
}
  
@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-SemiBold.woff') format('woff');
    font-weight: 600; /* Semi Bold */
    font-style: normal;
}
  
@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-Medium.woff') format('woff');
    font-weight: 500; /* Medium */
    font-style: normal;
}
  
@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-Regular.woff') format('woff');
    font-weight: 400; /* Regular */
    font-style: normal;
}
  
@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-Light.woff') format('woff');
    font-weight: 300; /* Light */
    font-style: normal;
}
  
@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-ExtraLight.woff') format('woff');
    font-weight: 200; /* Extra Light */
    font-style: normal;
}
  
@font-face {
    font-family: 'Lahzeh';
    src: url('../fonts/Lahzeh-Thin.woff') format('woff');
    font-weight: 100; /* Thin */
    font-style: normal;
}

/* ------------------------------------------------------- */
/* ========== 1. Root Variables and Basic Body ========== */
/* ------------------------------------------------------- */

:root {
    --primary-color: #f15a29;
    --secondary-color: #343a40;
    --accent-color: #4cc9f0;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --text-color-light: #ffffff;
    --text-color-dark: #2d3748;
    --text-color-muted: #718096;
    --bg-color-light: #f8f9fa;
    --bg-color-dark: #121212;
    --card-bg-color: #ffffff;
    --border-color: #e2e8f0;
    --font-family: 'Lahzeh', sans-serif;
    --font-size-xs: 12px;
    --font-size-small: 14px;
    --font-size-medium: 16px;
    --font-size-large: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --primary-gradient: linear-gradient(135deg, #4361ee, #3a0ca3);
    --form-bg: #ffffff;
    --input-bg: #f8f9fa;
    --input-border: #e2e8f0;
    --button-gradient: linear-gradient(135deg, #4361ee, #3a0ca3);
    --shadow-color: rgba(67, 97, 238, 0.15);
    --border-radius: 10px;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
    background-color: var(--bg-color-light);
    color: var(--text-color-dark);
    line-height: 1.5;
    font-size: var(--font-size-medium);
}

/* ------------------------------------------------------- */
/* ========== 2. Body Modifier for Fixed Header ========== */
/* ------------------------------------------------------- */

body.with-header {
    padding-top: 60px; /* Adjusted for fixed header */
}

/* ------------------------------------------------------- */
/* ========== 3. Header Styles ========== */
/* ------------------------------------------------------- */

header {
    background-color: var(--card-bg-color);
    /* color: "#f15a29"; */
    padding: 5px 20px;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.spacer {
    flex: 1;
}

/* ------------------------------------------------------- */
/* ========== 4. Header Buttons and Search ========== */
/* ------------------------------------------------------- */

.toggle-sidebar {
    display: none;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-dark);
    z-index: 1002;
    background: none;
    border: none;
    padding: 5px 10px;
    font-size: 24px;
}

.header-btn {
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-color-dark);
    padding: 6px 16px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
    font-weight: 500;
    cursor: pointer;
}

.header-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

.header-btn i {
    font-size: 14px;
}

.logout-header-btn {
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-color-dark);
}

.logout-header-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Header search */
.header-search form {
    display: flex;
    align-items: center;
    position: relative;
}

.header-search .search-input {
    padding: 8px 15px;
    padding-right: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-small);
    width: 300px;
    transition: all 0.3s;
    font-family: var(--font-family);
}

.header-search .search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
    outline: none;
}

.header-search .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-muted);
}

/* ------------------------------------------------------- */
/* ========== 5. Sidebar and Overlay ========== */
/* ------------------------------------------------------- */

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    background-image: linear-gradient(135deg, #343a40, #212529);
    color: var(--text-color-light);
    padding-top: 10px;
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.company-logo-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* background-color: white; */
    /* padding: 5px; */
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
}

.company-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-header .user-info {
    margin-top: 15px;
    text-align: center;
}

.sidebar-header .user-name {
    font-size: var(--font-size-medium);
    font-weight: 500;
    margin: 5px 0;
}

.sidebar-header .user-role {
    font-size: var(--font-size-small);
    opacity: 0.7;
}

.sidebar-links {
    padding: 0 15px;
}

.sidebar-section {
    margin-bottom: 15px;
}

.sidebar-section-title {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    padding: 10px 15px;
    margin: 0;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 15px;
    text-decoration: none;
    font-size: var(--font-size-small);
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.sidebar-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color-light);
}

.sidebar-links a.active {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-links a.active i {
    color: #fff;
}

.sidebar-links a i {
    margin-left: 10px;
    font-size: 18px;
    width: 25px;
    text-align: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* ------------------------------------------------------- */
/* ========== 6. Main Content and Page Header ========== */
/* ------------------------------------------------------- */

.content {
    margin-right: 260px;
    padding: 20px 25px 25px;
    transition: margin-right 0.3s ease;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-color-dark);
}

.page-header p {
    color: var(--text-color-muted);
    margin: 0;
    font-size: var(--font-size-medium);
}

/* ------------------------------------------------------- */
/* ========== 7. Stats Cards ========== */
/* ------------------------------------------------------- */

.stats-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px 25px;
}

.stat-card {
    flex: 1;
    min-width: 220px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin: 0 15px 30px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-title {
    font-size: var(--font-size-small);
    color: var(--text-color-muted);
    margin-bottom: 10px;
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-color-light);
    margin: 0;
}

.stat-p-value {
    font-size: var(--font-size-xl);
    color: var(--text-color-light);
    margin: 0;
}

.stat-change {
    margin-top: 10px;
    font-size: var(--font-size-xs);
    display: flex;
    align-items: center;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--error-color);
}

.stat-change i {
    margin-left: 5px;
}

.stat-card .stat-icon {
    position: absolute;
    left: 15px;
    top: 15px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border-radius: 50%;
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.stat-card .stat-icon i{
    color: var(--text-color-light);
}

/* ------------------------------------------------------- */
/* ========== 8. Grid (Row / Columns) ========== */
/* ------------------------------------------------------- */

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

/* Only relevant col classes used: .col-lg-4 and .col-lg-8 */

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* ------------------------------------------------------- */
/* ========== 9. Quick Actions ========== */
/* ------------------------------------------------------- */

.quick-actions {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 30px;
}

.quick-actions-title {
    margin: 0 0 20px;
    font-size: var(--font-size-large);
    font-weight: 600;
    color: var(--text-color-dark);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 15px 10px;
    transition: all 0.3s;
    text-decoration: none;
}

.action-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.action-icon {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.action-text {
    font-size: var(--font-size-xs);
    color: var(--text-color-dark);
    text-align: center;
}

/* ------------------------------------------------------- */
/* ========== 10. Activity Card ========== */
/* ------------------------------------------------------- */

.activity-card {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    overflow: hidden;
}

.activity-card .card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-card .card-title {
    margin: 0;
    font-size: var(--font-size-large);
    font-weight: 600;
    color: var(--text-color-dark);
}

.activity-card .card-actions a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: var(--font-size-small);
    display: inline-flex;
    align-items: center;
}

.activity-card .card-actions a i {
    margin-right: 5px;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    flex-shrink: 0;
}

.activity-icon.blue {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.activity-icon.green {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
}

.activity-icon.orange {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.activity-icon.red {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
}

.activity-content {
    flex: 1;
}

.activity-title {
    margin: 0 0 5px;
    font-size: var(--font-size-small);
    color: var(--text-color-dark);
}

.activity-meta {
    font-size: var(--font-size-xs);
    color: var(--text-color-muted);
    display: flex;
    align-items: center;
}

.activity-meta i {
    margin-left: 5px;
}

.activity-time {
    margin-right: 10px;
}

.filter-container {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 25px;
}

.date-filter {
    display: flex;
    flex-direction: column;
}

.date-filter label {
    font-weight: 500;
    margin-bottom: 10px;
}

.date-input-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.date-input-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.date-input {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    transition: all 0.3s;
    width: 100%;
}

.date-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
    outline: none;
}

.filter-btn {
    background-image: var(--button-gradient);
    color: var(--text-color-light);
    border: none;
    border-radius: var(--border-radius-md);
    padding: 10px 20px;
    font-family: var(--font-family);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    margin-top: 23px;
}

.filter-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.filter-btn i {
    font-size: 14px;
}

/* Adjust stat cards for this specific layout */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    justify-content: space-between;
}

.stats-row area{
    text-decoration: none;
}

.stat-card {
    flex: 1 1 calc(33.333% - 20px);
    min-width: 290px;
    margin: 0 10px 20px;
    border-radius: 15px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    display: flex;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.stats-background-blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.stats-background-dark-green {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.stats-background-yellow {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.stats-background-purple {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.stats-background-light-green {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: white;
}

.stats-background-red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.stats-background-dark-gray {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.stats-background-dark-pink {
    background: linear-gradient(135deg, #8e44ad, #673ab7);
    color: white;
}

/* Beautiful gradient backgrounds for cards */
/* .users {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
} */

/* .packages-cart {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
} */

/* .referrals {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
} */

/* .credits {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
} */

/* .payments {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
} */

/* .gateway {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: white;
} */

/* .canceled {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
} */

/* .model {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
} */

/* .tokens {
    background: linear-gradient(135deg, #8e44ad, #673ab7);
    color: white;
} */

.stat-content {
    flex: 1;
    z-index: 1;
}

.stat-title {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
}

.stat-change {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    width: 60px;
    color: rgba(255, 255, 255, 0.25);
    margin-right: 10px;
}

/* Card decoration */
.stat-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    z-index: 0;
}

/* Debug panel styles */
.debug-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.9);
    color: #00ff00;
    padding: 15px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 12px;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.debug-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #343a40;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    transition: all 0.2s ease;
}

.debug-toggle:hover {
    background: #212529;
    transform: translateY(-2px);
}

.debug-item {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 15px;
}

.query {
    color: #ffcc00;
}

.result {
    color: #00ff00;
}

.error {
    color: #ff5555;
}

/* Improved card for showing model calls breakdown */
.model-breakdown {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.model-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.model-name {
    font-weight: 500;
}

.model-count {
    font-weight: 600;
}

/* ------------------------------------------------------- */
/* ========== 11. Mobile Responsiveness ========== */
/* ------------------------------------------------------- */

@media (max-width: 767px) {
    .content {
        margin-right: 0;
    }
    header .toggle-sidebar {
        display: block;
    }
    .sidebar {
        transform: translateX(100%);
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .toggle-sidebar {
        display: block;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .stat-card {
        flex: 1 1 calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex: 1 1 100%;
    }
}

.fa {
    color: var(--primary-color);
}


.fa:hover {
    color: #fff;
}