/* ===== Glass Card ===== */
.glass-card {
    background: hsla(var(--color-surface-elevated), 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .glass-card:hover {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* ===== Stat Card ===== */
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    background: hsla(var(--color-surface-elevated), 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(30%, -30%);
    pointer-events: none;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-card .stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: hsl(var(--color-muted));
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
    margin-top: 0.25rem;
}

.stat-card .stat-subtext {
    font-size: 0.75rem;
    color: hsl(var(--color-muted));
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

[data-theme="light"] .stat-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.06);
}

/* ===== Sidebar ===== */
.sidebar {
    background: hsl(var(--color-surface));
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    width: 260px;
    min-height: 100vh;
    position: relative;
    z-index: 30;
}

[data-theme="light"] .sidebar {
    background: hsl(var(--color-surface));
    border-right-color: rgba(0, 0, 0, 0.08);
}

.sidebar .brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .brand-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar .brand-logo svg {
    width: 18px;
    height: 18px;
    color: white;
}

.sidebar .brand-text {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}

.sidebar .brand-text .accent {
    color: hsl(var(--color-primary));
}

.sidebar nav {
    flex: 1;
    padding: 0.75rem;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: hsl(var(--color-muted));
    padding: 0.75rem 0.75rem 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--color-muted-foreground));
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    color: hsl(var(--color-foreground));
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: hsl(var(--color-primary));
    background: hsla(var(--color-primary), 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: hsl(var(--color-primary));
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
}

[data-theme="light"] .nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .nav-item.active {
    background: hsla(var(--color-primary), 0.08);
}

/* Sidebar User Block */
.sidebar-user {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0 0.5rem;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.sidebar-user-info:hover {
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-meta {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    color: hsl(var(--color-muted));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--color-muted));
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-logout:hover {
    color: hsl(var(--color-danger));
    background: hsla(var(--color-danger), 0.08);
}

.sidebar-logout svg {
    width: 16px;
    height: 16px;
}

/* ===== Dashboard Header ===== */
.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dash-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.dash-header .subtitle {
    font-size: 0.875rem;
    color: hsl(var(--color-muted));
    margin-top: 0.25rem;
}

.dash-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
    transition: all var(--transition-fast);
}

.status-badge.online {
    color: hsl(var(--color-success));
    background: hsla(var(--color-success), 0.08);
    border-color: hsla(var(--color-success), 0.2);
}

.status-badge .pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    position: relative;
}

.status-badge .pulse-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { opacity: 0.6; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(2); }
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: hsla(var(--color-surface-elevated), 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: hsl(var(--color-muted));
}

.theme-toggle:hover {
    color: hsl(var(--color-foreground));
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

[data-theme="light"] .theme-toggle {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

/* ===== Data Grid / Empty State ===== */
.data-section {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: hsla(var(--color-surface-elevated), 0.3);
    overflow: hidden;
}

.data-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-section-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-section-header h2 svg {
    width: 16px;
    height: 16px;
    color: hsl(var(--color-muted));
}

.data-section-body {
    padding: 2rem 1.5rem;
}

[data-theme="light"] .data-section {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .data-section-header {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: hsla(var(--color-primary), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    color: hsl(var(--color-primary));
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.empty-state p {
    font-size: 0.8125rem;
    color: hsl(var(--color-muted));
    max-width: 280px;
}

/* ===== Skeleton Loader ===== */
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

[data-theme="light"] .skeleton {
    background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
    background-size: 200% 100%;
}

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

/* ===== Quick Actions Grid ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: hsla(var(--color-surface-elevated), 0.3);
    color: hsl(var(--color-foreground));
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-action-btn:hover {
    background: hsla(var(--color-surface-elevated), 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.quick-action-btn svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

[data-theme="light"] .quick-action-btn {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Flash Messages */
.flash-message {
    backdrop-filter: blur(12px);
}

.flash-message.bg-danger {
    background-color: hsl(var(--color-danger));
}

.flash-message.bg-success {
    background-color: hsl(var(--color-success));
}

.flash-message.bg-warning {
    background-color: hsl(var(--color-warning));
}

/* Inputs */
input:focus {
    outline: 2px solid hsl(var(--color-primary));
    outline-offset: 2px;
}