/* ============================================
   AUTH PAGES (Login & Admin Login)
   ============================================ */

/* Remove default page margins for auth wrapper */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Left panel - gradient branding */
.auth-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: pulse-bg 4s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.auth-branding {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 380px;
}

.brand-icon {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
}

.brand-name {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 1rem;
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.brand-features {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.feature-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Right panel - form */
.auth-right {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    padding: 2rem;
}

.auth-form-container {
    width: 100%;
    max-width: 380px;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.4rem;
}

.auth-header p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Form inputs with icons */
.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.input-icon-wrapper .form-control {
    padding-left: 2.8rem;
    height: 48px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.input-icon-wrapper .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
}

.form-label {
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.4rem;
}

/* Login button */
.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    height: 48px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-login:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: white;
}

.btn-login:active {
    transform: translateY(0);
}

/* OTP input */
.otp-input {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 2px solid #c7d2fe;
    background: #f8faff;
    color: #312e81;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.otp-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.18);
    background: #fff;
    outline: none;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-left {
        display: none;
    }
    .auth-right {
        width: 100%;
    }
}

/* ============================================
   ADMIN LOGIN PAGE
   ============================================ */

.admin-auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.admin-auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.admin-auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

.admin-auth-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.3rem;
}

.admin-auth-logo p {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
}

/* Admin form inputs */
.admin-input-wrapper {
    position: relative;
}

.admin-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.4);
    pointer-events: none;
}

.admin-auth-form .form-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

.admin-auth-form .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    color: white;
    height: 48px;
    border-radius: 10px;
    padding-left: 2.8rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-auth-form .form-control::placeholder {
    color: rgba(255,255,255,0.3);
}

.admin-auth-form .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    color: white;
    outline: none;
}

.btn-admin-login {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    height: 48px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-admin-login:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: white;
}

.admin-auth-back {
    margin-top: 1.5rem;
    text-align: center;
}

.admin-auth-back a {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}

.admin-auth-back a:hover {
    color: rgba(255,255,255,0.8);
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #f1f5f9;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: #1e293b;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-sidebar.collapsed {
    width: 70px;
}

.admin-sidebar.collapsed .sidebar-link span,
.admin-sidebar.collapsed .nav-section-label,
.admin-sidebar.collapsed .brand-name,
.admin-sidebar.collapsed .sidebar-logout span {
    display: none;
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
}

.sidebar-logo svg {
    color: #818cf8;
    flex-shrink: 0;
}

.sidebar-logo span {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 0 0.5rem 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-link.active {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Main content area */
.admin-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

/* Top bar */
.admin-topbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
    display: flex;
    align-items: center;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.topbar-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── User dropdown ── */
.user-dropdown-wrap { position: relative; }

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: .35rem .6rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.user-dropdown-btn:hover { background: #f1f5f9; border-color: #e2e8f0; }

.user-chevron { color: #94a3b8; transition: transform .2s; }
.user-chevron.open { transform: rotate(180deg); }

.user-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 1001;
    overflow: hidden;
    animation: dropdownIn .15s ease;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    background: #f8fafc;
}
.user-dropdown-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.user-dropdown-name { font-size: .875rem; font-weight: 600; color: #1e293b; }
.user-dropdown-role { font-size: .75rem; color: #64748b; }

.user-dropdown-divider { height: 1px; background: #f1f5f9; margin: .25rem 0; }

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1rem;
    font-size: .875rem;
    color: #374151;
    text-decoration: none;
    transition: background .12s, color .12s;
    cursor: pointer;
}
.user-dropdown-item:hover { background: #f1f5f9; color: #1e293b; }
.user-dropdown-item svg { color: #94a3b8; flex-shrink: 0; }
.user-dropdown-logout { color: #ef4444; }
.user-dropdown-logout:hover { background: #fef2f2; color: #dc2626; }
.user-dropdown-logout svg { color: #ef4444; }

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Content area */
.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */

.dashboard-page {
    max-width: 1200px;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.dashboard-subtitle {
    color: #64748b;
    font-size: 0.95rem;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-blue .stat-icon { background: #eff6ff; color: #3b82f6; }
.stat-green .stat-icon { background: #f0fdf4; color: #22c55e; }
.stat-purple .stat-icon { background: #f5f3ff; color: #8b5cf6; }
.stat-orange .stat-icon { background: #fff7ed; color: #f97316; }

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.stat-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #22c55e;
    background: #f0fdf4;
    padding: 2px 8px;
    border-radius: 99px;
}

/* Section */
.dashboard-section {
    background: white;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* Table */
.cms-table {
    margin: 0;
    font-size: 0.875rem;
}

.cms-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    padding: 0.875rem 1.5rem;
}

.cms-table tbody td {
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
    color: #374151;
}

.cms-table tbody tr:last-child td {
    border-bottom: none;
}

.cms-table tbody tr:hover {
    background: #f8fafc;
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Quick actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
}

.quick-action-card {
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    padding: 1.5rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.quick-action-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

.quick-action-card svg {
    color: #6366f1;
    margin-bottom: 0.75rem;
}

.quick-action-card h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.quick-action-card p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

/* ============================================
   CRUD TOOLBAR
   ============================================ */

.crud-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.crud-search {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.crud-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.crud-search .form-control {
    padding-left: 2.4rem;
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.875rem;
}

.crud-search .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.crud-filter {
    width: auto;
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.875rem;
    color: #374151;
    min-width: 130px;
}

.crud-filter:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.table-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: right;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fade-in 0.15s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cms-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slide-up 0.2s ease;
    overflow: hidden;
}

.cms-modal-sm {
    max-width: 380px;
}

@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.cms-modal-header h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.btn-close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.2rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}

.btn-close-modal:hover {
    background: #f1f5f9;
    color: #374151;
}

.cms-modal-body {
    padding: 1.5rem;
}

.cms-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.delete-icon {
    display: flex;
    justify-content: center;
}

/* ============================================
   SLUG LINK
   ============================================ */

.slug-link {
    color: #6366f1;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: monospace;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.slug-link:hover {
    text-decoration: underline;
}

/* ============================================
   HTML PAGE EDITOR (full-screen overlay)
   ============================================ */

.editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    animation: fade-in 0.15s ease;
}

.editor-panel {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: 1% 20%;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    gap: 1rem;
    flex-shrink: 0;
}

/* ===== SEO ACCORDION ===== */
.seo-accordion { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }

.seo-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 1rem;
    background: #f8fafc;
    border: none;
    font-size: .85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}
.seo-accordion-toggle:hover { background: #f1f5f9; }

.seo-chevron { margin-left: auto; transition: transform .2s; }
.seo-chevron.open { transform: rotate(180deg); }

.seo-panel {
    padding: 1rem;
    background: #fafbff;
    border-top: 1px solid #e2e8f0;
}

.seo-label { display: flex; align-items: center; gap: .4rem; font-weight: 500; margin-bottom: .35rem; }

.seo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .1rem .4rem;
    border-radius: 4px;
    font-size: .65rem;
    font-weight: 700;
    background: #dbeafe;
    color: #1d4ed8;
    letter-spacing: .04em;
}
.og-badge    { background: #e0e7ff; color: #4338ca; }
.robots-badge{ background: #fef3c7; color: #92400e; }

/* SERP Preview */
.serp-preview { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; }
.serp-label { font-size: .7rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; }

.serp-card { max-width: 540px; }
.serp-url  { font-size: .78rem; color: #16a34a; margin-bottom: .2rem; }
.serp-title{ font-size: 1.05rem; color: #1a0dab; font-weight: 400; line-height: 1.3; margin-bottom: .25rem; cursor: pointer; }
.serp-title:hover { text-decoration: underline; }
.serp-desc { font-size: .83rem; color: #4d5156; line-height: 1.5; }
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.editor-publish-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    user-select: none;
}

.editor-publish-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
}

.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

.editor-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #e2e8f0;
}

.editor-fields {
    padding: 1.25rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.editor-fields .form-control {
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.875rem;
}

.editor-fields .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.html-editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.html-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: #1e293b;
    flex-shrink: 0;
}

.editor-lang-badge {
    background: #6366f1;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.editor-hint {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
}

/* ============================================
   MEDIA PICKER (inline in Pages editor)
   ============================================ */
.media-picker-overlay {
    z-index: 3000;
}

.media-picker-modal {
    background: #fff;
    border-radius: 14px;
    width: 860px;
    max-width: 96vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.28);
    animation: modalIn 0.18s ease;
}

.media-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.media-picker-header h5 { color: #1e293b; }

.media-picker-filter {
    width: 140px;
    font-size: .83rem;
}

.media-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: #f1f5f9;
}

.media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .75rem;
}

.media-picker-item {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s, transform .12s;
    display: flex;
    flex-direction: column;
}

.media-picker-item:hover {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
    transform: translateY(-2px);
}

.media-picker-item.selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99,102,241,.22);
}

.media-picker-thumb {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.media-picker-icon-wrap {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.media-picker-name {
    font-size: .7rem;
    color: #475569;
    padding: .3rem .4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
}

.media-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
    gap: 1rem;
}

.media-picker-selected-info {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}


.html-editor {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    padding: 1.25rem;
    background: #0f172a;
    color: #e2e8f0;
    tab-size: 2;
}

.html-editor::placeholder {
    color: rgba(255,255,255,0.2);
}

/* Preview panel */
.editor-preview {
    width: 45%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    flex-shrink: 0;
}

.preview-iframe {
    flex: 1;
    border: none;
    background: white;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

/* ===== MEDIA LIBRARY ===== */

/* Upload button */
.media-upload-btn { cursor: pointer; position: relative; }
.media-upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Upload progress bar */
.media-upload-progress {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem 1rem; background: #f0f9ff; border: 1px solid #bae6fd;
    border-radius: 8px; margin-bottom: 1rem; font-size: .85rem; color: #0369a1;
}

/* Empty state */
.media-empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 1rem; padding: 4rem 2rem;
    text-align: center; color: #94a3b8;
}
.media-empty-state p { max-width: 360px; margin: 0; font-size: .9rem; }

/* ---- Grid ---- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding-bottom: 2rem;
}

.media-card {
    border: 2px solid #e2e8f0; border-radius: 10px;
    overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s;
    background: white;
}
.media-card:hover  { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.media-card.selected { border-color: #6366f1; box-shadow: 0 0 0 3px #e0e7ff; }

.media-thumb {
    width: 100%; aspect-ratio: 1;
    background: #f8fafc; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.media-icon-thumb {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
.thumb-doc   { color: #f59e0b; }
.thumb-video { color: #6366f1; }
.thumb-image { color: #10b981; }
.thumb-other { color: #64748b; }

.media-card-name {
    padding: .35rem .5rem; font-size: .73rem; color: #475569;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-top: 1px solid #f1f5f9;
}

/* ---- List icon ---- */
.media-list-icon {
    width: 36px; height: 36px; display: flex; align-items: center;
    justify-content: center; border-radius: 6px; background: #f8fafc;
}

/* ===== Detail Panel ===== */
.media-detail-overlay {
    position: fixed; inset: 0; z-index: 1040;
    background: rgba(0,0,0,.25);
}
.media-detail-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 320px;
    z-index: 1050; background: white;
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
    display: flex; flex-direction: column; overflow-y: auto;
    animation: slideInRight .2s ease;
}
@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.media-detail-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1rem .75rem; border-bottom: 1px solid #e2e8f0;
    position: sticky; top: 0; background: white; z-index: 1;
}

.media-detail-preview {
    padding: 1rem; background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
    min-height: 160px; border-bottom: 1px solid #e2e8f0;
}
.media-detail-preview img {
    max-width: 100%; max-height: 220px; border-radius: 6px;
    object-fit: contain;
}
.media-detail-icon-wrap {
    display: flex; align-items: center; justify-content: center;
    width: 80px; height: 80px; border-radius: 12px;
    background: white; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.media-detail-info {
    padding: .75rem 1rem; border-bottom: 1px solid #e2e8f0;
}
.media-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: .25rem 0; font-size: .8rem;
}
.media-info-row > span:first-child { color: #94a3b8; flex-shrink: 0; width: 60px; }

/* URL box */
.media-url-box { padding: .75rem 1rem; border-bottom: 1px solid #e2e8f0; }
.media-url-row { display: flex; gap: .35rem; }
.media-url-row .form-control { font-size: .75rem; font-family: monospace; color: #374151; }

.media-detail-footer {
    padding: 1rem; margin-top: auto;
    border-top: 1px solid #e2e8f0;
}

/* ============================================
   PUBLIC LAYOUT (PublicLayout.razor)
   ============================================ */
.pub-header {
    background: #1e293b;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.pub-header-inner { max-width: 1200px; margin: 0 auto; padding: .85rem 1.5rem; display: flex; align-items: center; }
.pub-logo { font-size: 1.35rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -.5px; }
.pub-logo:hover { color: #a5b4fc; }
.pub-logo-img { display: inline-flex; align-items: center; }
.pub-logo-img img { max-height: 50px; width: auto; }

.pub-nav { background: #0f172a; }
.pub-nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.pub-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; }
.pub-menu li a { display: block; padding: .6rem .9rem; color: #cbd5e1; text-decoration: none; font-size: .9rem; border-radius: 4px; transition: color .15s, background .15s; }
.pub-menu li a:hover { color: #fff; background: rgba(255,255,255,.08); }

.pub-main { min-height: 60vh; }

.pub-footer { background: #1e293b; color: #94a3b8; margin-top: 3rem; }
.pub-footer-inner { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: .6rem; }
.pub-footer-contact { font-size: .85rem; }
.pub-footer-contact a { color: #94a3b8; text-decoration: none; }
.pub-footer-contact a:hover { color: #fff; }
.pub-footer-copy { font-size: .8rem; color: #64748b; margin-top: .25rem; }
.pub-social-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.pub-social-link { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; background: rgba(255,255,255,.08); color: #cbd5e1; text-decoration: none; font-size: .8rem; font-weight: 700; transition: background .15s, color .15s; }
.pub-social-link:hover { background: #6366f1; color: #fff; }

/* ── Maintenance Page ── */
.maintenance-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f8fafc; }
.maintenance-inner { text-align: center; padding: 3rem; max-width: 480px; }
.maintenance-inner h1 { font-size: 2rem; font-weight: 700; color: #1e293b; margin-top: 1.25rem; }
.maintenance-inner p { color: #475569; font-size: 1.05rem; }

/* ============================================
   ADMIN SETTINGS PAGE (Settings.razor)
   ============================================ */
.settings-tabs { display: flex; gap: 0; border-bottom: 1px solid #e2e8f0; background: #f8fafc; flex-wrap: wrap; }
.settings-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: .65rem 1.25rem; font-size: .9rem; font-weight: 500; color: #64748b; cursor: pointer; transition: color .15s, border-color .15s; white-space: nowrap; }
.settings-tab:hover { color: #1e293b; }
.settings-tab.active { color: #6366f1; border-bottom-color: #6366f1; background: #fff; }
.settings-body { padding: 1.75rem; }
.settings-footer { padding: 1rem 1.75rem; border-top: 1px solid #e2e8f0; background: #f8fafc; display: flex; align-items: center; gap: .75rem; }
.settings-section { max-width: 860px; }
.settings-section-title { font-size: .95rem; font-weight: 700; color: #1e293b; padding-bottom: .6rem; margin-bottom: 1.25rem; border-bottom: 1px solid #e2e8f0; }

/* Social icon badges */
.social-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; font-size: .7rem; font-weight: 700; color: #fff; margin-right: 4px; }
.social-icon.facebook  { background: #1877f2; }
.social-icon.twitter   { background: #000; }
.social-icon.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-icon.linkedin  { background: #0a66c2; }
.social-icon.youtube   { background: #ff0000; }

/* SERP preview */
.serp-preview { border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem 1.25rem; background: #fff; max-width: 600px; }
.serp-heading { font-size: .75rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.serp-title { color: #1a0dab; font-size: 1.05rem; font-weight: 500; line-height: 1.3; }
.serp-url { color: #188038; font-size: .8rem; margin: .15rem 0 .35rem; }
.serp-desc { color: #4d5156; font-size: .85rem; line-height: 1.5; }
.pub-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pub-logo {
    color: #f1f5f9;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -.02em;
}
.pub-logo:hover { color: #a5b4fc; }

.pub-nav {
    background: #0f172a;
    border-bottom: 2px solid #312e81;
}
.pub-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.pub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
}
.pub-menu li a {
    display: block;
    padding: .65rem 1.1rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.pub-menu li a:hover,
.pub-menu li a.active {
    color: #a5b4fc;
    background: rgba(99,102,241,.12);
}

/* Dropdown nav */
.pub-menu li { position: relative; }

.pub-caret {
    margin-left: 4px;
    opacity: .6;
    vertical-align: middle;
    transition: transform .2s;
}
.pub-caret--right { margin-left: auto; }

.pub-has-sub > a { display: flex; align-items: center; gap: 2px; }

.pub-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,.08);
    border-top: 2px solid #6366f1;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    z-index: 200;
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.pub-submenu li a {
    padding: .5rem 1rem;
    font-size: .875rem;
    color: #cbd5e1;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pub-submenu li a:hover { color: #a5b4fc; background: rgba(99,102,241,.12); }

/* Deep (level-3) submenu — opens to the right */
.pub-submenu--deep {
    top: 0;
    left: 100%;
    border-top: 1px solid rgba(255,255,255,.08);
    border-radius: 0 8px 8px 0;
    margin-top: 0;
}

/* Show on hover / focus-within */
.pub-has-sub:hover > .pub-submenu,
.pub-has-sub:focus-within > .pub-submenu { display: block; }

.pub-has-sub:hover > a .pub-caret { transform: rotate(-180deg); }

.pub-main {
    min-height: calc(100vh - 250px);
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pub-footer {
    background: #1e293b;
    color: #94a3b8;
    margin-top: auto;
}
.pub-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    text-align: center;
    font-size: .85rem;
}

/* ============================================
   THEMES ADMIN (Themes.razor)
   ============================================ */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}
.theme-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, border-color .2s;
}
.theme-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.1); }
.theme-card-active {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.theme-card-top {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 1.5rem 1.25rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.theme-card-active .theme-card-top {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}
.theme-preview-swatch {
    width: 56px; height: 56px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.theme-card-body {
    padding: 1rem 1.25rem;
    flex: 1;
}
.theme-card-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .2rem;
    font-size: 1rem;
}
.theme-card-desc {
    color: #64748b;
    font-size: .82rem;
    margin-bottom: .5rem;
}
.theme-card-badges .badge { font-size: .7rem; }
.theme-card-date {
    font-size: .72rem;
    color: #94a3b8;
    margin-top: .6rem;
}
.theme-card-footer {
    padding: .85rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    gap: .5rem;
    align-items: center;
}

/* ============================================
   THEME EDITOR TABS
   ============================================ */
.theme-editor-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
    padding: 0 1.25rem;
    flex-shrink: 0;
}
.theme-tab {
    position: relative;
    background: none;
    border: none;
    padding: .75rem 1.1rem .6rem;
    font-size: .875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.theme-tab:hover { color: #334155; }
.theme-tab.active { color: #6366f1; border-bottom-color: #6366f1; }
.theme-tab-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
}
.theme-editor-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-lang-badge {
    display: inline-block;
    background: #334155;
    color: #94a3b8;
    font-size: .7rem;
    font-family: monospace;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 4px;
    letter-spacing: .06em;
}
.editor-hint {
    font-size: .78rem;
    color: #94a3b8;
    margin-left: .75rem;
}
