/* ============================================
   TARHUM ADMIN PANEL - Premium Design System v2
   Dark Theme with Glassmorphism & Micro-animations
   RTL Support (Arabic/English)
   ============================================ */

/* Import Google Fonts for Chat UI */
@import url('https://fonts.googleapis.com/css2?family=Jaro:wght@400&display=swap');

/* ============================================
   NORDIC THEME - Clean, Minimal, Professional
   ============================================ */
:root {
    /* Nordic Color Palette - Light & Airy */
    --bg-primary: #ECEFF4;
    --bg-secondary: #E5E9F0;
    --bg-tertiary: #D8DEE9;
    --bg-card: #FFFFFF;
    --bg-card-solid: #FFFFFF;
    --bg-card-hover: #F9FAFB;
    --bg-input: #FFFFFF;
    --bg-sidebar: #2E3440;
    --bg-glass: rgba(255, 255, 255, 0.95);

    /* Text Colors - High Contrast */
    --text-primary: #2E3440;
    --text-secondary: #4C566A;
    --text-muted: #6B7280;
    --text-accent: #5E81AC;
    --text-on-dark: #ECEFF4;

    /* Nordic Accent Colors */
    --accent-primary: #5E81AC;
    --accent-secondary: #81A1C1;
    --accent-tertiary: #88C0D0;
    --accent-gradient: linear-gradient(135deg, #5E81AC 0%, #81A1C1 50%, #88C0D0 100%);
    --accent-glow: rgba(94, 129, 172, 0.15);
    --accent-soft: rgba(94, 129, 172, 0.08);

    /* Status Colors - Nordic Palette */
    --success: #A3BE8C;
    --success-soft: rgba(163, 190, 140, 0.15);
    --warning: #EBCB8B;
    --warning-soft: rgba(235, 203, 139, 0.15);
    --danger: #BF616A;
    --danger-soft: rgba(191, 97, 106, 0.15);
    --info: #88C0D0;
    --info-soft: rgba(136, 192, 208, 0.15);

    /* Borders - Subtle & Clean */
    --border-color: #D8DEE9;
    --border-subtle: #E5E9F0;
    --border-hover: #81A1C1;
    --border-active: #5E81AC;

    /* Shadows - Soft & Natural */
    --shadow-sm: 0 1px 3px rgba(46, 52, 64, 0.08);
    --shadow-md: 0 4px 12px rgba(46, 52, 64, 0.1);
    --shadow-lg: 0 8px 24px rgba(46, 52, 64, 0.12);
    --shadow-xl: 0 16px 40px rgba(46, 52, 64, 0.15);
    --shadow-glow: 0 0 20px rgba(94, 129, 172, 0.12);
    --shadow-glow-strong: 0 0 30px rgba(94, 129, 172, 0.2);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.5);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --drawer-width: 440px;

    /* Border Radius - Minimal */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-ar: 'Noto Kufi Arabic', sans-serif;
    --font-en: 'Inter', sans-serif;

    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-spring: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ar);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Nordic subtle pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, #ECEFF4 0%, #E5E9F0 100%);
    pointer-events: none;
    z-index: 0;
}

html[dir="ltr"] body {
    font-family: var(--font-en);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--text-accent);
}

img {
    max-width: 100%;
    height: auto;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.4);
}

/* ---- Login Screen - Nordic Clean ---- */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ECEFF4 0%, #E5E9F0 100%);
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(94, 129, 172, 0.08), transparent 70%);
    top: -150px;
    right: -150px;
    pointer-events: none;
}

.login-screen::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(136, 192, 208, 0.06), transparent 70%);
    bottom: -100px;
    left: -100px;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
    position: relative;
}

.logo-actions {
    position: absolute;
    top: -10px;
    right: -10px;
}

.logo-actions .lang-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.logo-actions .lang-toggle:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.logo-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(94, 129, 172, 0.2));
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 0.5px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 16px;
    transition: var(--transition);
}

html[dir="ltr"] .input-wrapper i {
    right: auto;
    left: 14px;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 44px 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

html[dir="ltr"] .input-wrapper input {
    padding: 13px 16px 13px 44px;
}

.input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card);
}

.input-wrapper input:focus+i,
.input-wrapper input:focus~i {
    color: var(--accent-primary);
}

.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 13px;
    text-align: center;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #A54E56;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: #8FAA75;
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    background: #D4B574;
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--accent-soft);
    color: var(--accent-primary);
    border-color: var(--border-color);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-card-solid);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: scale(1.08);
}

.btn-icon.edit:hover {
    color: var(--accent-primary);
    background: var(--accent-soft);
}

.btn-icon.delete:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.btn-icon.info:hover {
    color: var(--info);
    background: var(--info-soft);
}

.btn-icon.view:hover {
    color: var(--success);
    background: var(--success-soft);
}

/* ---- App Layout ---- */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ---- Sidebar - Nordic Dark ---- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    background: var(--bg-sidebar);
    border-left: 1px solid rgba(216, 222, 233, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
    box-shadow: -2px 0 16px rgba(46, 52, 64, 0.15);
}

html[dir="ltr"] .sidebar {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid rgba(216, 222, 233, 0.1);
    box-shadow: 2px 0 16px rgba(46, 52, 64, 0.15);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(216, 222, 233, 0.1);
    background: rgba(94, 129, 172, 0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: brightness(1.2);
}

.sidebar-logo span {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-on-dark);
    letter-spacing: -0.5px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(236, 239, 244, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: var(--text-on-dark);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: rgba(236, 239, 244, 0.7);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: rgba(94, 129, 172, 0.15);
    color: var(--text-on-dark);
}

.nav-item.active {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(94, 129, 172, 0.3);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item.active i {
    filter: none;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(216, 222, 233, 0.1);
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    background: rgba(191, 97, 106, 0.15);
    border: 1px solid rgba(191, 97, 106, 0.2);
    border-radius: var(--radius-sm);
    color: #BF616A;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(191, 97, 106, 0.25);
    border-color: rgba(191, 97, 106, 0.4);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

html[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: var(--sidebar-width);
}

/* ---- Top Bar - Clean Nordic ---- */
.topbar {
    height: var(--topbar-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-left h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.topbar-link:hover {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.topbar-time {
    font-family: 'Inter', monospace;
    color: var(--text-muted);
    font-size: 13px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.lang-toggle {
    padding: 7px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-en);
    cursor: pointer;
    transition: var(--transition);
}

.lang-toggle:hover {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-avatar {
    width: 38px;
    height: 38px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    box-shadow: var(--shadow-sm);
}

.admin-info span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 800;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Stat Cards - Nordic Clean ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: default;
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-secondary);
    transform: translate(40%, -40%);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    transform: translate(35%, -35%) scale(1.1);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
}

.stat-icon.purple {
    background: rgba(94, 129, 172, 0.12);
    color: #5E81AC;
}

.stat-icon.blue {
    background: rgba(129, 161, 193, 0.12);
    color: #81A1C1;
}

.stat-icon.green {
    background: rgba(163, 190, 140, 0.12);
    color: #A3BE8C;
}

.stat-icon.amber {
    background: rgba(235, 203, 139, 0.12);
    color: #EBCB8B;
}

.stat-icon.cyan {
    background: rgba(136, 192, 208, 0.12);
    color: #88C0D0;
}

.stat-icon.rose {
    background: rgba(191, 97, 106, 0.12);
    color: #BF616A;
}

.stat-icon.indigo {
    background: rgba(94, 129, 172, 0.12);
    color: #5E81AC;
}

.stat-icon.red {
    background: rgba(191, 97, 106, 0.12);
    color: #BF616A;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* ---- Content Cards - Nordic ---- */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.content-card-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

/* ---- Search Box ---- */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 9px 36px 9px 14px;
    width: 220px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

html[dir="ltr"] .search-box input {
    padding: 9px 14px 9px 36px;
}

.search-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    width: 280px;
}

.search-box i {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

html[dir="ltr"] .search-box i {
    right: auto;
    left: 12px;
}

/* ---- Data Tables - Nordic Clean ---- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: right;
    padding: 14px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

html[dir="ltr"] .data-table th {
    text-align: left;
}

.data-table td {
    padding: 14px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}

.data-table tbody tr {
    transition: var(--transition-fast);
    cursor: default;
}

.data-table tbody tr:hover td {
    background: var(--bg-secondary);
}

.data-table tbody tr:hover {
    box-shadow: inset 3px 0 0 var(--accent-primary);
}

html[dir="ltr"] .data-table tbody tr:hover {
    box-shadow: inset -3px 0 0 var(--accent-primary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

/* ---- Badges - Nordic Colors ---- */
.badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
}

.badge-success {
    background: var(--success-soft);
    color: #8FAA75;
    border: 1px solid rgba(163, 190, 140, 0.2);
}

.badge-warning {
    background: var(--warning-soft);
    color: #D4B574;
    border: 1px solid rgba(235, 203, 139, 0.2);
}

.badge-danger {
    background: var(--danger-soft);
    color: #A54E56;
    border: 1px solid rgba(191, 97, 106, 0.2);
}

.badge-info {
    background: var(--info-soft);
    color: #6FA8B8;
    border: 1px solid rgba(136, 192, 208, 0.2);
}

.badge-purple {
    background: var(--accent-soft);
    color: var(--accent-primary);
    border: 1px solid rgba(94, 129, 172, 0.2);
}

.badge-default {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.badge-primary {
    background: rgba(94, 129, 172, 0.12);
    color: #5E81AC;
    border: 1px solid rgba(94, 129, 172, 0.2);
}

.badge-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Pulse badge for active items */
.badge-pulse::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

/* ---- Charts - Nordic ---- */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.chart-wrapper {
    position: relative;
    height: 250px;
    width: 100%;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* ---- Detail Drawer - Nordic ---- */
.detail-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--drawer-width);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 24px rgba(46, 52, 64, 0.2);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

html[dir="rtl"] .detail-drawer {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(46, 52, 64, 0.2);
}

.detail-drawer.open {
    transform: translateX(0);
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(46, 52, 64, 0.5);
    backdrop-filter: blur(2px);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.drawer-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.drawer-close {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.drawer-close:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-section {
    margin-bottom: 24px;
}

.drawer-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.drawer-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.drawer-field {
    margin-bottom: 14px;
}

.drawer-field-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.drawer-field-value {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ---- Empty State ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h4 {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
    opacity: 0.7;
}

/* ---- Loading ---- */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--accent-primary);
    font-size: 24px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card-solid) 25%, rgba(168, 85, 247, 0.06) 50%, var(--bg-card-solid) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-line:last-child {
    width: 60%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ---- Modals - Nordic ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(46, 52, 64, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    width: 92%;
    max-width: 560px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Confirm Dialog - Nordic */
.confirm-dialog {
    max-width: 400px;
    text-align: center;
    padding: 32px;
}

.confirm-icon {
    font-size: 48px;
    color: #EBCB8B;
    margin-bottom: 16px;
}

.confirm-dialog h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.confirm-dialog p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    margin: 16px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Alert - Nordic */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-warning {
    background: var(--warning-soft);
    color: #D4B574;
    border: 1px solid rgba(235, 203, 139, 0.25);
}

/* ---- Pagination - Nordic ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 600;
}

.pagination button:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: var(--accent-soft);
}

.pagination button.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---- Tooltips ---- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-sidebar);
    border: 1px solid rgba(216, 222, 233, 0.1);
    border-radius: var(--radius-xs);
    font-size: 12px;
    color: var(--text-on-dark);
    white-space: nowrap;
    z-index: 50;
    box-shadow: var(--shadow-md);
    animation: tooltipIn 0.15s ease;
}

@keyframes tooltipIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
}

/* ---- Toast - Nordic ---- */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 280px;
}

.toast.success {
    border-color: rgba(163, 190, 140, 0.4);
    background: rgba(163, 190, 140, 0.05);
}

.toast.success .toast-icon {
    color: #8FAA75;
}

.toast.error {
    border-color: rgba(191, 97, 106, 0.4);
    background: rgba(191, 97, 106, 0.05);
}

.toast.error .toast-icon {
    color: #BF616A;
}

.toast.warning {
    border-color: rgba(235, 203, 139, 0.4);
    background: rgba(235, 203, 139, 0.05);
}

.toast.warning .toast-icon {
    color: #EBCB8B;
}

.toast.info {
    border-color: rgba(136, 192, 208, 0.4);
    background: rgba(136, 192, 208, 0.05);
}

.toast.info .toast-icon {
    color: #88C0D0;
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    color: var(--text-primary);
}

.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(-40px);
    }
}

/* ---- Misc ---- */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
}

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

.text-warning {
    color: var(--warning);
}

.text-info {
    color: var(--info);
}

.mb-3 {
    margin-bottom: 16px;
}

.table-responsive {
    overflow-x: auto;
}

.loading-cell,
.empty-cell,
.error-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

.pagination-container {
    margin-top: 16px;
}

.refresh {
    font-size: 14px;
}

/* Row with view button for preview */
.data-table tbody tr.clickable-row {
    cursor: pointer;
}

.data-table tbody tr.clickable-row:hover td {
    background: var(--bg-secondary);
}

/* ---- Mobile Responsiveness ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }

    html[dir="ltr"] .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .mobile-menu-btn {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(46, 52, 64, 0.7);
        backdrop-filter: blur(2px);
        z-index: 90;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .header-actions {
        flex-wrap: wrap;
    }

    .search-box input {
        width: 160px;
    }

    .search-box input:focus {
        width: 200px;
    }

    .detail-drawer {
        width: 100%;
    }

    .topbar-time {
        display: none;
    }
}

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

    .content-card {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }
}

/* ============================================
   MODERATION PAGE STYLES
   ============================================ */

/* Moderation Layout */
.moderation-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Stats Grid for Moderation */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card.stat-primary .stat-icon {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.stat-card.stat-success .stat-icon {
    background: var(--success-soft);
    color: var(--success);
}

.stat-card.stat-info .stat-icon {
    background: var(--info-soft);
    color: var(--info);
}

.stat-card.stat-warning .stat-icon {
    background: var(--warning-soft);
    color: var(--warning);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Rooms Panel */
.rooms-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 320px);
}

.rooms-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.room-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.room-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(-2px);
}

.room-item.active {
    background: var(--accent-soft);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.room-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.room-item.active .room-icon {
    background: var(--accent-primary);
    color: white;
}

.room-info {
    flex: 1;
    min-width: 0;
}

.room-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.room-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
}

.badge-alliance {
    background: var(--info-soft);
    color: var(--info);
}

.badge-private {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.badge-group {
    background: var(--success-soft);
    color: var(--success);
}

.room-id {
    font-size: 11px;
    color: var(--text-muted);
}

.room-time {
    font-size: 11px;
    color: var(--text-muted);
}

.room-actions {
    display: flex;
    gap: 4px;
}

/* Messages Panel */
.messages-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 320px);
    background: #EDEDED;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    background: #EDEDED;
}

/* Chat-style Messages */
.chat-messages-header {
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 10;
}

.messages-count-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-soft);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.chat-messages-container {
    padding: 16px;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

/* Message Groups (like Flutter app) */
.chat-message-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.chat-message-group.other-user {
    align-items: flex-start;
}

.chat-message-group.current-user {
    align-items: flex-end;
}

/* Sender Header (like Flutter app) */
.message-sender-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sender-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A148C 0%, #7B1FA2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'RussoOne', sans-serif;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.sender-name-badge {
    background: #C76318;
    color: white;
    padding: 3px 12px;
    border-radius: 3px 3px 0 0;
    font-family: 'Jaro', sans-serif;
    font-size: 13px;
    font-weight: 400;
}

/* Message Bubbles */
.message-bubbles {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
}

.chat-bubble {
    background: white;
    border: 1px solid #C76318;
    border-radius: 10px;
    padding: 8px 12px;
    position: relative;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.chat-bubble:hover {
    box-shadow: 0 2px 8px rgba(199, 99, 24, 0.2);
}

.chat-bubble.bubble-other {
    border-radius: 10px 10px 10px 0;
    align-self: flex-start;
}

.chat-bubble.bubble-current {
    border-radius: 10px 10px 0 10px;
    align-self: flex-end;
    background: #F5F5F5;
}

.bubble-content {
    font-family: 'RussoOne', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #000000;
    letter-spacing: 0.33px;
    line-height: 1.45;
    word-wrap: break-word;
    margin-bottom: 4px;
}

.bubble-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.bubble-time {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 400;
    color: #666666;
    letter-spacing: 0.3px;
}

.bubble-delete-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    opacity: 0;
    transition: var(--transition);
}

.chat-bubble:hover .bubble-delete-btn {
    opacity: 1;
}

.bubble-delete-btn:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Scrollbar styling for chat */
.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: #E0E0E0;
    border-radius: 3px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: #C76318;
    border-radius: 3px;
}

.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: #A85515;
}

/* Search Box */
.search-box {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box i {
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Filter Select */
.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--border-hover);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    font-weight: 500;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--danger);
}

.error-state i {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-state p {
    font-size: 14px;
    font-weight: 500;
}

/* Page Subtitle */
.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pagination Container */
.pagination-container {
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
}

/* Responsive Moderation Layout */
@media (max-width: 1024px) {
    .moderation-layout {
        grid-template-columns: 1fr;
    }

    .rooms-panel,
    .messages-panel {
        max-height: 500px;
    }

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

    .message-bubbles {
        max-width: 85%;
    }
}

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

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-value {
        font-size: 24px;
    }

    .chat-bubble {
        padding: 6px 10px;
    }

    .room-item {
        padding: 10px;
    }

    .message-bubbles {
        max-width: 90%;
    }

    .bubble-content {
        font-size: 10px;
    }

    .sender-name-badge {
        font-size: 11px;
        padding: 2px 10px;
    }
}

/* ============================================
   Events Page Styles
   ============================================ */

/* Page Header */
.page-header {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.page-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.page-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 12px;
}

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

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-subtle);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--stat-color, var(--accent-primary));
    background: color-mix(in srgb, var(--stat-color, var(--accent-primary)) 15%, transparent);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.filters-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group i {
    font-size: 12px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.view-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.view-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Table Container */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

/* Item Info (for table rows) */
.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.item-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-subtitle i {
    font-size: 10px;
}

/* ID Badge */
.id-badge {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Organizer Info */
.organizer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.organizer-info i {
    color: var(--text-muted);
    font-size: 12px;
}

/* Date Info */
.date-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-info > div {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.date-info i {
    font-size: 10px;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
}

/* Progress Info */
.progress-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-bar-container {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Reward Badge */
.reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 13px;
}

.reward-badge i {
    font-size: 12px;
}

/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Event Card */
.event-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-subtle);
}

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

.event-card-header {
    position: relative;
    height: 180px;
}

.event-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.event-image-placeholder {
    background: var(--info-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--info);
}

.event-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.event-card-body {
    padding: 20px;
}

.event-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--purple);
    background: var(--purple-soft);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-bottom: 12px;
}

.event-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.event-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.event-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item i {
    color: var(--text-muted);
    font-size: 11px;
    width: 14px;
}

.event-progress {
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.progress-header span:first-child {
    color: var(--text-muted);
    font-weight: 600;
}

.progress-value {
    color: var(--text-primary);
    font-weight: 700;
}

.event-card-footer {
    padding: 16px 20px;
    background: var(--bg-secondary);
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-subtle);
}

.event-card-footer .btn {
    flex: 1;
}

/* Drawer Preview Styles */
.drawer-preview-header {
    text-align: center;
    margin-bottom: 24px;
}

.preview-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.preview-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 36px;
}

.preview-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.preview-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.preview-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    gap: 16px;
}

.field-value-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-value-with-icon i {
    color: var(--text-muted);
    font-size: 14px;
}

.reward-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: var(--radius-md);
    font-weight: 700;
}

.reward-display i {
    font-size: 14px;
}

/* Schedule Info */
.schedule-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.schedule-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.schedule-details {
    flex: 1;
}

.schedule-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.schedule-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 700;
}

/* Participation Stats */
.participation-stats {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-row .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-row .stat-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 700;
}

.progress-bar-large {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.tag-chip i {
    font-size: 10px;
    color: var(--text-muted);
}

/* Metadata Grid */
.metadata-grid {
    display: grid;
    gap: 12px;
}

.metadata-grid code {
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
}

/* Form Tabs */
.form-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.form-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.form-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.form-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.form-tab-content {
    display: none;
}

.form-tab-content.active {
    display: block;
}

/* Form Hints */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.required {
    color: var(--danger);
    margin-left: 4px;
}

/* Image Preview */
.image-preview {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.image-preview small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

/* Schedule Preview */
.schedule-preview {
    padding: 16px;
    background: var(--info-soft);
    border-radius: var(--radius-md);
    text-align: center;
}

.preview-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.preview-value {
    font-size: 18px;
    color: var(--info);
    font-weight: 800;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-left,
    .filters-right {
        width: 100%;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

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

    .event-meta {
        grid-template-columns: 1fr;
    }

    .form-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .form-tab {
        white-space: nowrap;
    }
}

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

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

    .page-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .page-title {
        font-size: 20px;
    }

    .event-card-footer {
        flex-direction: column;
    }
}

/* ============================================
   Map Locations Page Styles
   ============================================ */

.map-view-container {
    display: flex;
    gap: 20px;
    height: 600px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.map-sidebar {
    width: 380px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.map-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.map-sidebar-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.location-item:hover {
    background: var(--bg-hover);
    transform: translateX(-2px);
}

.location-item.active {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.location-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.location-item-content {
    flex: 1;
    min-width: 0;
}

.location-item-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-item-meta {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.location-item-coords {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.location-item-coords i {
    margin-right: 4px;
}

.location-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.location-item:hover .location-item-actions {
    opacity: 1;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.btn-icon-sm:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon-sm.edit:hover {
    background: var(--info-soft);
    color: var(--info);
}

.btn-icon-sm.delete:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.map-canvas-container {
    flex: 1;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.map-empty-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.map-empty-overlay i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.map-empty-overlay h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.map-empty-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Leaflet Map Popup Styles */
.map-popup {
    min-width: 250px;
}

.map-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.map-popup-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.map-popup-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.map-popup-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.map-popup-meta div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-popup-meta i {
    width: 16px;
    color: var(--text-muted);
}

.map-popup-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* Leaflet Custom Marker */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Empty State Small */
.empty-state-small {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Form Info Box */
.form-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.form-info i {
    margin-top: 2px;
}

/* Responsive Map View */
@media (max-width: 1024px) {
    .map-view-container {
        flex-direction: column;
        height: auto;
    }

    .map-sidebar {
        width: 100%;
        max-height: 400px;
    }

    .map-canvas-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .map-sidebar {
        max-height: 300px;
    }

    .map-canvas-container {
        height: 400px;
    }

    .location-item {
        padding: 10px;
    }

    .location-item-icon {
        width: 36px;
        height: 36px;
    }

    .location-item-name {
        font-size: 13px;
    }
}
