* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.10), transparent 32%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.08), transparent 30%),
        #f3f4f8;
    color: #1f2937;
    direction: rtl;
}

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

button,
input,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.26), transparent 34%),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.20), transparent 32%),
        linear-gradient(135deg, #0f172a, #111827);
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 30px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(18px);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.login-logo {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 20px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.34);
}

.login-brand h1 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #111827;
}

.login-brand p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.8;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13px;
    margin-bottom: 18px;
}

.login-form {
    display: grid;
    gap: 11px;
}

.login-form label {
    color: #374151;
    font-size: 13px;
    margin-top: 6px;
}

.login-form input {
    width: 100%;
    height: 50px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 16px;
    outline: none;
    padding: 0 14px;
    color: #111827;
    font-size: 14px;
}

.login-form input:focus {
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

.login-form button {
    height: 52px;
    border: 0;
    border-radius: 17px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-size: 15px;
    margin-top: 12px;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.30);
}

.login-hint {
    margin-top: 18px;
    padding: 13px 14px;
    border-radius: 16px;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    color: #6b7280;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.login-hint strong {
    color: #111827;
    direction: ltr;
}

/* Sidebar */
.sidebar {
    width: 255px;
    min-height: 100vh;
    background: #111827;
    color: #fff;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
    z-index: 20;
    transition: width 0.22s ease;
}

.brand {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    min-width: 34px;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.26);
}

.brand-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.brand h1 {
    margin: 0 0 3px;
    font-size: 13px;
    color: #fff;
    font-weight: bold;
}

.brand span {
    font-size: 10px;
    color: #9ca3af;
}

.sidebar-toggle {
    min-width: 30px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 14px;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.13);
}

.sidebar-view-site {
    padding: 9px 9px 5px;
}

.sidebar-view-site a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    background: #1f2937;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-view-site a:hover {
    background: #2563eb;
    color: #fff;
}

.view-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.sidebar-view-site strong {
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
}

.sidebar-menu {
    padding: 4px 7px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.36);
    border-radius: 999px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.58);
}

.menu-section-separator {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 11px 7px 6px;
    color: #6b7280;
    font-size: 10px;
    white-space: nowrap;
}

.menu-section-separator::before,
.menu-section-separator::after {
    content: "";
    height: 1px;
    background: rgba(148, 163, 184, 0.14);
    flex: 1;
}

.menu-group {
    margin-bottom: 3px;
    border-radius: 8px;
    overflow: hidden;
}

.menu-group summary {
    list-style: none;
    cursor: pointer;
    padding: 6px 8px;
    min-height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #d1d5db;
    font-size: 12px;
    transition: 0.16s ease;
    position: relative;
}

.menu-group summary::-webkit-details-marker {
    display: none;
}

.menu-group summary:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.menu-group.is-active-group summary {
    background: rgba(37, 99, 235, 0.16);
    color: #fff;
    box-shadow: inset -3px 0 0 #38bdf8;
}

.menu-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
    font-size: 12px;
}

.menu-group.is-active-group .menu-icon {
    background: #2563eb;
    color: #fff;
}

.menu-title {
    flex: 1;
    white-space: nowrap;
}

.menu-arrow {
    color: #6b7280;
    font-size: 16px;
    transform: rotate(0deg);
    transition: 0.18s ease;
}

.menu-group[open] .menu-arrow {
    transform: rotate(-90deg);
    color: #d1d5db;
}

.submenu {
    padding: 3px 34px 4px 4px;
}

.submenu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    min-height: 30px;
    margin-bottom: 2px;
    border-radius: 7px;
    color: #9ca3af;
    font-size: 11.5px;
    transition: 0.16s ease;
    position: relative;
}

.submenu a span {
    width: 5px;
    height: 5px;
    min-width: 5px;
    border-radius: 50%;
    background: rgba(156, 163, 175, 0.5);
}

.submenu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.submenu a.active {
    color: #fff;
    background: #2563eb;
}

.submenu a.active span {
    background: #fff;
}

.submenu a.active::before {
    content: "";
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: #38bdf8;
    position: absolute;
    right: -26px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f172a;
}

.panel-version {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 10px;
    padding: 7px 8px;
    margin-bottom: 7px;
}

.panel-version span {
    display: block;
    color: #9ca3af;
    font-size: 9px;
    margin-bottom: 2px;
}

.panel-version strong {
    display: block;
    color: #e5e7eb;
    font-size: 11px;
}

.panel-version em {
    font-style: normal;
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 9px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    padding: 8px;
    background: rgba(239, 68, 68, 0.13);
    color: #fecaca;
    border-radius: 10px;
    font-size: 12px;
}

.logout-btn span {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 7px;
    background: rgba(239, 68, 68, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.23);
}

/* Main */
.main-content {
    margin-right: 255px;
    width: calc(100% - 255px);
    min-height: 100vh;
    padding: 22px;
    transition: margin-right 0.22s ease, width 0.22s ease;
}

.topbar {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(300px, 520px) auto;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(16px);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
    margin-bottom: 22px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 7px;
}

.page-heading h2 {
    margin: 0 0 7px;
    font-size: 23px;
    color: #111827;
}

.page-heading p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.admin-search {
    height: 48px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    display: flex;
    align-items: center;
    padding: 0 12px 0 6px;
    gap: 8px;
}

.admin-search:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.11);
    background: #fff;
}

.search-icon {
    color: #4b5563;
    min-width: 26px;
    text-align: center;
    font-size: 19px;
}

.admin-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: #111827;
    font-size: 13px;
    min-width: 0;
}

.admin-search button {
    border: 0;
    background: #111827;
    color: #fff;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.quick-add {
    position: relative;
}

.quick-add summary {
    list-style: none;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    padding: 12px 15px;
    border-radius: 14px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.23);
}

.quick-add summary::-webkit-details-marker {
    display: none;
}

.quick-add-menu {
    position: absolute;
    top: 52px;
    left: 0;
    width: 190px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.14);
    border-radius: 16px;
    padding: 8px;
    z-index: 30;
}

.quick-add-menu a {
    display: block;
    padding: 10px 12px;
    color: #374151;
    border-radius: 10px;
    font-size: 13px;
}

.quick-add-menu a:hover {
    background: #f3f4f6;
}

.notification-btn {
    width: 46px;
    height: 46px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 15px;
    position: relative;
    font-size: 20px;
}

.notification-dot {
    width: 9px;
    height: 9px;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 10px;
}

.admin-user {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 7px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 132px;
}

.admin-avatar {
    min-width: 34px;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f172a, #334155);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-user span {
    color: #6b7280;
    font-size: 11px;
}

.admin-user strong {
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

/* Boxes */
.search-result-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 17px 18px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.search-result-box h3 {
    margin: 0 0 8px;
    font-size: 17px;
    color: #1e3a8a;
}

.search-result-box p {
    margin: 0;
    color: #1e40af;
    font-size: 13px;
    line-height: 1.8;
}

.search-result-box a {
    background: #fff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 10px 14px;
    border-radius: 13px;
    font-size: 13px;
    white-space: nowrap;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.stat-card span {
    display: block;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.stat-card strong {
    display: block;
    font-size: 27px;
    margin-bottom: 10px;
    color: #111827;
}

.stat-card p {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
    margin-bottom: 22px;
}

.panel-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    margin-bottom: 22px;
}

.panel-card-header {
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-card-header h3 {
    margin: 0;
    font-size: 18px;
}

.panel-card-header span {
    background: #eef2ff;
    color: #4f46e5;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
}

.features-grid,
.module-grid,
.media-grid,
.analytics-grid,
.backup-grid,
.roles-grid,
.section-builder-grid {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.feature-item,
.module-card,
.media-card,
.backup-card,
.roles-grid div,
.analytics-grid div,
.builder-section,
.banner-zones div {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
}

.feature-item b {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    margin-bottom: 13px;
}

.feature-item h4,
.module-card h4,
.media-card h4,
.backup-card h4,
.roles-grid h4,
.analytics-grid h4,
.builder-section h4,
.banner-zones h4 {
    margin: 0 0 9px;
    font-size: 15px;
}

.feature-item p,
.module-card p,
.media-card p,
.backup-card p,
.roles-grid p,
.analytics-grid p,
.builder-section p,
.banner-zones p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.9;
}

/* Smart Dashboard */
.smart-list,
.activity-list {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.smart-item {
    border-radius: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.smart-item strong {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
}

.smart-item p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.smart-item.warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.smart-item.danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.smart-item.success {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.activity-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.activity-list b {
    font-size: 12px;
    color: #2563eb;
}

.activity-list span {
    font-size: 13px;
    color: #374151;
}

/* Section Builder */
.builder-section {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.builder-section.active {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.mini-actions button,
.small-btn,
.backup-card button {
    border: 0;
    background: #111827;
    color: #fff;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
}

/* Tables */
.admin-toolbar {
    padding: 18px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-toolbar button {
    border: 0;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    padding: 10px 13px;
    font-size: 13px;
}

.table-wrap {
    padding: 0 20px 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
    padding: 13px 10px;
    font-size: 13px;
}

th {
    color: #6b7280;
    font-weight: normal;
    background: #f9fafb;
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
}

.status.good,
.status.published {
    background: #ecfdf5;
    color: #047857;
}

.status.bad {
    background: #fef2f2;
    color: #b91c1c;
}

.status.warning,
.status.draft {
    background: #fffbeb;
    color: #b45309;
}

/* Media */
.fake-image {
    height: 115px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #c7d2fe);
    margin-bottom: 14px;
}

.warning-bg {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.danger-bg {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

/* Banner */
.banner-zones {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* SEO */
.seo-layout {
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.seo-form-preview {
    display: grid;
    gap: 10px;
}

.seo-form-preview label {
    font-size: 13px;
    color: #374151;
}

.seo-form-preview input,
.seo-form-preview textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 14px;
    padding: 12px;
    outline: none;
    font-size: 13px;
}

.seo-form-preview textarea {
    min-height: 110px;
    resize: vertical;
}

.google-preview {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
}

.google-preview span {
    color: #047857;
    font-size: 13px;
}

.google-preview h4 {
    color: #1d4ed8;
    margin: 9px 0;
    font-size: 18px;
}

.google-preview p {
    margin: 0;
    color: #4b5563;
    line-height: 1.8;
}

/* Tools */
.health-list {
    padding: 22px;
    display: grid;
    gap: 12px;
}

.health-list div {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Security */
.security-box {
    margin: 0 22px 22px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    padding: 18px;
}

.security-box h4 {
    margin: 0 0 8px;
}

.security-box p {
    margin: 0;
    color: #1e40af;
    line-height: 1.9;
}

/* Empty */
.empty-state {
    padding: 58px 24px;
    text-align: center;
}

.empty-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    background: #eef2ff;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.empty-state h4 {
    margin: 0 0 10px;
    font-size: 21px;
}

.empty-state p {
    max-width: 600px;
    margin: 0 auto 22px;
    color: #6b7280;
    line-height: 2;
    font-size: 14px;
}

.primary-btn {
    border: 0;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    padding: 12px 20px;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

/* Collapsed Sidebar */
body.sidebar-collapsed .sidebar {
    width: 68px;
}

body.sidebar-collapsed .main-content {
    margin-right: 68px;
    width: calc(100% - 68px);
}

body.sidebar-collapsed .brand {
    justify-content: center;
    padding-left: 7px;
    padding-right: 7px;
    flex-wrap: wrap;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-view-site strong,
body.sidebar-collapsed .menu-section-separator span,
body.sidebar-collapsed .menu-title,
body.sidebar-collapsed .menu-arrow,
body.sidebar-collapsed .submenu,
body.sidebar-collapsed .panel-version,
body.sidebar-collapsed .logout-btn strong {
    display: none;
}

body.sidebar-collapsed .menu-section-separator {
    margin: 10px 14px 6px;
}

body.sidebar-collapsed .sidebar-view-site {
    padding: 9px 7px 5px;
}

body.sidebar-collapsed .sidebar-view-site a {
    justify-content: center;
    padding: 8px 0;
}

body.sidebar-collapsed .menu-group summary {
    justify-content: center;
    padding: 6px 0;
}

body.sidebar-collapsed .menu-icon {
    margin: 0 auto;
}

body.sidebar-collapsed .logout-btn {
    padding: 8px 0;
}

/* Responsive */
@media (max-width: 1250px) {
    .topbar,
    .dashboard-grid,
    .seo-layout {
        grid-template-columns: 1fr;
    }

    .topbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .features-grid,
    .module-grid,
    .media-grid,
    .analytics-grid,
    .backup-grid,
    .roles-grid,
    .section-builder-grid,
    .banner-zones {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .admin-layout {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }

    body.sidebar-collapsed .sidebar {
        width: 100%;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        width: 100%;
        margin-right: 0;
        padding: 16px;
    }

    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .sidebar-view-site strong,
    body.sidebar-collapsed .menu-section-separator span,
    body.sidebar-collapsed .menu-title,
    body.sidebar-collapsed .menu-arrow,
    body.sidebar-collapsed .submenu,
    body.sidebar-collapsed .panel-version,
    body.sidebar-collapsed .logout-btn strong {
        display: block;
    }

    .brand {
        flex-wrap: nowrap;
    }

    .topbar {
        border-radius: 20px;
        padding: 16px;
    }

    .admin-search {
        width: 100%;
    }

    .quick-add-menu {
        right: 0;
        left: auto;
    }

    .search-result-box {
        display: block;
    }

    .search-result-box a {
        display: inline-block;
        margin-top: 14px;
    }

    .stats-grid,
    .features-grid,
    .module-grid,
    .media-grid,
    .analytics-grid,
    .backup-grid,
    .roles-grid,
    .section-builder-grid,
    .banner-zones {
        grid-template-columns: 1fr;
    }

    .builder-section {
        display: block;
    }

    .mini-actions {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .health-list div {
        display: block;
    }

    .health-list .status {
        margin-top: 10px;
    }

    .login-card {
        padding: 22px;
        border-radius: 24px;
    }

    .login-brand h1 {
        font-size: 19px;
    }

    .login-hint {
        display: block;
        line-height: 2;
    }
}


/* =========================================================
   Stage 13.4 — Final Raw Admin UI Polish
   This section only improves visual appearance.
   It does not change panel logic or PHP functionality.
   ========================================================= */

:root {
    --admin-bg: #f5f7fb;
    --admin-surface: rgba(255, 255, 255, 0.96);
    --admin-surface-solid: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #111827;
    --admin-muted: #64748b;
    --admin-primary: #4f46e5;
    --admin-primary-dark: #3730a3;
    --admin-primary-soft: #eef2ff;
    --admin-success: #059669;
    --admin-success-soft: #ecfdf5;
    --admin-warning: #d97706;
    --admin-warning-soft: #fffbeb;
    --admin-danger: #dc2626;
    --admin-danger-soft: #fef2f2;
    --admin-sidebar: #0f172a;
    --admin-sidebar-2: #111827;
    --admin-shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
    --admin-shadow: 0 18px 50px rgba(15, 23, 42, 0.09);
    --admin-radius: 22px;
    --admin-radius-lg: 28px;
}

body {
    background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.13), transparent 34%),
        radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.10), transparent 30%),
        linear-gradient(180deg, #f8fafc, var(--admin-bg));
    color: var(--admin-text);
}

.sidebar {
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, .24), transparent 34%),
        linear-gradient(180deg, var(--admin-sidebar), var(--admin-sidebar-2));
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -18px 0 48px rgba(15, 23, 42, 0.18);
}

.brand {
    min-height: 72px;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand-logo {
    border-radius: 18px;
    background: linear-gradient(135deg, #6366f1, #2563eb);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.30);
}

.brand-title {
    font-weight: 900;
    letter-spacing: -0.2px;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.58);
}

.sidebar-nav {
    padding: 14px 10px 22px;
}

.nav-group-title {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    letter-spacing: .4px;
    margin: 12px 10px 8px;
}

.nav-link,
.sidebar a {
    transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}

.nav-link {
    border: 1px solid transparent;
    border-radius: 15px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, .96), rgba(37, 99, 235, .92));
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.main-content {
    padding: 26px;
}

.topbar {
    background: var(--admin-surface);
    border-color: rgba(226, 232, 240, .95);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm);
}

.breadcrumb {
    color: var(--admin-muted);
}

.page-title h1 {
    letter-spacing: -0.4px;
}

.search-box input,
.user-form-field input,
.user-form-field select,
.user-form-field textarea,
.filters-form input,
.filters-form select {
    border: 1px solid var(--admin-border);
    background: #f8fafc;
    border-radius: 16px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.search-box input:focus,
.user-form-field input:focus,
.user-form-field select:focus,
.user-form-field textarea:focus,
.filters-form input:focus,
.filters-form select:focus {
    border-color: rgba(79, 70, 229, .65);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .10);
    outline: none;
}

.panel-card {
    background: var(--admin-surface-solid);
    border-color: rgba(226, 232, 240, .95);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm);
    overflow: hidden;
}

.panel-card-header {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, .95), rgba(255, 255, 255, .95));
    padding: 20px 22px;
}

.panel-card-header h3 {
    letter-spacing: -0.25px;
    color: var(--admin-text);
}

.panel-card-header span {
    background: var(--admin-primary-soft);
    color: var(--admin-primary-dark);
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    font-weight: 800;
}

.stats-grid {
    gap: 18px;
}

.stat-card {
    border-color: rgba(226, 232, 240, .95);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, #6366f1, #0ea5e9);
}

.stat-card strong {
    color: var(--admin-text);
    letter-spacing: -0.5px;
}

.table-wrap {
    padding: 0 18px 20px;
}

table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

th {
    border-bottom: 0;
    background: transparent;
    color: var(--admin-muted);
    font-weight: 800;
    padding: 10px 12px;
}

td {
    background: #fff;
    border-top: 1px solid var(--admin-border);
    border-bottom: 1px solid var(--admin-border);
    padding: 14px 12px;
    vertical-align: middle;
}

td:first-child {
    border-right: 1px solid var(--admin-border);
    border-top-right-radius: 17px;
    border-bottom-right-radius: 17px;
}

td:last-child {
    border-left: 1px solid var(--admin-border);
    border-top-left-radius: 17px;
    border-bottom-left-radius: 17px;
}

tbody tr {
    transition: transform .18s ease, box-shadow .18s ease;
}

tbody tr:hover {
    transform: translateY(-1px);
}

tbody tr:hover td {
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.status {
    border-radius: 999px;
    padding: 7px 11px;
    font-weight: 900;
    border: 1px solid transparent;
}

.status.good,
.status.published {
    background: var(--admin-success-soft);
    color: var(--admin-success);
    border-color: #a7f3d0;
}

.status.bad,
.status.danger {
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
    border-color: #fecaca;
}

.status.warning,
.status.draft {
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
    border-color: #fde68a;
}

.status.neutral {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.form-actions {
    gap: 11px;
}

.form-actions button,
.form-actions a,
.user-action-btn {
    border-radius: 999px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.form-actions button:hover,
.form-actions a:hover,
.user-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.form-actions a.secondary,
.form-actions button.secondary,
button.secondary,
a.secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.form-actions button.danger,
.form-actions a.danger,
button.danger,
a.danger {
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
    border: 1px solid #fecaca;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.row-actions form {
    margin: 0;
}

.row-actions .small,
.row-actions button.small,
.row-actions a.small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    text-decoration: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.row-actions .small:hover,
.row-actions button.small:hover,
.row-actions a.small:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .12);
}

.row-actions .small.secondary,
.row-actions button.small.secondary,
.row-actions a.small.secondary {
    background: var(--admin-primary-soft);
    color: var(--admin-primary-dark);
    border-color: #c7d2fe;
}

.row-actions .small.danger,
.row-actions button.small.danger,
.row-actions a.small.danger {
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
    border-color: #fecaca;
}

.form-notice {
    border-radius: 18px;
    box-shadow: var(--admin-shadow-sm);
}

.login-card {
    border-radius: 34px;
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.34);
}

.login-button,
.login-form button {
    border-radius: 999px;
    font-weight: 900;
}

.fake-image,
.media-thumb,
.gallery-thumb,
.preview-image,
.logo-preview-box {
    border-radius: 18px;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
    border: 2px solid #e2e8f0;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

@media (max-width: 1180px) {
    .topbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .main-content {
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 14px;
    }

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

    .topbar,
    .panel-card,
    .stat-card {
        border-radius: 22px;
    }

    .row-actions .small,
    .row-actions button.small,
    .row-actions a.small {
        min-width: unset;
        width: 100%;
    }

    .row-actions {
        align-items: stretch;
    }
}


/* =========================================================
   Stage 13.6b — Admin Panel Theme Awareness
   The selected site theme now visibly affects the admin panel too.
   ========================================================= */

body.admin-theme-festival {
    --admin-primary: #4f46e5;
    --admin-primary-dark: #3730a3;
    --admin-primary-soft: #eef2ff;
    --admin-sidebar: #0f172a;
    --admin-sidebar-2: #111827;
}

body.admin-theme-news {
    --admin-primary: #dc2626;
    --admin-primary-dark: #991b1b;
    --admin-primary-soft: #fef2f2;
    --admin-sidebar: #111827;
    --admin-sidebar-2: #7f1d1d;
}

body.admin-theme-corporate {
    --admin-primary: #2563eb;
    --admin-primary-dark: #1d4ed8;
    --admin-primary-soft: #eff6ff;
    --admin-sidebar: #0f172a;
    --admin-sidebar-2: #1e3a8a;
}

body.admin-theme-luxury {
    --admin-primary: #d97706;
    --admin-primary-dark: #92400e;
    --admin-primary-soft: #fffbeb;
    --admin-sidebar: #020617;
    --admin-sidebar-2: #1c1917;
}

body.admin-theme-kids {
    --admin-primary: #ec4899;
    --admin-primary-dark: #be185d;
    --admin-primary-soft: #fdf2f8;
    --admin-sidebar: #831843;
    --admin-sidebar-2: #164e63;
}

body.admin-theme-nature {
    --admin-primary: #16a34a;
    --admin-primary-dark: #166534;
    --admin-primary-soft: #f0fdf4;
    --admin-sidebar: #052e16;
    --admin-sidebar-2: #134e4a;
}

body.admin-theme-minimal {
    --admin-primary: #0f172a;
    --admin-primary-dark: #020617;
    --admin-primary-soft: #f1f5f9;
    --admin-sidebar: #0f172a;
    --admin-sidebar-2: #334155;
}

body.admin-theme-dark {
    --admin-bg: #0f172a;
    --admin-surface: rgba(15, 23, 42, 0.96);
    --admin-surface-solid: #111827;
    --admin-border: #334155;
    --admin-text: #e5e7eb;
    --admin-muted: #94a3b8;
    --admin-primary: #8b5cf6;
    --admin-primary-dark: #7c3aed;
    --admin-primary-soft: rgba(139, 92, 246, 0.16);
    --admin-sidebar: #020617;
    --admin-sidebar-2: #111827;
}

body[class*="admin-theme-"] .sidebar {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--admin-primary) 35%, transparent), transparent 34%),
        linear-gradient(180deg, var(--admin-sidebar), var(--admin-sidebar-2)) !important;
}

body[class*="admin-theme-"] .brand-logo,
body[class*="admin-theme-"] .nav-link.active,
body[class*="admin-theme-"] .form-actions button,
body[class*="admin-theme-"] .contact-submit {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-dark)) !important;
}

body[class*="admin-theme-"] .panel-card-header span,
body[class*="admin-theme-"] .status.good,
body[class*="admin-theme-"] .row-actions .small.secondary,
body[class*="admin-theme-"] .form-actions a.secondary,
body[class*="admin-theme-"] .archive-tabs a.active {
    background: var(--admin-primary-soft) !important;
    color: var(--admin-primary-dark) !important;
    border-color: color-mix(in srgb, var(--admin-primary) 28%, #e5e7eb) !important;
}

body[class*="admin-theme-"] .stat-card::before {
    background: linear-gradient(180deg, var(--admin-primary), var(--admin-primary-dark)) !important;
}

body[class*="admin-theme-"] input:focus,
body[class*="admin-theme-"] select:focus,
body[class*="admin-theme-"] textarea:focus {
    border-color: var(--admin-primary) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--admin-primary) 14%, transparent) !important;
}

body.admin-theme-dark {
    background:
        radial-gradient(circle at top right, rgba(139, 92, 246, .18), transparent 34%),
        linear-gradient(180deg, #020617, #0f172a) !important;
    color: var(--admin-text) !important;
}

body.admin-theme-dark .topbar,
body.admin-theme-dark .panel-card,
body.admin-theme-dark .stat-card,
body.admin-theme-dark td,
body.admin-theme-dark .login-card {
    background: var(--admin-surface-solid) !important;
    border-color: var(--admin-border) !important;
    color: var(--admin-text) !important;
}

body.admin-theme-dark th,
body.admin-theme-dark .breadcrumb,
body.admin-theme-dark .stat-card span,
body.admin-theme-dark .panel-card-header p,
body.admin-theme-dark .panel-card-header small {
    color: var(--admin-muted) !important;
}

body.admin-theme-dark input,
body.admin-theme-dark select,
body.admin-theme-dark textarea {
    background: #020617 !important;
    color: var(--admin-text) !important;
    border-color: var(--admin-border) !important;
}

body.admin-theme-dark .panel-card-header {
    background: linear-gradient(180deg, #111827, #0f172a) !important;
}
