:root {
    /* Modern Dark Theme Palette (Shadcn-like) */
    --bg-app: #09090b;
    --bg-sidebar: #09090b;
    --bg-card: #18181b;
    --bg-input: #27272a;
    --border: #27272a;
    --primary: #fbbf24;
    /* Amber-400 for Gold accent */
    --primary-foreground: #000;
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --danger: #ef4444;
    --success: #22c55e;

    --radius: 0.5rem;
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    direction: rtl;
    /* Arabic support */
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
}

/* Layout */
#app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--bg-input);
    color: var(--text-main);
}

.nav-item.active {
    color: var(--primary);
    background-color: rgba(251, 191, 36, 0.1);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* User Profile in Sidebar */
.user-mini {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    background: radial-gradient(circle at top left, rgba(251, 191, 36, 0.05), transparent 40%);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
}

.balance-card {
    background: linear-gradient(135deg, var(--primary), #d97706);
    color: #000;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.2);
}

/* Cards & Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: var(--font-body);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: opacity 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: #000;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: right;
    padding: 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-completed {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status-pending {
    background: rgba(251, 191, 36, 0.1);
    color: var(--primary);
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        right: -260px;
        height: 100vh;
        z-index: 100;
    }

    .sidebar.open {
        right: 0;
    }

    .main-content {
        margin-right: 0;
    }

    .mobile-toggle {
        display: block !important;
    }
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
}