/* MehrBot Pro — قالب «سپهر» (Sepehr) — پایه: default.css */
/* --- Base Styles & Variables --- */
:root {
--bg-color: #f8fafc;
--card-bg: #ffffff;
--sidebar-bg: #1e293b;
--sidebar-text: #cbd5e1;
--sidebar-text-hover: #ffffff;
--sidebar-active-bg: #3b82f6;
--text-color: #475569;
--heading-color: #0f172a;
--border-color: #e2e8f0;
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--secondary-color: #64748b;
--secondary-hover: #475569;
--danger-color: #ef4444;
--danger-hover: #dc2626;
--success-color: #22c55e;
--warning-color: #f97316;
--info-color: #0ea5e9;
--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
--bg-color: #0f172a;
--card-bg: #1e293b;
--sidebar-bg: #0f172a;
--sidebar-text: #94a3b8;
--sidebar-text-hover: #f1f5f9;
--sidebar-active-bg: #3b82f6;
--text-color: #94a3b8;
--heading-color: #f1f5f9;
--border-color: #334155;
--primary-color: #60a5fa;
--primary-hover: #3b82f6;
}

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

body {
font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
margin: 0;
background-color: var(--bg-color);
color: var(--text-color);
transition: background-color 0.3s, color 0.3s;
font-size: 16px;
line-height: 1.6;
overflow: hidden;
}

body:not(.auth-page) {
    display: flex;
}

/* --- New Auth Page (Login/Register) Styles --- */
.auth-page {
    display: block;
    height: 100vh;
}
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    width: 100%;
}
.auth-slider-panel {
    position: relative;
    background-color: #1e293b;
    overflow: hidden;
    color: white;
}
.slider-container .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.slider-container .slide.active { opacity: 1; }
.slider-container .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}
.slide-content {
    position: absolute;
    bottom: 10%;
    right: 10%;
    max-width: 80%;
    text-align: right;
}
.slide-content h2 { font-size: 2.5em; margin-bottom: 15px; }
.slide-content p { font-size: 1.1em; line-height: 1.7; opacity: 0.9; }
.slider-dots {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}
.slider-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background-color 0.3s;
}
.slider-dots .dot.active { background-color: white; }

.auth-form-panel {
    display: flex;
    flex-direction: column; /* Changed for footer positioning */
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}
.form-wrapper { 
    width: 100%; 
    max-width: 400px; 
    flex-grow: 1; /* Allow wrapper to take space */
    display: flex; /* Center content vertically */
    flex-direction: column;
    justify-content: center;
}
.form-header { text-align: center; margin-bottom: 30px; }
.form-header h2 { color: var(--heading-color); }
.form-header p { color: var(--text-color); }
.auth-form-panel .form-group { text-align: right; margin-bottom: 20px; }
.auth-form-panel .form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.auth-form-panel input { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; box-sizing: border-box; background-color: var(--bg-color); color: var(--text-color); }
.btn-full { width: 100%; padding: 12px; font-size: 1.1em; }
.form-footer-text { text-align: center; margin-top: 25px; }
.form-footer-text a { color: var(--primary-color); text-decoration: none; font-weight: bold; }
.form-footer-text a:hover { text-decoration: underline; }
.error-message { color: var(--danger-color); font-size: 0.9em; margin-top: 15px; text-align: center; }

/* --- Footer --- */
.app-footer {
    padding: 1rem 2rem;
    font-size: 0.85em;
    color: var(--secondary-color);
    flex-shrink: 0;
    width: 100%;
}
.auth-form-panel .app-footer {
    max-width: 480px;
}
.app-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1rem;
}
.app-footer .footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.app-footer .footer-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 0;
}
.app-footer .footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.app-footer .social-links { display: flex; gap: 1rem; align-items: center; }
.app-footer .social-links a { color: var(--secondary-color); text-decoration: none; }
.app-footer .social-links a:hover { color: var(--primary-color); }
.app-footer .social-links svg { width: 16px; height: 16px; }
.app-footer .footer-logo img { width: 16px; height: 16px; border-radius: 50%; }


/* --- Main Layout & Sidebar --- */
.sidebar { width: 260px; background-color: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; padding: 0; box-shadow: -5px 0 15px -5px rgba(0,0,0,0.1); transition: width 0.3s ease; flex-shrink: 0; }
.sidebar-content { display: flex; flex-direction: column; height: 100%; overflow-y: auto; overflow-x: hidden; }
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 20px; text-align: right; color: white; border-bottom: 1px solid var(--border-color); overflow: hidden; }
.sidebar-title-wrapper { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.sidebar-header h3 { margin: 0; white-space: nowrap; }
.sidebar-header p { margin: 5px 0 0; font-size: 0.8em; opacity: 0.7; white-space: nowrap; }
.version-info { font-size: 0.75em; opacity: 0.6; margin-top: 8px; white-space: nowrap; }
.sidebar-nav { flex-grow: 1; padding: 10px 0; }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--sidebar-text); text-decoration: none; transition: all 0.2s ease-in-out; border-right: 4px solid transparent; white-space: nowrap; }
.sidebar-nav li.active > a, .sidebar-nav li a:hover { background-color: #334155; color: var(--sidebar-text-hover); border-right-color: var(--sidebar-active-bg); }
.sidebar-nav svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding: 10px; border-top: 1px solid var(--border-color); white-space: nowrap; overflow: hidden; }
.main-content { flex-grow: 1; height: 100vh; display: flex; flex-direction: column; }
.content-wrapper { flex-grow: 1; overflow-y: auto; padding: 25px 35px; }
.content-section { display: none; }
.content-section.active { display: block; animation: fadeIn 0.4s ease-in-out; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; position: sticky; top: 0; background-color: var(--bg-color); z-index: 99; }
header h1 { color: var(--heading-color); margin: 0; font-size: 1.8em; }

/* Collapsed Sidebar Styles */
body.sidebar-collapsed .sidebar { width: 80px; }
body.sidebar-collapsed .sidebar-header .header-text,
body.sidebar-collapsed .sidebar-nav li a span,
body.sidebar-collapsed .sidebar-footer .footer-item span,
body.sidebar-collapsed .submenu-arrow { display: none; }
body.sidebar-collapsed .sidebar-nav li a { justify-content: center; }
body.sidebar-collapsed .sidebar-header { justify-content: center; }
body.sidebar-collapsed .has-submenu.open > .submenu { max-height: 0; }
body.sidebar-collapsed .sidebar-toggle-btn i { transform: rotate(180deg); }
body.sidebar-collapsed .sidebar-footer { padding: 10px 0; }
body.sidebar-collapsed .footer-item { justify-content: center; }

/* --- Submenu Styles --- */
.sidebar-nav .has-submenu { position: relative; }
.sidebar-nav .has-submenu > a { justify-content: space-between; }
.submenu-arrow { transition: transform 0.3s ease; }
.has-submenu.open > a .submenu-arrow { transform: rotate(180deg); }
.submenu { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-in-out; background-color: rgba(0,0,0,0.2); }
.has-submenu.open > .submenu { max-height: 500px; }
.submenu li a { padding-right: 30px; font-size: 0.9em; }
.submenu li a i { width: 16px; height: 16px; }
.submenu li.active a { background-color: var(--sidebar-active-bg); color: white; }
body.sidebar-collapsed .has-submenu:hover .submenu { display: block; position: absolute; right: 80px; top: 0; background-color: var(--sidebar-bg); border-radius: 0 8px 8px 0; box-shadow: 5px 0 15px rgba(0,0,0,0.2); max-height: 500px; z-index: 100; }
body.sidebar-collapsed .submenu { display: none; }

/* --- Sidebar Toggle Button --- */
.sidebar-toggle-btn { position: absolute; bottom: 120px; left: -16px; z-index: 10; background-color: var(--sidebar-bg); color: var(--sidebar-text); border: 1px solid var(--border-color); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease; box-shadow: var(--shadow); }
.sidebar-toggle-btn i { transition: transform 0.3s ease; }
body.sidebar-collapsed .sidebar-toggle-btn i { transform: rotate(180deg); }

/* --- Header User Menu & UTC Clock --- */
.header-user-menu { display: flex; align-items: center; gap: 15px; }
.utc-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0 15px;
    border-left: 1px solid var(--border-color);
    font-size: 0.9em;
}
.utc-clock #utc-time { font-weight: bold; color: var(--heading-color); }
.utc-clock #utc-date { font-size: 0.8em; color: var(--text-color); }
.header-icon { color: var(--secondary-color); text-decoration: none; display: flex; align-items: center; padding: 8px; border-radius: 50%; transition: all 0.2s; position: relative; }
.header-icon:hover { background-color: var(--bg-color); color: var(--primary-color); }
.notification-badge { position: absolute; top: 0; right: 0; background-color: var(--danger-color); color: white; width: 18px; height: 18px; border-radius: 50%; font-size: 0.7em; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.profile-dropdown { position: relative; }
.header-avatar { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; object-fit: cover; border: 2px solid var(--border-color); }
.dropdown-content { display: none; position: absolute; left: 0; background-color: var(--card-bg); min-width: 240px; box-shadow: var(--shadow); z-index: 100; border-radius: 8px; overflow: hidden; animation: fadeIn 0.2s; }
.profile-dropdown:hover .dropdown-content { display: block; }
.dropdown-header { padding: 15px; border-bottom: 1px solid var(--border-color); text-align: right; }
.dropdown-header span { display: block; }
.dropdown-header #dropdown-username { font-weight: bold; color: var(--heading-color); }
.dropdown-header #dropdown-role { font-size: 0.8em; margin-top: 5px; }
.dropdown-info { padding: 10px 15px; font-size: 0.9em; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-color); }
.dropdown-item { color: var(--text-color); padding: 12px 15px; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.dropdown-item:hover { background-color: var(--bg-color); color: var(--primary-color); }
.dropdown-item svg { width: 18px; height: 18px; }

/* --- Sidebar Footer --- */
.sidebar-footer .footer-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--sidebar-text); text-decoration: none; }
.sidebar-footer .footer-item:hover { background-color: #334155; color: var(--sidebar-text-hover); }
.sidebar-footer .theme-switcher { justify-content: space-between; }

/* --- General Components --- */
.card { background: var(--card-bg); padding: 25px; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 25px; }
.card h3 { margin-top: 0; color: var(--heading-color); border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; }
.card-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header-flex h3 { margin: 0; padding: 0; border: none; }
.action-bar { display: flex; gap: 15px; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; }
.batch-actions { display: flex; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-weight: bold; font-family: 'Vazirmatn'; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: var(--secondary-color); color: white; }
.btn-secondary:hover { background-color: var(--secondary-hover); }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-danger:hover { background-color: var(--danger-hover); }
.btn-success { background-color: var(--success-color); color: white; }
.btn-warning { background-color: var(--warning-color); color: white; }
.hidden { display: none !important; }

/* --- Dashboard Section --- */
.quick-access-card { background: transparent; box-shadow: none; padding: 0 0 25px 0; }
.quick-access-grid { display: flex; gap: 20px; justify-content: flex-start; flex-wrap: wrap; }
.quick-access-item { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--text-color); width: 120px; text-align: center; }
.quick-access-icon { width: 72px; height: 72px; border-radius: 50%; background-color: var(--card-bg); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); transition: all 0.3s ease; }
.quick-access-icon i { color: var(--primary-color); }
.quick-access-item:hover .quick-access-icon { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); background-color: var(--primary-color); }
.quick-access-item:hover .quick-access-icon i { color: white; }
.quick-access-item span { font-weight: 500; font-size: 0.9em; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 25px; }
.stat-card { background-color: var(--card-bg); padding: 20px; border-radius: 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; }
.stat-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background-color: rgba(59, 130, 246, 0.1); color: var(--primary-color); }
.stat-icon svg { width: 28px; height: 28px; }
.stat-info h4 { margin: 0; font-size: 1em; color: var(--text-color); }
.stat-info p { margin: 5px 0 0; font-size: 2em; font-weight: bold; color: var(--heading-color); }
.chart-wrapper { height: 350px; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; }

/* --- Map Styles --- */
.map-container-sm { height: 350px; border-radius: 12px; }
.map-container-lg { height: 450px; border-radius: 12px; }
.leaflet-container { background: var(--bg-color); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card-bg); color: var(--text-color); box-shadow: var(--shadow); }
.leaflet-popup-content-wrapper { border-radius: 8px; }
.leaflet-popup-close-button { color: var(--text-color) !important; }

/* --- Tables --- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 14px 16px; text-align: right; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
th { background-color: var(--bg-color); font-weight: bold; color: var(--heading-color); }
td.actions { text-align: left; white-space: nowrap; }
td.actions .btn { padding: 6px 10px; font-size: 0.9em; }
td.actions .btn svg { width: 16px; height: 16px; margin: 0; }
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.8em; font-weight: bold; color: white; display: inline-block; text-transform: capitalize; }
.status-badge.success, .status-badge.approved, .status-badge.active { background-color: var(--success-color); }
.status-badge.error, .status-badge.rejected, .status-badge.inactive { background-color: var(--danger-color); }
.status-badge.warning, .status-badge.pending { background-color: var(--warning-color); color: #fff; }
.status-badge.info { background-color: var(--info-color); }
.status-badge.scheduled { background-color: var(--primary-color); }
.status-badge.published { background-color: var(--secondary-color); }
.status-badge.gold { background: linear-gradient(45deg, #FFD700, #F0C000); color: #333; }
.status-badge.silver { background: linear-gradient(45deg, #C0C0C0, #A9A9A9); color: #333; }
.status-badge.bronze { background: linear-gradient(45deg, #CD7F32, #A0522D); color: white; }
.thumbnail-img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.user-cell { display: flex; align-items: center; gap: 10px; }

/* --- Forms --- */
.styled-form .form-group { margin-bottom: 20px; }
.styled-form label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--heading-color); }
.styled-form input, .styled-form select, .styled-form textarea { width: 100%; padding: 12px; box-sizing: border-box; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-color); color: var(--text-color); font-family: 'Vazirmatn'; transition: border-color 0.2s, box-shadow 0.2s; }
.styled-form input:focus, .styled-form select:focus, .styled-form textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); outline: none; }
.styled-form .form-help-text { font-size: 0.85em; opacity: 0.7; margin-top: 5px; }
.settings-form { max-width: 600px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; align-items: end; }
.form-grid-3col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: end; }
.styled-select { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--card-bg); }

/* --- Modal --- */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(5px); animation: fadeIn 0.3s; }
.modal-content { background-color: var(--card-bg); margin: 10% auto; padding: 30px; border: none; width: 90%; max-width: 600px; border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); animation: slideIn 0.3s; }
.close-btn { color: #aaa; float: left; font-size: 28px; font-weight: bold; cursor: pointer; }
.modal-content form button { width: 100%; padding: 12px; margin-top: 10px; }

/* --- Tabs --- */
.tabs { display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 25px; overflow-x: auto; }
.tab-link { background: none; border: none; padding: 12px 20px; cursor: pointer; font-family: 'Vazirmatn'; font-size: 1.1em; font-weight: 500; color: var(--text-color); border-bottom: 3px solid transparent; transition: all 0.2s; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tab-link.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: bold; }
.tab-link svg { width: 18px; height: 18px; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.4s; }

/* --- System Settings Specifics --- */
.profile-management { display: flex; gap: 30px; align-items: flex-start; }
.avatar-section { flex-shrink: 0; text-align: center; }
.user-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--border-color); margin-bottom: 15px; }
.avatar-section form { display: flex; gap: 10px; justify-content: center; }
.user-details-section { flex-grow: 1; }
.user-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.info-item { background-color: var(--bg-color); padding: 10px 15px; border-radius: 8px; }
.info-item label { font-weight: bold; color: var(--heading-color); display: block; font-size: 0.9em; }
.info-item span { font-size: 1.1em; }
.form-grid-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.setting-item-inline { display: flex; justify-content: space-between; align-items: center; background-color: var(--bg-color); padding: 15px; border-radius: 8px; }
.setting-item-inline label { margin: 0; }
.switch.with-text-inline { display: flex; align-items: center; gap: 10px; }
.switch.with-text-inline span { font-size: 0.9em; font-weight: 500; }
.backup-list { list-style: none; padding: 0; }
.backup-actions { display: flex; gap: 10px; }
.upload-form { margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 20px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 15px; }
.checkbox-label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.checkbox-label input { width: auto; }

/* --- SEO Agent Section --- */
.seo-layout { display: flex; gap: 25px; }
.seo-sidebar { width: 240px; flex-shrink: 0; }
.seo-sidebar h4 { margin-top: 0; color: var(--heading-color); }
#seo-sites-list-container .site-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 15px; margin-bottom: 5px; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; }
#seo-sites-list-container .site-list-item:hover { background-color: var(--bg-color); }
#seo-sites-list-container .site-list-item.active { background-color: var(--primary-color); color: white; font-weight: bold; }
.site-favicon { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background-color: var(--bg-color); }
.seo-main-panel { flex-grow: 1; }
#seo-dashboard-placeholder { display: flex; align-items: center; justify-content: center; height: 400px; border: 2px dashed var(--border-color); border-radius: 12px; }
.placeholder-content { text-align: center; color: var(--text-color); }
.placeholder-icon { width: 60px; height: 60px; margin-bottom: 20px; color: var(--border-color); }
.seo-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.seo-header h2 { margin: 0; color: var(--heading-color); }
.seo-summary-card .stat-icon { background-color: transparent; }
.seo-summary-card .stat-info p { font-size: 2.5em; }
.seo-summary-card .stat-icon.success { color: var(--success-color); }
.seo-summary-card .stat-icon.warning { color: var(--warning-color); }
.seo-summary-card .stat-icon.error { color: var(--danger-color); }
.seo-results-table td { vertical-align: top; padding-top: 20px; padding-bottom: 20px; }
.seo-results-table td:first-child, .seo-results-table td:nth-child(2) { text-align: center; }
.status-icon { width: 24px; height: 24px; }
.status-icon.success { color: var(--success-color); }
.status-icon.warning { color: var(--warning-color); }
.status-icon.error { color: var(--danger-color); }
.seo-results-table .description { font-size: 0.9em; color: var(--text-color); margin-bottom: 8px; }
.seo-results-table .suggestion { font-size: 0.85em; color: var(--secondary-color); display: flex; align-items: center; justify-content: space-between; }
.copy-icon { cursor: pointer; color: var(--primary-color); }
.copy-icon:hover { color: var(--primary-hover); }

/* --- Chat Agent Section --- */
.chat-session { margin-bottom: 20px; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.chat-session-header { background-color: var(--bg-color); padding: 10px 15px; font-weight: bold; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.chat-session-toggle { background: none; border: none; cursor: pointer; color: var(--text-color); }
.chat-session-body { max-height: 1000px; transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out; overflow: hidden; padding: 10px 0; }
.chat-session.collapsed .chat-session-body { max-height: 0; padding: 0; }
.chat-message-pair { padding: 10px 15px; border-bottom: 1px solid var(--border-color); }
.chat-session-body .chat-message-pair:last-child { border-bottom: none; }
.chat-message-pair p { margin: 0; }
.chat-message-pair .user-msg { color: var(--heading-color); font-weight: 500; }
.chat-message-pair .bot-msg { color: var(--text-color); margin-top: 5px; padding-right: 15px; }

/* --- Widget Customizer --- */
#widget-customizer-wrapper { display: grid; grid-template-columns: 1fr 370px; gap: 25px; align-items: flex-start; }
.widget-preview-panel { position: sticky; top: 20px; }
#widget-preview-container {
    width: 350px;
    height: 500px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    transform: scale(0.9);
    transform-origin: top right;
}
.icon-selector { display: flex; gap: 15px; align-items: center; }
.icon-selector label { cursor: pointer; padding: 8px; border-radius: 50%; }
.icon-selector input:checked + i { color: var(--primary-color); }
.radio-group { display: flex; gap: 20px; }
.widget-preview { --widget-bg-color: #ffffff; --widget-text-color: #0f172a; --widget-user-msg-bg: #e2e8f0; font-family: 'Vazirmatn', sans-serif; }
.widget-preview .mehrbot-chat-window { position: absolute; bottom: 10px; right: 10px; width: 320px; height: 450px; background-color: var(--widget-bg-color); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.widget-preview .mehrbot-chat-header { background-color: var(--widget-primary-color); color: white; padding: 12px; text-align: center; font-weight: bold; }
.widget-preview .mehrbot-chat-body { flex-grow: 1; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.widget-preview .mehrbot-chat-message { max-width: 80%; padding: 8px 12px; border-radius: 18px; line-height: 1.5; word-wrap: break-word; }
.widget-preview .mehrbot-chat-message.user { background-color: var(--widget-user-msg-bg); color: var(--widget-text-color); border-bottom-right-radius: 4px; align-self: flex-end; }
.widget-preview .mehrbot-chat-message.bot { background-color: var(--widget-primary-color); color: white; border-bottom-left-radius: 4px; align-self: flex-start; }
.widget-preview .mehrbot-chat-footer { padding: 8px; border-top: 1px solid var(--border-color); }
.widget-preview .mehrbot-chat-footer input { width: 100%; border: 1px solid var(--border-color); border-radius: 20px; padding: 8px 12px; }
.widget-preview .mehrbot-chat-toggle { position: absolute; bottom: 10px; right: 10px; width: 50px; height: 50px; background-color: var(--widget-primary-color); border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.widget-preview .mehrbot-chat-toggle svg { width: 28px; height: 28px; color: white; }

/* --- Notifications Section --- */
.notifications-list { display: flex; flex-direction: column; gap: 15px; }
.notification-item { padding: 15px; border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--bg-color); transition: background-color 0.2s; }
.notification-item.read { background-color: transparent; opacity: 0.7; }
.notification-item:not(.read) { cursor: pointer; }
.notification-item:not(.read):hover { background-color: var(--card-bg); }
.notification-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.notification-header strong { color: var(--heading-color); }
.notification-header small { font-size: 0.8em; }
.notification-item p { margin: 0; }

/* --- Reports Section --- */
.export-buttons { display: flex; gap: 10px; margin-right: auto; }

/* --- Agent Permissions (New Design) --- */
.agent-permissions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.permission-card { background-color: var(--bg-color); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.permission-card-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background-color: var(--card-bg); border-bottom: 1px solid var(--border-color); }
.permission-card-header h4 { margin: 0; color: var(--heading-color); text-transform: capitalize; }
.permission-card-body { padding: 20px; }
.permission-card-body label { font-weight: 500; margin-bottom: 10px; display: block; }

/* --- Theme Switcher & Animations --- */
.theme-switcher { display: flex; justify-content: space-between; align-items: center; font-size: 0.9em; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #475569; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

.switch.with-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    font-weight: 500;
}
.switch-text-label.enabled { color: var(--success-color); }
.switch-text-label.disabled { color: var(--danger-color); }


.spin { animation: spin 2s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-50px); } to { transform: translateY(0); } }

/* --- Scroll to Top Button --- */
#scroll-to-top-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s, opacity 0.3s;
}
#scroll-to-top-btn:hover {
    background-color: var(--primary-hover);
}
/* --- Mobile: keep the scroll-to-top button clear of a floating WhatsApp button --- */
@media (max-width: 768px) {
    #scroll-to-top-btn {
        bottom: 88px;   /* sits ABOVE a bottom-anchored WhatsApp button so they don't overlap */
    }
}

/* ============ Sidebar polish + Mobile responsiveness ============ */
.mobile-nav-toggle { display: none; background: transparent; border: 0; cursor: pointer; color: var(--heading-color, var(--text-color)); padding: 6px; margin-inline-end: 6px; }
.mobile-nav-toggle svg { width: 26px; height: 26px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 998; opacity: 0; transition: opacity .25s; }

/* nicer nav items */
.sidebar-nav li a { position: relative; }
.sidebar-nav li a:hover { transform: translateX(-2px); }
.sidebar-nav li.active > a::before { content: ""; position: absolute; inset-inline-start: 0; top: 20%; height: 60%; width: 3px; border-radius: 3px; background: #fff; opacity: .9; }

@media (max-width: 768px) {
    .sidebar {
        position: fixed; top: 0; right: 0; height: 100vh; width: 268px; z-index: 999;
        transform: translateX(100%); transition: transform .28s ease; box-shadow: -8px 0 30px rgba(0,0,0,.3);
    }
    body.mobile-nav-open .sidebar { transform: translateX(0); }
    body.mobile-nav-open .sidebar-overlay { display: block; opacity: 1; }
    .main-content { margin-right: 0 !important; width: 100% !important; }
    .mobile-nav-toggle { display: inline-flex; align-items: center; }
    .sidebar-toggle-btn { display: none; }        /* desktop collapse btn hidden on mobile */
    header { position: sticky; top: 0; }
    header h1 { font-size: 1.15rem; }
    .utc-clock { display: none; }                 /* save header space on mobile */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { font-size: .85rem; }
}
@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════════════════════
   سپهر (Sepehr) — قالب پنل MehrBot
   ایده: اسطرلاب و کاشی‌کاری ایرانی؛ لاجوردی شب برای ناوبری، فیروزه‌ای برای
   کنش‌ها و زعفرانی برای جلب توجه. پایه‌ی ساختاری از default.css می‌آید و این
   لایه ظاهر را بازطراحی می‌کند.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
    --sp-lapis: #17306B;
    --sp-night: #0C1631;
    --sp-night-2: #12214A;
    --sp-firuzeh: #0E8F84;
    --sp-firuzeh-2: #0B7569;
    --sp-saffron: #E6A532;
    --sp-mist: #EEF2F9;
    --sp-ink: #0F1B3D;
    --sp-slate: #44506E;
    --sp-line: #DCE3F0;

    --bg-color: var(--sp-mist);
    --card-bg: #FFFFFF;
    --sidebar-bg: var(--sp-night);
    --sidebar-text: #B7C2DD;
    --sidebar-text-hover: #FFFFFF;
    --sidebar-active-bg: var(--sp-saffron);
    --text-color: var(--sp-slate);
    --heading-color: var(--sp-ink);
    --border-color: var(--sp-line);
    --primary-color: var(--sp-firuzeh);
    --primary-hover: var(--sp-firuzeh-2);
    --secondary-color: #5C6A8C;
    --secondary-hover: #48557A;
    --danger-color: #C8394F;
    --danger-hover: #A92D41;
    --success-color: #1E8E5A;
    --warning-color: #C9821A;
    --info-color: #2F6FD0;
    --muted: #7A86A6;
    --shadow: 0 1px 0 rgba(15, 27, 61, .04), 0 10px 30px -18px rgba(23, 48, 107, .28);
    --sp-r-lg: 22px;
    --sp-r-md: 14px;
    --sp-r-sm: 10px;
    --sp-astro: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none'%3E%3Ccircle cx='20' cy='20' r='18' stroke='%23E6A532' stroke-width='1.6'/%3E%3Ccircle cx='20' cy='20' r='12.5' stroke='%235FD3C6' stroke-width='1.2' opacity='.7'/%3E%3Ccircle cx='20' cy='18' r='6' fill='%23E6A532'/%3E%3Cpath d='M10.5 25a10.5 10.5 0 0 0 19 0' stroke='%23fff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    --sp-girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64' fill='none' stroke='%23ffffff' stroke-opacity='.055' stroke-width='1'%3E%3Ccircle cx='32' cy='32' r='12'/%3E%3Ccircle cx='32' cy='32' r='2'/%3E%3Cpath d='M0 32h8M56 32h8M32 0v8M32 56v8'/%3E%3C/svg%3E");
}
[data-theme="dark"] {
    --bg-color: #0A1228;
    --card-bg: #111D3F;
    --sidebar-bg: #070D1F;
    --sidebar-text: #93A0C2;
    --text-color: #B4BFDA;
    --heading-color: #EEF2FB;
    --border-color: #22315C;
    --primary-color: #2BB8A9;
    --primary-hover: #22A094;
    --secondary-color: #42507A;
    --secondary-hover: #52618F;
    --danger-color: #F0687D;
    --success-color: #3CC486;
    --warning-color: #F0B347;
    --muted: #7F8BAD;
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 14px 34px -20px rgba(0, 0, 0, .7);
}

/* ── تایپوگرافی ── */
body { font-family: 'Vazirmatn', system-ui, sans-serif; font-size: 15px; line-height: 1.85; background: var(--bg-color); color: var(--text-color); font-feature-settings: "ss01"; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: 0; }
.stat-info p, .sync-stat b, td, .plan-price .final { font-variant-numeric: tabular-nums; }
::selection { background: color-mix(in srgb, var(--sp-saffron) 35%, transparent); }

/* ── نوار کناری: آسمان شب ── */
.sidebar {
    background-color: var(--sidebar-bg);
    background-image: var(--sp-girih), radial-gradient(120% 60% at 100% 0%, #1B3A82 0%, transparent 60%);
    background-size: 64px 64px, 100% 100%;
    box-shadow: none;
    border-inline-start: 1px solid rgba(255, 255, 255, .04);
    width: 272px;
}
.sidebar-header { border-bottom: 1px solid rgba(255, 255, 255, .07); padding: 22px 20px 18px; gap: 12px; flex-shrink: 0; }
.sidebar-header::before { content: ""; width: 42px; height: 42px; flex: 0 0 42px; background: var(--sp-astro) center/contain no-repeat; }
body:not(.sidebar-collapsed) .sidebar-header::before { animation: spAstro 1.6s cubic-bezier(.2, .7, .2, 1) 1; }
@keyframes spAstro { from { transform: rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
.sidebar-header h3 { font-size: 1.15rem; color: #fff; }
.sidebar-header p { color: #8EA0CC; opacity: 1; font-size: .78rem; }
.version-info { color: var(--sp-saffron); opacity: .75; font-size: .72rem; }
.sidebar-nav { padding: 8px 12px 16px; }
.sidebar-nav li a { border: 0; border-radius: 12px; padding: 10px 14px; margin: 2px 0; color: var(--sidebar-text); font-size: .93rem; transition: background .15s, color .15s; }
.sidebar-nav li a:hover { transform: none; background: rgba(255, 255, 255, .06); color: #fff; border: 0; }
.sidebar-nav li.active > a { background: rgba(255, 255, 255, .09); color: #fff; border: 0; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.sidebar-nav li.active > a::before { inset-inline-start: -12px; top: 22%; height: 56%; width: 4px; border-radius: 0 4px 4px 0; background: var(--sp-saffron); opacity: 1; }
[dir="rtl"] .sidebar-nav li.active > a::before { border-radius: 4px 0 0 4px; }
.sidebar-nav li.active > a svg { color: var(--sp-saffron); }
.sidebar-nav svg { width: 19px; height: 19px; stroke-width: 1.8; }
.sidebar-nav li.nav-group-label { color: #6E80AE; opacity: 1; padding: 18px 14px 6px; font-size: .74rem; }
.submenu { background: rgba(0, 0, 0, .18); border-radius: 12px; margin: 2px 0 6px; }
.submenu li a { padding-inline-start: 34px; font-size: .86rem; }
.submenu li.active a { background: rgba(43, 184, 169, .18); color: #fff; }
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .07); padding: 12px; }
.sidebar-footer .footer-item { border-radius: 12px; }
.sidebar-footer .footer-item:hover { background: rgba(255, 255, 255, .06); }
.sidebar-toggle-btn { background: var(--sp-night-2); border-color: rgba(255, 255, 255, .12); color: #fff; }
body.sidebar-collapsed .sidebar { width: 84px; }
body.sidebar-collapsed .sidebar-header::before { width: 36px; height: 36px; flex-basis: 36px; }
body.sidebar-collapsed .sidebar-nav li.active > a::before { inset-inline-start: -12px; }
.sidebar-content::-webkit-scrollbar { width: 6px; }
.sidebar-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 6px; }

/* ── سربرگ: نوار شناور ── */
.content-wrapper { padding: 18px 28px 32px; }
.content-wrapper > header {
    background: color-mix(in srgb, var(--card-bg) 88%, transparent);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 10px 14px 10px 18px;
    margin-bottom: 22px;
    top: 10px;
    box-shadow: var(--shadow);
}
#main-header-title { font-size: 1.2rem !important; color: var(--heading-color); }
.header-user-menu { gap: 6px; }
.utc-clock { border: 0; padding: 0 12px; align-items: flex-end; line-height: 1.4; }
.utc-clock #utc-time { color: var(--heading-color); font-size: 1rem; }
.utc-clock #utc-date { color: var(--muted); font-size: .72rem; }
.header-icon { border-radius: 12px; padding: 9px; color: var(--secondary-color); }
.header-icon:hover { background: var(--bg-color); color: var(--primary-color); }
.notification-badge { background: var(--sp-saffron); color: var(--sp-ink); top: 2px; right: 2px; font-size: .62rem; border: 2px solid var(--card-bg); width: 19px; height: 19px; }
.header-avatar { border-radius: 14px; border: 2px solid color-mix(in srgb, var(--sp-saffron) 70%, transparent); width: 40px; height: 40px; }
.dropdown-content { border-radius: var(--sp-r-md); border: 1px solid var(--border-color); box-shadow: 0 24px 50px -24px rgba(12, 22, 49, .45); }
.mb-search-trigger { border-radius: 12px; background: var(--bg-color); }

/* ── کارت‌ها ── */
.card { border-radius: var(--sp-r-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow); padding: 22px 24px; }
.card h3 { border-bottom: 0; padding-bottom: 0; margin-bottom: 16px; font-size: 1.08rem; display: flex; align-items: center; gap: 10px; }
.card > h3::before { content: ""; width: 8px; height: 8px; transform: rotate(45deg); background: var(--sp-saffron); border-radius: 2px; flex: 0 0 8px; }
.card-header-flex h3::before { display: none; }

/* ── دسترسی سریع ── */
.quick-access-card { background: transparent; border: 0; box-shadow: none; padding: 0 0 18px; }
.quick-access-card > h3 { font-size: .95rem; color: var(--muted); }
.quick-access-card > h3::before { display: none; }
.quick-access-grid { gap: 12px; }
.quick-access-item { flex-direction: row; width: auto; gap: 10px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 999px; padding: 6px 16px 6px 8px; }
[dir="rtl"] .quick-access-item { padding: 6px 8px 6px 16px; }
.quick-access-icon { width: 36px; height: 36px; box-shadow: none; background: color-mix(in srgb, var(--primary-color) 12%, transparent); }
.quick-access-icon svg { width: 18px; height: 18px; }
.quick-access-item:hover { border-color: var(--primary-color); }
.quick-access-item:hover .quick-access-icon { transform: none; box-shadow: none; }
.quick-access-item span { font-weight: 700; color: var(--heading-color); }

/* ── آمار ── */
.stats-grid { gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat-card { border-radius: var(--sp-r-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow); padding: 18px; gap: 12px; position: relative; overflow: hidden; flex-direction: column; align-items: flex-start; }
.stat-icon { width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--primary-color) 12%, transparent); color: var(--primary-color); }
.stat-icon svg { width: 22px; height: 22px; }
.stat-info h4 { font-size: .82rem; font-weight: 600; color: var(--muted); }
.stat-info p { font-size: 1.75rem; font-weight: 800; margin-top: 2px; line-height: 1.3; }
.dashboard-grid { gap: 18px; }

/* ── دکمه‌ها ── */
.btn { border-radius: 12px; font-weight: 700; padding: 10px 18px; font-family: inherit; letter-spacing: 0; transition: background .15s, box-shadow .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary-color); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--primary-color) 80%, transparent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--card-bg); color: var(--heading-color); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-color); border-color: color-mix(in srgb, var(--primary-color) 45%, var(--border-color)); color: var(--primary-color); }
.btn-danger { background: color-mix(in srgb, var(--danger-color) 12%, transparent); color: var(--danger-color); }
.btn-danger:hover { background: var(--danger-color); color: #fff; }
.btn-success { background: var(--success-color); }
.btn-warning { background: var(--warning-color); }
.btn:focus-visible, a:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--sp-saffron) 70%, transparent); outline-offset: 2px; }

/* ── فرم‌ها ── */
.styled-form label { font-weight: 600; font-size: .9rem; }
.styled-form input, .styled-form select, .styled-form textarea, .styled-select, .sync-enqueue input {
    border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--heading-color); padding: 11px 13px; font-family: inherit;
}
[data-theme="dark"] .styled-form input, [data-theme="dark"] .styled-form select, [data-theme="dark"] .styled-form textarea, [data-theme="dark"] .styled-select { background: #0C1633; }
.styled-form input:focus, .styled-form select:focus, .styled-form textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color) 16%, transparent); }
.setting-item-inline, .info-item { border-radius: var(--sp-r-md); border: 1px solid var(--border-color); background: var(--bg-color); }
input:checked + .slider { background: var(--primary-color); }

/* ── زبانه‌ها: نوار قطعه‌ای ── */
.tabs { border: 1px solid var(--border-color); background: var(--card-bg); border-radius: 16px; padding: 5px; gap: 4px; margin-bottom: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-link { border: 0; border-radius: 12px; padding: 9px 16px; font-size: .92rem; color: var(--text-color); font-family: inherit; }
.tab-link:hover { background: var(--bg-color); color: var(--heading-color); }
.tab-link.active { background: var(--sp-night); color: #fff; border: 0; font-weight: 700; }
.tab-link.active svg { color: var(--sp-saffron); }
[data-theme="dark"] .tab-link.active { background: #233A78; }

/* ── جدول‌ها ── */
.table-wrapper { border-radius: var(--sp-r-md); }
table { margin-top: 12px; border-collapse: separate; border-spacing: 0; }
th { background: var(--bg-color); color: var(--muted); font-size: .8rem; font-weight: 700; border-bottom: 1px solid var(--border-color); padding: 11px 14px; }
th:first-child { border-start-start-radius: 12px; }
th:last-child { border-start-end-radius: 12px; }
td { padding: 13px 14px; border-bottom: 1px solid var(--border-color); color: var(--heading-color); font-size: .92rem; }
tbody tr:hover td { background: color-mix(in srgb, var(--primary-color) 4%, transparent); }
td.actions .btn { padding: 7px 9px; border-radius: 10px; }
.status-badge { border-radius: 999px; font-weight: 700; padding: 3px 11px; font-size: .74rem; }
.status-badge.success, .status-badge.approved, .status-badge.active { background: color-mix(in srgb, var(--success-color) 15%, transparent); color: var(--success-color); }
.status-badge.error, .status-badge.rejected, .status-badge.inactive { background: color-mix(in srgb, var(--danger-color) 14%, transparent); color: var(--danger-color); }
.status-badge.warning, .status-badge.pending { background: color-mix(in srgb, var(--warning-color) 16%, transparent); color: var(--warning-color); }
.status-badge.scheduled { background: color-mix(in srgb, var(--info-color) 14%, transparent); color: var(--info-color); }

/* ── مودال ── */
.modal { background: rgba(7, 13, 31, .58); backdrop-filter: blur(4px); }
.modal-content { border-radius: var(--sp-r-lg); border: 1px solid var(--border-color); margin: 6vh auto; padding: 26px; box-shadow: 0 40px 90px -30px rgba(7, 13, 31, .6); }
.close-btn { color: var(--muted); }

/* ── نقشه و نمودار ── */
.map-container-sm, .map-container-lg { border-radius: var(--sp-r-md); overflow: hidden; }

/* ── صفحهٔ ورود و ثبت‌نام ── */
.auth-page { background: var(--bg-color); }
.auth-slider-panel { background-color: var(--sp-night); background-image: var(--sp-girih), radial-gradient(90% 70% at 20% 10%, #1D3E8C 0%, transparent 60%); background-size: 64px 64px, 100% 100%; }
.auth-slider-panel::before { content: ""; position: absolute; width: min(46vw, 520px); aspect-ratio: 1; inset-inline-start: 50%; top: 50%; transform: translate(50%, -50%); background: var(--sp-astro) center/contain no-repeat; opacity: .16; }
[dir="ltr"] .auth-slider-panel::before { transform: translate(-50%, -50%); }
.slider-container .slide img { opacity: .22; mix-blend-mode: luminosity; }
.slide-content h2 { font-weight: 800; }
.auth-form-panel { background: var(--card-bg); }
.form-wrapper .form-header h2 { color: var(--heading-color); font-weight: 800; }
.form-wrapper input { border-radius: 12px !important; }
.btn-full { width: 100%; padding: 13px; font-size: 1rem; }
.form-footer-text a { color: var(--primary-color); font-weight: 700; }
.success-message { color: var(--success-color); background: color-mix(in srgb, var(--success-color) 10%, transparent); border-radius: 12px; padding: 10px 12px; text-align: center; }

/* ── اسکرول ── */
.content-wrapper::-webkit-scrollbar { width: 10px; }
.content-wrapper::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--secondary-color) 35%, transparent); border-radius: 10px; border: 3px solid var(--bg-color); }

/* ── موبایل: منو به‌شکل برگهٔ پایین‌رونده ── */
@media (max-width: 992px) {
    html body .sidebar {
        top: auto !important; bottom: 0; right: 0; left: 0; width: 100% !important; height: 84vh !important;
        border-radius: 26px 26px 0 0; transform: translateY(104%) !important; transition: transform .3s cubic-bezier(.2, .8, .2, 1);
        box-shadow: 0 -30px 60px -20px rgba(0, 0, 0, .5); z-index: 1001;
    }
    html body.mobile-nav-open .sidebar { transform: translateY(0) !important; }
    .sidebar-header { padding-top: 26px; position: relative; }
    .sidebar-header::after { content: ""; position: absolute; top: 9px; left: 50%; width: 44px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .22); transform: translateX(-50%); }
    .sidebar-nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
    .sidebar-nav li.nav-group-label, .sidebar-nav li.has-submenu { grid-column: 1 / -1; }
    .sidebar-nav li a { padding: 11px 12px; white-space: normal; line-height: 1.5; font-size: .88rem; }
    .content-wrapper { padding: 10px 12px 96px; }
    .content-wrapper > header { border-radius: 16px; top: 6px; padding: 8px 10px; margin-bottom: 14px; }
    #main-header-title { font-size: 1.02rem !important; }
    .header-user-menu .header-icon[data-section="activity-log-section"], .header-user-menu .header-icon[data-section="system-section"], .header-home-link { display: none !important; }
    .card { padding: 16px; border-radius: 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .stat-info p { font-size: 1.45rem; }
    .quick-access-grid { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
    .quick-access-item { flex: 0 0 auto; }
    .tabs { border-radius: 14px; }
    .tab-link { padding: 8px 12px; font-size: .85rem; }
    .action-bar { gap: 10px; }
    .action-bar .btn { flex: 1 1 auto; }
    .mb-bottom-nav { border-radius: 20px 20px 0 0; }
    .mb-bottom-nav button.is-active svg { color: var(--sp-saffron); }
    .auth-container { grid-template-columns: 1fr; }
    .auth-slider-panel { display: none; }
}
@media (max-width: 420px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .sidebar-header::before { animation: none !important; } }
.content-wrapper > .app-footer { padding: 18px 4px 0; margin-top: 30px; border-top: 1px solid var(--border-color); }
.app-footer .footer-divider { display: none; }
.app-footer .footer-top, .app-footer .footer-bottom { margin: 0 0 6px; color: var(--muted); }
.styled-form input[type="color"] { height: 46px; padding: 4px; cursor: pointer; }
