/* ═══════════════════════════════════════════════════════════════════
   Hytale Server Panel - Minimal Modern Design
   Clean, professional interface with refined typography and spacing
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* Neutral base - zinc scale */
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-elevated: #27272a;
    --bg-card: #1c1c1f;
    --bg-input: #0c0c0e;
    --bg-hover: #2a2a2e;
    
    /* Accent - refined cyan */
    --accent-primary: #22d3ee;
    --accent-secondary: #06b6d4;
    --accent-muted: rgba(34, 211, 238, 0.1);
    --accent-subtle: rgba(34, 211, 238, 0.05);
    
    /* Text hierarchy */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-faint: #52525b;
    
    /* Status colors - muted variants */
    --status-online: #4ade80;
    --status-online-muted: rgba(74, 222, 128, 0.15);
    --status-offline: #f87171;
    --status-offline-muted: rgba(248, 113, 113, 0.15);
    --status-warning: #fbbf24;
    --status-warning-muted: rgba(251, 191, 36, 0.15);
    
    /* Borders */
    --border-primary: #27272a;
    --border-subtle: #1f1f23;
    --border-hover: #3f3f46;
    
    /* Typography */
    --font-display: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', 'SF Mono', 'Consolas', monospace;
    
    /* Spacing - generous scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
    
    /* Container widths */
    --container-narrow: 640px;
    --container-default: 1200px;
    --container-wide: 1400px;
    
    /* Radii - softer corners */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows - subtle elevation */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.4);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ═══════════════════════════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Page fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-content {
    animation: fadeIn 0.4s ease-out;
}

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

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

/* ═══════════════════════════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

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

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

.text-sm {
    font-size: 0.8125rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-success {
    color: var(--status-online);
}

.text-danger {
    color: var(--status-offline);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-elevated);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   Navbar
   ═══════════════════════════════════════════════════════════════════ */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(24, 24, 27, 0.9);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo {
    font-size: 1.25rem;
    color: var(--accent-primary);
    opacity: 0.9;
}

.brand-text {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.navbar-menu {
    display: flex;
    gap: var(--space-xs);
}

.nav-link {
    position: relative;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: var(--space-md);
    right: var(--space-md);
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.username {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--accent-primary);
}

.role-badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-admin {
    background: var(--accent-muted);
    color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   Main Content
   ═══════════════════════════════════════════════════════════════════ */

.main-content {
    padding: var(--space-xl);
    max-width: var(--container-wide);
    margin: 0 auto;
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.header-content {
    flex: 1;
}

.header-actions {
    display: flex;
    gap: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: border-color var(--transition-fast);
}

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

.card h2 {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin-bottom: var(--space-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding-top: var(--space-sm);
}

/* Margin utilities */
.mb-4 {
    margin-bottom: var(--space-lg);
}

.mt-2 {
    margin-top: var(--space-sm);
}

.mt-3 {
    margin-top: var(--space-md);
}

/* ═══════════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.5rem 1rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

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

.btn-success {
    background: var(--status-online);
    border-color: var(--status-online);
    color: var(--bg-primary);
}

.btn-success:hover {
    background: #22c55e;
    border-color: #22c55e;
}

.btn-danger {
    background: transparent;
    border-color: var(--status-offline);
    color: var(--status-offline);
}

.btn-danger:hover {
    background: var(--status-offline);
    color: white;
}

.btn-warning {
    background: transparent;
    border-color: var(--status-warning);
    color: var(--status-warning);
}

.btn-warning:hover {
    background: var(--status-warning);
    color: var(--bg-primary);
}

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

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-color: var(--border-primary);
}

.btn-danger-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--status-offline);
}

.btn-danger-ghost:hover {
    background: var(--status-offline-muted);
    border-color: transparent;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
}

.btn-block {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   Forms
   ═══════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: var(--space-lg);
}

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

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select,
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
}

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

input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

input[readonly],
.form-control[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-text {
    margin-top: var(--space-xs);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

small.form-text {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-row .form-group {
    margin-bottom: var(--space-md);
}

.col {
    min-width: 0;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.checkbox-group {
    margin-top: var(--space-md);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

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

/* ═══════════════════════════════════════════════════════════════════
   Alerts
   ═══════════════════════════════════════════════════════════════════ */

.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.9375rem;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--status-offline-muted);
    border-color: rgba(248, 113, 113, 0.25);
    color: var(--status-offline);
}

.alert-success {
    background: var(--status-online-muted);
    border-color: rgba(74, 222, 128, 0.25);
    color: var(--status-online);
}

.alert-warning {
    background: var(--status-warning-muted);
    border-color: rgba(251, 191, 36, 0.25);
    color: var(--status-warning);
}

/* ═══════════════════════════════════════════════════════════════════
   Login Page
   ═══════════════════════════════════════════════════════════════════ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: var(--space-lg);
    position: relative;
    z-index: 1;
    animation: fadeIn 0.5s ease-out;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-logo {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
    opacity: 0.9;
}

.login-header h1 {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-form {
    margin-top: var(--space-lg);
}

.login-form .form-group {
    margin-bottom: var(--space-lg);
}

.login-form .btn {
    margin-top: var(--space-sm);
}

.login-footer {
    text-align: center;
    margin-top: var(--space-xl);
    color: var(--text-faint);
    font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════
   Dashboard
   ═══════════════════════════════════════════════════════════════════ */

.dashboard {
    animation: fadeIn 0.4s ease-out;
}

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.server-card {
    transition: all var(--transition-fast);
}

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

.server-card .card-header h3 {
    font-size: 1.0625rem;
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
}

.info-row .label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.info-row .value {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.server-actions {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-loading {
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.status-loading::before {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.status-badge.status-online {
    background: var(--status-online-muted);
    color: var(--status-online);
}

.status-badge.status-offline {
    background: var(--status-offline-muted);
    color: var(--status-offline);
}

/* Dashboard stat cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

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

.stat-content h3 {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.status-online {
    color: var(--status-online);
}

.status-offline {
    color: var(--status-offline);
}

.dashboard-actions {
    margin-top: var(--space-xl);
}

.dashboard-actions h2 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.action-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════
   Server Page
   ═══════════════════════════════════════════════════════════════════ */

.server-page .page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.server-selector {
    min-width: 200px;
}

.server-selector .form-select {
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Server page layout */
.server-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.server-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.server-console {
    min-width: 0;
}

/* Status card */
.server-status-card {
    margin-bottom: 0;
}

.server-status-card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.status-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.status-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.status-value {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Server controls */
.server-controls h2 {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
}

.control-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.control-form {
    display: contents;
}

/* ═══════════════════════════════════════════════════════════════════
   Console
   ═══════════════════════════════════════════════════════════════════ */

.console-card {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.console-card h2 {
    margin-bottom: 0;
    font-size: 0.8125rem;
    font-weight: 500;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-md);
}

.console-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-faint);
    transition: all var(--transition-base);
}

.status-dot.connected {
    background: var(--status-online);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
    }
    50% { 
        box-shadow: 0 0 12px rgba(74, 222, 128, 0.8);
    }
}

.status-dot.disconnected {
    background: var(--status-offline);
}

.console-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.8;
    scroll-behavior: smooth;
}

.console-welcome {
    color: var(--text-faint);
    padding: var(--space-lg);
    text-align: center;
    font-family: var(--font-display);
}

.console-hint {
    font-size: 0.75rem;
    margin-top: var(--space-xs);
}

.console-line {
    margin-bottom: 2px;
}

.console-line.command {
    color: var(--accent-primary);
}

.console-line.response {
    color: var(--text-primary);
    white-space: pre-wrap;
    padding-left: var(--space-md);
}

.console-line.error {
    color: var(--status-offline);
}

.console-line.system {
    color: var(--text-muted);
    font-style: italic;
}

/* Journal log styling */
.console-line.journal {
    color: var(--text-secondary);
}

.console-line.journal .log-timestamp {
    color: var(--text-faint);
    font-size: 0.75rem;
    margin-right: var(--space-sm);
}

.console-line.journal .log-content {
    color: var(--text-primary);
}

/* Console input */
.console-input-form {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
}

.console-prompt {
    color: var(--accent-primary);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.875rem;
}

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

.console-input::placeholder {
    color: var(--text-faint);
}

.console-readonly-notice {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════
   Tables
   ═══════════════════════════════════════════════════════════════════ */

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

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-md);
    text-align: left;
}

.table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-primary);
}

.table td {
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}

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

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-elevated);
}

.server-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.server-name strong {
    font-weight: 500;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 500;
}

.badge-success {
    background: var(--status-online-muted);
    color: var(--status-online);
}

.badge-secondary {
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.action-buttons.small {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════════════
   Server Management Page
   ═══════════════════════════════════════════════════════════════════ */

.server-management .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.super-panel {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(34, 211, 238, 0.02) 100%);
}

.super-panel h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.super-panel p {
    margin-bottom: var(--space-md);
}

/* Memory Stats in Super Panel */
.memory-stats {
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.memory-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.memory-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.memory-value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.memory-percent {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.progress-bar-container {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.servers-list {
    margin-top: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════════
   Users Page
   ═══════════════════════════════════════════════════════════════════ */

.users-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.page-header-content {
    flex: 1;
}

.btn-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.users-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border-bottom-color: var(--border-primary);
}

.users-table tbody tr {
    transition: background var(--transition-fast);
}

.users-table tbody tr:hover {
    background: var(--bg-elevated);
}

.user-row-admin {
    background: var(--accent-subtle);
}

.user-name {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
}

.users-table .user-avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--accent-primary);
}

.badge-admin {
    background: var(--accent-muted);
    color: var(--accent-primary);
}

.badge-user {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.badge-you {
    background: var(--status-warning-muted);
    color: var(--status-warning);
    margin-left: var(--space-xs);
}

.permissions-cell {
    max-width: 300px;
}

.perm-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    margin: 0.125rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.perm-all {
    background: var(--accent-muted);
    color: var(--accent-primary);
}

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

.date-cell {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.actions-cell {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

/* ═══════════════════════════════════════════════════════════════════
   Form Pages
   ═══════════════════════════════════════════════════════════════════ */

.server-form-page {
    max-width: var(--container-narrow);
}

.user-form-page {
    max-width: var(--container-wide);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--accent-primary);
}

.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.form-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.section-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.form-hint {
    margin-top: var(--space-xs);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.input-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Permission groups */
.permission-groups {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.permission-group {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.permission-group-header {
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-primary);
}

.permission-group-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.group-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

.permission-list {
    display: flex;
    flex-direction: column;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-subtle);
}

.permission-item:last-child {
    border-bottom: none;
}

.permission-item:hover {
    background: var(--bg-elevated);
}

.permission-item input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.permission-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.permission-label {
    font-weight: 500;
    color: var(--text-primary);
}

.permission-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

.form-actions-split {
    justify-content: space-between;
}

.user-form,
.server-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════════
   User Form - Two Column Layout
   ═══════════════════════════════════════════════════════════════════ */

.user-form-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-lg);
}

.form-section-account {
    position: sticky;
    top: calc(60px + var(--space-lg));
    align-self: start;
}

.form-section-perms {
    min-width: 0;
}

/* Compact permission grid for global permissions */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.perm-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.perm-category-header {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-primary);
}

.perm-category-items {
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.perm-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.perm-toggle:hover {
    background: var(--bg-hover);
}

.perm-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--accent-primary);
}

.perm-toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.perm-toggle input:checked + .perm-toggle-label {
    color: var(--text-primary);
}

/* Per-Server Overrides Section */
.form-section-overrides {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.overrides-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.overrides-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.add-server-inline {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.server-select-inline {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8125rem;
    min-width: 180px;
}

.server-select-inline:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* Server Override Cards - Horizontal Layout */
.server-overrides-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.server-overrides-container:empty::before {
    content: 'No per-server overrides. Permissions will be determined by global settings above.';
    display: block;
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-primary);
    border-radius: var(--radius-md);
}

.server-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-primary);
}

.server-card-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-remove:hover {
    color: var(--status-offline);
    background: var(--status-offline-muted);
}

/* Server permissions in horizontal grid */
.server-card-perms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1px;
    background: var(--border-primary);
}

.server-perm-cat {
    background: var(--bg-card);
    padding: var(--space-md);
}

.server-perm-cat-name {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.server-perm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
}

.server-perm-name {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Tri-state toggle (Inherit / Grant / Deny) */
.tri-toggle {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.tri-opt {
    cursor: pointer;
}

.tri-opt input {
    display: none;
}

.tri-opt span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.tri-opt:hover span {
    background: var(--bg-hover);
}

.tri-inherit input:checked + span {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.tri-grant input:checked + span {
    background: var(--status-online);
    color: var(--bg-primary);
}

.tri-deny input:checked + span {
    background: var(--status-offline);
    color: white;
}

/* Responsive - stack on mobile */
@media (max-width: 900px) {
    .user-form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-section-account {
        position: static;
    }
    
    .permission-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .overrides-header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .add-server-inline {
        width: 100%;
    }
    
    .server-select-inline {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .permission-grid {
        grid-template-columns: 1fr;
    }
    
    .server-card-perms {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Players
   ═══════════════════════════════════════════════════════════════════ */

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
}

.player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
}

.player-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.player-avatar {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.player-name {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.player-status {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.player-status.online {
    color: var(--status-online);
}

.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}

.players-actions {
    margin-top: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════════
   Error Page
   ═══════════════════════════════════════════════════════════════════ */

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.error-container {
    text-align: center;
    padding: var(--space-lg);
}

.error-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 400px;
}

.error-icon {
    font-size: 3rem;
    color: var(--status-warning);
    margin-bottom: var(--space-lg);
    opacity: 0.8;
}

.error-card h1 {
    font-size: 1.375rem;
    margin-bottom: var(--space-sm);
}

.error-card p {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════════
   Modals
   ═══════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    transform: translateY(16px) scale(0.98);
    transition: transform var(--transition-slow) cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    margin-bottom: var(--space-md);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: var(--space-xl);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: var(--space-sm);
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   Loading Spinner
   ═══════════════════════════════════════════════════════════════════ */

.spinner {
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-rotate 0.75s linear infinite;
    display: inline-block;
    vertical-align: text-bottom;
}

@keyframes spinner-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn .spinner {
    margin-right: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--status-online);
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--transition-base);
    pointer-events: auto;
    max-width: 400px;
    font-size: 0.9375rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--status-online);
}

.toast-error {
    border-left-color: var(--status-offline);
}

.toast-warning {
    border-left-color: var(--status-warning);
}

/* ═══════════════════════════════════════════════════════════════════
   Scrollbar
   ═══════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-faint);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) transparent;
}

/* ═══════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .server-layout {
        grid-template-columns: 1fr;
    }
    
    .console-card {
        height: 500px;
    }
}

@media (max-width: 768px) {
    :root {
        --space-xl: 1.5rem;
        --space-2xl: 2.5rem;
    }
    
    .navbar {
        flex-wrap: wrap;
        gap: var(--space-sm);
        padding: var(--space-md);
    }
    
    .navbar-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 0;
        margin-top: var(--space-sm);
        padding-top: var(--space-sm);
        border-top: 1px solid var(--border-subtle);
    }
    
    .nav-link {
        padding: var(--space-sm);
        font-size: 0.8125rem;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    .nav-link.active {
        background: var(--accent-muted);
        color: var(--accent-primary);
        border-radius: var(--radius-md);
    }
    
    .main-content {
        padding: var(--space-md);
    }
    
    .servers-grid {
        grid-template-columns: 1fr;
    }
    
    .console-output {
        font-size: 0.75rem;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .control-buttons .btn {
        width: 100%;
    }
    
    .console-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .console-card {
        height: 400px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .users-page .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .users-page .page-header .btn {
        width: 100%;
    }
    
    .table-container {
        margin: 0 calc(var(--space-lg) * -1);
    }
    
    .table th:first-child,
    .table td:first-child {
        padding-left: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: var(--space-xl);
    }
    
    .login-logo {
        font-size: 2rem;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Per-Server Permission Overrides
   ═══════════════════════════════════════════════════════════════════ */

.server-overrides {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.server-override-card {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    overflow: hidden;
}

.server-override-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-primary);
}

.btn-remove-server {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-remove-server:hover {
    color: var(--status-offline);
    background: var(--status-offline-muted);
}

.server-permissions-grid {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.server-perm-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.server-perm-group-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.server-perm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    gap: var(--space-md);
}

.server-perm-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex: 1;
}

.server-perm-options {
    display: flex;
    gap: var(--space-xs);
}

.server-perm-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.server-perm-option input[type="radio"] {
    display: none;
}

.option-label {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    background: var(--bg-card);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.server-perm-option input[type="radio"]:checked + .option-inherit {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border-hover);
}

.server-perm-option input[type="radio"]:checked + .option-grant {
    background: var(--status-online-muted);
    color: var(--status-online);
    border-color: var(--status-online);
}

.server-perm-option input[type="radio"]:checked + .option-deny {
    background: var(--status-offline-muted);
    color: var(--status-offline);
    border-color: var(--status-offline);
}

.option-label:hover {
    background: var(--bg-hover);
}

/* Add server override section */
.add-server-override {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px dashed var(--border-primary);
    border-radius: var(--radius-md);
}

.server-select {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.server-select:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

.server-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.server-select option:disabled {
    color: var(--text-muted);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

/* Empty state */
.server-overrides:empty::before {
    content: 'No per-server overrides configured. Add a server above to customize permissions.';
    display: block;
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-primary);
    border-radius: var(--radius-md);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .server-perm-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .server-perm-options {
        width: 100%;
        justify-content: flex-start;
    }
    
    .add-server-override {
        flex-direction: column;
    }
    
    .server-select {
        width: 100%;
    }
}