/* =====================================================
   ADMIN LAYOUT STYLES
   Full-screen admin interface with fixed header, 350px sidebar, content area
   Mobile-first responsive design with hamburger menu
   WCAG 2.1 AA compliant (touch targets, contrast, focus indicators)
   ===================================================== */

/* =====================================================
   CSS VARIABLES FOR ADMIN LAYOUT
   ===================================================== */

:root {
    --admin-header-height: 60px;
    --admin-sidebar-width: 350px;
    --admin-sidebar-width-tablet: 280px;
    --admin-sidebar-width-mobile: 280px;
}

/* =====================================================
   ADMIN LAYOUT STRUCTURE
   ===================================================== */

.admin-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-light, #f9fafb);
}

/* =====================================================
   ADMIN HEADER
   ===================================================== */

.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--admin-header-height);
    z-index: 100;
    background: var(--bg-white, #ffffff);
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.3));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.admin-header-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
    max-width: 100%;
    gap: 1rem;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.admin-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.admin-community-name {
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-label {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--community-primary, #6A4A9E);
    background: rgba(106, 74, 158, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    white-space: nowrap;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Hamburger Button - Hidden on desktop */
.admin-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-primary, #1f2937);
    transition: background 0.2s;
    flex-shrink: 0;
}

.admin-hamburger:hover {
    background: var(--glass-white, rgba(255, 255, 255, 0.8));
}

.admin-hamburger:focus-visible {
    outline: 3px solid var(--community-primary, #6A4A9E);
    outline-offset: 2px;
}

.admin-hamburger i {
    font-size: 1.25rem;
}

/* Header Buttons - Close and Sign Out */
.admin-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    font-family: inherit;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px; /* WCAG 2.1 AA touch target */
    white-space: nowrap;
    text-decoration: none !important;
}

.admin-header-btn:focus-visible {
    outline: 3px solid var(--community-primary, #6A4A9E);
    outline-offset: 2px;
}

/* Secondary button - transparent with border */
.admin-header-btn-secondary {
    background: transparent;
    color: var(--text-primary, #1f2937);
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

.admin-header-btn-secondary:hover {
    background: var(--glass-white, rgba(255, 255, 255, 0.8));
    border-color: var(--community-primary, #6A4A9E);
    color: var(--community-primary, #6A4A9E);
}

/* Outline button - border with community primary color hint */
.admin-header-btn-outline {
    background: transparent;
    color: var(--text-secondary, #4B5563);
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

.admin-header-btn-outline:hover {
    background: rgba(220, 38, 38, 0.05);
    border-color: var(--error, #DC2626);
    color: var(--error, #DC2626);
}

/* =====================================================
   ADMIN BODY (SIDEBAR + CONTENT)
   ===================================================== */

.admin-body {
    display: flex;
    margin-top: var(--admin-header-height);
    min-height: calc(100vh - var(--admin-header-height));
    background: var(--bg-white, #ffffff);
}

/* =====================================================
   ADMIN SIDEBAR
   ===================================================== */

.admin-sidebar {
    width: var(--admin-sidebar-width);
    min-width: var(--admin-sidebar-width);
    height: calc(100vh - var(--admin-header-height));
    position: fixed;
    left: 0;
    top: var(--admin-header-height);
    background: var(--bg-white, #ffffff);
    border-right: 1px solid var(--glass-border, rgba(255, 255, 255, 0.3));
    overflow: hidden; /* Non-scrollable as requested */
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    z-index: 50;
}

/* Menu Section */
.admin-menu-section {
    margin-bottom: 1.5rem;
}

.admin-menu-header {
    padding: 0.5rem 1.5rem;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 600;
    color: var(--text-secondary, #4B5563);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Menu Item */
.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-primary, #1f2937);
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    min-height: 48px; /* WCAG 2.1 AA touch target */
    border-left: 3px solid transparent;
    position: relative;
}

.admin-menu-item:hover:not(.disabled) {
    background: var(--glass-white, rgba(255, 255, 255, 0.8));
    text-decoration: none !important;
}

.admin-menu-item:visited,
.admin-menu-item:active,
.admin-menu-item:focus {
    text-decoration: none !important;
}

.admin-menu-item:focus-visible {
    outline: 3px solid var(--community-primary, #6A4A9E);
    outline-offset: -3px;
}

.admin-menu-item.active {
    background: rgba(106, 74, 158, 0.1);
    color: var(--community-primary, #6A4A9E);
    border-left-color: var(--community-primary, #6A4A9E);
}

.admin-menu-item.active i {
    color: var(--community-primary, #6A4A9E);
}

.admin-menu-item.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.admin-menu-item i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
    color: var(--text-secondary, #4B5563);
    flex-shrink: 0;
}

.admin-menu-item span {
    font-size: var(--font-size-base, 1rem);
    font-weight: 500;
    text-decoration: none !important;
}

/* Coming Soon Badge */
.admin-menu-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    background: var(--glass-border, rgba(0, 0, 0, 0.1));
    color: var(--text-secondary, #4B5563);
    margin-left: auto;
}

/* =====================================================
   ADMIN CONTENT
   ===================================================== */

.admin-content {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    padding: 0 0.75rem 0.75rem 0.75rem;
    overflow-y: auto;
    background: var(--bg-white, #ffffff);
    min-height: calc(100vh - var(--admin-header-height));
}

/* Admin Page Container */
.admin-page {
    background: var(--bg-white, #ffffff);
    border-radius: 0 0 0.75rem 0.75rem;
    padding: 0;
    min-height: 200px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   MOBILE OVERLAY
   ===================================================== */

.admin-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.admin-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =====================================================
   RESPONSIVE - TABLET (max-width: 1024px)
   ===================================================== */

@media (max-width: 1024px) {
    :root {
        --admin-sidebar-width: var(--admin-sidebar-width-tablet);
    }

    .admin-sidebar {
        width: var(--admin-sidebar-width-tablet);
        min-width: var(--admin-sidebar-width-tablet);
    }

    .admin-content {
        margin-left: var(--admin-sidebar-width-tablet);
        padding: 0 0.5rem 0.5rem 0.5rem;
    }
}

/* =====================================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ===================================================== */

@media (max-width: 768px) {
    /* Show hamburger button on mobile */
    .admin-hamburger {
        display: flex;
    }

    /* Sidebar slides in from left */
    .admin-sidebar {
        position: fixed;
        left: -300px;
        width: var(--admin-sidebar-width-mobile);
        min-width: var(--admin-sidebar-width-mobile);
        height: 100vh;
        top: 0;
        padding-top: calc(var(--admin-header-height) + 1rem);
        transition: left 0.3s ease-in-out;
        z-index: 200;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .admin-sidebar.open {
        left: 0;
    }

    /* Show overlay when sidebar is open */
    .admin-overlay {
        display: block;
    }

    /* Content takes full width */
    .admin-content {
        margin-left: 0;
        padding: 0 0.375rem 0.375rem 0.375rem;
    }

    /* Header adjustments */
    .admin-header-content {
        padding: 0 0.75rem;
    }

    .admin-logo {
        height: 28px;
    }

    .admin-community-name {
        font-size: var(--font-size-base, 1rem);
    }

    .admin-label {
        font-size: var(--font-size-xs, 0.75rem);
        padding: 0.125rem 0.5rem;
    }

    /* Header buttons - smaller on mobile */
    .admin-header-btn {
        padding: 0.375rem 0.75rem;
        font-size: var(--font-size-xs, 0.75rem);
    }

    /* Page container adjustments */
    .admin-page {
        padding: 1rem;
        border-radius: 0 0 0.75rem 0.75rem;
    }
}

/* =====================================================
   ADMIN LAYOUT SKELETON STYLES
   ===================================================== */

.admin-layout-skeleton {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-light, #f9fafb);
}

/* Skeleton Header */
.admin-skeleton-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--admin-header-height);
    background: var(--bg-white, #ffffff);
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.3));
    z-index: 100;
}

.admin-skeleton-header-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
    gap: 1rem;
}

.admin-skeleton-hamburger {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    display: none;
}

.admin-skeleton-logo {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.admin-skeleton-community-name {
    width: 150px;
    height: 20px;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    animation-delay: 0.1s;
}

.admin-skeleton-admin-label {
    width: 60px;
    height: 24px;
    border-radius: 1rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    animation-delay: 0.2s;
}

/* Skeleton Body */
.admin-skeleton-body {
    display: flex;
    margin-top: var(--admin-header-height);
    min-height: calc(100vh - var(--admin-header-height));
}

/* Skeleton Sidebar */
.admin-skeleton-sidebar {
    width: var(--admin-sidebar-width);
    min-width: var(--admin-sidebar-width);
    height: calc(100vh - var(--admin-header-height));
    background: var(--bg-white, #ffffff);
    border-right: 1px solid var(--glass-border, rgba(255, 255, 255, 0.3));
    padding: 1.5rem 0;
}

.admin-skeleton-menu-section {
    margin-bottom: 1.5rem;
}

.admin-skeleton-menu-header {
    width: 80px;
    height: 12px;
    margin: 0.5rem 1.5rem;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.admin-skeleton-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
}

.admin-skeleton-menu-icon {
    width: 24px;
    height: 24px;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.admin-skeleton-menu-label {
    width: 100px;
    height: 16px;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    animation-delay: 0.1s;
}

/* Skeleton Content */
.admin-skeleton-content {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    padding: 2rem;
    padding-top: 0;
}

.admin-skeleton-content-card {
    background: var(--bg-white, #ffffff);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-skeleton-content-title {
    width: 200px;
    height: 24px;
    margin-bottom: 1.5rem;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.admin-skeleton-content-line {
    height: 16px;
    margin-bottom: 0.75rem;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.admin-skeleton-content-line.full {
    width: 100%;
}

.admin-skeleton-content-line.long {
    width: 80%;
    animation-delay: 0.1s;
}

.admin-skeleton-content-line.medium {
    width: 60%;
    animation-delay: 0.2s;
}

/* Mobile skeleton adjustments */
@media (max-width: 768px) {
    .admin-skeleton-hamburger {
        display: block;
    }

    .admin-skeleton-sidebar {
        display: none;
    }

    .admin-skeleton-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 0;
    }
}

@media (max-width: 1024px) {
    .admin-skeleton-sidebar {
        width: var(--admin-sidebar-width-tablet);
        min-width: var(--admin-sidebar-width-tablet);
    }

    .admin-skeleton-content {
        margin-left: var(--admin-sidebar-width-tablet);
        padding: 1.5rem;
        padding-top: 0;
    }
}

/* Skeleton Animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .admin-skeleton-hamburger,
    .admin-skeleton-logo,
    .admin-skeleton-community-name,
    .admin-skeleton-admin-label,
    .admin-skeleton-menu-header,
    .admin-skeleton-menu-icon,
    .admin-skeleton-menu-label,
    .admin-skeleton-content-title,
    .admin-skeleton-content-line {
        animation: none;
        background: #e0e0e0;
    }

    .admin-sidebar,
    .admin-overlay {
        transition: none;
    }
}

/* =====================================================
   UNAUTHORIZED MODAL STYLES
   ===================================================== */

.admin-unauthorized-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.admin-unauthorized-modal {
    background: var(--bg-white, #ffffff);
    border-radius: 1rem;
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.admin-unauthorized-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 0.5rem;
    object-fit: contain;
}

.admin-unauthorized-icon {
    font-size: 3rem;
    color: var(--error, #DC2626);
    margin-bottom: 1rem;
}

.admin-unauthorized-title {
    font-size: var(--font-size-xl, 1.25rem);
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin-bottom: 0.75rem;
}

.admin-unauthorized-message {
    font-size: var(--font-size-base, 1rem);
    color: var(--text-secondary, #4B5563);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.admin-unauthorized-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--community-primary, #6A4A9E);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: var(--font-size-base, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    min-height: 48px;
    min-width: 200px;
}

.admin-unauthorized-button:hover {
    background: var(--primary-dark, #5a3a8e);
    transform: translateY(-1px);
}

.admin-unauthorized-button:focus-visible {
    outline: 3px solid var(--community-primary, #6A4A9E);
    outline-offset: 2px;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
    .admin-header,
    .admin-hamburger,
    .admin-overlay,
    .admin-sidebar {
        display: none !important;
    }

    .admin-content {
        margin-left: 0;
        padding: 0;
    }

    .admin-page {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* =====================================================
   ADMIN GRID & FLYOUT STYLES
   CSS patterns copied from runevents.CrmIntegration.Web
   Used by ArticlesAdmin, MembersAdmin, and similar pages
   ===================================================== */

/* =====================================================
   ADMIN GRID & FLYOUT CSS VARIABLES
   ===================================================== */

:root {
    --admin-primary: #6A4A9E;
    --admin-secondary: #EE265A;
    --admin-tertiary: #7BCED7;
    --admin-bg-main: #ffffff;
    --admin-bg-secondary: #f8f9fa;
    --admin-bg-tertiary: #f0f2f5;
    --admin-text-primary: #1a1a1a;
    --admin-text-secondary: #6c757d;
    --admin-border-color: #e0e0e0;
    --admin-hover-bg: #f5f5f5;
    --admin-shadow: rgba(0, 0, 0, 0.1);
    --admin-shadow-hover: rgba(0, 0, 0, 0.15);
}

/* =====================================================
   ADMIN SCROLLBAR STYLING
   ===================================================== */

.admin-content ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.admin-content ::-webkit-scrollbar-track {
    background: var(--admin-bg-secondary);
}

.admin-content ::-webkit-scrollbar-thumb {
    background: var(--admin-border-color);
    border-radius: 4px;
}

.admin-content ::-webkit-scrollbar-thumb:hover {
    background: var(--admin-primary);
}

/* =====================================================
   ADMIN PAGE HEADER
   ===================================================== */

.admin-page-header {
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--admin-border-color);
    background: var(--admin-bg-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px var(--admin-shadow);
}

.admin-page-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--admin-text-primary);
    flex-shrink: 0;
    margin: 0;
}

.admin-page-title .count {
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
    font-weight: 400;
}

.admin-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* Inline Search */
.admin-inline-search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--admin-bg-main);
    border: 1px solid var(--admin-border-color);
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
}

.admin-inline-search-wrapper:focus-within {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(106, 74, 158, 0.08);
}

.admin-inline-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: var(--admin-text-primary);
    outline: none;
    padding: 0;
    font-family: inherit;
}

.admin-inline-search-input::placeholder {
    color: var(--admin-text-secondary);
}

.admin-clear-search {
    background: transparent;
    border: none;
    color: var(--admin-text-secondary);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.admin-clear-search:hover {
    background: var(--admin-bg-tertiary);
    color: var(--admin-text-primary);
}

.admin-clear-search:focus-visible {
    outline: 3px solid var(--admin-primary);
    outline-offset: 2px;
}

/* Header Buttons */
.admin-action-btn {
    padding: 0.5rem 0.875rem;
    background: var(--admin-bg-main);
    border: 1px solid var(--admin-border-color);
    border-radius: 6px;
    color: var(--admin-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-family: inherit;
    min-height: 36px;
}

.admin-action-btn:hover {
    background: var(--admin-hover-bg);
    border-color: var(--admin-primary);
}

.admin-action-btn:focus-visible {
    outline: 3px solid var(--admin-primary);
    outline-offset: 2px;
}

.admin-action-btn.primary {
    background: var(--admin-primary);
    color: white;
    border-color: var(--admin-primary);
}

.admin-action-btn.primary:hover {
    background: #5a3a8e;
}

/* =====================================================
   ADMIN GRID CONTAINER
   ===================================================== */

.admin-grid-container {
    padding: 0;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
    height: auto;
}

.admin-grid {
    background: var(--admin-bg-main);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    margin-right: 0;
}

/* Grid Header */
.admin-grid-header {
    display: grid;
    padding: 0.5rem 1.5rem;
    background: var(--admin-bg-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--admin-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--admin-border-color);
    align-items: center;
}

/* Grid Row */
.admin-grid-row {
    display: grid;
    padding: 0.625rem 1.5rem;
    border-bottom: 1px solid var(--admin-border-color);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
    background: var(--admin-bg-main);
    align-items: center;
}

.admin-grid-row:hover {
    background: var(--admin-hover-bg);
}

.admin-grid-row.selected {
    background: rgba(106, 74, 158, 0.05);
    box-shadow: inset 4px 0 0 var(--admin-secondary);
}

/* Grid Cell Types */
.admin-grid-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-grid-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 2px solid var(--admin-border-color);
    border-radius: 3px;
    cursor: pointer;
    appearance: none;
    background: var(--admin-bg-main);
    transition: all 0.2s ease;
}

.admin-grid-checkbox input[type="checkbox"]:checked {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.admin-grid-id {
    color: var(--admin-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.admin-grid-name {
    font-weight: 500;
    color: var(--admin-text-primary);
    font-size: 0.875rem;
}

.admin-grid-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.admin-grid-status.published {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.admin-grid-status.draft {
    background: rgba(107, 114, 128, 0.1);
    color: #6B7280;
}

/* Grid cell base style for compact appearance */
.admin-grid-row [role="cell"] {
    font-size: 0.8125rem;
    color: var(--admin-text-secondary);
}

/* Empty State */
.admin-grid-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--admin-text-secondary);
}

.admin-grid-empty i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.admin-grid-empty h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--admin-text-primary);
    margin-bottom: 0.25rem;
}

/* Articles Grid Specific Columns */
.articles-grid-header,
.articles-grid-row {
    grid-template-columns: 32px 60px 2fr 100px 1fr 110px;
    gap: 0.5rem;
    /* checkbox | ID | Title | Status | Author | PublishDate */
}

/* Videos Grid Specific Columns */
.videos-grid-header,
.videos-grid-row {
    grid-template-columns: 32px 60px 2fr 100px 100px 1fr 110px;
    gap: 0.5rem;
    /* checkbox | ID | Title | Status | StreamType | Author | PublishDate */
}

/* Video Stream Type Badge */
.admin-grid-stream-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    background-color: var(--admin-bg-secondary);
    color: var(--admin-text-secondary);
}

/* Admin Grid Loading State */
.admin-grid-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--admin-text-secondary);
    gap: 1rem;
}

.admin-grid-loading .fa-spinner {
    font-size: 2rem;
}

/* Flyout loading state */
.admin-flyout-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--admin-text-secondary);
    gap: 1rem;
    height: 100%;
}

.admin-flyout-loading .fa-spinner {
    font-size: 2rem;
}

/* Label badges for flyout */
.admin-label-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    background-color: var(--admin-bg-tertiary);
    color: var(--admin-text-primary);
}

.admin-text-muted {
    color: var(--admin-text-secondary);
    font-style: italic;
}

/* =====================================================
   ADMIN FLYOUT
   ===================================================== */

.admin-flyout {
    position: fixed;
    right: -50%;
    top: 0;
    width: 50%;
    height: 100vh;
    background: var(--admin-bg-main);
    border-left: 1px solid var(--admin-border-color);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1000;
}

.admin-flyout.active {
    right: 0;
    box-shadow: -10px 0 40px var(--admin-shadow);
}

/* Flyout Header */
.admin-flyout-header {
    padding: 2rem;
    border-bottom: 1px solid var(--admin-border-color);
    background: var(--admin-bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-flyout-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--admin-text-primary);
}

.admin-flyout-subtitle {
    color: var(--admin-text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.admin-flyout-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background: var(--admin-bg-main);
    border: 1px solid var(--admin-border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--admin-text-primary);
    font-size: 1.25rem;
}

.admin-flyout-close:hover {
    background: var(--admin-secondary);
    color: white;
    transform: rotate(90deg);
}

.admin-flyout-close:focus-visible {
    outline: 3px solid var(--admin-primary);
    outline-offset: 2px;
}

/* =====================================================
   ADMIN TABS
   ===================================================== */

.admin-tabs-container {
    border-bottom: 1px solid var(--admin-border-color);
    background: var(--admin-bg-secondary);
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
    overflow-x: auto;
}

.admin-tab {
    padding: 1rem 0;
    cursor: pointer;
    color: var(--admin-text-secondary);
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    min-height: 44px;
}

.admin-tab:hover {
    color: var(--admin-text-primary);
}

.admin-tab.active {
    color: var(--admin-primary);
}

.admin-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--admin-primary);
    border-radius: 3px 3px 0 0;
}

.admin-tab:focus-visible {
    outline: 3px solid var(--admin-primary);
    outline-offset: 2px;
}

.admin-tab-content {
    padding: 2rem;
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: adminFadeIn 0.3s ease;
}

@keyframes adminFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   ADMIN DETAIL SECTIONS
   ===================================================== */

.admin-detail-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--admin-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--admin-border-color);
}

.admin-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--admin-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-detail-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--admin-border-color);
    align-items: center;
}

.admin-detail-row:last-child {
    border-bottom: none;
}

.admin-detail-label {
    flex: 0 0 140px;
    color: var(--admin-text-secondary);
    font-size: 0.9rem;
}

.admin-detail-value {
    flex: 1;
    color: var(--admin-text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-edit-icon {
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.admin-detail-row:hover .admin-edit-icon {
    opacity: 1;
}

.admin-edit-icon:hover {
    color: var(--admin-primary);
    transform: scale(1.2);
}

/* =====================================================
   ADMIN BADGES
   ===================================================== */

.admin-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.admin-badge.primary {
    background: rgba(106, 74, 158, 0.2);
    color: var(--admin-primary);
}

.admin-badge.secondary {
    background: rgba(238, 38, 90, 0.2);
    color: var(--admin-secondary);
}

.admin-badge.tertiary {
    background: rgba(123, 206, 215, 0.2);
    color: var(--admin-tertiary);
}

/* =====================================================
   ADMIN GRID/FLYOUT RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .admin-page-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .admin-inline-search-wrapper {
        max-width: 100%;
        margin: 0;
        order: 3;
        flex: 1 1 100%;
    }

    .admin-grid-container {
        padding: 0;
    }

    .admin-grid {
        margin-right: 0;
    }

    .admin-flyout {
        width: 70%;
        right: -70%;
    }
}

@media (max-width: 768px) {
    .admin-page-header {
        padding: 0.625rem 0.75rem;
    }

    .admin-page-title {
        font-size: 1rem;
    }

    .admin-grid-container {
        padding: 0;
        max-height: calc(100vh - 160px);
    }

    .admin-grid {
        margin-right: 0;
    }

    .admin-grid-header {
        padding: 0.375rem 0.625rem;
        font-size: 0.6875rem;
    }

    .admin-grid-row {
        padding: 0.5rem 0.625rem;
    }

    .admin-flyout {
        width: 100%;
        right: -100%;
    }

    .admin-flyout-header {
        padding: 1rem;
    }

    .admin-tabs-container {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .admin-tab-content {
        padding: 0.75rem;
    }

    .admin-detail-section {
        padding: 0.75rem;
    }

    .admin-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
    }

    .admin-detail-label {
        flex: none;
    }
}

/* ===========================================
   ADMIN FORM STYLES
   Form inputs, labels, and validation states
   =========================================== */

/* Form Groups */
.admin-form-group {
    margin-bottom: 1.25rem;
}

.admin-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-text-secondary);
    margin-bottom: 0.5rem;
}

.admin-form-label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

/* Text Inputs and Selects */
.admin-form-input,
.admin-form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--admin-text-primary);
    background: var(--admin-bg-main);
    border: 1px solid var(--admin-border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    min-height: 44px; /* WCAG 2.1 AA touch target */
}

.admin-form-input:hover,
.admin-form-select:hover {
    border-color: var(--admin-primary);
}

.admin-form-input:focus,
.admin-form-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.admin-form-input::placeholder {
    color: var(--admin-text-muted);
}

.admin-form-input.invalid {
    border-color: #ef4444;
}

.admin-form-input.invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Select dropdown arrow */
.admin-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Textarea styling */
.admin-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--admin-text-primary);
    background: var(--admin-bg-main);
    border: 1px solid var(--admin-border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.admin-form-textarea:hover {
    border-color: var(--admin-primary);
}

.admin-form-textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.admin-form-textarea::placeholder {
    color: var(--admin-text-muted);
}

/* Static display (non-editable field) */
.admin-form-static {
    padding: 0.75rem 0;
    color: var(--admin-text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Hint text below inputs */
.admin-form-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--admin-text-muted);
    margin-top: 0.375rem;
    font-style: italic;
}

/* Error message */
.admin-form-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.875rem;
}

/* Labels Multi-Select */
.admin-labels-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-label-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
}

.admin-label-checkbox:hover {
    border-color: var(--admin-primary);
}

.admin-label-checkbox.selected {
    background: var(--label-color, var(--admin-primary));
    border-color: var(--label-color, var(--admin-primary));
    color: white;
}

.admin-label-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-label-checkbox-indicator {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-label-checkbox.selected .admin-label-checkbox-indicator::after {
    content: '\f00c'; /* Font Awesome check */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.625rem;
}

.admin-label-checkbox-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Flyout Footer */
.admin-flyout-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--admin-bg-secondary);
    border-top: 1px solid var(--admin-border-color);
    margin-top: auto;
}

/* Form Buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px; /* WCAG 2.1 AA touch target */
    min-width: 100px;
    border: none;
}

.admin-btn:focus-visible {
    outline: 3px solid var(--admin-primary);
    outline-offset: 2px;
}

.admin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.admin-btn-primary {
    background: var(--admin-primary);
    color: white;
}

.admin-btn-primary:hover:not(:disabled) {
    background: #5a3a8e;
    transform: translateY(-1px);
}

.admin-btn-secondary {
    background: var(--admin-bg-main);
    color: var(--admin-text-primary);
    border: 1px solid var(--admin-border-color);
}

.admin-btn-secondary:hover:not(:disabled) {
    background: var(--admin-hover-bg);
    border-color: var(--admin-primary);
}

/* Responsive adjustments for flyout form */
@media (max-width: 768px) {
    .admin-flyout-footer {
        padding: 1rem;
        flex-direction: column-reverse;
    }

    .admin-btn {
        width: 100%;
    }

    .admin-form-input,
    .admin-form-select {
        font-size: 1rem; /* Prevent zoom on iOS */
    }
}
