/*
 * نظام إدارة المجوهرات - الماسة
 * Light Theme with Gold & Beige Colors
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Primary - الذهبي */
    --gold-primary: #D4AF37;
    --gold-light: #F4E4BC;
    --gold-dark: #B8860B;
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);

    /* Secondary - البيج */
    --beige-light: #FDF8F3;
    --beige: #F5EDE4;
    --beige-dark: #E8DDD1;

    /* Neutral */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #E5E5E5;
    --gray-300: #D4D4D4;
    --gray-400: #A3A3A3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    /* Semantic */
    --success: #22C55E;
    --success-light: #F0FDF4;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --info: #3B82F6;
    --info-light: #EFF6FF;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--app-font, 'Cairo'), sans-serif;
    background-color: var(--beige-light);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold-primary);
}

/* ========================================
   App Wrapper
   ======================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    border-left: 1px solid var(--beige-dark);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition);
    box-shadow: var(--shadow);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--beige-dark);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 45px;
    height: 45px;
    background: var(--gold-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    box-shadow: var(--shadow);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.brand-subtitle {
    font-size: 11px;
    color: var(--gray-500);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.nav-list {
    list-style: none;
    padding: 0 10px;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--gray-600);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: var(--beige);
    color: var(--gray-800);
}

.nav-item.active .nav-link {
    background: var(--gold-gradient);
    color: white;
    box-shadow: var(--shadow);
}

.nav-item.active .nav-link i {
    color: white;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--beige-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gold-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gold-dark);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-800);
}

.user-role {
    font-size: 11px;
    color: var(--gray-500);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: var(--danger-light);
    color: var(--danger);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin var(--transition);
}

/* ========================================
   Top Navbar
   ======================================== */
.top-navbar {
    background: var(--white);
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--beige-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-start {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--beige);
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    color: var(--gray-700);
}

.gold-price-ticker {
    display: flex;
    gap: 20px;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gold-light);
    border-radius: 8px;
}

.ticker-label {
    font-size: 12px;
    color: var(--gray-600);
}

.ticker-value {
    font-weight: 700;
    color: var(--gold-dark);
}

.ticker-currency {
    font-size: 11px;
    color: var(--gray-500);
}

.navbar-center {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--beige-dark);
    border-radius: 10px;
    background: var(--beige-light);
    font-family: inherit;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.navbar-end {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--beige);
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.navbar-btn:hover {
    background: var(--gold-light);
    color: var(--gold-dark);
}

.navbar-btn .badge {
    position: absolute;
    top: -2px;
    left: -2px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Content Wrapper
   ======================================== */
.content-wrapper {
    padding: 25px;
    flex: 1;
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--beige-dark);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--beige-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 20px;
}

/* ========================================
   Stat Cards
   ======================================== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--beige-dark);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.gold {
    background: var(--gold-light);
    color: var(--gold-dark);
}

.stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

.stat-change {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
}

.stat-change.positive {
    background: var(--success-light);
    color: var(--success);
}

.stat-change.negative {
    background: var(--danger-light);
    color: var(--danger);
}

/* ========================================
   Tables
   ======================================== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--beige-dark);
}

.table th {
    background: var(--beige);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
}

.table tbody tr:hover {
    background: var(--beige-light);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--gold-gradient);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-secondary {
    background: var(--beige);
    color: var(--gray-700);
    border: 1px solid var(--beige-dark);
}

.btn-secondary:hover {
    background: var(--beige-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ========================================
   Form Controls
   ======================================== */
.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--beige-dark);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-left: 40px;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-gold {
    background: var(--gold-light);
    color: var(--gold-dark);
}

/* ========================================
   Alerts
   ======================================== */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ========================================
   Charts Container
   ======================================== */
.chart-container {
    position: relative;
    height: 300px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .navbar-center {
        display: none;
    }

    .gold-price-ticker {
        display: none;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }
}