/* فونت‌های محلی - بدون نیاز به اینترنت */
@font-face {
    font-family: 'SiteFont';
    src: url('../fonts/IRANSansXVF.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================
   Design tokens
   ========================================================== */
:root {
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-pill: 999px;
    --shadow-xs: 0 1px 2px rgba(16,24,40,.04);
    --shadow-card: 0 1px 2px rgba(16,24,40,.03), 0 8px 24px rgba(16,24,40,.05);
    --shadow-card-hover: 0 4px 10px rgba(16,24,40,.05), 0 14px 34px rgba(16,24,40,.08);
    --border-subtle: #edf0f4;
    --page-bg: #f6f7fb;
    --text-main: #1f2430;
    --text-muted: #8a90a1;
    --sidebar-w: 268px;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Body */
body {
    font-family: 'CustomFont', 'SiteFont', Tahoma, sans-serif;
    background: var(--page-bg);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    overflow-y: scroll;
}

/* ==========================================================
   Sidebar (راست‌چین برای زبان فارسی)
   ========================================================== */
.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-w);
    height: 100dvh;
    background: #14161c;
    border-left: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    padding: 26px 20px 20px;
    z-index: 200;
    overflow-y: auto;
}

.app-sidebar .sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px 22px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-sidebar .sb-brand img {
    width: 34px; height: 34px; object-fit: contain; border-radius: 10px; flex-shrink: 0;
}
.app-sidebar .sb-brand-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-grade-switcher {
    background: linear-gradient(135deg, var(--secondary-color, #0ea5a3), color-mix(in srgb, var(--secondary-color, #0ea5a3) 75%, black));
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 18px;
    color: #fff;
    box-shadow: 0 6px 16px rgba(14,165,163,.28);
}
.sb-gs-label { font-size: 11px; opacity: .9; margin-bottom: 6px; font-weight: 700; }
.sb-gs-select {
    width: 100%;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.sb-gs-select option { color: #111; }
.sb-gs-value { font-weight: 700; font-size: 14px; }

.sb-nav { display: flex; flex-direction: column; gap: 3px; }
.sb-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: #c2c5cc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.sb-nav a .sb-ic { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sb-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-nav a.active {
    background: var(--primary-color, #6320ee);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(99,32,238,.35);
}

.app-sidebar .sb-bottom {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.app-sidebar .sb-bottom a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius-md);
    text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.app-sidebar .sb-bottom .sb-logout { color: #f87171; }
.app-sidebar .sb-bottom .sb-logout:hover { background: rgba(239,68,68,.12); }
.app-sidebar .sb-bottom .sb-settings { color: #c2c5cc; }
.app-sidebar .sb-bottom .sb-settings:hover { background: rgba(255,255,255,.07); }

.header-hamburger-only { display: none; }

/* Legacy header (kept for backward compatibility, unused on desktop now) */
header.legacy-hidden { display: none; }

/* Content area shifts next to the fixed sidebar */
body.with-sidebar { padding-right: var(--sidebar-w); }

/* Container */
.container {
    max-width: 1280px;
    margin: 32px auto 40px;
    padding: 0 32px;
}

/* Typography */
h1 {
    font-size: 26px;
    color: var(--text-main);
    margin-bottom: 22px;
    font-weight: 800;
    letter-spacing: -.2px;
}

h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    margin-top: 30px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 14.5px;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: #ecfdf3;
    color: #166534;
    border-color: #d3f5df;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fbdcdc;
}

.alert-warning {
    background: #fffaeb;
    color: #92400e;
    border-color: #fde8bd;
}

/* Buttons */
.btn {
    padding: 12px 22px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: 'CustomFont', 'SiteFont', Tahoma, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all .2s;
}

.btn-primary {
    background: #6320ee;
    color: white;
    box-shadow: 0 6px 16px rgba(99,32,238,.22);
}

.btn-primary:hover {
    background: #5018d4;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f2f6;
    color: #4b5160;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #e5e7ee;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-small {
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: 5px;
    text-decoration: none;
    display: inline-block;
}

.btn-edit {
    background: #eef2ff;
    color: #4338ca;
    text-decoration: none;
}

.btn-edit:hover {
    background: #e0e7ff;
    text-decoration: none;
}

.btn-delete {
    background: #fef2f2;
    color: #dc2626;
    text-decoration: none;
}

.btn-delete:hover {
    background: #fee2e2;
    text-decoration: none;
}

.action-buttons {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Course Boxes Grid - 3 columns */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.course-box {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    transition: all .25s;
}

.course-box:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
}

.course-box h3 {
    color: #6320ee;
    font-size: 17px;
    margin-bottom: 18px;
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

/* Narrow columns in module tables */
.course-box table th:nth-child(1),
.course-box table td:nth-child(1) {
    width: 50px !important;
    max-width: 50px !important;
    min-width: 50px !important;
}

.course-box table th:nth-child(3),
.course-box table td:nth-child(3) {
    width: 80px !important;
    max-width: 80px !important;
    min-width: 80px !important;
}

.course-box table th:nth-child(4),
.course-box table td:nth-child(4) {
    width: 70px !important;
    max-width: 70px !important;
    min-width: 70px !important;
}

/* Filter Form */
.filter-form {
    background: white;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form input,
.filter-form select {
    padding: 11px 15px;
    border: 1.5px solid #e6e8ee;
    border-radius: var(--radius-sm);
    font-family: 'CustomFont', 'SiteFont', Tahoma, sans-serif;
    font-size: 14px;
    min-width: 150px;
    background: #fbfbfd;
}

.filter-form input:focus,
.filter-form select:focus {
    outline: none;
    border-color: #6320ee;
    background: #fff;
}

/* Tables */
table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
}

table thead,
table tbody,
table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

/* Narrow Row Number Column */
th:first-child,
td:first-child {
    width: 60px !important;
    max-width: 60px !important;
    min-width: 60px !important;
    text-align: center !important;
}

th, td {
    padding: 15px 14px;
    text-align: right;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    background: #fafafc;
    color: #6b7280;
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

tr:hover td {
    background: #fafaff;
}

tr:last-child td {
    border-bottom: none;
}

td {
    font-size: 14px;
    color: #333;
}

.text-center {
    text-align: center !important;
}

/* Badges */
.badge {
    padding: 5px 13px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-red {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-yellow {
    background: #fef9c3;
    color: #854d0e;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(20,20,30,0.45);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 26px;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 700px;
    box-shadow: 0 24px 60px rgba(0,0,0,.18);
}

.modal-content h2 {
    margin-bottom: 20px;
    margin-top: 0;
    color: #6320ee;
}

.close {
    float: left;
    font-size: 26px;
    cursor: pointer;
    color: #b0b3bd;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="number"],
.modal-content input[type="email"],
.modal-content input[type="color"],
.modal-content input[type="file"],
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 15px;
    border: 1.5px solid #e6e8ee;
    border-radius: var(--radius-sm);
    font-family: 'CustomFont', 'SiteFont', Tahoma, sans-serif;
    font-size: 14px;
    background: #fbfbfd;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #6320ee;
    background: #fff;
}

.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 10px;
    margin-top: 0;
    font-weight: 600;
}

.stat-card .number {
    font-size: 34px;
    font-weight: 800;
    color: #6320ee;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    transition: all 0.25s;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.card-icon {
    font-size: 30px;
    margin-bottom: 15px;
}

.dashboard-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    margin-top: 0;
    color: #333;
}

.dashboard-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 11px;
    line-height: 1.6;
}

.card-button {
    display: inline-block;
    background: #6320ee;
    color: white;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 600;
}

.card-button:hover {
    background: #5018d4;
}

/* Generic card (used by many pages) */
.card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 13.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e6e8ee;
    border-radius: var(--radius-sm);
    font-family: 'CustomFont', 'SiteFont', Tahoma, sans-serif;
    font-size: 14px;
    background: #fbfbfd;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6320ee;
    background: #fff;
}

/* Color Picker */
.color-picker-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.color-preview {
    width: 80px;
    height: 40px;
    border: 1.5px solid #e6e8ee;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.color-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.color-input-wrapper input[type="text"] {
    padding-right: 50px;
}

.color-swatch {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 1.5px solid #e6e8ee;
    border-radius: 8px;
    cursor: pointer;
}

/* Student Search & Report Card */
.search-box {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 25px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #e6e8ee;
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f9fafb;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Report Card */
.report-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.report-header {
    border-bottom: 3px solid #6320ee;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.report-header h2 {
    margin: 0;
    color: #6320ee;
}

.report-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.report-info-item {
    display: flex;
    gap: 10px;
}

.report-info-item strong {
    color: #666;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    .report-card,
    .report-card *,
    .report-page,
    .report-page * {
        visibility: visible;
    }

    .report-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
    }

    .report-page {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .btn,
    .action-buttons,
    header,
    nav,
    .app-sidebar,
    .app-topbar {
        display: none !important;
    }
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
    z-index: 1001;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* =============================================
   RESPONSIVE - MOBILE ADMIN PANEL
   فقط تغییرات موبایل - دسکتاپ دست نخورده
   ============================================= */

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
    z-index: 1100;
    flex-shrink: 0;
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #333;
    border-radius: 3px;
    transition: all 0.28s ease;
    transform-origin: center;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.mobile-nav-overlay.active { display: block; }

/* ========== @media دسکتاپ کمکی ========== */
@media (max-width: 1200px) {
    .courses-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== موبایل اصلی ========== */
@media (max-width: 768px) {

    body.with-sidebar { padding-right: 0; }
    .app-sidebar { display: none; }
    .app-topbar { display: none; }

    header {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .header-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        padding: 0 16px !important;
        min-height: 56px !important;
        gap: 8px !important;
        background: #fff;
        border-bottom: 1px solid var(--border-subtle);
    }

    .header-row-2 { display: none !important; }

    .header-row-1 {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex: 1 !important;
        gap: 8px !important;
        min-width: 0 !important;
    }

    .header-brand {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }
    .header-title {
        font-size: 15px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-logo {
        height: 32px !important;
        width: 32px !important;
        min-height: 32px !important;
        min-width: 32px !important;
        max-height: 32px !important;
        max-width: 32px !important;
    }

    .header-user-section {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }
    .header-username {
        font-size: 12px !important;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header-logout-btn {
        font-size: 11px !important;
        padding: 5px 10px !important;
        white-space: nowrap;
    }

    .hamburger-menu {
        display: flex !important;
        flex-shrink: 0;
        margin-right: 0;
    }

    .header-hamburger-only { display: flex !important; }

    .container {
        padding: 12px 14px;
        margin: 16px auto;
    }

    h1 { font-size: 20px; }
    h2 { font-size: 17px; }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    .dashboard-card {
        padding: 16px 12px !important;
    }
    .card-icon { font-size: 28px !important; }

    .card { padding: 18px !important; margin-bottom: 14px !important; }
    .stat-card { margin-bottom: 12px !important; }
    .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

    .filter-form {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .filter-form input,
    .filter-form select,
    .filter-form button {
        width: 100% !important;
    }

    table {
        font-size: 12px !important;
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
    }
    th, td {
        padding: 9px 8px !important;
        font-size: 12px !important;
    }

    .action-buttons {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .action-buttons .btn {
        width: 100% !important;
        text-align: center !important;
    }
    .btn { font-size: 13px !important; padding: 10px 16px !important; }
    .btn-small { font-size: 11px !important; padding: 5px 8px !important; }

    .modal-content {
        width: 96% !important;
        margin: 12px auto !important;
        padding: 20px !important;
        max-height: 90dvh !important;
        overflow-y: auto !important;
        border-radius: var(--radius-lg) !important;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }

    .settings-grid { grid-template-columns: 1fr !important; }
    .tools-grid { grid-template-columns: 1fr !important; }
}

/* ========== خیلی کوچک ========== */
@media (max-width: 480px) {
    .header-title { font-size: 13px !important; }
    .header-username { max-width: 60px; }

    .dashboard-grid { grid-template-columns: 1fr !important; }
    .stats-grid { grid-template-columns: 1fr !important; }

    .btn { font-size: 13px !important; }
    h1 { font-size: 18px !important; }
}

/* ---- grid helpers ---- */
@media (max-width: 600px) {
    .dashboard-grid { grid-template-columns: 1fr !important; }
}

/* ---- permissions grid ---- */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 10px 0;
}
.permissions-grid label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    flex-direction: row-reverse;
    justify-content: flex-end;
}
.permissions-grid label:hover { background: #f3f4f6; }
.permissions-grid input[type="checkbox"] { margin: 0; flex-shrink: 0; }
