:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #64748b;
    --bg-body: #f3f4f6;
    --bg-panel: #ffffff;
    --text-main: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --sidebar-width: 260px;
    --header-height: 64px;
    --danger: #ef4444;
    --success: #10b981;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Tahoma', 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    direction: rtl;
}

a { text-decoration: none; color: inherit; }

/* Layout Grid */
.panel-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary);
}

.sidebar-menu {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    list-style: none;
    margin: 0;
}

.menu-item { margin-bottom: 0.5rem; }

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-main);
    transition: all 0.2s;
}

.menu-link:hover, .menu-link.active {
    background-color: #eef2ff;
    color: var(--primary);
}

.menu-icon { margin-left: 10px; font-size: 1.2rem; }

.user-info-mini {
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width); /* Space for sidebar */
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title { font-size: 1.1rem; font-weight: bold; }

.header-actions { display: flex; gap: 1rem; align-items: center; }

.btn-logout {
    color: var(--danger);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--danger);
    border-radius: 6px;
    transition: 0.2s;
}
.btn-logout:hover { background: #fef2f2; }

/* Dashboard Content */
.content-wrapper { padding: 2rem; }

.card {
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(100%); } /* Hide sidebar */
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-right: 0; width: 100%; }
}