/* ─── منصة غصون — Admin Panel Styles ─── */
:root {
    --black: #222222;
    --black-light: #2d2d2d;
    --black-soft: #333333;
    --black-hover: #3a3a3a;
    --yellow: #ffb606;
    --yellow-dark: #e6a405;
    --yellow-glow: rgba(255, 182, 6, 0.12);
    --white: #ffffff;
    --gray: #999999;
    --gray-light: #f0f0f0;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --sidebar-w: 280px;
    --header-h: 64px;
    --font: 'Tajawal', 'Segoe UI', sans-serif;
    --radius: 10px;
    --transition: 0.25s ease;
}

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

body {
    font-family: var(--font);
    background: #f4f4f5;
    color: var(--black);
    direction: rtl;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ─── Layout ─── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--black);
    color: var(--white);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--yellow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--black);
    font-size: 1.1rem;
}

.sidebar-logo-text {
    font-size: 1.2rem;
    font-weight: 800;
}

.sidebar-logo-text span { color: var(--yellow); }

.sidebar-badge {
    display: inline-block;
    background: var(--yellow-glow);
    color: var(--yellow);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    margin-top: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition);
    border-right: 3px solid transparent;
    margin: 2px 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
}

.nav-item.active {
    background: var(--yellow-glow);
    color: var(--yellow);
    border-right-color: var(--yellow);
}

.nav-item svg, .nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item.active svg, .nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-avatar {
    width: 38px;
    height: 38px;
    background: var(--yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--black);
    font-size: 0.9rem;
}

.admin-user-info { flex: 1; min-width: 0; }

.admin-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-role {
    font-size: 0.72rem;
    color: var(--gray);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.55);
    transition: var(--transition);
    padding: 0.25rem;
}

.logout-btn:hover { color: var(--yellow); }

/* ─── Main Content ─── */
.main-content {
    margin-right: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.topbar-actions { display: flex; align-items: center; gap: 1rem; }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--black);
    align-items: center;
    justify-content: center;
}

.page-content { padding: 2rem; flex: 1; }

/* ─── Cards & Stats ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon.yellow { background: var(--yellow-glow); color: var(--yellow-dark); }
.stat-card-icon.green  { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.stat-card-icon.red    { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.stat-card-icon.orange { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

/* ─── Panel Card ─── */
.panel {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid #e5e5e5;
    overflow: hidden;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
}

.panel-body { padding: 0; }
.panel-body.padded { padding: 1.5rem; }

/* ─── Table ─── */
.table-wrap { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th,
table.data-table td {
    padding: 0.85rem 1.25rem;
    text-align: right;
    font-size: 0.88rem;
}

table.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--gray);
    border-bottom: 1px solid #e5e5e5;
    white-space: nowrap;
}

table.data-table td { border-bottom: 1px solid #f0f0f0; }

table.data-table tbody tr:hover { background: #fafafa; }

table.data-table tbody tr:last-child td { border-bottom: none; }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.badge-danger  { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.badge-muted   { background: #f0f0f0; color: #666; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.15rem;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--yellow);
    color: var(--black);
}

.btn-primary:hover {
    background: var(--yellow-dark);
}

.btn-dark {
    background: var(--black);
    color: var(--white);
}

.btn-dark:hover { background: var(--black-light); }

.btn-outline {
    background: transparent;
    border: 1.5px solid #ddd;
    color: var(--black);
}

.btn-outline:hover { border-color: var(--yellow); color: var(--yellow-dark); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

/* ─── Forms ─── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--black);
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--black);
}

.form-control:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px var(--yellow-glow);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--yellow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ─── Alerts ─── */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert-icon { flex-shrink: 0; }

.alert-success { background: rgba(34, 197, 94, 0.1); color: #16a34a; border: 1px solid rgba(34, 197, 94, 0.2); }
.alert-error   { background: rgba(239, 68, 68, 0.1); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.2); }

/* ─── Login Page ─── */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--black);
}

.login-visual {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background:
        radial-gradient(ellipse at 30% 50%, var(--yellow-glow) 0%, transparent 60%),
        var(--black);
    position: relative;
    overflow: hidden;
}

.login-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 182, 6, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 182, 6, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.login-visual-content {
    position: relative;
    text-align: center;
    color: var(--white);
}

.login-visual-content h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.login-visual-content h1 span { color: var(--yellow); }

.login-visual-content p {
    color: var(--gray);
    font-size: 1.05rem;
    max-width: 400px;
}

.login-form-side {
    width: 480px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--white);
}

.login-box {
    width: 100%;
    max-width: 380px;
}

.login-box h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-box .subtitle {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-box .btn-primary {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state-icon {
    margin-bottom: 1rem;
    opacity: 0.35;
    color: var(--gray);
    display: flex;
    justify-content: center;
}

/* ─── Responsive ─── */
@media (max-width: 992px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-right: 0; }
    .sidebar-toggle { display: flex; }
    .login-visual { display: none; }
    .login-form-side { width: 100%; }
}

@media (max-width: 576px) {
    .form-row { grid-template-columns: 1fr; }
    .page-content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Overlay ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.show { display: block; }
