/* ============================================
   GeekZilla Core Framework - Dashboard CSS
   Versão: 2.0 - Modernizado com Theme System
   Data: 31/12/2025
   ============================================ */

/* ============================================
   VARIÁVEIS CSS (THEME SYSTEM)
   ============================================ */
:root {
    /* Cores Principais */
    --primary: hsl(221, 83%, 53%);
    --primary-glow: hsl(221, 83%, 63%);
    --primary-foreground: hsl(0, 0%, 100%);

    /* Cores Secundárias */
    --secondary: hsl(210, 17%, 98%);
    --secondary-foreground: hsl(221, 39%, 11%);

    /* Cores de Status */
    --success: hsl(142, 76%, 36%);
    --warning: hsl(38, 92%, 50%);
    --info: hsl(199, 89%, 48%);
    --destructive: hsl(0, 84%, 60%);

    /* Background e Foreground */
    --background: hsl(0, 0%, 100%);
    --foreground: hsl(221, 39%, 11%);

    /* Sidebar */
    --sidebar-background: hsl(221, 39%, 11%);
    --sidebar-foreground: hsl(210, 17%, 98%);
    --sidebar-primary: hsl(221, 83%, 53%);
    --sidebar-accent: hsl(221, 39%, 16%);
    --sidebar-border: hsl(221, 39%, 16%);

    /* Cards e Elementos */
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(221, 39%, 11%);
    --muted: hsl(210, 17%, 96%);
    --muted-foreground: hsl(215, 16%, 47%);
    --border: hsl(214, 32%, 91%);

    /* Raio de Borda */
    --radius: 0.75rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Sombras */
    --shadow-elegant: 0 10px 30px -10px hsl(221 83% 53% / 0.2);
    --shadow-card: 0 4px 12px hsl(221 39% 11% / 0.08);

    /* Transições */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tipografia */
    --font-size: 16px;
}

/* ============================================
   RESET E BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    font-size: var(--font-size, 16px);
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: var(--background);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.dashboard-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--background);
}

/* ============================================
   SIDEBAR MODERNA
   ============================================ */
.sidebar {
    width: 280px;
    background: var(--sidebar-background);
    color: var(--sidebar-foreground);
    padding: 1.5rem;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 1.5rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--sidebar-primary);
    border-radius: var(--radius-lg, 0.625rem);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-primary-foreground);
    font-weight: var(--font-weight-medium, 500);
    font-size: 1.25rem;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-medium, 500);
    color: var(--sidebar-foreground);
}

/* Navegação */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md, calc(0.625rem - 2px));
    color: var(--sidebar-foreground);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    font-weight: var(--font-weight-normal, 400);
}

.nav-item:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
}

.nav-item.active {
    background: var(--sidebar-primary);
    color: var(--sidebar-primary-foreground);
    font-weight: var(--font-weight-medium, 500);
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-label {
    flex: 1;
}

/* ============================================
   DIVISOR DE NAVEGAÇÃO
   ============================================ */
.nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 1rem 0;
}

/* ============================================
   MENU EXPANSÍVEL (SUBMENU)
   ============================================ */
.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-item-expandable {
    cursor: pointer;
    position: relative;
}

.nav-item-expandable .nav-arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.nav-item-expandable.expanded .nav-arrow {
    transform: rotate(0deg);
}

.nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding-left: 2.5rem;
    margin-top: 0.25rem;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm, 0.375rem);
    color: var(--sidebar-foreground);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: var(--font-weight-normal, 400);
    opacity: 0.9;
}

.nav-subitem:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
    opacity: 1;
}

.nav-subitem.active {
    background: var(--sidebar-primary);
    color: var(--sidebar-primary-foreground);
    font-weight: var(--font-weight-medium, 500);
    opacity: 1;
}

.nav-subitem .nav-icon {
    font-size: 1.125rem;
    width: 20px;
}

/* ============================================
   SEÇÕES DE NAVEGAÇÃO (REABILITADAS)
   ============================================ */
.nav-section {
    margin-bottom: 1rem;
}

.nav-section-title {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
    border-radius: var(--radius-md);
}

.nav-section-title:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-foreground);
}

.nav-section-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
}

.nav-section-toggle {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.nav-section-toggle.expanded {
    transform: rotate(0deg);
}

.nav-section-toggle.collapsed {
    transform: rotate(-90deg);
}

/* Sub-itens do menu admin */
.nav-sub-item {
    padding-left: 2rem !important;
    font-size: 0.875rem;
}

.nav-sub-item .nav-icon {
    width: 18px;
}

/* ============================================
   TOPBAR MODERNA
   ============================================ */
.topbar {
    height: 64px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-left h1 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-medium, 500);
    color: var(--foreground);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-bar input {
    width: 100%;
    padding: 0.5rem 1rem;
    background: var(--input-background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.625rem);
    font-size: 0.875rem;
    color: var(--foreground);
    transition: all 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(3, 2, 19, 0.1);
}

.search-bar input::placeholder {
    color: var(--muted-foreground);
}

/* ============================================
   CARDS MODERNOS
   ============================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.625rem);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Module Card (para os widgets de módulos) */
.module-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.625rem);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.module-card:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.module-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.module-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.module-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--foreground);
}

.module-card-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.module-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Metric Card */
.metric-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.625rem);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-card:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.metric-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Cores dos ícones baseadas no theme */
.metric-icon.primary,
.system-metric-icon.primary,
.module-icon.primary {
    background: hsl(221, 83%, 53%, 0.1);
    color: hsl(221, 83%, 53%);
}

.metric-icon.success,
.system-metric-icon.success,
.module-icon.success {
    background: hsl(142, 76%, 36%, 0.1);
    color: hsl(142, 76%, 36%);
}

.metric-icon.warning,
.system-metric-icon.warning,
.module-icon.warning {
    background: hsl(38, 92%, 50%, 0.1);
    color: hsl(38, 92%, 50%);
}

.metric-icon.danger,
.system-metric-icon.danger,
.module-icon.danger {
    background: hsl(0, 84%, 60%, 0.1);
    color: hsl(0, 84%, 60%);
}

.metric-icon.info,
.system-metric-icon.info,
.module-icon.info {
    background: hsl(199, 89%, 48%, 0.1);
    color: hsl(199, 89%, 48%);
}

.metric-icon.purple,
.system-metric-icon.purple,
.module-icon.purple {
    background: hsl(271, 81%, 56%, 0.1);
    color: hsl(271, 81%, 56%);
}

.metric-icon.cyan,
.system-metric-icon.cyan,
.module-icon.cyan {
    background: hsl(189, 94%, 43%, 0.1);
    color: hsl(189, 94%, 43%);
}

.metric-icon.orange,
.system-metric-icon.orange,
.module-icon.orange {
    background: hsl(24, 94%, 50%, 0.1);
    color: hsl(24, 94%, 50%);
}

/* Progress bar colors */
.system-metric-progress-bar.primary {
    background: hsl(221, 83%, 53%);
}

.system-metric-progress-bar.success {
    background: hsl(142, 76%, 36%);
}

.system-metric-progress-bar.warning {
    background: hsl(38, 92%, 50%);
}

.system-metric-progress-bar.danger {
    background: hsl(0, 84%, 60%);
}

.system-metric-progress-bar.info {
    background: hsl(199, 89%, 48%);
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-title {
    font-size: 0.75rem;
    font-weight: var(--font-weight-normal, 400);
    color: var(--muted-foreground);
    text-transform: none;
    letter-spacing: 0;
}

.metric-value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.metric-value .value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1;
}

.metric-value .unit {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg, 0.625rem);
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium, 500);
    line-height: 1;
}

.badge.success {
    background: oklch(0.696 0.17 162.48 / 0.1);
    color: oklch(0.696 0.17 162.48);
}

.badge.danger {
    background: oklch(0.627 0.265 303.9 / 0.1);
    color: oklch(0.627 0.265 303.9);
}

.badge.warning {
    background: oklch(0.769 0.188 70.08 / 0.1);
    color: oklch(0.769 0.188 70.08);
}

.badge.info {
    background: oklch(0.6 0.118 184.704 / 0.1);
    color: oklch(0.6 0.118 184.704);
}

.badge.primary {
    background: oklch(0.488 0.243 264.376 / 0.1);
    color: oklch(0.488 0.243 264.376);
}

/* ============================================
   GRID DE MÉTRICAS
   ============================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Grid de métricas do sistema (5 colunas) */
.system-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Card de métrica do sistema (mais compacto) */
.system-metric-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.625rem);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.system-metric-card:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.system-metric-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.system-metric-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.system-metric-info {
    flex: 1;
    min-width: 0;
}

.system-metric-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-weight: var(--font-weight-normal, 400);
}

.system-metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1.2;
}

.system-metric-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--muted-foreground);
}

.system-metric-progress {
    width: 100%;
    height: 4px;
    background: var(--muted);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.system-metric-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ============================================
   ÍCONES LUCIDE
   ============================================ */
.lucide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lucide-icon svg {
    display: block;
}

.nav-icon .lucide-icon {
    width: 20px;
    height: 20px;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md, calc(0.625rem - 2px));
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium, 500);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    opacity: 0.9;
}

/* ============================================
   GRÁFICOS
   ============================================ */
.chart-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.625rem);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-medium, 500);
    color: var(--foreground);
}

.chart-subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .dashboard-main {
        padding: 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        display: none;
    }
}

/* ============================================
   LOADING E ESTADOS
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--muted-foreground);
}

.error-message {
    background: var(--destructive);
    color: var(--destructive-foreground);
    padding: 1rem;
    border-radius: var(--radius-md, calc(0.625rem - 2px));
    margin-bottom: 1rem;
}

/* ============================================
   DARK MODE
   ============================================ */
.dark .sidebar {
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

.dark .topbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .card,
.dark .metric-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .card:hover,
.dark .metric-card:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* ============================================
   LOGIN PAGE (SPA)
   ============================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--primary-glow));
}

.login-box {
    background: var(--card);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-elegant);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--foreground);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--foreground);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(3, 2, 19, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--foreground);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-label .required {
    color: var(--destructive);
}

.form-label .form-hint {
    color: var(--muted-foreground);
    font-weight: 400;
    font-size: 0.75rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.875rem;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
    border-color: var(--destructive);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    display: block;
    margin-top: 0.25rem;
    color: var(--destructive);
    font-size: 0.75rem;
}

.form-error-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--destructive-bg, #fef2f2);
    border: 1px solid var(--destructive);
    border-radius: calc(var(--radius) - 4px);
    color: var(--destructive);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: calc(var(--radius) - 4px);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-login:hover {
    background: var(--primary-glow);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    background: var(--destructive);
    color: white;
    padding: 0.75rem;
    border-radius: calc(var(--radius) - 4px);
    margin-bottom: 1rem;
}

.error-message.show {
    display: block;
}

/* ============================================
   TOPBAR USER (SPA)
   ============================================ */
.topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--foreground);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.875rem;
    color: var(--foreground);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: var(--destructive);
    color: white;
    border: none;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    opacity: 0.9;
}

/* ============================================
   NAV LINK (React Router)
   ============================================ */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md, calc(0.625rem - 2px));
    color: var(--sidebar-foreground);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    font-weight: 400;
}

.nav-link:hover {
    background: var(--sidebar-accent);
}

.nav-link.active {
    background: var(--sidebar-primary);
    color: var(--sidebar-primary-foreground);
    font-weight: 500;
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */
.dashboard-page {
    padding: 2rem;
}

.dashboard-page h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.dashboard-page p {
    font-size: 1rem;
    color: var(--muted-foreground);
}

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-page {
    padding: 2rem;
}

.settings-page h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.settings-page p {
    font-size: 1rem;
    color: var(--muted-foreground);
}

/* ============================================
   ADMIN INTERFACE COMPONENTS
   ============================================ */

/* Modal Component */
.modal-overlay,
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content,
.modal-container {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-elegant);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.2s ease-out;
    width: 90%;
    max-width: 600px;
}

.modal-small { width: 90%; max-width: 400px; }
.modal-medium { width: 90%; max-width: 600px; }
.modal-large { width: 90%; max-width: 800px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.modal-close:hover {
    background: var(--muted);
    color: var(--foreground);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--muted);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Module Grid (for GroupModal) */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--muted);
}

.module-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.module-checkbox-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px hsl(221 83% 53% / 0.1);
}

.module-checkbox-item input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.module-checkbox-item input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.module-checkbox-label {
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.module-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.module-info strong {
    color: var(--foreground);
    font-size: 0.9375rem;
}

.module-info small {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.loading-text {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-style: italic;
}

/* Toast Component */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    animation: toastSlideIn 0.3s ease-out;
    transition: var(--transition-smooth);
}

.toast-success {
    background: var(--success);
    color: white;
}

.toast-error {
    background: var(--destructive);
    color: white;
}

.toast-warning {
    background: var(--warning);
    color: white;
}

.toast-info {
    background: var(--info);
    color: white;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    opacity: 0.8;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tabs Component */
.tabs {
    display: flex;
    flex-direction: column;
}

.tabs-list {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--muted);
    border-radius: var(--radius) var(--radius) 0 0;
}

.tabs-default .tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: var(--transition-smooth);
    border-bottom: 2px solid transparent;
}

.tabs-default .tab-button:hover {
    color: var(--foreground);
    background: var(--background);
}

.tabs-default .tab-button.active {
    color: var(--primary);
    background: var(--background);
    border-bottom-color: var(--primary);
}

.tabs-pills .tab-button {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--muted-foreground);
    border-radius: var(--radius);
    transition: var(--transition-smooth);
}

.tabs-pills .tab-button:hover {
    background: var(--muted);
    color: var(--foreground);
}

.tabs-pills .tab-button.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.tab-content {
    padding: 1.5rem;
    background: var(--background);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ConfirmDialog Component */
.confirm-dialog-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.confirm-dialog-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--muted);
}

.confirm-icon {
    font-size: 1.5rem;
}

.confirm-icon-danger {
    color: var(--destructive);
}

.confirm-icon-warning {
    color: var(--warning);
}

.confirm-icon-info {
    color: var(--info);
}

.confirm-dialog-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.confirm-dialog-message {
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.confirm-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* SkeletonLoader Component */
.skeleton-line,
.skeleton-circle {
    background: linear-gradient(90deg, var(--muted) 25%, var(--border) 50%, var(--muted) 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-line {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-line-short { width: 30%; }
.skeleton-line-medium { width: 60%; }
.skeleton-line-long { width: 90%; }

.skeleton-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
}

.skeleton-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.skeleton-table-header,
.skeleton-table-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
}

.skeleton-table-header {
    background: var(--muted);
    border-bottom: 1px solid var(--border);
}

.skeleton-table-row {
    border-bottom: 1px solid var(--border);
}

.skeleton-table-row:last-child {
    border-bottom: none;
}

.skeleton-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-card-title {
    flex: 1;
}

.skeleton-card-content .skeleton-line {
    margin-bottom: 0.75rem;
}

.skeleton-lines .skeleton-line:last-child {
    margin-bottom: 0;
}

@keyframes skeletonPulse {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* SearchBar Component */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    transition: var(--transition-smooth);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px hsl(221 83% 53% / 0.1);
}

.search-icon {
    color: var(--muted-foreground);
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    color: var(--foreground);
    font-size: 0.875rem;
}

.search-input::placeholder {
    color: var(--muted-foreground);
}

.search-clear {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.search-clear:hover {
    background: var(--muted);
    color: var(--foreground);
}

/* Button Variants for Components */
.btn-destructive {
    background: var(--destructive);
    color: white;
    border: 1px solid var(--destructive);
}

.btn-destructive:hover {
    background: hsl(0, 84%, 55%);
    border-color: hsl(0, 84%, 55%);
}

.btn-warning {
    background: var(--warning);
    color: white;
    border: 1px solid var(--warning);
}

.btn-warning:hover {
    background: hsl(38, 92%, 45%);
    border-color: hsl(38, 92%, 45%);
}

.btn-info {
    background: var(--info);
    color: white;
    border: 1px solid var(--info);
}

.btn-info:hover {
    background: hsl(199, 89%, 43%);
    border-color: hsl(199, 89%, 43%);
}

/* Responsive Design for Components */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
    
    .tabs-list {
        flex-wrap: wrap;
    }
    
    .confirm-dialog-actions {
        flex-direction: column;
    }
    
    .skeleton-table-header,
    .skeleton-table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ============================================
   ADMIN INTERFACE STYLES
   ============================================ */

/* Admin Page Layout */
.admin-page {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    margin: 0;
    color: var(--foreground);
    font-size: 1.875rem;
    font-weight: 600;
}

/* Filters Section */
.filters-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--background);
    color: var(--foreground);
    transition: var(--transition-smooth);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsl(221 83% 53% / 0.1);
}

.form-input.error,
.form-select.error {
    border-color: var(--destructive);
}

.error-text {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--destructive);
}

.required {
    color: var(--destructive);
}

.optional-text {
    color: var(--muted-foreground);
    font-weight: normal;
}

/* Checkbox Styles */
.checkbox-group {
    margin: 1rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--muted);
    transition: var(--transition-smooth);
}

.checkbox-label:hover {
    background: var(--secondary);
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

.checkbox-text {
    flex: 1;
}

.checkbox-text strong {
    display: block;
    color: var(--foreground);
}

.checkbox-text small {
    color: var(--muted-foreground);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Table Styles */
.table-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.users-table th {
    background: var(--muted);
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.875rem;
}

.users-table tbody tr:hover {
    background: var(--secondary);
}

.user-name-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
    padding: 0;
}

.user-name-link:hover {
    color: var(--primary-glow);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: var(--muted);
    color: var(--muted-foreground);
}

.badge.success {
    background: var(--success);
    color: white;
}

.badge.danger {
    background: var(--destructive);
    color: white;
}

.badge:hover {
    opacity: 0.8;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-info {
    margin-left: 1rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-foreground);
}

.empty-state p {
    margin: 0.5rem 0;
}

/* Error Message */
.error-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: hsl(0 84% 60% / 0.1);
    border: 1px solid var(--destructive);
    border-radius: var(--radius-sm);
    color: var(--destructive);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-page {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filters-section {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .users-table {
        font-size: 0.75rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-info {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
/* ============================================
   ADMIN USER DETAIL PAGE STYLES
   ============================================ */

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.breadcrumb-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: inherit;
}

.breadcrumb-link:hover {
    color: var(--primary-glow);
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--muted-foreground);
}

.breadcrumb-current {
    font-weight: 500;
    color: var(--foreground);
}

/* User Detail Page Header */
.admin-user-detail-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.user-header-info h1 {
    margin: 0 0 0.5rem 0;
    color: var(--foreground);
    font-size: 1.875rem;
    font-weight: 600;
}

.user-header-info p {
    margin: 0 0 0.75rem 0;
    color: var(--muted-foreground);
    font-size: 1rem;
}

.user-badges {
    display: flex;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Tab Content Styles */
.tab-content-info,
.tab-content-groups,
.tab-content-permissions,
.tab-content-modules {
    padding: 1.5rem 0;
}

/* Info Tab */
.user-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.user-info-header h3 {
    margin: 0;
    color: var(--foreground);
    font-size: 1.25rem;
    font-weight: 600;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.info-item label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item span {
    font-size: 0.875rem;
    color: var(--foreground);
    font-weight: 500;
}

/* Groups Tab */
.groups-header,
.permissions-header,
.modules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.groups-header h3,
.permissions-header h3,
.modules-header h3 {
    margin: 0;
    color: var(--foreground);
    font-size: 1.25rem;
    font-weight: 600;
}

.count-badge {
    background: var(--muted);
    color: var(--muted-foreground);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.groups-list,
.permissions-list,
.modules-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.group-item,
.permission-item,
.module-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.group-item:hover,
.permission-item:hover,
.module-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px hsl(221 83% 53% / 0.1);
}

.group-info,
.permission-info,
.module-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.group-info strong,
.permission-info strong,
.module-info strong {
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 600;
}

.group-info p,
.module-info p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    line-height: 1.4;
}

.permission-info {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.available-groups {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.available-groups h4 {
    margin: 0 0 1rem 0;
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 600;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--muted);
    border-radius: 1.5rem;
    transition: var(--transition-smooth);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background: white;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(1.5rem);
}

.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 0 2px hsl(221 83% 53% / 0.2);
}

/* Responsive Design for Detail Page */
@media (max-width: 768px) {
    .admin-user-detail-page .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .header-actions .btn {
        flex: 1;
    }
    
    .user-info-grid {
        grid-template-columns: 1fr;
    }
    
    .group-item,
    .permission-item,
    .module-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .group-info,
    .permission-info,
    .module-info {
        width: 100%;
    }
    
    .permission-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .groups-header,
    .permissions-header,
    .modules-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
/* ============================================
   ADMIN GROUPS PAGE STYLES
   ============================================ */

/* Groups Table */
.groups-table {
    width: 100%;
    border-collapse: collapse;
}

.groups-table th,
.groups-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.groups-table th {
    background: var(--muted);
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.875rem;
}

.groups-table tbody tr:hover {
    background: var(--secondary);
}

.group-name-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
    padding: 0;
}

.group-name-link:hover {
    color: var(--primary-glow);
}

.member-count {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.group-description {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.text-muted {
    color: var(--muted-foreground);
    font-style: italic;
}

/* Badge Variants */
.badge.primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

/* Textarea Styles */
.form-input[rows] {
    resize: vertical;
    min-height: 4rem;
    font-family: inherit;
    line-height: 1.5;
}

/* Responsive Design for Groups */
@media (max-width: 768px) {
    .groups-table {
        font-size: 0.75rem;
    }
    
    .groups-table th,
    .groups-table td {
        padding: 0.5rem;
    }
    
    .group-description {
        max-width: 150px;
    }
}

/* ============================================
   DEPARTMENT MANAGEMENT STYLES
   ============================================ */

/* Department Page Layout */
.admin-departments-page {
    padding: 1.5rem;
}

.admin-departments-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-departments-page .page-header h1 {
    margin: 0;
    color: var(--foreground);
    font-size: 1.875rem;
    font-weight: 600;
}

/* Department Table */
.departments-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.departments-table th,
.departments-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.departments-table th {
    background: var(--muted);
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.departments-table tbody tr:hover {
    background: var(--muted);
}

.departments-table .manager-name {
    color: var(--primary);
    font-weight: 500;
}

.departments-table .text-muted {
    color: var(--muted-foreground);
    font-style: italic;
}

.departments-table .member-count {
    color: var(--info);
    font-weight: 500;
}

.departments-table .department-description {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Department Action Buttons */
.departments-table .action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.departments-table .action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    min-width: auto;
}

/* Department Modals */
.members-modal-content {
    max-height: 70vh;
    overflow-y: auto;
}

.members-search {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.members-info {
    margin-bottom: 1rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.members-table-container {
    margin-bottom: 1.5rem;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
}

.members-table th,
.members-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.members-table th {
    background: var(--muted);
    font-weight: 600;
    font-size: 0.875rem;
}

.members-table .member-avatar {
    font-size: 1.25rem;
    text-align: center;
}

.members-table .member-info strong {
    color: var(--foreground);
}

.members-table .member-info small {
    color: var(--muted-foreground);
}

/* Role and Status Badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.role-badge.admin {
    background: var(--primary);
    color: var(--primary-foreground);
}

.role-badge.user {
    background: var(--muted);
    color: var(--muted-foreground);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.active {
    background: var(--success);
    color: white;
}

.status-badge.inactive {
    background: var(--muted);
    color: var(--muted-foreground);
}

.manager-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--warning);
    color: white;
}

/* Set Manager Modal */
.set-manager-modal-content .current-manager-info {
    padding: 1rem;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.set-manager-modal-content .current-manager-info p {
    margin: 0;
    color: var(--foreground);
}

.set-manager-modal-content .form-help {
    display: block;
    margin-top: 0.5rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Loading and Error States */
.loading-state,
.error-state {
    padding: 2rem;
    text-align: center;
}

.loading-state p,
.error-state p {
    margin-bottom: 1rem;
    color: var(--muted-foreground);
}

.error-state .error-message {
    color: var(--destructive);
    font-weight: 500;
}

/* Responsive Design for Department Tables */
@media (max-width: 768px) {
    .departments-table,
    .members-table {
        font-size: 0.875rem;
    }
    
    .departments-table .department-description {
        max-width: 150px;
    }
    
    .departments-table .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .departments-table .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .members-modal-content {
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .admin-departments-page {
        padding: 1rem;
    }
    
    .admin-departments-page .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .admin-departments-page .page-header h1 {
        font-size: 1.5rem;
    }
}
/* ============================================
   ADMIN DETAIL PAGES STYLES
   ============================================ */

/* User and Group Detail Pages */
.admin-user-detail-page,
.admin-group-detail-page {
    padding: 1.5rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
}

.breadcrumb-link:hover {
    color: var(--primary-glow);
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--muted-foreground);
}

.breadcrumb-current {
    color: var(--foreground);
    font-weight: 500;
}

/* Detail Page Header */
.admin-user-detail-page .page-header,
.admin-group-detail-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.user-header-info,
.group-header-info {
    flex: 1;
}

.user-header-info h1,
.group-header-info h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--foreground);
}

.user-header-info p,
.group-header-info p {
    margin: 0 0 1rem 0;
    color: var(--muted-foreground);
    font-size: 1rem;
}

.user-badges,
.group-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

/* Tab Content Styles */
.tab-content-info,
.tab-content-groups,
.tab-content-members,
.tab-content-permissions,
.tab-content-modules {
    min-height: 400px;
}

/* Info Tab */
.user-info-header,
.group-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.user-info-header h3,
.group-info-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.user-info-grid,
.group-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.info-item span {
    font-size: 1rem;
    color: var(--foreground);
    font-weight: 500;
}

/* Groups/Members Tab */
.groups-header,
.members-header,
.permissions-header,
.modules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.groups-header h3,
.members-header h3,
.permissions-header h3,
.modules-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.count-badge {
    background: var(--muted);
    color: var(--muted-foreground);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.groups-list,
.members-list,
.users-list,
.permissions-list,
.modules-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-item,
.member-item,
.user-item,
.permission-item,
.module-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition-smooth);
}

.group-item:hover,
.member-item:hover,
.user-item:hover,
.permission-item:hover,
.module-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-card);
}

.group-info,
.member-info,
.user-info,
.permission-info,
.module-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.member-avatar,
.user-avatar {
    font-size: 1.5rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border-radius: 50%;
}

.member-details,
.user-details {
    flex: 1;
    min-width: 0;
}

.member-details strong,
.user-details strong {
    display: block;
    color: var(--foreground);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.member-details p,
.user-details p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.member-details small,
.user-details small {
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

.member-badges,
.user-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Available Groups/Users Section */
.available-groups,
.available-users {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.available-groups h4,
.available-users h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
}

/* Permission Items */
.permission-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.permission-info strong {
    color: var(--foreground);
    font-weight: 600;
}

.permission-info .badge {
    margin-right: 0.5rem;
}

/* Module Items */
.module-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.module-info strong {
    color: var(--foreground);
    font-weight: 600;
}

.module-info p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--muted);
    border-radius: 1.5rem;
    transition: var(--transition-smooth);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background: white;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(1.5rem);
}

.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 0 2px hsl(221 83% 53% / 0.1);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-foreground);
}

.empty-state p {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.empty-state p:first-child {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--foreground);
}

/* Responsive Design for Detail Pages */
@media (max-width: 768px) {
    .admin-user-detail-page,
    .admin-group-detail-page {
        padding: 1rem;
    }
    
    .admin-user-detail-page .page-header,
    .admin-group-detail-page .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: stretch;
    }
    
    .header-actions .btn {
        flex: 1;
    }
    
    .user-info-grid,
    .group-info-grid {
        grid-template-columns: 1fr;
    }
    
    .group-item,
    .member-item,
    .user-item,
    .permission-item,
    .module-item {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .member-info,
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .member-badges,
    .user-badges {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .breadcrumb {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .user-header-info h1,
    .group-header-info h1 {
        font-size: 1.5rem;
    }
    
    .groups-header,
    .members-header,
    .permissions-header,
    .modules-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}


/* ============================================
   ADMIN INTERFACE - ADDITIONAL STYLES FROM TEMPLATES
   Added: 2026-01-17 - Task 5.1
   ============================================ */

/* Stats Grid (from gerenciar_usuarios_completo.html) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-card-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.stat-card-icon.success {
    background: var(--success-bg, hsl(142, 76%, 36%, 0.1));
    color: var(--success-text, var(--success));
}

.stat-card-icon.info {
    background: var(--info-bg, hsl(199, 89%, 48%, 0.1));
    color: var(--info-text, var(--info));
}

.stat-card-icon.warning {
    background: var(--warning-bg, hsl(38, 92%, 50%, 0.1));
    color: var(--warning-text, var(--warning));
}

.stat-card-icon.danger {
    background: var(--danger-bg, hsl(0, 84%, 60%, 0.1));
    color: var(--danger-text, var(--destructive));
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main, var(--foreground));
    line-height: 1;
}

/* Search and Filter Bar */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-main, var(--foreground));
    transition: all 0.2s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted, var(--muted-foreground));
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, var(--muted-foreground));
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.filter-select {
    padding: 0.625rem 0.875rem;
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-main, var(--foreground));
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Data Table Styles */
.table-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card, var(--card));
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-hover, var(--muted));
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-main, var(--foreground));
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--bg-hover, var(--muted));
}

/* User Cell Component */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-cell-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-cell-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-cell-name {
    color: var(--text-main, var(--foreground));
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-cell-email {
    color: var(--text-muted, var(--muted-foreground));
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons Cell */
.action-buttons-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted, var(--muted-foreground));
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 2px);
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--bg-hover, var(--muted));
}

.icon-btn.btn-edit:hover {
    color: var(--info);
    background: var(--info-bg, hsl(199, 89%, 48%, 0.1));
}

.icon-btn.btn-delete:hover {
    color: var(--danger, var(--destructive));
    background: var(--danger-bg, hsl(0, 84%, 60%, 0.1));
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Pagination Component */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted, var(--muted-foreground));
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-controls button {
    padding: 0.5rem 1rem;
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main, var(--foreground));
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--bg-hover, var(--muted));
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls span {
    font-size: 0.875rem;
    color: var(--text-main, var(--foreground));
    font-weight: 500;
    padding: 0 0.5rem;
}

/* Section Card (for edit pages) */
.section-card {
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover, var(--muted));
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main, var(--foreground));
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 svg {
    color: var(--text-muted, var(--muted-foreground));
    width: 20px;
    height: 20px;
}

.section-header p {
    font-size: 0.75rem;
    color: var(--text-muted, var(--muted-foreground));
    margin: 0;
}

.section-content {
    padding: 1.5rem;
}

/* Page Header Section */
.page-header-section {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-section h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-main, var(--foreground));
    margin-bottom: 0.25rem;
}

.page-header-section p {
    color: var(--text-muted, var(--muted-foreground));
    font-size: 0.875rem;
    margin: 0;
}

/* Badge Variants */
.badge-success {
    background: var(--success-bg, hsl(142, 76%, 36%, 0.1));
    color: var(--success-text, var(--success));
}

.badge-danger {
    background: var(--danger-bg, hsl(0, 84%, 60%, 0.1));
    color: var(--danger-text, var(--destructive));
}

.badge-warning {
    background: var(--warning-bg, hsl(38, 92%, 50%, 0.1));
    color: var(--warning-text, var(--warning));
}

.badge-info {
    background: var(--info-bg, hsl(199, 89%, 48%, 0.1));
    color: var(--info-text, var(--info));
}

/* Responsive Design for Admin Interface */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input-wrapper {
        min-width: auto;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .pagination-info {
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }
    
    .page-header-section {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .user-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .action-buttons-cell {
        flex-direction: column;
        width: 100%;
    }
    
    .icon-btn {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================
   USER DASHBOARD - Dashboard Simplificado para Usuários Comuns
   ============================================ */

/* Welcome Section */
.welcome-section {
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-section h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-main, var(--foreground));
    margin-bottom: 0.5rem;
}

.welcome-section p {
    color: var(--text-muted, var(--muted-foreground));
    font-size: 1rem;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.module-card {
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    border-color: var(--primary);
}

.module-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg, #eff6ff);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--primary);
}

.module-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main, var(--foreground));
    margin-bottom: 0.5rem;
}

.module-card p {
    color: var(--text-muted, var(--muted-foreground));
    font-size: 0.875rem;
    margin-bottom: 1rem;
    flex: 1;
}

.module-card .btn {
    width: 100%;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted, var(--muted-foreground));
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-state p {
    margin-bottom: 0.5rem;
}

.empty-state p:last-child {
    font-size: 0.875rem;
    color: var(--text-light, var(--muted-foreground));
}

/* Quick Links & Personal Stats */
.quick-links,
.personal-stats {
    background: var(--bg-card, var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.quick-links h2,
.personal-stats h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main, var(--foreground));
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-section {
        padding: 2rem 1rem;
    }
    
    .welcome-section h1 {
        font-size: 1.5rem;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MODULE GRID (GroupModal)
   ============================================ */

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.module-checkbox-label {
    display: block;
    cursor: pointer;
    position: relative;
}

.module-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.module-checkbox-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    transition: var(--transition-smooth);
}

.module-checkbox-label input[type="checkbox"]:checked ~ .module-checkbox-content {
    border-color: var(--primary);
    background: hsl(221, 83%, 98%);
}

.module-checkbox-label:hover .module-checkbox-content {
    border-color: var(--primary-glow);
    box-shadow: var(--shadow-card);
}

.module-checkbox-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border-radius: calc(var(--radius) - 2px);
    color: var(--muted-foreground);
    transition: var(--transition-smooth);
}

.module-checkbox-label input[type="checkbox"]:checked ~ .module-checkbox-content .module-checkbox-icon {
    background: var(--primary);
    color: var(--primary-foreground);
}

.module-checkbox-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.module-checkbox-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--foreground);
}

.module-checkbox-desc {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}

.module-checkbox-label input[type="checkbox"]:disabled ~ .module-checkbox-content {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Section Styling */
.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.form-help {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.required {
    color: var(--destructive);
    margin-left: 0.25rem;
}

/* Modal Size Variants */
.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1200px;
}

/* ============================================
   ADMIN GROUP EDIT PAGE - SPECIFIC STYLES
   ============================================ */

/* Two Column Layout for Edit Pages */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Permissions Grid (2 columns, scrollable) */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--muted);
    border-radius: var(--radius);
}

.permission-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    transition: background 0.2s;
    cursor: pointer;
}

.permission-checkbox:hover {
    background: var(--background);
}

.permission-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox label {
    font-size: 0.8125rem;
    color: var(--foreground);
    cursor: pointer;
    margin: 0;
    user-select: none;
}

/* Member Info in Table */
.member-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.member-name {
    color: var(--foreground);
    font-weight: 500;
}

/* Icon Button for Actions */
.icon-btn {
    background: none;
    border: none;
    color: var(--destructive);
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 2px);
    transition: all 0.2s;
}

.icon-btn:hover {
    background: hsl(0, 84%, 60%, 0.1);
}

.icon-btn.btn-edit {
    color: var(--primary);
}

.icon-btn.btn-edit:hover {
    background: hsl(221, 83%, 53%, 0.1);
}

/* Action Buttons Cell */
.action-buttons-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* User Select Item (for modal) */
.user-select-item {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-select-item:hover {
    background: var(--muted);
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .permissions-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Select */
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--foreground);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--muted);
}

/* Form Help Text */
.form-help {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    display: block;
    margin-top: 0.25rem;
}

/* ============================================
   DEPARTMENT EDIT PAGE - SPECIFIC STYLES
   ============================================ */

/* Two Column Layout for Department Edit */
.two-column-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 1.5rem;
}

/* Section Cards */
.section-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 svg {
    color: var(--muted-foreground);
}

.section-header p {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin: 0;
}

.section-content {
    padding: 1.5rem;
}

/* Page Header Section */
.page-header-section {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header-section h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.page-header-section p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Form Elements */
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--foreground);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    resize: vertical;
    min-height: 5rem;
    line-height: 1.5;
}

.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--foreground);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.form-textarea:focus, 
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Search Input Wrapper */
.search-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    pointer-events: none;
}

/* Table Wrapper */
.table-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--foreground);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--muted);
}

/* Group Info */
.group-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.group-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.group-icon svg {
    width: 16px;
    height: 16px;
}

.group-name {
    color: var(--foreground);
    font-weight: 500;
}

.group-description {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Icon Button */
.icon-btn {
    background: none;
    border: none;
    color: var(--destructive);
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 2px);
    transition: all 0.2s;
}

.icon-btn:hover {
    background: hsl(0, 84%, 60%, 0.1);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Button with SVG */
.btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive for Department Edit */
@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }

    .group-description {
        max-width: 150px;
    }
}
/* Group Selection Item */
.group-select-item:hover {
    background: var(--muted);
}

.group-select-item:last-child {
    border-bottom: none;
}

/* Department List Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 16px;
    height: 16px;
}

.user-name {
    color: var(--foreground);
    font-weight: 500;
}

.user-description {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background: var(--destructive);
    color: white;
    border-color: var(--destructive);
}

.btn-danger:hover {
    background: hsl(0, 84%, 50%);
    border-color: hsl(0, 84%, 50%);
}

.filters-section {
    margin-bottom: 1.5rem;
}

.filters-section .search-input-wrapper {
    max-width: 400px;
}

/* ============================================
   WEBSOCKET STATUS WIDGET STYLES
   ============================================ */

.websocket-status-widget {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.websocket-status-widget:hover {
    box-shadow: var(--shadow-elegant);
    transform: translateY(-2px);
}

/* Widget Header */
.websocket-status-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.websocket-status-widget .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.websocket-status-widget .widget-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.websocket-status-widget .status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.websocket-status-widget .status-indicator.success {
    background: var(--success);
    color: white;
    animation: pulse-success 2s infinite;
}

.websocket-status-widget .status-indicator.warning {
    background: var(--warning);
    color: white;
}

.websocket-status-widget .status-indicator.danger {
    background: var(--destructive);
    color: white;
}

.websocket-status-widget .header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.websocket-status-widget .last-update {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    background: var(--muted);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* Loading State */
.websocket-status-widget.loading {
    text-align: center;
    padding: 2rem;
}

.websocket-status-widget .loading-spinner {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

/* Error Message */
.websocket-status-widget .error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: hsl(0 84% 60% / 0.1);
    border: 1px solid var(--destructive);
    border-radius: var(--radius-sm);
    color: var(--destructive);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Metrics Grid */
.websocket-status-widget .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.websocket-status-widget .metric-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--muted);
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.websocket-status-widget .metric-card:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

.websocket-status-widget .metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.websocket-status-widget .metric-content {
    flex: 1;
    min-width: 0;
}

.websocket-status-widget .metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1.2;
}

.websocket-status-widget .metric-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Activity Section */
.websocket-status-widget .activity-section {
    margin-bottom: 1.5rem;
}

.websocket-status-widget .activity-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.websocket-status-widget .activity-feed {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
}

.websocket-status-widget .no-activity {
    padding: 2rem;
    text-align: center;
    color: var(--muted-foreground);
    font-style: italic;
}

.websocket-status-widget .activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-smooth);
}

.websocket-status-widget .activity-item:last-child {
    border-bottom: none;
}

.websocket-status-widget .activity-item:hover {
    background: var(--muted);
}

.websocket-status-widget .activity-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.websocket-status-widget .activity-content {
    flex: 1;
    min-width: 0;
}

.websocket-status-widget .activity-message {
    font-size: 0.875rem;
    color: var(--foreground);
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.websocket-status-widget .activity-time {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Activity Types */
.websocket-status-widget .activity-item.user_online {
    border-left: 3px solid var(--success);
}

.websocket-status-widget .activity-item.user_offline {
    border-left: 3px solid var(--destructive);
}

.websocket-status-widget .activity-item.notification {
    border-left: 3px solid var(--info);
}

/* Server Info */
.websocket-status-widget .server-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--muted);
    border-radius: var(--radius-sm);
    border-top: 1px solid var(--border);
}

.websocket-status-widget .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.websocket-status-widget .info-label {
    color: var(--muted-foreground);
    font-weight: 500;
}

.websocket-status-widget .info-value {
    color: var(--foreground);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Pulse animation for status indicator */
@keyframes pulse-success {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Compact version for smaller spaces */
.websocket-status-widget.compact {
    padding: 1rem;
}

.websocket-status-widget.compact .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.websocket-status-widget.compact .metric-card {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem 0.5rem;
}

.websocket-status-widget.compact .metric-icon {
    width: 32px;
    height: 32px;
}

.websocket-status-widget.compact .metric-value {
    font-size: 1rem;
}

.websocket-status-widget.compact .activity-section {
    display: none;
}

.websocket-status-widget.compact .server-info {
    display: none;
}

/* Responsive Design for WebSocket Widget */
@media (max-width: 768px) {
    .websocket-status-widget {
        padding: 1rem;
    }

    .websocket-status-widget .widget-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .websocket-status-widget .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .websocket-status-widget .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .websocket-status-widget .metric-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .websocket-status-widget .activity-feed {
        max-height: 150px;
    }

    .websocket-status-widget .server-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .websocket-status-widget .info-item {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .websocket-status-widget .metrics-grid {
        grid-template-columns: 1fr;
    }

    .websocket-status-widget .metric-card {
        flex-direction: row;
        text-align: left;
    }
}

/* Dark mode adjustments for WebSocket widget */
.dark .websocket-status-widget {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .websocket-status-widget:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.dark .websocket-status-widget .activity-feed {
    border-color: var(--border);
}

.dark .websocket-status-widget .activity-item:hover {
    background: var(--sidebar-accent);
}


/* ============================================
   ORGANIZATIONAL UNITS MANAGEMENT
   ============================================ */

/* OU Management Container */
.ou-management {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.ou-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.ou-header h1 {
    font-size: 1.75rem;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.ou-header .subtitle {
    color: var(--muted-foreground);
    font-size: 0.95rem;
}

/* Tree Container */
.ou-tree {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

/* Tree Node */
.tree-node {
    margin: 0.25rem 0;
}

.tree-node-content {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    transition: var(--transition-smooth);
    gap: 0.5rem;
}

.tree-node-content:hover {
    background: var(--muted);
}

/* Toggle Button */
.tree-toggle {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.tree-toggle:hover {
    background: var(--border);
    color: var(--foreground);
}

.tree-toggle.invisible {
    visibility: hidden;
}

/* Tree Icon */
.tree-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tree Label */
.tree-label {
    flex: 1;
    font-weight: 500;
    color: var(--foreground);
}

/* Tree Badge */
.tree-badge {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Tree Actions */
.tree-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

.tree-node-content:hover .tree-actions {
    opacity: 1;
}

/* Icon Buttons */
.btn-icon {
    background: none;
    border: 1px solid var(--border);
    color: var(--foreground);
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--muted);
    border-color: var(--primary);
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon.btn-danger:hover {
    background: var(--destructive);
    color: white;
    border-color: var(--destructive);
}

/* Tree Children */
.tree-children {
    margin-left: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--muted-foreground);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.loading-state .spinner {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

/* Modal Content */
.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-elegant);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--foreground);
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition-smooth);
}

.btn-close:hover {
    color: var(--foreground);
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
}

/* Form Group */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--foreground);
    background: var(--background);
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(221, 83%, 53%, 0.1);
}

.form-input:disabled {
    background: var(--muted);
    cursor: not-allowed;
}

/* Form Info */
.form-info {
    padding: 0.75rem;
    background: var(--muted);
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form-info strong {
    color: var(--foreground);
}

/* Alert */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: hsla(0, 84%, 60%, 0.1);
    color: var(--destructive);
    border: 1px solid var(--destructive);
}

.alert-success {
    background: hsla(142, 76%, 36%, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: var(--primary-glow);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .ou-management {
        padding: 1rem;
    }
    
    .ou-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .ou-header .btn {
        width: 100%;
    }
    
    .tree-node-content {
        padding: 0.5rem;
    }
    
    .tree-actions {
        opacity: 1; /* Sempre visível no mobile */
    }
    
    .modal-content {
        max-width: 100%;
        margin: 0;
    }
}

/* ============================================
   OU GROUPS MODAL
   ============================================ */

/* Container for groups sections */
.ou-groups-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Section (Linked / Available) */
.ou-groups-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ou-groups-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Divider between sections */
.ou-groups-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* List of groups */
.ou-groups-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.25rem;
}

/* Empty state */
.ou-groups-empty {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-style: italic;
    padding: 1rem;
    text-align: center;
    background: var(--muted);
    border-radius: var(--radius-sm);
}

/* Group item */
.ou-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    transition: var(--transition-smooth);
}

.ou-group-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px hsl(221 83% 53% / 0.1);
}

/* Linked group (different background) */
.ou-group-item--linked {
    background: var(--muted);
    border-color: var(--success);
}

.ou-group-item--linked:hover {
    border-color: var(--success);
    box-shadow: 0 2px 8px hsl(142 76% 36% / 0.1);
}

/* Group info */
.ou-group-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.ou-group-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--foreground);
}

.ou-group-meta {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}

/* Group actions */
.ou-group-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Button sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-danger {
    background: var(--destructive);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-danger:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .ou-group-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .ou-group-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .ou-groups-list {
        max-height: 250px;
    }
}


/* ============================================
   OU TREE COMPONENT STYLES
   ============================================ */

.ou-tree {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ou-tree-node {
    display: flex;
    flex-direction: column;
}

.ou-tree-node-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.ou-tree-node-content:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px hsl(221 83% 53% / 0.1);
}

.ou-tree-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--muted-foreground);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ou-tree-toggle:hover {
    color: var(--foreground);
}

.ou-tree-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ou-tree-label {
    flex: 1;
    min-width: 0;
}

.ou-tree-label > div:first-child {
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.95rem;
}

.ou-tree-label > div:last-child {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.ou-tree-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.ou-tree-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    white-space: nowrap;
}

.ou-tree-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-shrink: 0;
}

.ou-tree-actions button {
    padding: 0.4rem;
    font-size: 0.875rem;
    background: var(--muted);
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--foreground);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ou-tree-actions button:hover:not(:disabled) {
    background: var(--primary);
    color: var(--primary-foreground);
}

.ou-tree-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ou-tree-actions .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.ou-tree-children {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .ou-tree-actions button {
        padding: 0.35rem;
        font-size: 0.8rem;
    }
    
    .ou-tree-badges {
        gap: 0.25rem;
    }
}

@media (max-width: 768px) {
    .ou-tree-node-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .ou-tree-badges {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .ou-tree-actions {
        order: 4;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .ou-tree-actions button {
        flex: 1;
        min-width: 60px;
    }
}
