﻿/* ============================================
   UTD Software Solutions - Main Stylesheet v4
   Imports design tokens for unified system
   ============================================ */
@import url('design-tokens.css');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Cairo', sans-serif;
    background: var(--gray-light);
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
}

[dir="ltr"] body { font-family: 'Inter', 'Cairo', sans-serif; }

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition); white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-light); color: var(--dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--secondary); }
.btn-ghost:hover { background: var(--gray-light); color: var(--dark); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon-only { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--dark-2); margin-bottom: 6px;
}
.form-control {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius); font-family: inherit; font-size: 14px;
    transition: var(--transition); background: var(--white); color: var(--dark);
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control::placeholder { color: var(--gray); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

small.text-muted {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.input-icon {
    position: relative; display: flex; align-items: center;
}
.input-icon > i {
    position: absolute; color: var(--gray); font-size: 14px;
    z-index: 1; pointer-events: none;
}
[dir="rtl"] .input-icon > i { right: 14px; }
[dir="ltr"] .input-icon > i { left: 14px; }
[dir="rtl"] .input-icon input { padding-right: 40px; }
[dir="ltr"] .input-icon input { padding-left: 40px; }

.toggle-password {
    position: absolute; background: none; border: none;
    color: var(--gray); cursor: pointer; font-size: 14px; padding: 8px;
}
[dir="rtl"] .toggle-password { left: 8px; }
[dir="ltr"] .toggle-password { right: 8px; }

.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.alert {
    padding: 10px 16px; border-radius: var(--radius); font-size: 13px;
    font-weight: 500; margin-bottom: 12px;
}
.alert-danger { background: var(--danger-light); color: var(--danger); }
.alert-success { background: var(--success-light); color: #065f46; }
.alert-warning { background: var(--warning-light); color: #92400e; }
.alert-info { background: var(--info-light); color: #1e40af; }

/* ============================================
   Auth Pages (Login + Signup) - Unified
   ============================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #312e81 70%, #4f46e5 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 32px 32px; pointer-events: none;
}
.login-page::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(circle at 20% 80%, rgba(99,102,241,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(79,70,229,0.1) 0%, transparent 50%);
}

.login-container {
    width: 100%; max-width: 420px; position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.login-card {
    background: var(--white); border-radius: var(--radius-xl);
    box-shadow: 0 32px 64px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
    width: 100%; overflow: hidden;
}

/* Header */
.login-header {
    text-align: center; padding: 36px 32px 20px;
    border-bottom: 1px solid var(--border);
}
.login-logo {
    width: 64px; height: 64px; border-radius: 16px;
    background: var(--gradient-brand);
    box-shadow: 0 8px 24px rgba(79,70,229,0.4);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; color: white; font-size: 28px;
    text-decoration: none; transition: var(--transition);
}
.login-logo:hover { transform: scale(1.05); box-shadow: 0 12px 32px rgba(79,70,229,0.5); }
.login-header h1 { font-size: 24px; font-weight: 800; color: var(--dark); margin-bottom: 4px; }
.login-header p { font-size: 13px; color: var(--gray); }
.login-brand-link { text-decoration: none; color: inherit; }

/* Form section */
.login-form { padding: 24px 32px 16px; }

/* Auth sections (google btn, whatsapp, etc) */
.auth-section { padding: 12px 32px; }

/* Divider */
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 32px; color: var(--gray); font-size: 13px; font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Hint text */
.auth-hint {
    font-size: 13px; color: var(--gray); text-align: center;
    margin-bottom: 12px;
}

/* Footer */
.login-footer {
    padding: 16px 32px; text-align: center;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
}
.auth-switch-link {
    font-size: 13px; color: var(--secondary); text-decoration: none;
    transition: var(--transition);
}
.auth-switch-link strong { color: var(--primary); }
.auth-switch-link:hover { color: var(--primary); }

/* Language toggle */
.lang-toggle {
    background: none; border: none; color: var(--gray);
    font-family: inherit; font-size: 13px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--radius);
    transition: var(--transition);
}
.lang-toggle:hover { background: var(--gray-light); color: var(--dark); }

/* Google button - unified */
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; padding: 13px 20px;
    border: 1.5px solid var(--border); border-radius: var(--radius-lg);
    background: var(--white); cursor: pointer;
    font-family: inherit; font-size: 14px; font-weight: 600; color: var(--dark);
    transition: var(--transition); text-decoration: none;
}
.btn-google:hover {
    border-color: #4285F4; background: #f8faff;
    box-shadow: 0 4px 16px rgba(66,133,244,0.15);
    transform: translateY(-1px);
}
.btn-google:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* WhatsApp button - unified */
.btn-whatsapp {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 13px 20px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white; border-radius: var(--radius-lg);
    border: none; font-family: inherit; font-size: 15px; font-weight: 700;
    text-decoration: none; cursor: pointer; transition: var(--transition);
    box-shadow: 0 4px 16px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,0.4);
}
.btn-whatsapp i { font-size: 20px; }

/* Background text */
.login-bg-text {
    color: rgba(255,255,255,0.3); font-size: 12px; letter-spacing: 0.05em;
}

/* Social divider (old - keep for compat) */
.social-divider {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 32px; color: var(--gray); font-size: 13px; font-weight: 600;
}
.social-divider::before, .social-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ============================================
   App Loading
   ============================================ */
.app-loading {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--white); display: flex; align-items: center;
    justify-content: center; z-index: 9999;
    transition: opacity 0.2s ease;
}
.loader { text-align: center; }
.loader i { font-size: 48px; color: var(--primary); margin-bottom: 20px; display: block; animation: pulse 1.5s ease infinite; }
.loader-bar { width: 200px; height: 4px; background: var(--gray-light); border-radius: 2px; overflow: hidden; }
.loader-fill { width: 40%; height: 100%; background: var(--primary); border-radius: 2px; animation: loading 1.2s ease infinite; }
@keyframes loading { 0%{transform:translateX(-100%)} 50%{transform:translateX(150%)} 100%{transform:translateX(-100%)} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard-layout {
    display: flex; min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width); height: 100vh; position: fixed;
    background: var(--dark); color: white; z-index: 200;
    display: flex; flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}
[dir="rtl"] .sidebar { right: 0; }
[dir="ltr"] .sidebar { left: 0; }

.sidebar-header {
    padding: 16px 20px; display: flex; align-items: center;
    justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 64px;
}

.sidebar-logo {
    display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800;
}
.sidebar-logo i { font-size: 24px; color: #818cf8; }

.sidebar-toggle {
    background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.6);
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.15); color: white; }

.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 12px 0;
}

.sidebar-nav .nav-section {
    padding: 8px 20px 4px; font-size: 11px; font-weight: 600;
    color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.5px;
}

.sidebar-nav .nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; color: rgba(255,255,255,0.65);
    cursor: pointer; transition: var(--transition); font-size: 14px; font-weight: 500;
    border: none; background: none; width: 100%; text-align: inherit; font-family: inherit;
}
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-nav .nav-item.active {
    background: rgba(15,12,96,0.35); color: #c7d2fe;
    border-inline-start: 3px solid #6366f1;
}
.sidebar-nav .nav-item i { width: 20px; text-align: center; font-size: 15px; }


/* ── Nav Groups (accordion) ── */
.nav-group { margin: 4px 0; }

.nav-group-header {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 10px 20px; background: none; border: none;
    color: rgba(255,255,255,0.8); cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 600; transition: background 0.2s;
    text-align: inherit;
}
.nav-group-header:hover { background: rgba(255,255,255,0.06); }
.nav-group-header.active { color: #a5b4fc; }

.nav-group-arrow { font-size: 11px; transition: transform 0.25s ease; opacity: 0.6; }

.nav-group-items { padding: 2px 0 4px 0; }

.nav-sub {
    padding-right: 40px !important;
    font-size: 13px !important;
    color: rgba(255,255,255,0.6) !important;
}
.nav-sub:hover { color: white !important; }
.nav-sub.active { color: #a5b4fc !important; }

/* border separator between sections */
.nav-group { border-top: 1px solid rgba(255,255,255,0.06); margin-top: 6px; padding-top: 6px; }
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08); padding: 12px 16px;
}

.sidebar-user {
    display: flex; align-items: center; gap: 10px; padding: 8px 4px;
}

.sidebar-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.1); display: flex;
    align-items: center; justify-content: center; font-size: 14px;
    color: rgba(255,255,255,0.6);
}

.sidebar-user-info { display: flex; flex-direction: column; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9); }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

.sidebar-actions {
    display: flex; gap: 6px; margin-top: 8px;
}

.sidebar-action-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px; background: rgba(255,255,255,0.06); border: none;
    border-radius: var(--radius); color: rgba(255,255,255,0.5);
    cursor: pointer; font-size: 13px; font-family: inherit;
    transition: var(--transition);
}
.sidebar-action-btn:hover { background: rgba(255,255,255,0.12); color: white; }
/* Language Dropdown */.lang-dropdown-container {    position: relative;    flex: 1;}.lang-dropdown-menu {    position: absolute;    bottom: 100%;    left: 0;    right: 0;    margin-bottom: 8px;    background: #1e293b;    border: 1px solid rgba(255,255,255,0.1);    border-radius: var(--radius);    overflow: hidden;    box-shadow: 0 10px 25px rgba(0,0,0,0.3);    opacity: 0;    transform: translateY(10px);    pointer-events: none;    transition: all 0.2s ease;    z-index: 1000;}.lang-dropdown-menu.active {    opacity: 1;    transform: translateY(0);    pointer-events: all;}.lang-option {    display: flex;    align-items: center;    gap: 10px;    padding: 10px 12px;    cursor: pointer;    color: rgba(255,255,255,0.7);    font-size: 13px;    transition: background 0.15s;}.lang-option:hover { background: rgba(255,255,255,0.1); }.lang-option.active { background: rgba(79,70,229,0.2); color: white; }

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

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1; min-height: 100vh; transition: var(--transition);
    min-width: 0; /* CRITICAL: prevents flex child from expanding beyond container */
    overflow-x: hidden;
}
[dir="rtl"] .main-content { margin-right: var(--sidebar-width); }
[dir="ltr"] .main-content { margin-left: var(--sidebar-width); }

.topbar {
    height: var(--topbar-height); background: var(--white);
    border-bottom: 1px solid var(--border); padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 18px; font-weight: 700; color: var(--dark); }
.topbar-date { font-size: 13px; color: var(--gray); }

.mobile-menu-btn {
    display: none; background: none; border: none; font-size: 20px;
    color: var(--dark); cursor: pointer; padding: 4px;
}

.page-content { padding: 24px; min-width: 0; overflow: hidden; }

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--white); border-radius: var(--radius-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 700; color: var(--dark); }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* Stats Cards */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white); border-radius: var(--radius-lg);
    border: 1px solid var(--border); padding: 20px;
    display: flex; align-items: flex-start; justify-content: space-between;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-info h4 { font-size: 12px; color: var(--gray); font-weight: 600; margin-bottom: 6px; }
.stat-info .stat-value { font-size: 24px; font-weight: 800; color: var(--dark); }
.stat-info .stat-change { font-size: 12px; margin-top: 4px; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

.stat-icon {
    width: 44px; height: 44px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.purple { background: var(--primary-light); color: var(--primary); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

/* ============================================
   Data Table
   ============================================ */
.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
.card-body.no-pad > .table-responsive,
.card-body > .table-responsive {
    max-width: 100%;
    overflow-x: auto !important;
}

.data-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}

.data-table thead th {
    background: var(--gray-light); padding: 10px 12px; text-align: start;
    font-weight: 600; color: var(--dark-2); font-size: 12px;
    border-bottom: 2px solid var(--border); white-space: nowrap;
    position: sticky; top: 0; z-index: 2;
}

.data-table tbody td {
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--primary-light); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table .text-center { text-align: center; }
.data-table .text-end { text-align: end; }

/* ============================================
   Force English (Western) numerals everywhere
   ============================================ */

/* كل العناصر */
*, *::before, *::after {
    font-variant-numeric: lining-nums;
}

/* inputs و textareas — المصدر الرئيسي للأرقام العربية */
input, textarea, select,
input[type="number"],
input[type="text"],
input[type="tel"] {
    direction: ltr;
    text-align: right;
    -webkit-locale: "en";
    font-variant-numeric: lining-nums tabular-nums;
    unicode-bidi: plaintext;
}

/* inputs العربية اللي نصها يمين-لشمال تحتاج text-align:right */
input.form-control, .sheet-input {
    direction: ltr;
    text-align: center;
}

/* الجداول والأرقام */
td, th, tfoot,
.stat-value, .summary-value,
.discount-col, .total-col, .net-col,
.cost-col, .price-item input {
    font-variant-numeric: lining-nums tabular-nums;
    unicode-bidi: plaintext;
}

/* inputs النصية زي الاسم والإيميل تبقى RTL */
input[type="email"],
input[type="password"],
input[type="date"],
input[type="search"] {
    direction: rtl;
    text-align: right;
}

/* Inline sheet edit inputs */
.sheet-input {
    width: 70px; padding: 3px 5px;
    border: 1.5px solid transparent;
    border-radius: 4px; background: transparent;
    text-align: center; font-size: 13px; font-weight: 600;
    transition: all 0.15s;
}
.sheet-input:not([disabled]) {
    border-color: #7c3aed; background: #f5f3ff; cursor: text;
}
.sheet-input:not([disabled]):focus {
    outline: none; border-color: #6d28d9; background: #ede9fe;
    box-shadow: 0 0 0 2px #7c3aed30;
}
.sheet-sig { accent-color: #7c3aed; transform: scale(1.3); cursor: pointer; }

/* Usage Table (specialized) */
.usage-table { font-size: 12px; min-width: 2200px; border-collapse: collapse; }
.usage-table thead th {
    text-align: center; padding: 10px 8px; font-size: 11.5px;
}
.usage-table .th-main {
    background: linear-gradient(135deg, #312e81, var(--primary));
    color: white; border: 1px solid #4338ca;
    min-width: 80px;
}
.usage-table .th-sub {
    background: #6366f1; color: rgba(255,255,255,0.9);
    border: 1px solid #818cf8; font-size: 10.5px;
    min-width: 55px;
}
.usage-table tbody td {
    text-align: center; padding: 8px 6px; font-size: 12px;
    border: 1px solid var(--border); white-space: nowrap;
    min-width: 55px;
}
.usage-table .date-col {
    font-weight: 700; background: var(--light);
    position: sticky; right: 0; z-index: 5;
    min-width: 110px; font-size: 12.5px;
    box-shadow: -2px 0 6px rgba(0,0,0,0.08);
}
[dir="ltr"] .usage-table .date-col {
    position: sticky; left: 0; right: auto;
    box-shadow: 2px 0 6px rgba(0,0,0,0.08);
}
.usage-table thead th:first-child {
    position: sticky; right: 0; z-index: 10;
    box-shadow: -2px 0 6px rgba(0,0,0,0.15);
}
[dir="ltr"] .usage-table thead th:first-child {
    left: 0; right: auto;
    box-shadow: 2px 0 6px rgba(0,0,0,0.15);
}
.usage-table .charge-col { color: var(--success); font-weight: 700; }
.usage-table .cost-col { color: var(--danger); font-weight: 600; min-width: 60px; }
.usage-table .total-col { font-weight: 700; background: #fefce8; min-width: 70px; font-size: 12.5px; }
.usage-table .discount-col { color: var(--warning); font-weight: 700; min-width: 70px; }
.usage-table .disc-pct-col { color: #7c3aed; font-weight: 700; background: #f5f3ff; min-width: 50px; }
.usage-table .net-col { font-weight: 700; color: var(--primary); background: var(--primary-light); min-width: 70px; font-size: 12.5px; }
.usage-table .zero { color: #cbd5e1; }
.usage-table tfoot td {
    font-weight: 700; font-size: 12.5px;
    background: linear-gradient(135deg, var(--gray-light), var(--border));
    padding: 10px 6px;
}
.usage-table tfoot td:first-child {
    background: linear-gradient(135deg, #312e81, var(--primary)); color: white;
    position: sticky; right: 0; z-index: 5;
}
[dir="ltr"] .usage-table tfoot td:first-child {
    left: 0; right: auto;
}

/* ===== Table Scroll Controls ===== */
.table-scroll-controls {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 10px 16px; background: linear-gradient(135deg, #312e81, #4f46e5);
    border-radius: 10px 10px 0 0; margin-bottom: 0;
}
.table-scroll-controls .scroll-label {
    color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 600;
}
.table-scroll-btn {
    width: 44px; height: 36px; border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px; background: rgba(255,255,255,0.1);
    color: white; cursor: pointer; font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; user-select: none;
}
.table-scroll-btn:hover { background: rgba(255,255,255,0.25); border-color: white; transform: scale(1.05); }
.table-scroll-btn:active { background: rgba(255,255,255,0.4); transform: scale(0.95); }
.scroll-position-bar {
    flex: 1; max-width: 300px; height: 10px; background: rgba(255,255,255,0.15);
    border-radius: 5px; overflow: hidden; position: relative; cursor: pointer;
}
.scroll-position-fill {
    height: 100%; background: linear-gradient(90deg, #818cf8, #a5b4fc);
    border-radius: 5px; transition: width 0.15s; min-width: 20px;
}
/* Drag-to-scroll cursor */
.table-responsive.draggable { cursor: grab; }
.table-responsive.draggable:active, .table-responsive.dragging { cursor: grabbing; }
/* Ensure scrollbar visible */
.table-responsive { scrollbar-width: auto; scrollbar-color: #6366f1 #e2e8f0; }
.table-responsive::-webkit-scrollbar { height: 14px !important; }
.table-responsive::-webkit-scrollbar-track { background: #e2e8f0; }
.table-responsive::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 7px; border: 2px solid #e2e8f0; }

/* Action buttons in table */
.table-actions { display: flex; gap: 4px; justify-content: center; }
.table-actions .btn-xs { border-radius: 6px; }

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    width: 100%;
    max-width: 560px;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal {
    background: var(--white); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg); width: 100%;
    max-height: 90vh; overflow-y: auto;
    animation: modalSlideIn 0.2s ease;
}
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 2px solid #f1f5f9;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.modal-header h3 {
    font-size: 18px; font-weight: 800;
    color: #1e293b;
    display: flex; align-items: center; gap: 10px;
    margin: 0;
}
.modal-header h3 i {
    font-size: 20px;
}
.modal-close {
    background: #f1f5f9;
    border: none;
    font-size: 24px;
    font-weight: 400;
    color: #64748b;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background: #ffffff;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 2px solid #f1f5f9;
    background: #fafafa;
    display: flex; gap: 10px; justify-content: flex-end;
    flex-shrink: 0;
}
[dir="rtl"] .modal-footer { justify-content: flex-start; }

/* ============================================
   Toast Notifications
   ============================================ */
#toastContainer {
    position: fixed; bottom: 24px; z-index: 3000;
    display: flex; flex-direction: column; gap: 8px;
}
[dir="rtl"] #toastContainer { right: 24px; }
[dir="ltr"] #toastContainer { left: 24px; }

.toast {
    background: var(--dark); color: white; padding: 12px 20px;
    border-radius: var(--radius); font-size: 14px; font-family: inherit;
    box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
    min-width: 280px; max-width: 420px;
    animation: toastIn 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: #1e293b; }

.toast-exit { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(20px); } }

/* ============================================
   Month Selector
   ============================================ */
.month-selector {
    display: flex; align-items: center; gap: 12px;
}
.month-label {
    font-size: 16px; font-weight: 700; min-width: 140px; text-align: center;
}
.month-btn {
    width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border);
    background: var(--white); color: var(--primary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); font-size: 13px;
}
.month-btn:hover { background: var(--primary-light); border-color: var(--primary); }

/* ============================================
   Summary Cards Row
   ============================================ */
.summary-row {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.summary-card {
    flex: 1; min-width: 150px; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px; text-align: center;
}
.summary-card .summary-label { font-size: 11px; color: var(--gray); font-weight: 600; }
.summary-card .summary-value { font-size: 20px; font-weight: 800; margin-top: 2px; }
.summary-card .summary-value.text-primary { color: var(--primary); }
.summary-card .summary-value.text-danger { color: var(--danger); }
.summary-card .summary-value.text-success { color: var(--success); }
.summary-card .summary-value.text-warning { color: var(--warning); }

/* ============================================
   Settings Page
   ============================================ */
.settings-section {
    margin-bottom: 24px;
}
.settings-section h3 {
    font-size: 16px; font-weight: 700; color: var(--dark);
    margin-bottom: 16px; padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    display: flex; align-items: center; gap: 8px;
}
.settings-section h3 i { color: var(--primary); }

.price-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.price-item {
    background: var(--light); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px;
}
.price-item label {
    font-size: 12px; font-weight: 600; color: var(--dark-2);
    margin-bottom: 6px; display: block;
}
.price-item input {
    width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
    border-radius: 6px; font-family: inherit; font-size: 14px;
    direction: ltr; text-align: center; font-weight: 600;
}
.price-item input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--gray);
}
.empty-state i { font-size: 48px; color: var(--border); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--dark-2); }
.empty-state p { font-size: 14px; max-width: 400px; margin: 0 auto 16px; }

/* ============================================
   Notice Bar
   ============================================ */
.notice-bar {
    background: var(--warning-light); color: #92400e;
    padding: 8px 20px; font-size: 13px;
    display: flex; align-items: center; gap: 8px;
    border-radius: var(--radius); margin-bottom: 16px;
}

/* ============================================
   Calc Preview (in data entry)
   ============================================ */
.calc-preview {
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: var(--radius); padding: 14px; margin-top: 12px;
}
.calc-preview h4 { font-size: 13px; color: var(--success); margin-bottom: 8px; }
.preview-line {
    display: flex; justify-content: space-between; font-size: 12px;
    padding: 3px 0; border-bottom: 1px dotted #d1fae5;
}
.preview-line:last-child {
    border-bottom: none; font-weight: 700; font-size: 14px;
    padding-top: 8px; color: var(--primary);
}

/* ============================================
   Client Project Cards
   ============================================ */
.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.project-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    cursor: pointer; transition: var(--transition);
}
.project-card:hover {
    border-color: var(--primary); box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.project-card .project-icon {
    width: 48px; height: 48px; border-radius: var(--radius-lg);
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 12px;
}
.project-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.project-card p { font-size: 13px; color: var(--gray); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }
    [dir="ltr"] .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0) !important; }
    .sidebar.open + .sidebar-overlay { display: block; }

    [dir="rtl"] .main-content { margin-right: 0; }
    [dir="ltr"] .main-content { margin-left: 0; }

    .mobile-menu-btn { display: block; }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }

    .topbar { padding: 0 16px; }
    .page-content { padding: 16px; }

    .summary-row { flex-direction: column; }
    .summary-card { min-width: unset; }

    .modal { margin: 10px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-form { padding: 20px; }
    .login-header { padding: 24px 20px 8px; }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* ============================================
   Utilities
   ============================================ */
/* ============================================
   Toggle Switch
   ============================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    vertical-align: middle;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.25s ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.toggle-switch input:checked + .toggle-slider {
    background: #10b981;
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}
[dir="rtl"] .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(-20px);
}
.toggle-switch:hover .toggle-slider {
    filter: brightness(0.95);
}
.toggle-switch input:focus-visible + .toggle-slider {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* ============================================
   Utilities
   ============================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-gray { color: var(--gray) !important; }
.text-center { text-align: center !important; }
.text-end { text-align: end !important; }
.fw-bold { font-weight: 700 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: 8px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-24 { margin-bottom: 24px !important; }
.mt-16 { margin-top: 16px !important; }
.gap-8 { gap: 8px !important; }
.d-flex { display: flex !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.flex-wrap { flex-wrap: wrap !important; }

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--gray);
}
.breadcrumb a {
    color: var(--primary); text-decoration: none; font-weight: 600;
    display: flex; align-items: center; gap: 4px;
    transition: var(--transition);
}
.breadcrumb a:hover { color: var(--primary-dark); }
.breadcrumb-sep { font-size: 10px; color: var(--gray); margin: 0 2px; }
[dir="ltr"] .breadcrumb-sep { transform: rotate(180deg); }
.breadcrumb-current { font-weight: 700; color: var(--dark); }

/* ============================================
   Client Name Link
   ============================================ */
.client-name-link {
    color: var(--primary); font-weight: 700; text-decoration: none;
    transition: var(--transition); cursor: pointer;
}
.client-name-link:hover {
    color: var(--primary-dark); text-decoration: underline;
}

/* ============================================
   Client Avatar
   ============================================ */
.client-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white; display: flex; align-items: center;
    justify-content: center; font-size: 20px;
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

/* ============================================
   Profile Info Grid
   ============================================ */
.profile-info-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.profile-info-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px; border-radius: var(--radius);
    background: var(--gray-light);
}
.profile-info-item > i {
    font-size: 16px; margin-top: 2px; width: 20px; text-align: center;
}
.profile-info-item .info-label {
    display: block; font-size: 11px; color: var(--gray);
    font-weight: 600; margin-bottom: 2px;
}
.profile-info-item .info-value {
    display: block; font-size: 14px; font-weight: 600;
    color: var(--dark); word-break: break-all;
}

@media (max-width: 768px) {
    .profile-info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .profile-info-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Payment Methods
   ============================================ */
.payment-methods-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px;
}
.payment-method-card {
    background: var(--white); border: 1.5px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
    transition: var(--transition); position: relative;
}
.payment-method-card:hover {
    border-color: var(--primary); box-shadow: var(--shadow-md);
}
.payment-method-card.disabled {
    opacity: 0.6; background: var(--gray-light);
}
.pm-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 12px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.pm-icon {
    width: 44px; height: 44px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.pm-info h4 {
    font-size: 15px; font-weight: 700; color: var(--dark);
    margin: 0 0 4px;
}
.pm-details { margin-bottom: 12px; }
.pm-detail {
    font-size: 13px; color: var(--dark-2);
    margin-bottom: 6px; display: flex;
    align-items: center; gap: 6px; flex-wrap: wrap;
}
.pm-detail strong { color: var(--gray); font-size: 12px; }
.pm-detail code {
    background: var(--primary-light); padding: 2px 8px;
    border-radius: 4px; font-family: 'Courier New', monospace;
    font-size: 14px; font-weight: 700; color: var(--primary);
    letter-spacing: 1px;
}
.pm-actions {
    display: flex; gap: 6px; justify-content: flex-end;
    padding-top: 8px; border-top: 1px solid var(--border);
}
/* Search Bar */
.search-bar{position:relative;max-width:320px;}
.search-bar input{width:100%;padding:8px 14px 8px 36px;border:1.5px solid var(--border);border-radius:var(--radius);font-family:inherit;font-size:13px;transition:var(--transition);background:var(--white);}
[dir="rtl"] .search-bar input{padding:8px 36px 8px 14px;}
.search-bar input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-light);}
.search-bar i{position:absolute;top:50%;transform:translateY(-50%);color:var(--gray);font-size:14px;}
[dir="ltr"] .search-bar i{left:12px;}
[dir="rtl"] .search-bar i{right:12px;}
.search-bar .search-clear{position:absolute;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--gray);cursor:pointer;font-size:14px;padding:4px;display:none;}
[dir="ltr"] .search-bar .search-clear{right:8px;}
[dir="rtl"] .search-bar .search-clear{left:8px;}
.search-bar input:not(:placeholder-shown) ~ .search-clear{display:block;}

/* Export Button */
.btn-export{background:linear-gradient(135deg,#059669,#10b981);color:white;font-size:12px;padding:6px 12px;}
.btn-export:hover{background:linear-gradient(135deg,#047857,#059669);}

/* Skeleton Loading */
.skeleton{position:relative;overflow:hidden;background:#e2e8f0;border-radius:6px;}
.skeleton::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,0.5),transparent);animation:shimmer 1.5s infinite;}
@keyframes shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
.skeleton-text{height:14px;margin-bottom:8px;border-radius:4px;}
.skeleton-text.w50{width:50%;}
.skeleton-text.w75{width:75%;}
.skeleton-text.w100{width:100%;}
.skeleton-card{height:100px;border-radius:var(--radius-lg);margin-bottom:16px;}
.skeleton-row{display:flex;gap:16px;margin-bottom:12px;}
.skeleton-row .skeleton{flex:1;height:40px;}
.skeleton-stat{height:90px;border-radius:var(--radius-lg);}
.skeleton-table-row{display:flex;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border);}
.skeleton-table-row .skeleton{height:16px;}

/* ID Badges */
.id-badge{display:inline-flex;align-items:center;gap:3px;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-size:11px;font-family:'Courier New',monospace;color:#64748b;cursor:pointer;transition:all 0.2s;letter-spacing:0.5px;font-weight:600;}
.id-badge:hover{background:#e2e8f0;color:#334155;border-color:#94a3b8;}
.id-badge i{font-size:9px;color:#94a3b8;}

.btn-copy {
    background: none; border: 1px solid var(--border);
    border-radius: 4px; padding: 2px 6px; cursor: pointer;
    color: var(--gray); font-size: 12px;
    transition: var(--transition);
}
.btn-copy:hover {
    background: var(--primary-light); color: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 480px) {
    .payment-methods-grid { grid-template-columns: 1fr; }
}

/* ===== NOTIFICATION BELL ===== */
.notif-bell{position:relative;cursor:pointer;padding:8px 12px;border-radius:8px;transition:background 0.2s;margin-left:8px;}
.notif-bell:hover{background:var(--gray-light);}
.notif-bell i{font-size:18px;color:var(--dark-2);}
.notif-badge{position:absolute;top:2px;right:4px;background:var(--danger);color:#fff;font-size:10px;font-weight:700;min-width:18px;height:18px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px;animation:notifPulse 2s infinite;}
@keyframes notifPulse{0%,100%{transform:scale(1);}50%{transform:scale(1.15);}}
.notif-dropdown{position:fixed;width:380px;max-height:520px;background:#fff;border-radius:14px;box-shadow:0 16px 48px rgba(0,0,0,0.18);z-index:99999;overflow:hidden;border:1px solid var(--border);display:flex;flex-direction:column;}
.notif-header{padding:14px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;flex-shrink:0;background:linear-gradient(135deg,#f8faff 0%,#fff 100%);}
.notif-header h4{margin:0;font-size:14px;font-weight:700;display:flex;align-items:center;gap:6px;}
.notif-list{max-height:440px;overflow-y:auto;flex:1;}
.notif-list::-webkit-scrollbar{width:4px;}
.notif-list::-webkit-scrollbar-track{background:#f1f5f9;}
.notif-list::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:2px;}
.notif-item{padding:12px 16px;border-bottom:1px solid #f1f5f9;cursor:pointer;transition:background 0.2s;display:flex;gap:10px;align-items:flex-start;position:relative;}
.notif-item:hover{background:#f8fafc;}
.notif-item:last-child{border-bottom:none;}
.notif-item.unread{background:#eff6ff;}
.notif-item.read{background:#fff;}
.notif-icon{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:15px;}
.notif-icon.success{background:#dcfce7;color:#16a34a;}
.notif-icon.danger{background:#fee2e2;color:#dc2626;}
.notif-icon.info{background:#dbeafe;color:#2563eb;}
.notif-content{flex:1;min-width:0;}
.notif-item .notif-text{font-size:13px;line-height:1.5;color:var(--dark-2);word-break:break-word;}
.notif-item .notif-time{font-size:11px;color:var(--gray);margin-top:3px;display:flex;align-items:center;gap:4px;}
.notif-unread-dot{width:8px;height:8px;border-radius:50%;background:var(--primary);flex-shrink:0;margin-top:4px;}
.notif-empty{padding:48px 16px;text-align:center;color:var(--gray);}

/* ===== PAYMENT METHOD LOGOS ===== */
.pm-logo{width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0;}
.pm-logo.vodafoneCash{background:#e60000;color:#fff;}
.pm-logo.instaPay{background:linear-gradient(135deg,#f5a623,#f7ce68);color:#fff;}
.pm-logo.usdt{background:#26a17b;color:#fff;}
.pm-logo.bankTransfer,.pm-logo.bankAccount{background:#1e40af;color:#fff;}
.pm-logo.crypto{background:linear-gradient(135deg,#f7931a,#ffb347);color:#fff;}
.pm-logo.other{background:#64748b;color:#fff;}

/* ===== CLIENT PAYMENT CARDS ===== */
.pm-client-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px;margin-bottom:24px;}
.pm-client-card{background:#fff;border:2px solid var(--border);border-radius:16px;padding:20px;transition:all 0.3s;}
.pm-client-card:hover{border-color:var(--primary);box-shadow:0 4px 20px rgba(59,130,246,0.1);transform:translateY(-2px);}
.pm-client-card.selected{border-color:var(--primary);background:var(--primary-light);}
.pm-client-card .pm-card-header{display:flex;align-items:center;gap:12px;margin-bottom:12px;}
.pm-client-card .pm-card-name{font-weight:700;font-size:16px;}
.pm-client-card .pm-card-details{font-size:13px;color:var(--dark-2);line-height:1.8;}
.pm-card-detail{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px dashed #e2e8f0;}
.pm-card-detail:last-child{border-bottom:none;}
.pm-card-detail .detail-label{color:var(--gray);min-width:100px;font-size:12px;}
.pm-card-detail .detail-value{font-weight:600;flex:1;word-break:break-all;}
.btn-copy-inline{background:var(--primary-light);color:var(--primary);border:none;padding:4px 10px;border-radius:6px;cursor:pointer;font-size:12px;transition:all 0.2s;}
.btn-copy-inline:hover{background:var(--primary);color:#fff;}

/* ===== FILE UPLOAD AREA ===== */
.upload-area{border:2px dashed var(--border);border-radius:12px;padding:30px;text-align:center;cursor:pointer;transition:all 0.3s;background:#fafbfc;}
.upload-area:hover,.upload-area.dragover{border-color:var(--primary);background:var(--primary-light);}
.upload-area i{font-size:36px;color:var(--gray);margin-bottom:8px;display:block;}
.upload-area .upload-text{font-size:14px;color:var(--dark-2);margin-bottom:4px;}
.upload-area .upload-hint{font-size:12px;color:var(--gray);}
.upload-preview{margin-top:12px;position:relative;display:inline-block;}
.upload-preview img{max-width:200px;max-height:150px;border-radius:8px;border:2px solid var(--primary);}
.upload-preview .remove-preview{position:absolute;top:-8px;right:-8px;background:var(--danger);color:#fff;width:24px;height:24px;border-radius:50%;border:none;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center;}

/* ===== PAYMENT REQUEST CARDS ===== */
.pr-card{background:#fff;border:2px solid var(--border);border-radius:12px;padding:16px;margin-bottom:12px;transition:all 0.3s;}
.pr-card.pending{border-right:4px solid #f59e0b;}
.pr-card.approved{border-right:4px solid #10b981;}
.pr-card.rejected{border-right:4px solid #ef4444;}
[dir="rtl"] .pr-card.pending{border-right:none;border-left:4px solid #f59e0b;}
[dir="rtl"] .pr-card.approved{border-right:none;border-left:4px solid #10b981;}
[dir="rtl"] .pr-card.rejected{border-right:none;border-left:4px solid #ef4444;}
.pr-card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:8px;}
.pr-card-body{display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap;}
.pr-proof-thumb{width:100px;height:80px;border-radius:8px;object-fit:cover;cursor:pointer;border:2px solid var(--border);transition:transform 0.2s;}
.pr-proof-thumb:hover{transform:scale(1.05);}
.pr-tabs{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap;}
.pr-tab{padding:8px 16px;border:2px solid var(--border);border-radius:8px;background:#fff;cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;transition:all 0.2s;}
.pr-tab.active{border-color:var(--primary);background:var(--primary-light);color:var(--primary);}
.pr-tab .pr-tab-count{background:var(--gray-light);padding:2px 8px;border-radius:10px;font-size:11px;margin-right:4px;}
.pr-tab.active .pr-tab-count{background:var(--primary);color:#fff;}

/* ===== CLIENT WALLET PAYMENT GRID ===== */
.payment-methods-client-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px;}
.payment-methods-client-grid .pm-client-card{display:flex;align-items:center;gap:12px;padding:14px 16px;background:#fff;border:1.5px solid var(--border);border-radius:10px;cursor:pointer;transition:all 0.2s;}
.payment-methods-client-grid .pm-client-card:hover{border-color:var(--success);background:#f0fdf4;transform:translateY(-2px);box-shadow:0 4px 12px rgba(16,185,129,0.15);}
.pm-icon-sm{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;}
.pm-client-info{display:flex;flex-direction:column;gap:2px;min-width:0;}
.pm-client-info strong{font-size:13px;color:var(--dark);}
.pm-client-info code{color:var(--gray);background:#f1f5f9;padding:2px 6px;border-radius:4px;font-size:11px;}
.btn-lg{padding:12px 24px;font-size:16px;}

/* ===== GOOGLE SIGN-IN BUTTON ===== */
.social-divider{display:flex;align-items:center;gap:12px;margin:16px 32px;color:var(--gray);font-size:13px;font-weight:600;}
.social-divider::before,.social-divider::after{content:'';flex:1;height:1px;background:var(--border);}
.btn-google{display:flex;align-items:center;justify-content:center;gap:12px;width:calc(100% - 64px);margin:0 32px 16px;padding:12px 20px;border:2px solid var(--border);border-radius:var(--radius);background:#fff;cursor:pointer;font-family:inherit;font-size:14px;font-weight:600;color:var(--dark);transition:all 0.3s;}
.btn-google:hover{border-color:#4285F4;background:#f8fafc;box-shadow:0 2px 12px rgba(66,133,244,0.15);transform:translateY(-1px);}
.btn-google:disabled{opacity:0.6;cursor:not-allowed;transform:none;}
.btn-google svg{flex-shrink:0;}

/* ===== PROJECT SETTINGS ===== */
.project-settings-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px;margin-top:12px;}
.project-setting-card{background:var(--gray-light);border:1.5px solid var(--border);border-radius:var(--radius-lg);padding:16px;transition:all 0.3s;}
.project-setting-card:hover{border-color:var(--primary);}
.project-setting-card .setting-label{font-size:12px;font-weight:700;color:var(--gray);margin-bottom:6px;display:flex;align-items:center;gap:6px;}
.project-setting-card .setting-value{font-size:14px;font-weight:600;color:var(--dark);word-break:break-all;font-family:'Courier New',monospace;background:#fff;padding:8px 12px;border-radius:6px;border:1px solid var(--border);}
.project-setting-card .setting-empty{font-size:13px;color:var(--danger);font-style:italic;}
.project-status-banner{padding:12px 20px;border-radius:var(--radius);margin-bottom:16px;display:flex;align-items:center;gap:10px;font-weight:600;font-size:14px;}
.project-status-banner.active{background:#dcfce7;color:#166534;border:1.5px solid #86efac;}
.project-status-banner.inactive{background:#fef2f2;color:#991b1b;border:1.5px solid #fca5a5;}
.project-status-banner.stopped{background:#fef3c7;color:#92400e;border:1.5px solid #fcd34d;}
.project-status-banner i{font-size:18px;}

/* ===== USAGE STATS GRID (Client Overview) ===== */
.usage-stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
.usage-stat-card{background:#fff;border-radius:12px;padding:20px;text-align:center;border:2px solid #e2e8f0;transition:all 0.3s ease;position:relative;overflow:hidden;}
.usage-stat-card::before{content:'';position:absolute;top:0;left:0;right:0;height:4px;}
.usage-stat-card.yesterday{border-color:#3b82f6;}
.usage-stat-card.yesterday::before{background:linear-gradient(90deg,#3b82f6,#60a5fa);}
.usage-stat-card.yesterday .usage-stat-icon{color:#3b82f6;background:#eff6ff;}
.usage-stat-card.daybefore{border-color:#8b5cf6;}
.usage-stat-card.daybefore::before{background:linear-gradient(90deg,#8b5cf6,#a78bfa);}
.usage-stat-card.daybefore .usage-stat-icon{color:#8b5cf6;background:#f5f3ff;}
.usage-stat-card.lastweek{border-color:#f59e0b;}
.usage-stat-card.lastweek::before{background:linear-gradient(90deg,#f59e0b,#fbbf24);}
.usage-stat-card.lastweek .usage-stat-icon{color:#f59e0b;background:#fffbeb;}
.usage-stat-card:hover{transform:translateY(-2px);box-shadow:0 8px 25px rgba(0,0,0,0.1);}
.usage-stat-icon{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 12px;font-size:20px;}
.usage-stat-label{font-size:13px;color:#64748b;margin-bottom:8px;font-weight:600;}
.usage-stat-value{font-size:28px;font-weight:800;color:#1e293b;line-height:1.2;}
.usage-stat-value small{font-size:13px;font-weight:500;color:#94a3b8;}
.usage-stat-cost{font-size:18px;font-weight:700;color:#3b82f6;margin-top:4px;}
.usage-stat-cmp{margin-top:10px;padding-top:10px;border-top:1px solid #f1f5f9;font-size:12px;color:#64748b;}
@media(max-width:768px){.usage-stats-grid{grid-template-columns:1fr;}.usage-stat-value{font-size:22px;}}

/* ============================================
   Packages System
   ============================================ */
/* Admin Packages Grid */
.packages-admin-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px;
}
.pkg-admin-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: var(--transition); display: flex; flex-direction: column;
}
.pkg-admin-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pkg-admin-header {
    display: flex; align-items: center; gap: 12px; padding: 16px;
    border-bottom: 1px solid var(--border); flex-wrap: wrap;
}

.pkg-price-tag {
    padding: 6px 14px; border-radius: 20px; font-size: 16px;
    font-weight: 800; white-space: nowrap;
}
.pkg-price-tag small { font-size: 11px; font-weight: 500; opacity: 0.8; }
.pkg-admin-body {
    padding: 16px; flex: 1;
}
.pkg-features-list {
    display: flex; flex-direction: column; gap: 6px;
}
.pkg-feature {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--dark-2);
}
.pkg-feature i { font-size: 12px; flex-shrink: 0; }
.pkg-services-list { margin-bottom: 12px; }
.pkg-svc-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-size: 13px; border-bottom: 1px solid #f1f5f9; border-radius: 4px; }
.pkg-svc-item:nth-child(odd) { background: #f8fafc; }
.pkg-svc-item:last-child { border-bottom: none; }
.pkg-svc-name { color: var(--dark-2); font-weight: 500; }
.pkg-svc-mins { color: var(--primary); font-weight: 700; font-size: 12px; direction: ltr; }
.pkg-admin-footer {
    padding: 12px 16px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--gray-light);
}

/* ============================================
   Package Store — New Design
   ============================================ */
.packages-store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    align-items: start;
}
.pkg-store-card {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    transition: all 0.3s ease; display: flex; flex-direction: column;
    position: relative;
}
.pkg-store-card:hover {
    transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border-color: var(--pkg-color, var(--primary));
}
.pkg-store-card.popular {
    border-color: var(--pkg-color, var(--primary));
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.pkg-popular-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 auto 14px;
    background: rgba(255,255,255,0.25);
    border: 1.5px solid rgba(255,255,255,0.5);
        color: #fff; padding: 4px 14px; border-radius: 20px;
    font-size: 12px; font-weight: 700;
    backdrop-filter: blur(4px);
}
[dir="rtl"] .pkg-popular-badge { margin: 0 auto 12px; }






.pkg-store-body {
    padding: 24px; flex: 1;
}
.pkg-desc {
    font-size: 14px; color: var(--gray); margin-bottom: 16px;
    line-height: 1.6; text-align: center;
}
.pkg-store-body .pkg-features-list { gap: 10px; }
.pkg-store-body .pkg-feature {
    font-size: 14px; padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}
.pkg-store-body .pkg-feature:last-child { border-bottom: none; }
.pkg-bonus {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; margin-top: 12px;
    background: var(--gray-light); border-radius: var(--radius);
    font-size: 13px; font-weight: 600; color: var(--dark-2);
}
.pkg-bonus i { font-size: 14px; }
.pkg-store-footer {
    padding: 16px 24px 24px;
}
.pkg-store-footer .btn {
    padding: 14px 24px; font-size: 16px; font-weight: 700;
    border-radius: var(--radius-lg); transition: all 0.3s;
}
.pkg-store-footer .btn:hover:not(:disabled) {
    transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ── Header ── */
.pkg-store-header {
    padding: 20px 20px 24px;
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pkg-icon-wrap { font-size: 40px; margin-bottom: 10px; line-height: 1; }
.pkg-title { font-size: 20px; font-weight: 800; margin: 0 0 6px; color: #fff; }
.pkg-validity { font-size: 12px; opacity: 0.85; }

/* ── Price block ── */
.pkg-price-block {
    padding: 16px 20px 0;
    text-align: center;
    background: #fff;
}
.pkg-real-price {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 2px;
}
.pkg-real-price span {
    text-decoration: line-through;
    font-weight: 700;
    color: #ef4444;
}
.pkg-discounted-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}
.pkg-amount { font-size: 38px; font-weight: 900; color: #1e293b; line-height: 1; }
.pkg-save-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Timer ── */
.pkg-timer-wrap { padding: 0 16px; margin-top: 10px; }
.pkg-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}
.pkg-timer-urgent {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    animation: pulseRed 1.5s ease-in-out infinite;
}
.pkg-timer-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #d97706;
}
.pkg-timer-ok {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #16a34a;
}
@keyframes pulseRed {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    50%      { box-shadow: 0 0 0 6px rgba(239,68,68,0.15); }
}

/* ── Body ── */
.pkg-store-body { padding: 16px 20px; flex: 1; }
.pkg-desc { font-size: 13px; color: #64748b; margin-bottom: 12px; line-height: 1.6; }
.pkg-maxbuy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #7c3aed;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 20px;
    padding: 3px 10px;
    margin-bottom: 12px;
}
.pkg-features-list { display: flex; flex-direction: column; gap: 6px; }
.pkg-feature-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed #f1f5f9;
    font-size: 13px;
}
.pkg-feature-row:last-child { border-bottom: none; }
.pkg-feature-icon {
    width: 26px; height: 26px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; flex-shrink: 0;
}
.pkg-feature-name { flex: 1; color: #374151; font-weight: 500; }
.pkg-feature-val { font-weight: 700; color: #1e293b; font-size: 13px; white-space: nowrap; }

/* ── Footer ── */
.pkg-store-footer { padding: 16px 20px 20px; }
.pkg-owned-badge {
    text-align: center;
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 8px;
}
.pkg-btn-buy {
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    color: #fff !important;
    transition: all 0.25s;
    border: none;
    letter-spacing: 0.3px;
}
.pkg-btn-buy:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

/* ── My Packages ── */
.pkg-my-card { border-radius: 14px; transition: box-shadow 0.2s; }
.pkg-my-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.08); }
.pkg-my-header-inner {
    display: flex; align-items: center; gap: 14px; width: 100%;
}
.pkg-my-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.pkg-my-info { flex: 1; }
.pkg-my-info strong { font-size: 15px; font-weight: 700; display: block; }
.pkg-my-meta { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.pkg-my-body { padding: 14px 16px; }
.pkg-usage-title {
    font-size: 13px; font-weight: 700; color: #475569;
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.pkg-usage-bar { margin-bottom: 12px; }
.pub-top {
    display: flex; justify-content: space-between;
    font-size: 12px; font-weight: 600; margin-bottom: 5px; color: #374151;
}
.pub-track {
    height: 7px; background: #f1f5f9;
    border-radius: 6px; overflow: hidden;
}
.pub-fill {
    height: 100%; border-radius: 6px;
    transition: width 0.5s ease;
}
.pkg-expiry-row { margin-bottom: 14px; }

/* My Subscriptions Grid */
.my-subs-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}
.my-sub-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    transition: var(--transition);
}
.my-sub-card:hover { box-shadow: var(--shadow-sm); }

/* Responsive */
@media (max-width: 768px) {
    .packages-admin-grid { grid-template-columns: 1fr; }
    .packages-store-grid { grid-template-columns: 1fr; }
    .my-subs-grid { grid-template-columns: 1fr; }
    
    .pkg-amount { font-size: 28px; }
}

/* Utilities for packages */
.mt-24 { margin-top: 24px !important; }
.p-16 { padding: 16px !important; }

/* ===== Offer Countdown Banner ===== */
.offer-countdown-banner{display:flex;align-items:center;gap:10px;padding:10px 14px;background:linear-gradient(135deg,#fef2f2,#fff1f2);border:2px solid #ef4444;border-radius:10px;margin-top:12px;animation:countdown-pulse 2s ease-in-out infinite;}
.offer-countdown-banner .countdown-icon{width:36px;height:36px;background:#ef4444;color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:16px;animation:fire-bounce 1s ease-in-out infinite;}
.offer-countdown-banner .countdown-info{flex:1;}
.offer-countdown-banner .countdown-label{font-size:11px;color:#991b1b;font-weight:600;margin-bottom:2px;}
.offer-countdown-banner .countdown-text{font-size:15px;font-weight:800;color:#dc2626;font-family:'Courier New',monospace;letter-spacing:0.5px;}
@keyframes countdown-pulse{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);}}
@keyframes fire-bounce{0%,100%{transform:scale(1);}50%{transform:scale(1.15);}}

/* ============================================
   Project Detail Page (ZEGOCLOUD-style)
   ============================================ */
.proj-detail-header{display:flex;align-items:center;gap:12px;margin-bottom:20px;}
.proj-detail-back{width:40px;height:40px;border-radius:50%;background:var(--white);border:1.5px solid var(--border);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--transition);font-size:16px;color:var(--dark-2);flex-shrink:0;}
.proj-detail-back:hover{background:var(--primary-light);border-color:var(--primary);color:var(--primary);}
.proj-detail-title{flex:1;}
.proj-detail-title h2{font-size:22px;font-weight:800;color:var(--dark);margin:0;}
.proj-detail-title span{font-size:13px;color:var(--gray);}

.proj-tabs{display:flex;gap:0;border-bottom:2px solid var(--border);margin-bottom:24px;}
.proj-tab{padding:12px 24px;font-size:14px;font-weight:700;color:var(--gray);cursor:pointer;border-bottom:3px solid transparent;transition:var(--transition);background:none;border-top:none;border-left:none;border-right:none;font-family:inherit;white-space:nowrap;}
.proj-tab:hover{color:var(--primary);background:var(--primary-light);}
.proj-tab.active{color:var(--primary);border-bottom-color:var(--primary);}

.proj-hero{background:linear-gradient(135deg,#eff6ff,#f0f9ff);border:2px solid var(--primary-light);border-radius:var(--radius-xl);padding:28px 32px;margin-bottom:24px;display:flex;align-items:center;gap:24px;}
.proj-hero-icon{width:80px;height:80px;border-radius:20px;background:linear-gradient(135deg,var(--primary),#6366f1);display:flex;align-items:center;justify-content:center;font-size:36px;color:#fff;flex-shrink:0;box-shadow:0 8px 24px rgba(79,70,229,0.25);}
.proj-hero-info{flex:1;}
.proj-hero-info h3{font-size:18px;font-weight:800;color:var(--dark);margin:0 0 4px;}
.proj-hero-info p{font-size:14px;color:var(--gray);margin:0 0 12px;}
.proj-hero-actions{display:flex;gap:8px;flex-wrap:wrap;}

.proj-section{margin-bottom:24px;}
.proj-section-title{font-size:16px;font-weight:800;color:var(--dark);margin-bottom:16px;padding-bottom:8px;border-bottom:2px solid var(--border);display:flex;align-items:center;gap:8px;}
.proj-section-title i{color:var(--primary);}

.proj-info-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0;background:var(--white);border:1.5px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;}
.proj-info-item{padding:16px 20px;border-bottom:1px solid var(--border);border-inline-end:1px solid var(--border);}
.proj-info-item:nth-child(3n){border-inline-end:none;}
.proj-info-label{font-size:12px;color:var(--gray);font-weight:600;margin-bottom:4px;display:flex;align-items:center;gap:4px;}
.proj-info-value{font-size:15px;font-weight:700;color:var(--dark);display:flex;align-items:center;gap:8px;word-break:break-all;}
.proj-info-value .copy-btn{background:none;border:1px solid var(--border);border-radius:4px;padding:2px 6px;cursor:pointer;color:var(--gray);font-size:11px;transition:var(--transition);flex-shrink:0;}
.proj-info-value .copy-btn:hover{background:var(--primary-light);color:var(--primary);border-color:var(--primary);}

.proj-secret-field{display:flex;align-items:center;gap:8px;background:var(--gray-light);border:1.5px solid var(--border);border-radius:var(--radius);padding:10px 14px;font-family:'Courier New',monospace;font-size:13px;color:var(--dark);direction:ltr;text-align:left;}
.proj-secret-field .secret-value{flex:1;word-break:break-all;}
.proj-secret-field .secret-toggle{background:none;border:none;cursor:pointer;color:var(--gray);font-size:14px;padding:4px;transition:var(--transition);flex-shrink:0;}
.proj-secret-field .secret-toggle:hover{color:var(--primary);}

.proj-api-key-box{background:linear-gradient(135deg,#f0fdf4,#ecfdf5);border:2px solid #86efac;border-radius:var(--radius-lg);padding:20px;margin-bottom:16px;}
.proj-api-key-box .key-label{font-size:13px;color:#166534;font-weight:700;margin-bottom:8px;display:flex;align-items:center;gap:6px;}
.proj-api-key-box .key-value{background:#fff;border:1.5px solid #86efac;border-radius:var(--radius);padding:12px 16px;font-family:'Courier New',monospace;font-size:14px;font-weight:600;color:var(--primary);display:flex;align-items:center;gap:10px;direction:ltr;word-break:break-all;}
.proj-api-key-box .key-actions{display:flex;gap:8px;margin-top:10px;}

.proj-callback-item{display:flex;align-items:center;gap:12px;padding:10px 16px;background:var(--white);border:1.5px solid var(--border);border-radius:var(--radius);margin-bottom:8px;transition:var(--transition);}
.proj-callback-item:hover{border-color:var(--primary);background:var(--primary-light);}
.proj-callback-icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0;}
.proj-callback-label{font-size:13px;font-weight:600;color:var(--dark-2);min-width:100px;}
.proj-callback-url{flex:1;font-family:'Courier New',monospace;font-size:12px;color:var(--gray);direction:ltr;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.proj-code-block{background:#1e293b;border-radius:var(--radius-lg);padding:20px;margin-top:12px;position:relative;overflow:hidden;}
.proj-code-block pre{color:#e2e8f0;font-family:'Courier New',monospace;font-size:13px;line-height:1.6;margin:0;overflow-x:auto;white-space:pre-wrap;word-break:break-all;}
.proj-code-block .code-lang{position:absolute;top:8px;right:8px;background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.6);padding:2px 10px;border-radius:4px;font-size:11px;font-weight:600;}
[dir="rtl"] .proj-code-block .code-lang{right:auto;left:8px;}
.proj-code-block .code-copy{position:absolute;top:8px;left:8px;background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.6);border:none;padding:4px 10px;border-radius:4px;font-size:12px;cursor:pointer;transition:var(--transition);font-family:inherit;}
[dir="rtl"] .proj-code-block .code-copy{left:auto;right:8px;}
.proj-code-block .code-copy:hover{background:var(--primary);color:#fff;}

.proj-status-dot{width:10px;height:10px;border-radius:50%;display:inline-block;margin-inline-end:6px;flex-shrink:0;}
.proj-status-dot.online{background:#10b981;box-shadow:0 0 6px rgba(16,185,129,0.5);animation:pulse 2s ease infinite;}
.proj-status-dot.offline{background:#ef4444;box-shadow:0 0 6px rgba(239,68,68,0.5);}

@media(max-width:768px){
    .proj-info-grid{grid-template-columns:1fr 1fr;}
    .proj-info-item:nth-child(3n){border-inline-end:1px solid var(--border);}
    .proj-info-item:nth-child(2n){border-inline-end:none;}
    .proj-hero{flex-direction:column;text-align:center;}
    .proj-hero-actions{justify-content:center;}
    .proj-tabs{overflow-x:auto;}
}
@media(max-width:480px){
    .proj-info-grid{grid-template-columns:1fr;}
    .proj-info-item{border-inline-end:none !important;}
}

/* ============================================
   UI/UX Improvements v4
   ============================================ */

/* ── Page Header (unified across all pages) ── */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
    padding-bottom: 16px; border-bottom: 2px solid var(--border);
}
.page-header h2 {
    font-size: 20px; font-weight: 800; color: var(--dark);
    display: flex; align-items: center; gap: 10px;
}
.page-header h2 i { color: var(--primary); }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Topbar improvements ── */
.topbar {
    box-shadow: 0 1px 0 var(--border);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
}
.topbar-brand {
    display: flex; align-items: center; gap: 10px;
}
.topbar-brand .brand-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px;
}

/* ── Sidebar improvements ── */
.sidebar {
    background: linear-gradient(180deg, #070540 0%, #0f0c60 60%, #1a1a80 100%);
    box-shadow: 4px 0 24px rgba(15,12,96,0.35);
}
[dir="ltr"] .sidebar { box-shadow: -4px 0 24px rgba(0,0,0,0.15); }

.sidebar-logo span {
    background: linear-gradient(135deg, #a5b4fc, #c7d2fe);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.sidebar-nav .nav-item {
    margin: 2px 8px; border-radius: var(--radius);
    padding: 10px 12px;
}
.sidebar-nav .nav-item.active {
    background: linear-gradient(135deg, rgba(15,12,96,0.4), rgba(26,26,128,0.25));
    border-inline-start: none;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,0.4);
}

/* ── Stat cards improvements ── */
.stat-card {
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute;
    top: 0; right: 0; width: 80px; height: 80px;
    border-radius: 50%; opacity: 0.05;
    transform: translate(20px, -20px);
    background: var(--primary);
}
.stat-card:hover::before { opacity: 0.1; }

/* ── Cards improvements ── */
.card {
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow);
}

/* ── Buttons improvements ── */
.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.btn-primary:hover {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary);
}
.btn-success {
    background: var(--gradient-success);
    box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.btn-success:hover {
    box-shadow: var(--shadow-success);
}
.btn-danger {
    background: var(--gradient-danger);
    box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}
.btn-danger:hover {
    box-shadow: var(--shadow-danger);
}

/* ── Loading spinner ── */
.app-loading {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
}
.loader i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Form improvements ── */
.form-control {
    box-shadow: var(--shadow-xs);
}
.form-control:hover {
    border-color: #c7d2fe;
}
.form-group label {
    letter-spacing: 0.01em;
}

/* ── Table improvements ── */
.data-table thead th {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Badge improvements ── */
.badge { letter-spacing: 0.02em; }

/* ── Modal improvements ── */
.modal-header {
    background: linear-gradient(135deg, #f8fafc, #fff);
}
.modal-header h3 { color: var(--dark-2); }

/* ── Toast improvements ── */
.toast {
    border-radius: var(--radius-lg);
    font-weight: 500;
    backdrop-filter: blur(8px);
}
.toast.success { background: linear-gradient(135deg, #059669, #10b981); }
.toast.error { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* ── Empty state improvements ── */
.empty-state {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border);
}
.empty-state i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 56px;
}

/* ── Contact CTA (for clients with no projects) ── */
.contact-cta {
    background: linear-gradient(135deg, #312e81, #4f46e5, #6366f1);
    border-radius: var(--radius-xl); padding: 48px 32px;
    text-align: center; color: white; margin-top: 24px;
    position: relative; overflow: hidden;
}
.contact-cta::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 30px 30px;
}
.contact-cta > * { position: relative; z-index: 1; }
.contact-cta h3 { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.contact-cta p { font-size: 15px; opacity: 0.85; margin-bottom: 24px; max-width: 500px; margin-inline: auto; margin-bottom: 24px; }
.contact-cta .btn-whatsapp {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 32px; background: #25d366; color: white;
    border-radius: var(--radius-full); font-size: 16px; font-weight: 700;
    text-decoration: none; transition: var(--transition);
    box-shadow: 0 8px 24px rgba(37,211,102,0.4);
}
.contact-cta .btn-whatsapp:hover {
    background: #128c7e; transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37,211,102,0.5);
}

/* ── Section separator ── */
.section-sep {
    height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 24px 0;
}

/* ── Info Box ── */
.info-box {
    display: flex; gap: 12px; padding: 16px;
    background: var(--info-light); border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg); font-size: 13px; color: #1e40af;
    line-height: 1.6;
}
.info-box i { font-size: 16px; margin-top: 2px; flex-shrink: 0; color: var(--info); }

/* ── Topbar page indicator ── */
.page-indicator {
    display: flex; align-items: center; gap: 8px;
}
.page-indicator .pi-icon {
    width: 28px; height: 28px; border-radius: 7px;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}

/* ── Responsive improvements ── */
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn { flex: 1; justify-content: center; }
    .contact-cta { padding: 32px 20px; }
    .contact-cta h3 { font-size: 20px; }
}

/* ── Improved login page ── */
.login-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #312e81 70%, #4f46e5 100%);
    position: relative;
}
.login-page::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 32px 32px;
}
.login-page::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 70%, rgba(99,102,241,0.2) 0%, transparent 60%),
                radial-gradient(circle at 70% 30%, rgba(79,70,229,0.15) 0%, transparent 60%);
}
.login-container { position: relative; z-index: 1; }
.login-card {
    box-shadow: 0 32px 64px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
}
.login-logo {
    background: var(--gradient-brand);
    box-shadow: 0 8px 24px rgba(79,70,229,0.4);
    animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(79,70,229,0.4); }
    50% { box-shadow: 0 12px 32px rgba(79,70,229,0.6); }
}

/* ── Improved summary cards ── */
.summary-card {
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ── Improved project cards ── */
.project-card {
    position: relative; overflow: hidden;
}
.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient-primary); opacity: 0; transition: var(--transition);
}
.project-card:hover::before { opacity: 1; }

/* ── Animated counter ── */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.stat-value { animation: countUp 0.5s ease; }

/* ── Pulse animation for online status ── */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* ── Improved scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: #c7d2fe #f1f5f9; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
*::-webkit-scrollbar-thumb { background: #a5b4fc; border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Back to top button ── */
.back-to-top {
    position: fixed; bottom: 24px; z-index: 100;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--gradient-primary); color: white;
    border: none; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-primary); transition: var(--transition);
    opacity: 0; pointer-events: none;
}
[dir="rtl"] .back-to-top { left: 24px; }
[dir="ltr"] .back-to-top { right: 24px; }
.back-to-top.visible { opacity: 1; pointer-events: all; }
.back-to-top:hover { transform: translateY(-3px); }

/* ── Topbar environment badge ── */
.env-badge {
    padding: 3px 10px; border-radius: var(--radius-full);
    font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
    background: var(--success-light); color: var(--success);
}
.env-badge.dev { background: var(--warning-light); color: var(--warning); }

/* ── Settings Tabs ───────────────────────── */
.settings-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.settings-tab {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--gray);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.settings-tab:hover { background: white; color: var(--text); }
.settings-tab.active { background: white; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.settings-section { padding: 4px 0; }
.price-group { margin-bottom: 24px; }

/* ============================================
   Games Animations
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Details tag animation */
details[open] summary ~ * {
  animation: fadeIn 0.3s ease;
}

details summary {
  transition: all 0.2s;
}

details[open] summary i.fa-chevron-left {
  transform: rotate(-90deg);
}

/* Modal Sections Styling */
.modal-body .alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #1e40af;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.modal-body .alert-info i {
    flex-shrink: 0;
    margin-top: 2px;
}
.modal-body .alert-info code {
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Colored Sections in Modal */
.modal-body > div[style*="background:#f8fafc"],
.modal-body > div[style*="background:#f0fdf4"],
.modal-body > div[style*="background:#eff6ff"] {
    border: 1px solid;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modal-body h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body h4 i {
    font-size: 16px;
}

/* Image Preview in Modal */
#game-image-preview {
    border: 3px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

#game-image-preview img {
    display: block;
}

/* Better form-row spacing */
.modal-body .form-row-2 {
    gap: 16px;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: 100%;
        margin: 0;
    }

    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body .form-row-2 {
        grid-template-columns: 1fr;
    }
}

