/* ════════════════════════════════════════
   layout.css — هيكل الصفحة
   ════════════════════════════════════════ */

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h);
    position: sticky; top: 0; z-index: 200;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.topbar-user  { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.topbar-admin { background: linear-gradient(135deg, #1e1b4b, #3730a3); }

.topbar-brand { display: flex; align-items: center; gap: 14px; }
.topbar-logo  {
    width: 42px; height: 42px; border-radius: 10px;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; font-size: 1.3rem;
    border: 1px solid rgba(255,255,255,.2);
}
.topbar-logo img { width:100%; height:100%; object-fit:cover; }
.topbar-title h3  { font-size: 1rem; font-weight: 800; color: white; }
.topbar-title small { font-size: 0.72rem; color: rgba(255,255,255,.7); }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user-info { text-align: right; }
.topbar-name  { color: white; font-weight: 700; font-size: 0.88rem; }
.topbar-role  { color: rgba(255,255,255,.7); font-size: 0.72rem; }
.topbar-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: white; overflow: hidden;
    border: 2px solid rgba(255,255,255,.3);
    cursor: pointer;
}
.topbar-avatar img { width:100%; height:100%; object-fit:cover; }

/* ── Main Content ── */
.main { padding: 22px 24px; max-width: 1700px; margin: 0 auto; }

/* ── Tabs ── */
.tabs {
    display: flex; gap: 4px;
    background: var(--gray-200); padding: 4px;
    border-radius: var(--radius); margin-bottom: 20px;
    overflow-x: auto;
}
.tab {
    flex: 1; min-width: max-content;
    padding: 10px 18px; border: none;
    background: transparent; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.88rem; font-weight: 600;
    color: var(--gray-500); transition: var(--tr);
    font-family: 'Tajawal', sans-serif; white-space: nowrap;
}
.tab:hover { color: var(--primary); }
.tab.active {
    background: white; color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ── Tab Content ── */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Section Card ── */
.section {
    background: white; border-radius: var(--radius-lg);
    box-shadow: var(--shadow); margin-bottom: 20px;
    border: 1px solid var(--gray-200); overflow: hidden;
}
.section-head {
    padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.section-head h3 { font-size: 0.95rem; font-weight: 700; color: white; }
.sh-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.sh-admin   { background: linear-gradient(135deg, #1e1b4b, #3730a3); }
.sh-red     { background: linear-gradient(135deg, #7f1d1d, var(--danger)); }
.sh-green   { background: linear-gradient(135deg, #064e3b, var(--success)); }
.sh-gold    { background: linear-gradient(135deg, #78350f, var(--warning)); }
.sh-gray    { background: linear-gradient(135deg, #374151, #6b7280); }
.section-body { padding: 18px; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 20px;
}
.stat-card {
    background: white; border-radius: var(--radius-lg);
    padding: 20px 18px; box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    cursor: pointer; transition: var(--tr);
    position: relative; overflow: hidden;
}
.stat-card::after {
    content:''; position:absolute;
    top:0; right:0; width:4px; height:100%;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.stat-card.blue::after   { background: var(--primary); }
.stat-card.gold::after   { background: var(--accent); }
.stat-card.green::after  { background: var(--success); }
.stat-card.red::after    { background: var(--danger); }
.stat-card.purple::after { background: var(--purple); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-icon  { font-size: 2.2rem; margin-bottom: 10px; }
.stat-label { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 1.9rem; font-weight: 900; color: var(--primary); line-height: 1; }
.stat-value.gold   { color: var(--accent-dark); }
.stat-value.green  { color: var(--success); }
.stat-value.red    { color: var(--danger); }
.stat-value.purple { color: var(--purple); }
.stat-sub { font-size: 0.75rem; color: var(--gray-400); margin-top: 4px; }

/* ── Quick Actions Grid ── */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px; margin-bottom: 20px;
}
.quick-card {
    background: white; border-radius: var(--radius-lg);
    padding: 18px 14px; text-align: center;
    cursor: pointer; box-shadow: var(--shadow);
    border: 1px solid var(--gray-200); transition: var(--tr);
}
.quick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.quick-card .qi { font-size: 2rem; display: block; margin-bottom: 8px; }
.quick-card .qt { font-weight: 700; font-size: 0.9rem; color: var(--gray-800); }
.quick-card .qs { font-size: 0.76rem; color: var(--gray-400); margin-top: 3px; }
