/* ========================================
   CYBER MINIMALIST DARK ENTERPRISE
   Premium Industrial Dashboard Design System
   ======================================== */

:root {
    /* FONDOS - Negros Profundos */
    --bg-void: #050505;
    --bg-deep: #080808;
    --bg-dark: #0d0d0d;
    --bg-elevated: #111111;
    --bg-card: #0a0a0a;
    --bg-input: #0f0f0f;
    --bg-hover: #141414;

    /* BORDES - Sutiles */
    --border-subtle: #1a1a1a;
    --border-soft: #222222;
    --border-medium: #2a2a2a;
    --border-focus: #333333;

    /* TEXTO */
    --text-bright: #ffffff;
    --text-primary: #e8e8e8;
    --text-secondary: #9a9a9a;
    --text-muted: #8a8a8a;       /* era #6b6b6b — subido para cumplir WCAG AA (4.5:1 sobre bg-void) */
    --text-dim: #6a6a6a;         /* era #4a4a4a — subido por la misma razón */

    /* ACCENT - Verde Neón/Lima */
    --accent-lime: #bfff00;
    --accent-lime-rgb: 191, 255, 0;
    --accent-lime-dim: rgba(191, 255, 0, 0.08);
    --accent-lime-soft: rgba(191, 255, 0, 0.15);
    --accent-lime-glow: rgba(191, 255, 0, 0.25);

    /* Estados */
    --state-warning: #f5c000;
    --state-error: #ff4444;
    --state-error-dim: rgba(255, 68, 68, 0.1);
    --state-success: var(--accent-lime);

    /* Colores de Rango */
    --rank-superadmin: #FF2800; /* Rojo para Superadmin */
    --rank-fundador: #8B0000;
    --rank-almirante: #FF2800; /* Rojo para Almirante */
    --rank-comodoro: #FF6600;
    --rank-oficial: #FFD700;
    --rank-guardian: #7FFF00;
    --rank-marinero: #0066FF;
    --rank-grumete: #8B5CF6;
    --rank-exlai: #FF6B9D;
    --rank-corsarios: #B45309;
    --rank-recluta: #696969;

    /* Sidebar */
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --sidebar-bg: var(--bg-void);

    /* Typography */
    --font-display: 'Inter', 'Space Grotesk', 'Satoshi', -apple-system, sans-serif;
    --font-ui: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Sizes */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 32px;
    --text-4xl: 48px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Elevation tokens (sombras semánticas) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-lime: 0 0 0 1px rgba(191, 255, 0, 0.2), 0 4px 12px rgba(191, 255, 0, 0.08);

    /* Semantic colors unificados */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

/* ========================================
   RESET & BASE
   ======================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-void);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   LAYOUT
   ======================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: width 0.3s var(--ease-out);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: var(--space-4) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-title {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.app-logo {
    font-size: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-text {
    opacity: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-6);
}

/* Colores por tema para los grupos del sidebar.
   --theme es una triplete RGB (sin rgba()) para poder componer
   con opacidad dinámica. Aplica solo a título + estado activo. */
.nav-section[data-theme="puntos"]  { --theme: 191, 255, 0;   }
.nav-section[data-theme="barcos"]  { --theme: 34, 211, 238;  }
.nav-section[data-theme="discord"] { --theme: 142, 155, 255; }
.nav-section[data-theme="torneo"]  { --theme: 251, 191, 36;  }
.nav-section[data-theme="admin"]   { --theme: 168, 85, 247;  }

.nav-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 var(--space-2);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Tint the section title icon + label with the theme color.
   Texto queda un poco más opaco que el icono para no gritar. */
.nav-section[data-theme] .nav-section-title {
    color: rgba(var(--theme), 0.85);
    text-shadow: 0 0 8px rgba(var(--theme), 0.35);
}
.nav-section[data-theme] .nav-section-title .nav-icon {
    color: rgb(var(--theme));
    filter: drop-shadow(0 0 4px rgba(var(--theme), 0.5));
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    margin-bottom: 1px;
    font-size: var(--text-sm);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-lime-dim);
    color: var(--accent-lime);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-lime);
    box-shadow: 0 0 12px var(--accent-lime);
}

/* Override del estado activo por tema:
   fondo tenue, texto, icono y borde 2px con glow usan el color del tema.
   Mismo patrón visual que el lima original, solo cambia el tinte.
   Glow en dos capas (núcleo + halo) para que se vea bien incluso
   con colores más oscuros como el violeta. */
.nav-section[data-theme] .nav-item:hover {
    background: rgba(var(--theme), 0.12);
    color: rgb(var(--theme));
}

.nav-section[data-theme] .nav-item.active {
    background: rgba(var(--theme), 0.18);
    color: rgb(var(--theme));
    text-shadow: 0 0 10px rgba(var(--theme), 0.6);
}

.nav-section[data-theme] .nav-item.active::before {
    background: rgb(var(--theme));
    box-shadow:
        0 0 4px rgb(var(--theme)),
        0 0 10px rgba(var(--theme), 0.9),
        0 0 20px rgba(var(--theme), 0.6);
}

.nav-section[data-theme] .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 6px rgba(var(--theme), 0.7));
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

.user-panel {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

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

.user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

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

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s var(--ease-out);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

.content-header {
    background: var(--bg-void);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.mobile-menu-toggle {
    display: none;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.content-section {
    padding: var(--space-6) var(--space-6);
    display: none;
    animation: fadeIn 0.2s var(--ease-out);
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: var(--space-6);
}

.section-header h2 {
    font-size: var(--text-3xl);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-1);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-base);
}

/* ========================================
   TABLE
   ======================================== */

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow-x: auto;  /* scroll horizontal en móvil */
}

/* ==================== BULK POINTS UI ==================== */

.th-bulk {
    width: 40px;
    text-align: center;
    padding: var(--space-2) !important;
}

.th-bulk input[type="checkbox"],
.td-bulk input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-lime, #bfff00);
}

.td-bulk {
    text-align: center;
    padding: var(--space-2) !important;
}

.bulk-checkbox:not(:disabled) { cursor: pointer; }
.bulk-checkbox:disabled { opacity: 0.3; cursor: not-allowed; }

.bulk-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    /* Antes tenía backdrop-filter:blur(8px) — causa repaints costosos en
       operaciones de bulk donde se actualizan muchos elementos. Lo quitamos
       y subimos la opacidad del gradiente para mantener look. */
    background: linear-gradient(135deg, rgba(191, 255, 0, 0.18), rgba(88, 101, 242, 0.18));
    border: 1px solid rgba(191, 255, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-4);
    margin-top: var(--space-3);
    animation: slideUpFade 0.25s var(--ease-out);
}

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

.bulk-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-primary);
    font-weight: 500;
    font-size: var(--text-sm);
}

#bulkSelectedCount {
    color: var(--accent-lime, #bfff00);
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    min-width: 1.5em;
    display: inline-block;
}

.bulk-points-names {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: var(--space-2);
    max-height: 120px;
    overflow-y: auto;
    padding: var(--space-2);
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.bulk-chip {
    background: rgba(191, 255, 0, 0.1);
    color: var(--accent-lime, #bfff00);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(191, 255, 0, 0.2);
}

.bulk-action-toggle {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.bulk-action-btn {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all 0.15s var(--ease-out);
}

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

.bulk-action-btn.active {
    background: rgba(191, 255, 0, 0.12);
    border-color: var(--accent-lime, #bfff00);
    color: var(--accent-lime, #bfff00);
}

#bulkActionRemove.active {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--danger, #ef4444);
    color: var(--danger, #ef4444);
}

.quick-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.quick-reasons button {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: all 0.15s var(--ease-out);
}

.quick-reasons button:hover {
    background: var(--bg-hover);
    border-color: var(--accent-lime, #bfff00);
    color: var(--accent-lime, #bfff00);
}

/* ==================== SHIPS CATALOG (visual) ==================== */

.ships-filters {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
}

.ships-filters .input-field {
    padding: 6px 10px;
    font-size: var(--text-sm);
}

.ship-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-3);
}

.ship-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    position: relative;
}

.ship-card:hover {
    transform: translateY(-3px);
    border-color: rgba(191, 255, 0, 0.3);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.ship-card-image {
    position: relative;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #0a1218, #0d1620);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.ship-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
    transition: transform 0.3s var(--ease-out);
}

.ship-card:hover .ship-card-image img {
    transform: scale(1.05);
}

.ship-card-placeholder {
    font-size: 56px;
    opacity: 0.35;
}

.ship-premium-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a1a;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.ship-faction-flag {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 18px;
    background: rgba(10, 12, 16, 0.7);
    backdrop-filter: blur(4px);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.ship-card-body {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.ship-card-title {
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.3;
    /* Truncar a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.ship-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ship-tag {
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.ship-card-stats {
    display: flex;
    gap: var(--space-2);
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--font-mono, monospace);
    padding-top: var(--space-1);
    border-top: 1px dashed var(--border-subtle);
    flex-wrap: wrap;
}

.ship-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.ship-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.ship-card-id {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
}

.ship-delete-btn {
    padding: 4px 8px !important;
    font-size: 12px;
}

.bulk-ships-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(191, 255, 0, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-left: 3px solid var(--info, #3b82f6);
}

.bulk-ships-card textarea {
    font-family: var(--font-mono, monospace);
    font-size: var(--text-sm);
    resize: vertical;
}

.bulk-ships-card code {
    background: var(--bg-deep);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    color: var(--accent-lime, #bfff00);
    font-size: 12px;
}

@media (max-width: 640px) {
    .ship-cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .ships-filters { flex-direction: column; align-items: stretch; }
    .ships-filters .input-field { width: 100% !important; }
}

/* ==================== WOSB SEED CARD ==================== */

.wosb-seed-card {
    background: linear-gradient(135deg, rgba(191, 255, 0, 0.05), rgba(88, 101, 242, 0.05));
    border: 1px solid rgba(191, 255, 0, 0.2);
    border-left: 3px solid var(--accent-lime, #bfff00);
}

.wosb-seed-card h3 {
    color: var(--accent-lime, #bfff00);
    font-size: var(--text-base);
    font-weight: 600;
}

/* ==================== WORLD OF SEA BATTLE ==================== */

.wosb-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.wosb-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    border-left: 3px solid var(--border-subtle);
}

.wosb-stat-controlled { border-left-color: #22c55e; }
.wosb-stat-contested  { border-left-color: #f59e0b; }
.wosb-stat-neutral    { border-left-color: #94a3b8; }
.wosb-stat-lost       { border-left-color: #ef4444; }
.wosb-stat-total      { border-left-color: var(--accent-lime, #bfff00); }

.wosb-stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wosb-stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    font-family: var(--font-mono, monospace);
}

.wosb-stat-total .wosb-stat-value { color: var(--accent-lime, #bfff00); }

.wosb-toolbar {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    align-items: center;
    flex-wrap: wrap;
}

.wosb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
}

.wosb-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-12);
    color: var(--text-muted);
}

.wosb-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: all 0.2s var(--ease-out);
    position: relative;
    overflow: hidden;
    animation: wosbSlide 0.3s var(--ease-out) backwards;
}

.wosb-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--border-subtle);
}
.wosb-card.wosb-controlled::before { background: #22c55e; }
.wosb-card.wosb-contested::before  { background: #f59e0b; }
.wosb-card.wosb-neutral::before    { background: #94a3b8; }
.wosb-card.wosb-lost::before       { background: #ef4444; }

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

.wosb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(191, 255, 0, 0.2);
}

.wosb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wosb-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
}
.wosb-status-pill.controlled { color: #22c55e; border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.08); }
.wosb-status-pill.contested  { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.08); }
.wosb-status-pill.neutral    { color: #94a3b8; border-color: rgba(148, 163, 184, 0.3); background: rgba(148, 163, 184, 0.08); }
.wosb-status-pill.lost       { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); }

.wosb-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.wosb-status-dot.controlled { background: #22c55e; }
.wosb-status-dot.contested  { background: #f59e0b; }
.wosb-status-dot.neutral    { background: #94a3b8; }
.wosb-status-dot.lost       { background: #ef4444; }

.wosb-card-actions {
    display: flex;
    gap: var(--space-1);
    opacity: 0;
    transition: opacity 0.15s var(--ease-out);
}
.wosb-card:hover .wosb-card-actions { opacity: 1; }

.wosb-card-actions button {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wosb-card-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.wosb-card-actions button.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger, #ef4444);
}

.wosb-card-title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.wosb-card-owner {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.wosb-card-notes {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.5;
    border-top: 1px dashed var(--border-subtle);
    padding-top: var(--space-2);
    margin-top: var(--space-1);
}

.wosb-card-date {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    font-family: var(--font-mono, monospace);
}

/* Selector de status en el modal */
.wosb-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.wosb-status-btn {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all 0.15s var(--ease-out);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

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

.wosb-status-btn.active {
    background: rgba(191, 255, 0, 0.08);
    border-color: var(--accent-lime, #bfff00);
    color: var(--text-primary);
}
.wosb-status-btn.active[data-status="controlled"] { border-color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.wosb-status-btn.active[data-status="contested"]  { border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.wosb-status-btn.active[data-status="lost"]       { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }

@media (max-width: 640px) {
    .wosb-grid { grid-template-columns: 1fr; }
    .wosb-stats { grid-template-columns: repeat(2, 1fr); }
    .wosb-status-grid { grid-template-columns: 1fr; }
    .wosb-card-actions { opacity: 1; }
}

/* Botón flotante para añadir entradas al HoF */
.hof-add-btn {
    margin-left: auto;
    background: rgba(191, 255, 0, 0.1);
    border: 1px solid rgba(191, 255, 0, 0.4);
    color: var(--accent-lime, #bfff00);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
}

.hof-add-btn:hover {
    background: rgba(191, 255, 0, 0.18);
    border-color: var(--accent-lime, #bfff00);
    transform: translateY(-1px);
}

/* FAB (Floating Action Button) para puntos bulk */
.bulk-fab {
    position: sticky;
    bottom: var(--space-3);
    margin: var(--space-4) 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, var(--accent-lime, #bfff00), #84cc16);
    color: #050505;
    border: none;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s var(--ease-out);
    z-index: 5;
}

.bulk-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(191, 255, 0, 0.3);
}

.bulk-fab:active {
    transform: translateY(0);
}

/* Picker de usuarios en el modal bulk */
.bulk-user-picker {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-deep);
    padding: var(--space-2);
}

.bulk-user-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s var(--ease-out);
    margin-bottom: 2px;
    font-size: var(--text-sm);
}

.bulk-user-row:hover {
    background: var(--bg-hover);
}

.bulk-user-row.selected {
    background: rgba(191, 255, 0, 0.1);
    box-shadow: inset 3px 0 0 var(--accent-lime, #bfff00);
}

.bulk-user-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-lime, #bfff00);
    flex-shrink: 0;
}

.bulk-user-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.bulk-user-points {
    font-family: var(--font-mono, monospace);
    color: var(--text-muted);
    font-size: 11px;
}

@media (max-width: 640px) {
    .bulk-fab { width: 100%; justify-content: center; }
    .bulk-fab-text { font-size: var(--text-sm); }
}

/* ==================== HALL OF FAME ==================== */

.hof-filters {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.hof-filter-btn {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
}

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

.hof-filter-btn.active {
    background: rgba(191, 255, 0, 0.12);
    border-color: var(--accent-lime, #bfff00);
    color: var(--accent-lime, #bfff00);
}

.hof-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.hof-stat-card {
    background: linear-gradient(135deg, rgba(191, 255, 0, 0.06), rgba(255, 215, 0, 0.03));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.hof-stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hof-stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--accent-lime, #bfff00);
    font-family: var(--font-mono, monospace);
}

.hof-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: var(--space-3);
}

.hof-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-12);
    color: var(--text-muted);
}

.hof-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    gap: var(--space-3);
    position: relative;
    transition: all 0.2s var(--ease-out);
    animation: hofCardSlide 0.3s var(--ease-out) backwards;
}

.hof-card:hover {
    border-color: rgba(191, 255, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

/* Borde izquierdo de color según el tipo */
.hof-type-tournament { border-left: 3px solid #bfff00; }
.hof-type-group_battle { border-left: 3px solid #ef4444; }
.hof-type-event { border-left: 3px solid #f59e0b; }

.hof-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
}

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

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

.hof-type-badge {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.hof-date {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
}

.hof-winner {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--accent-lime, #bfff00);
    margin-bottom: var(--space-1);
}

.hof-runner-up {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.hof-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
    line-height: 1.5;
}

.hof-tags {
    display: flex;
    gap: var(--space-1);
    margin-top: var(--space-2);
    flex-wrap: wrap;
}

.hof-tag {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10px;
}

.hof-recorded {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: var(--space-2);
    font-style: italic;
}

.hof-delete-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: all 0.15s var(--ease-out);
}

.hof-card:hover .hof-delete-btn {
    opacity: 1;
}

.hof-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger, #ef4444);
}

@media (max-width: 640px) {
    .hof-list { grid-template-columns: 1fr; }
    .hof-stats { grid-template-columns: 1fr; }
    .hof-delete-btn { opacity: 1; }  /* siempre visible en móvil */
}

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

.users-table thead {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.users-table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 500;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    user-select: none;
}

.users-table th:hover {
    color: var(--text-primary);
}

.sort-icon {
    margin-left: var(--space-1);
    font-size: 10px;
    opacity: 0.4;
}

.users-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

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

.users-table tbody tr {
    transition: background 0.1s ease;
}

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

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

.rank-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.04em;
    background: var(--accent-lime-dim);
    color: var(--accent-lime);
    border: 1px solid rgba(var(--accent-lime-rgb), 0.2);
}

/* Colores de rango */
.rank-badge.superadmin,
.rank-badge.Superadmin {
    background: rgba(255, 40, 0, 0.15);
    color: var(--rank-superadmin);
    border-color: rgba(255, 40, 0, 0.4);
}

.rank-badge.fundador,
.rank-badge.Fundador {
    background: rgba(139, 0, 0, 0.15);
    color: var(--rank-fundador);
    border-color: rgba(139, 0, 0, 0.4);
}

.rank-badge.almirante,
.rank-badge.Almirante {
    background: rgba(255, 40, 0, 0.15);
    color: var(--rank-almirante);
    border-color: rgba(255, 40, 0, 0.4);
}

.rank-badge.comodoro,
.rank-badge.Comodoro {
    background: rgba(255, 102, 0, 0.15);
    color: var(--rank-comodoro);
    border-color: rgba(255, 102, 0, 0.4);
}

.rank-badge.oficial,
.rank-badge.Oficial {
    background: rgba(255, 215, 0, 0.15);
    color: var(--rank-oficial);
    border-color: rgba(255, 215, 0, 0.4);
}

.rank-badge.guardian,
.rank-badge.Guardian {
    background: rgba(127, 255, 0, 0.15);
    color: var(--rank-guardian);
    border-color: rgba(127, 255, 0, 0.4);
}

.rank-badge.marinero,
.rank-badge.Marinero {
    background: rgba(0, 102, 255, 0.15);
    color: var(--rank-marinero);
    border-color: rgba(0, 102, 255, 0.4);
}

.rank-badge.grumete,
.rank-badge.Grumete {
    background: rgba(139, 92, 246, 0.15);
    color: var(--rank-grumete);
    border-color: rgba(139, 92, 246, 0.4);
}

.rank-badge.ex-lai {
    background: rgba(255, 107, 157, 0.15);
    color: var(--rank-exlai);
    border-color: rgba(255, 107, 157, 0.4);
}

.rank-badge.corsarios,
.rank-badge.Corsarios {
    background: rgba(180, 83, 9, 0.20);
    color: var(--rank-corsarios);
    border-color: rgba(180, 83, 9, 0.45);
}

.rank-badge.recluta,
.rank-badge.Recluta {
    background: rgba(105, 105, 105, 0.15);
    color: var(--rank-recluta);
    border-color: rgba(105, 105, 105, 0.4);
}

.points-badge {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-elevated);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
}

.points-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Discord ID Badge */
.discord-id-badge {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
}

.discord-id-badge.discord-linked {
    background: rgba(88, 101, 242, 0.1);
    color: #5865F2;
    border: 1px solid rgba(88, 101, 242, 0.3);
}

.discord-id-badge.discord-unlinked {
    background: rgba(107, 107, 107, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.discord-id-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   POINTS TIERS BADGES
   Sistema escalable de colores según cantidad
   ======================================== */

/* Negativo - Rojo intenso */
.points-negative {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.points-negative::before {
    content: '⚠️';
    margin-right: 4px;
}

/* Tier 1-4 - Gris básico */
.points-tier-1 {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
    border-color: rgba(148, 163, 184, 0.4) !important;
}

.points-tier-1::before {
    content: '🔹';
    margin-right: 4px;
}

/* 5+ Puntos - Cyan brillante */
.points-5 {
    background: rgba(6, 182, 212, 0.15) !important;
    color: #06b6d4 !important;
    border-color: rgba(6, 182, 212, 0.4) !important;
}

.points-5::before {
    content: '💎';
    margin-right: 4px;
}

/* 10+ Puntos - Verde esmeralda */
.points-10 {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

.points-10::before {
    content: '🌿';
    margin-right: 4px;
}

/* 20+ Puntos - Azul océano */
.points-20 {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

.points-20::before {
    content: '🌊';
    margin-right: 4px;
}

/* 30+ Puntos - Púrpura eléctrico */
.points-30 {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #8b5cf6 !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
}

.points-30::before {
    content: '⚡';
    margin-right: 4px;
}

/* 40+ Puntos - Rosa neón */
.points-40 {
    background: rgba(236, 72, 153, 0.15) !important;
    color: #ec4899 !important;
    border-color: rgba(236, 72, 153, 0.4) !important;
}

.points-40::before {
    content: '🔮';
    margin-right: 4px;
}

/* 50+ Puntos - Naranja fuego */
.points-50 {
    background: rgba(249, 115, 22, 0.15) !important;
    color: #f97316 !important;
    border-color: rgba(249, 115, 22, 0.4) !important;
}

.points-50::before {
    content: '🔥';
    margin-right: 4px;
}

/* 60+ Puntos - Rojo poder */
.points-60 {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.points-60::before {
    content: '💪';
    margin-right: 4px;
}

/* 70+ Puntos - Dorado real */
.points-70 {
    background: rgba(234, 179, 8, 0.15) !important;
    color: #eab308 !important;
    border-color: rgba(234, 179, 8, 0.4) !important;
}

.points-70::before {
    content: '👑';
    margin-right: 4px;
}

/* 80+ Puntos - Lima élite brillante */
.points-elite {
    background: rgba(191, 255, 0, 0.2) !important;
    color: #bfff00 !important;
    border-color: rgba(191, 255, 0, 0.5) !important;
    box-shadow: 0 0 12px rgba(191, 255, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.points-elite::before {
    content: '🏆';
    margin-right: 4px;
}

.points-elite::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateY(100%) rotate(45deg);
    }
    100% {
        transform: translateY(-100%) rotate(45deg);
    }
}

/* ========================================
   UTILITY CLASSES
   Extraídas de los inline styles más repetidos en script.js
   ======================================== */

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.cursor-default { cursor: default; }

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

.rank-superior-label {
    font-size: 10px;
    color: var(--accent-gold);
}

.row-space-between {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-3);
}

.row-space-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.grid-full {
    grid-column: 1 / -1;
}

.flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.mt-20 { margin-top: 20px; }
.ml-20 { margin-left: 20px; }
.mt-8 { margin-top: var(--space-2); }
.mt-12 { margin-top: var(--space-3); }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 40px;
}

/* Iconos Lucide (reemplazan emojis estructurales).
   Lucide inyecta <svg> al reemplazar <i data-lucide>. */
.emoji-icon,
.emoji-icon svg {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: -3px;
    stroke-width: 1.75;
    flex-shrink: 0;
}

/* En títulos de sección, agrandar un poco */
h2 .emoji-icon, h2 .emoji-icon svg,
h3 .emoji-icon, h3 .emoji-icon svg,
.modal-header h3 .emoji-icon, .modal-header h3 .emoji-icon svg {
    width: 20px;
    height: 20px;
    vertical-align: -4px;
}

/* En botones, alinear al centro */
.btn .emoji-icon, .btn .emoji-icon svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Focus-visible global para todos los interactivos.
   Solo se activa con navegación por teclado (no mouse). */
:focus-visible {
    outline: 2px solid var(--accent-lime);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Quitar el outline default solo cuando focus-visible está activo
   (evita doble outline en algunos browsers) */
:focus:not(:focus-visible) {
    outline: none;
}

/* Respeta prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

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

.btn-primary {
    background: var(--accent-lime);
    color: var(--bg-void);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-lime);
    box-shadow: 0 0 20px var(--accent-lime-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success, #22c55e);
    font-weight: 600;
    border: 1px solid rgba(34, 197, 94, 0.35);
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.18);
    border-color: var(--success, #22c55e);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-info {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info, #3b82f6);
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: var(--shadow-sm);
}

.btn-info:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: var(--info, #3b82f6);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning, #f59e0b);
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: var(--warning, #f59e0b);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

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

/* Estados activo/deshabilitado universales para todos los .btn */
.btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Botón cúbico refactorizado — sin shadow azul hardcodeada, usa variable */
.btn-cubic {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transform: translateY(0);
    transition: all 0.15s var(--ease-out);
}

.btn-cubic:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-cubic:active {
    box-shadow: var(--shadow-sm);
    transform: translateY(1px);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

/* Botones pequeños con estilos especiales */
.btn-success.btn-sm {
    padding: var(--space-2);
    font-size: var(--text-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.btn-danger.btn-sm.btn-cubic {
    padding: var(--space-2);
    font-size: var(--text-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    box-shadow:
        0 2px 0 #991b1b,
        0 4px 6px rgba(220, 38, 38, 0.2);
}

/* ========================================
   ACTION BUTTONS
   ======================================== */

.action-buttons {
    display: flex;
    gap: var(--space-1);
    align-items: center;
    justify-content: center;
}

.quick-points-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.quick-points-btn.add:hover {
    border-color: var(--accent-lime);
    color: var(--accent-lime);
    box-shadow: 0 0 12px var(--accent-lime-glow);
}

.quick-points-btn.remove:hover {
    border-color: var(--state-error);
    color: var(--state-error);
    background: var(--state-error-dim);
}

/* ========================================
   FORMS
   ======================================== */

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

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.input-field {
    width: 100%;
    padding: var(--space-3) var(--space-3);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    /* Antes era `transition: all` — eso fuerza al browser a comprobar todas las
       propiedades animables en cada cambio (incluido cada tecla en inputs).
       Listamos solo las que realmente cambian en :focus. */
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-lime);
    box-shadow: 0 0 0 3px var(--accent-lime-dim);
}

.input-field::placeholder {
    color: var(--text-dim);
}

select.input-field {
    cursor: pointer;
}

/* ========================================
   MODALS
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* backdrop-filter: blur(8px) era lo que causaba lag al escribir en modals:
       cada tecla fuerza al browser a recalcular el blur de toda la página
       detrás. Lo quitamos y subimos la opacidad para mantener el efecto visual
       sin el costo de composición. */
    background: rgba(0, 0, 0, 0.92);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.25s var(--ease-out);
    box-shadow: var(--shadow-xl);
}

.modal-large {
    max-width: 920px;
}

/* Para modales de puntos (quick + bulk): más aire + tipografía más cómoda */
.modal-large .modal-header {
    padding: var(--space-5) var(--space-6);
}
.modal-large .modal-header h3 {
    font-size: var(--text-xl);
}
.modal-large .modal-body {
    padding: var(--space-6);
}
.modal-large .modal-footer {
    padding: var(--space-5) var(--space-6);
}
.modal-large .form-group {
    margin-bottom: var(--space-5);
}
.modal-large .form-group > label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    display: block;
}
.modal-large .input-field {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: var(--space-1);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

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

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

/* ========================================
   CARDS
   ======================================== */

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s var(--ease-out);
}

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

.config-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.config-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
}

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

.config-card-body {
    padding: var(--space-4);
}

.config-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
    line-height: 1.5;
}

.config-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--accent-lime);
    box-shadow: 0 0 8px var(--accent-lime);
}

.status-indicator.offline {
    background: var(--text-dim);
}

.status-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.config-card-footer {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    justify-content: flex-end;
}

/* Channel Cards */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

.channel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    transition: all 0.2s var(--ease-out);
}

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

.channel-icon {
    font-size: 24px;
    margin-bottom: var(--space-3);
}

.channel-card h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.channel-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* ========================================
   TOAST
   ======================================== */

.toast-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    min-width: 300px;
    pointer-events: all;
    animation: toastSlideIn 0.2s var(--ease-out);
}

.toast.removing {
    animation: toastSlideOut 0.2s ease forwards;
}

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

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

.toast-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-actions {
    margin-top: var(--space-3);
}

.toast-actions button {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-2);
    height: auto;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
    font-size: 16px;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

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

.toast.success {
    border-left: 2px solid var(--accent-lime);
}

.toast.success .toast-icon {
    color: var(--accent-lime);
}

.toast.error {
    border-left: 2px solid var(--state-error);
}

.toast.error .toast-icon {
    color: var(--state-error);
}

.toast.warning {
    border-left: 2px solid var(--state-warning);
}

.toast.warning .toast-icon {
    color: var(--state-warning);
}

.toast.info {
    border-left: 2px solid var(--text-muted);
}

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

/* ========================================
   UTILITY
   ======================================== */

.hidden {
    display: none !important;
}

/* Elementos .superadmin-only solo se ocultan si el body NO marca al usuario
   como superadmin. Esto permite que el JS simplemente toggle la clase
   is-superadmin en <body>, sin pelearse con display:inline vs CSS. */
body:not(.is-superadmin) .superadmin-only {
    display: none;
}

.error-message {
    color: var(--state-error);
    font-size: var(--text-xs);
    margin-top: var(--space-2);
}

/* ========================================
   LOGS
   ======================================== */

.log-content {
    /* Sin límite de altura para mostrar todo el historial */
}

.log-entry {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    border-left: 2px solid transparent;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.add {
    border-left-color: var(--accent-lime);
}

.log-entry.remove {
    border-left-color: var(--state-error);
}

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

.log-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.log-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    width: 28px;
    height: 28px;
}

.log-delete-btn:hover {
    color: var(--state-error);
    background: var(--state-error-dim);
}

.log-delete-btn svg {
    width: 16px;
    height: 16px;
}

.log-delete-btn:active {
    transform: scale(0.95);
}

.log-user {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.log-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.log-action {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    margin-bottom: var(--space-1);
}

.log-action.add {
    color: var(--accent-lime);
}

.log-action.remove {
    color: var(--state-error);
}

.log-amount {
    font-family: var(--font-mono);
    font-weight: 600;
}

.log-reason {
    font-size: var(--text-base);
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.45;
    margin-top: var(--space-2);
    margin-bottom: var(--space-1);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-subtle);
    word-wrap: break-word;
}

.log-admin {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.log-empty {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-3);
    opacity: 0.5;
}

.empty-hint {
    font-size: var(--text-sm);
    color: var(--text-dim);
    margin-top: var(--space-2);
}

/* ========================================
   RESPONSIVE
   ======================================== */

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

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

    .main-content {
        margin-left: 0;
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .content-section {
        padding: var(--space-4);
    }

    .header-content {
        padding: var(--space-3) var(--space-4);
    }

    .page-title {
        font-size: var(--text-lg);
    }

    .users-table th,
    .users-table td {
        padding: var(--space-2) var(--space-3);
    }

    .toast-container {
        top: var(--space-2);
        right: var(--space-2);
        left: var(--space-2);
        max-width: none;
    }

    .toast {
        min-width: 0;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ========================================
   COMPONENT SPECIFIC
   ======================================== */

/* Password wrapper */
.password-wrapper {
    position: relative;
    display: flex;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: var(--space-2);
    cursor: pointer;
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.toggle-password:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

/* User info in modal */
.user-info {
    background: var(--bg-elevated);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    border: 1px solid var(--border-subtle);
}

.user-info p {
    margin: var(--space-1) 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

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

/* Reset options */
.reset-options {
    display: grid;
    gap: var(--space-3);
}

.reset-option {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

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

.reset-option.danger:hover {
    background: var(--state-error-dim);
    border-color: var(--state-error);
}

.reset-icon {
    font-size: 32px;
    margin-bottom: var(--space-2);
}

.reset-option h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.reset-option p {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Logo preview */
.logo-preview {
    margin-top: var(--space-2);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* File upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px dashed var(--border-soft);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    cursor: pointer;
}

.file-text {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* Commands grid */
.commands-grid {
    display: grid;
    gap: var(--space-3);
}

.command-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: all 0.15s ease;
}

.command-card:hover {
    background: var(--bg-elevated);
}

.command-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
}

.command-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.command-card h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.command-description {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.command-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}

.command-status.enabled {
    background: var(--accent-lime-dim);
    color: var(--accent-lime);
}

.command-status.disabled {
    background: var(--bg-hover);
    color: var(--text-dim);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--text-dim);
    transition: 0.2s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.2s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-lime);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Discord log entry */
.discord-log-entry {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-3);
    align-items: start;
    border-left: 2px solid transparent;
}

.discord-log-entry:last-child {
    border-bottom: none;
}

.discord-log-entry.command {
    border-left-color: var(--text-muted);
}

.discord-log-entry.points {
    border-left-color: var(--accent-lime);
}

.discord-log-entry.error {
    border-left-color: var(--state-error);
}

.discord-log-entry.info {
    border-left-color: var(--text-dim);
}

.discord-log-icon {
    font-size: 16px;
}

.discord-log-content {
    flex: 1;
}

.discord-log-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

.discord-log-user {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.discord-log-timestamp {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.discord-log-message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Discord app info */
.discord-app-info {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.app-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--accent-lime);
    font-weight: 600;
}

/* Logs toolbar */
.logs-toolbar {
    display: flex;
    gap: var(--space-4);
    align-items: flex-end;
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.logs-toolbar .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: var(--space-2);
}

.hamburger::before,
.hamburger::after {
    content: '';
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    transition: all 0.2s ease;
}

/* Superadmin only message styling */
.superadmin-only-message {
    animation: fadeIn 0.2s ease;
}

/* Inactive members section styling */
.inactive-section .nav-section-title svg {
    color: var(--state-error);
}

.users-table tbody tr.inactive-row {
    opacity: 0.7;
}

.users-table tbody tr.inactive-row:hover {
    opacity: 1;
}

/* ========================================
   COLUMN WIDTHS - Usuarios Table
   ======================================== */

/* Columna ID - ancho fijo pequeño */
.th-id {
    width: 50px;
    text-align: center;
}

.users-table td:first-child {
    text-align: center;
}

/* Distribución de anchos de columnas */
.th-id,
.td-id {
    width: 50px;
    text-align: center;
}

.th-name,
.td-name {
    width: 150px;
    text-align: left;
}

.th-role,
.td-role {
    width: 150px;
    text-align: center;
}

.th-points,
.td-points {
    width: 120px;
    text-align: center;
}

.users-table .th-entries,
.td-entries {
    width: 120px;
    text-align: center !important;
}

.td-entries .action-buttons {
    justify-content: center;
}

.users-table .th-actions,
.td-actions {
    width: 160px;
    text-align: center !important;
}

.td-actions .action-buttons {
    justify-content: center;
}

/* Columna de Historial */
.th-history,
.td-history {
    width: 80px;
    text-align: center;
}

/* Botón de historial */
.history-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.history-btn:hover {
    border-color: var(--accent-lime);
    color: var(--accent-lime);
    background: var(--accent-lime-dim);
    transform: translateY(-1px);
}

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

.history-btn svg {
    stroke: currentColor;
}

/* Contenido del historial en modal */
.history-content {
    max-height: 500px;
    overflow-y: auto;
    padding: var(--space-2);
}


.user-entries-container {
    margin-top: var(--space-2);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
}

.toggle-entries-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-1) var(--space-2);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.toggle-entries-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-lime);
}

.toggle-entries-btn.active {
    background: var(--accent-lime-dim);
    border-color: var(--accent-lime);
}

.mini-entry {
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.mini-entry.add {
    background: rgba(var(--accent-lime-rgb), 0.05);
}

.mini-entry.remove {
    background: rgba(var(--state-error-rgb), 0.05);
}

/* ========================================
   DROPDOWN CUSTOM DE FILTRO DE USUARIO
   ======================================== */

.user-filter-dropdown {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--text-sm);
    text-align: left;
    color: #ffffff;
}

.dropdown-trigger:hover {
    border-color: var(--accent-lime);
    background: var(--accent-lime-dim);
    color: #ffffff;
}

.dropdown-trigger.active {
    border-color: var(--accent-lime);
    background: var(--accent-lime-dim);
    color: #ffffff;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    font-size: 10px;
    color: #ffffff;
}

.dropdown-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + var(--space-1));
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-search {
    padding: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dropdown-search-input {
    width: 100%;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-sm);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s ease;
}

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

.dropdown-search-input:focus {
    border-color: var(--accent-lime);
    background: var(--bg-elevated);
}

.dropdown-item {
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border-subtle);
}

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

.dropdown-item:hover {
    background: var(--accent-lime-dim);
}

.dropdown-item.selected {
    background: var(--accent-lime);
    color: var(--bg-void);
    font-weight: 500;
}

/* ========================================
   IMPORT SPECIFIC STYLES
   ======================================== */

.import-textarea-wrapper {
    position: relative;
    margin-bottom: var(--space-4);
}

.import-textarea {
    padding: var(--space-4);
    min-height: 200px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    background: var(--bg-input);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.15s ease;
    resize: vertical;
}

.import-textarea:focus {
    outline: none;
    border-color: var(--accent-lime);
    box-shadow: 0 0 0 3px var(--accent-lime-dim);
}

.import-textarea::placeholder {
    color: var(--text-dim);
}

/* Import Format Cards */
.import-format-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.format-card {
    position: relative;
    cursor: pointer;
}

.format-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.format-card-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    transition: all 0.2s var(--ease-out);
    height: 100%;
}

.format-card:hover .format-card-content {
    border-color: var(--border-soft);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.format-card input[type="radio"]:checked + .format-card-content {
    border-color: var(--accent-lime);
    background: var(--accent-lime-dim);
    box-shadow: 0 0 0 3px var(--accent-lime-dim);
}

.format-icon {
    font-size: 32px;
    margin-bottom: var(--space-2);
}

.format-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.format-description {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

.format-badge {
    display: inline-block;
    background: var(--accent-lime);
    color: var(--bg-void);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-top: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Default Values Section */
.default-values-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
}

.default-values-header {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.default-values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
}

.default-value-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.default-value-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

/* Preview Section */
.preview-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: var(--space-5);
}

.preview-header {
    background: var(--bg-card);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.preview-count {
    background: var(--accent-lime);
    color: var(--bg-void);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.preview-grid {
    max-height: 300px;
    overflow-y: auto;
}

.preview-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s ease;
}

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

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

.preview-row.duplicate-row {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
}

.preview-row.duplicate-row:hover {
    background: rgba(239, 68, 68, 0.2);
}

.duplicate-badge {
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
}

.preview-row.header {
    background: var(--bg-card);
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: sticky;
    top: 0;
}

.preview-row div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Import Hint */
.import-hint {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-top: var(--space-3);
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
}

.import-hint-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

.import-hint code {
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-lime);
}

/* File Input */
.input-file {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.field-hint {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-dim);
}

/* Error List */
.error-list {
    padding: var(--space-4);
    background: var(--state-error-dim);
    border-top: 1px solid var(--state-error);
}

.error-list h3 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--state-error);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.error-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.error-list li {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    padding: var(--space-1) 0;
    line-height: 1.4;
}

.error-list li::before {
    content: '• ';
    color: var(--state-error);
    margin-right: var(--space-1);
}

/* Passwords Grid */
.passwords-grid {
    display: grid;
    gap: 1px;
    background: var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.passwords-header {
    background: var(--bg-elevated);
    padding: var(--space-3) var(--space-4);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.password-row {
    background: var(--bg-card);
    padding: var(--space-3) var(--space-4);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-3);
    align-items: center;
    font-size: var(--text-sm);
}

.password-row-header {
    display: contents;
}

/* ==================== ANNOUNCEMENT CREATOR ==================== */

.announcement-creator {
    max-width: 900px;
    margin: 0 auto;
}

.announcement-creator .form-group {
    margin-bottom: var(--space-6);
}

.announcement-creator .input-field {
    width: 100%;
}

.announcement-creator .textarea {
    min-height: 150px;
    resize: vertical;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
}

.announcement-creator .field-hint {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* Color Selector */
.color-selector {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.color-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.color-option:hover {
    border-color: var(--border-default);
    background: var(--bg-elevated);
}

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

.color-option input[type="radio"]:checked + span + span {
    font-weight: 600;
    color: var(--text-primary);
}

.color-option input[type="radio"]:checked + .color-preview {
    box-shadow: 0 0 0 2px var(--accent-lime);
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-subtle);
    display: inline-block;
}

/* Checkbox Field */
.checkbox-field {
    margin-right: var(--space-2);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Historial de anuncios custom */
.announce-list-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-card);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
    align-items: flex-start;
}
.announce-list-item-body { flex: 1; min-width: 220px; }
.announce-list-item-title { margin: 0 0 2px; font-weight: 600; }
.announce-list-item-desc {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.announce-list-item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.announce-list-item-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

/* Announcement Preview */
.announcement-preview {
    margin: var(--space-6) 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
}

.preview-header {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.embed-preview {
    padding: var(--space-5);
    background: var(--bg-card);
    border-left: 4px solid var(--accent-lime);
}

.embed-title-preview {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.embed-description-preview {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: var(--space-4);
}

.embed-footer-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.embed-timestamp {
    font-style: italic;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.form-actions .btn {
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .color-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-actions {
        flex-direction: column;
    }

    .embed-footer-preview {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

/* Optgroup styling for channel selector */
.optgroup {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: var(--space-2) var(--space-3);
    font-style: normal;
}

#announcementChannel optgroup {
    color: var(--text-primary);
    font-weight: 500;
    background: var(--bg-elevated);
}

#announcementChannel option,
.pointsChannelSelect optgroup,
.announcementsChannelSelect optgroup,
.logsChannelSelect optgroup,
.commandsChannelSelect optgroup {
    color: var(--text-primary);
    font-weight: 500;
    background: var(--bg-elevated);
}

#announcementChannel option,
.pointsChannelSelect option,
.announcementsChannelSelect option,
.logsChannelSelect option,
.commandsChannelSelect option {
    padding: var(--space-2) var(--space-3);
    font-weight: 400;
}

/* Channel Status */
.channel-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
    margin-bottom: var(--space-3);
}

/* ==================== DISCORD LINK MEMBERS ==================== */

.discord-link-container {
    max-width: 1400px;
    margin: 0 auto;
}

.discord-link-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.discord-link-column {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    border: 1px solid var(--border-color);
}

.column-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--border-color);
}

.column-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.column-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.column-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.member-count {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.members-list {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.member-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.member-item:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.member-item.selected {
    background: var(--accent-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.member-item.linked {
    border-color: var(--success-color);
    background: var(--success-bg);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--gray-600);
    flex-shrink: 0;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.member-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-sm);
    margin-bottom: 2px;
}

.member-details {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.member-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.link-actions {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    border: 1px solid var(--border-color);
}

.selected-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.selected-item {
    text-align: center;
    flex: 1;
}

.selected-item .label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.selected-item .value {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-arrow {
    font-size: 24px;
    color: var(--accent-color);
}

.link-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
}

.link-buttons .btn {
    min-width: 150px;
}

.current-links {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    border: 1px solid var(--border-color);
}

.current-links h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.active-links-list {
    display: grid;
    gap: var(--space-2);
}

.active-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.active-link-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
}

.active-link-discord {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.active-link-system {
    font-weight: 600;
    color: var(--text-primary);
}

.active-link-arrow {
    color: var(--accent-color);
    margin: 0 var(--space-2);
}

.empty-links {
    text-align: center;
    padding: var(--space-6);
    color: var(--text-secondary);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    color: var(--text-secondary);
}

.spinner-small {
    border: 3px solid var(--gray-100);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .discord-link-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .selected-info {
        flex-direction: column;
        gap: var(--space-2);
    }

    .selected-arrow {
        transform: rotate(90deg);
    }

    .link-buttons {
        flex-direction: column;
    }
}

/* ========================================
   TORNEO BRACKET - SISTEMA DE GESTIÓN
   ======================================== */

.tournament-header {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    text-align: center;
}

.tournament-title {
    font-size: var(--text-3xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.tournament-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.tournament-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--accent-lime-dim);
    border-radius: var(--radius-md);
    color: var(--accent-lime);
    font-size: var(--text-sm);
    font-weight: 500;
}

/* Configuración del torneo */
.tournament-config-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

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

.config-panel-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.participant-count {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.participant-count strong {
    color: var(--accent-lime);
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-3);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--space-2);
}

.participant-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.participant-item:hover {
    border-color: var(--accent-lime);
    background: var(--accent-lime-dim);
}

.participant-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-lime);
}

.participant-item-name {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.participant-item-role {
    font-size: var(--text-xs);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.config-panel-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

/* Bracket Container */
.bracket-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    min-height: 400px;
    overflow: visible;
    position: relative;
}

.bracket-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.bracket-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.bracket-actions {
    display: flex;
    gap: var(--space-2);
}

/* Bracket Layout */
.bracket-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    min-height: 600px;
}

.bracket-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.bracket-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    padding: var(--space-4);
}

.bracket-round {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.round-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: var(--space-2);
}

/* Match Card */
.match-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    position: relative;
    transition: all 0.15s ease;
    pointer-events: none; /* El contenedor no recibe clics */
}

.match-card:hover {
    border-color: var(--accent-lime);
    box-shadow: 0 2px 8px rgba(var(--accent-lime-rgb), 0.1);
}

.match-card.final-match {
    border-color: var(--accent-lime);
    box-shadow: 0 0 20px rgba(var(--accent-lime-rgb), 0.2);
}

.match-card::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 2px;
    background: var(--border-subtle);
    pointer-events: none;
}

.bracket-center .match-card::after,
.bracket-center .match-card::before {
    display: none;
}

/* Player Row */
.match-player {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: var(--space-1);
    pointer-events: auto; /* Solo los jugadores reciben clics */
    position: relative;
    z-index: 10;
}

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

.match-player:last-child {
    margin-bottom: 0;
}

.match-player:hover {
    background: var(--bg-hover);
}

.match-player.winner {
    background: var(--accent-lime-dim);
    border-left: 2px solid var(--accent-lime);
}

.match-player.loser {
    opacity: 0.4;
}

.match-player-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

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

.match-player-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-player-role {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.final-winner {
    text-align: center;
    padding: var(--space-6);
}

.trophy-display {
    font-size: 48px;
    margin-bottom: var(--space-3);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.winner-announcement {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--accent-lime);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.winner-name {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-top: var(--space-2);
}

/* Empty State */
.bracket-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    text-align: center;
}

.bracket-empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.bracket-empty-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.bracket-empty-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    max-width: 300px;
}

/* Responsive */
@media (max-width: 1024px) {
    .bracket-layout {
        flex-direction: column;
        align-items: center;
    }

    .bracket-side {
        width: 100%;
        max-width: 400px;
    }

    .bracket-center {
        margin: var(--space-6) 0;
    }

    .match-card::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .participants-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .config-panel-actions {
        flex-direction: column;
        width: 100%;
    }

    .config-panel-actions .btn {
        width: 100%;
    }

    .bracket-toolbar {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }
}

/* ========================================
   BATALLAS GRUPALES
   ======================================== */

/* Selector de usuarios en modal */
.users-selector {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.user-select-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-select-item:hover {
    border-color: var(--accent-lime);
    background: var(--accent-lime-dim);
}

.user-select-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-lime);
}

.user-select-item-name {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.user-select-item-role {
    font-size: var(--text-xs);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* Estado de usuario seleccionado en otro equipo */
.user-select-item.disabled-in-other {
    opacity: 0.6;
}

.user-select-item.disabled-in-other .user-select-item-name::after {
    content: " (en otro equipo)";
    font-size: var(--text-xs);
    color: var(--state-error);
    font-style: italic;
}

/* Indicador de equipo en usuario seleccionado */
.user-select-item.selected-our {
    background: rgba(var(--accent-lime-rgb), 0.1);
    border-color: var(--accent-lime);
}

.user-select-item.selected-enemy {
    background: rgba(var(--state-error-rgb), 0.1);
    border-color: var(--state-error);
}

/* Battle Card - Reutilizar channel-card */
.battle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    position: relative;
    transition: all 0.15s ease;
}

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

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

.battle-card-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.battle-card-title {
    flex: 1;
}

.battle-card-title h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.battle-card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.battle-card-actions {
    display: flex;
    gap: var(--space-2);
}

.battle-card-body {
    margin-bottom: var(--space-4);
}

.battle-info-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.battle-info-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.battle-info-value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.battle-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
}

.battle-status.Pendiente {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.battle-status.Victoria {
    background: rgba(var(--accent-lime-rgb), 0.1);
    color: var(--accent-lime);
    border: 1px solid rgba(var(--accent-lime-rgb), 0.3);
}

.battle-status.Derrota {
    background: rgba(var(--state-error-rgb), 0.1);
    color: var(--state-error);
    border: 1px solid rgba(var(--state-error-rgb), 0.3);
}

.battle-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

.battle-date {
    font-size: var(--text-xs);
    color: var(--text-dim);
}

.battle-our-team {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.battle-team-member {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.battle-enemy-team {
    margin-bottom: var(--space-3);
}

.battle-enemy-member {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* Empty state para batallas */
.battles-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-12);
    color: var(--text-secondary);
}

.battles-empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.battles-empty-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.battles-empty-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ========================================
   HISTORIAL DE USUARIO
   ======================================== */

/* Responsive para batallas */
@media (max-width: 768px) {
    .battles-grid {
        grid-template-columns: 1fr;
    }

    .battle-card {
        padding: var(--space-4);
    }

    .battle-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Animación de brillo para el ganador */
@keyframes winnerGlow {
    0%, 100% {
        box-shadow: 0 0 12px rgba(var(--accent-lime-rgb), 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(var(--accent-lime-rgb), 0.7);
    }
}

@keyframes loserGlow {
    0%, 100% {
        box-shadow: 0 0 12px rgba(var(--state-error-rgb), 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(var(--state-error-rgb), 0.7);
    }
}

/* Equipos en modal de edición */
.team-display-our {
    transition: all 0.15s ease;
}

.team-display-enemy {
    transition: all 0.15s ease;
}

/* ========================================
   FLEET MANAGEMENT
   ======================================== */

/* Fleet Section Containers */
.fleet-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.fleet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

/* Fleet Empty State */
.fleet-empty-state {
    text-align: center;
    padding: var(--space-12);
}

.fleet-empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.fleet-empty-state h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.fleet-empty-state p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* Fleet Status */
.fleet-status-container {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.fleet-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
}

.fleet-status-active {
    background: rgba(var(--accent-lime-rgb), 0.1);
    color: var(--accent-lime);
}

.fleet-status-absent {
    background: rgba(var(--state-warning-rgb), 0.1);
    color: var(--state-warning);
}

.fleet-status-icon {
    font-size: 16px;
}

/* Fleet Ships */
.fleet-ships-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.fleet-tier-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.fleet-tier-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.fleet-tier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.fleet-tier-actions {
    display: flex;
    gap: var(--space-2);
}

.fleet-ships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-3);
}

.fleet-ship-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    transition: all 0.15s ease;
}

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

.fleet-ship-selected {
    border-color: var(--accent-lime);
    background: rgba(var(--accent-lime-rgb), 0.05);
}

.fleet-ship-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.fleet-ship-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.fleet-ship-name {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: 500;
}

/* Fleet Clan */
.fleet-clan-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.fleet-ship-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

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

.fleet-ship-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.fleet-ship-count {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.fleet-ship-users {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.user-badge {
    display: inline-block;
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-hover);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.user-badge.user-absent {
    background: rgba(var(--state-warning-rgb), 0.1);
    color: var(--state-warning);
}

.absent-badge {
    font-size: var(--text-xs);
    margin-left: var(--space-1);
    opacity: 0.8;
}

/* Fleet Catalog */
.fleet-catalog-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.fleet-catalog-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.fleet-catalog-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.fleet-catalog-item:hover {
    border-color: var(--border-medium);
}

.fleet-catalog-inactive {
    opacity: 0.6;
}

.fleet-catalog-item-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.fleet-catalog-item-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.fleet-catalog-item-status {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.fleet-catalog-item-actions {
    display: flex;
    gap: var(--space-2);
}

/* Fleet Absences */
.fleet-absences-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.absence-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

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

.absence-user {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
}

.absence-details {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Fleet Actions */
.fleet-actions {
    display: flex;
    justify-content: center;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

/* Responsive */
@media (max-width: 768px) {
    .fleet-ships-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .fleet-catalog-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .fleet-catalog-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .absence-card {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .absence-card button {
        width: 100%;
    }
}

/* ========================================
   ATTACK WINDOWS STYLES - Ventanas de Ataque por Puerto
   ======================================== */

.attack-windows-control-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.control-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

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

.timezone-conversions-card,
.faction-legend-card,
.attack-windows-table-card,
.territorial-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

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

/* Timezone Conversions */
#timezoneConversionsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
}

.timezone-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    text-align: center;
    transition: transform 0.2s var(--ease-out);
}

.timezone-card:hover {
    transform: translateY(-2px);
}

.timezone-card .region-name {
    font-weight: 600;
    color: var(--accent-lime);
    margin-bottom: var(--space-2);
}

.timezone-card .offset-display {
    font-size: var(--text-lg);
    color: var(--text-primary);
    font-weight: 700;
}

/* Faction Legend */
#factionLegendContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
}

.faction-legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: transform 0.2s var(--ease-out);
}

.faction-legend-item:hover {
    transform: scale(1.02);
}

.faction-color-box {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 2px solid;
    flex-shrink: 0;
}

.faction-legend-item .faction-name {
    font-weight: 600;
}

.faction-legend-item .faction-icon {
    font-size: 20px;
}

/* Attack Windows Table */
.table-controls {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
}

.attack-windows-table-wrapper {
    overflow-x: auto;
    margin-top: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.attack-windows-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.attack-windows-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.attack-windows-table th,
.attack-windows-table td {
    padding: var(--space-2) var(--space-3);
    text-align: center;
    border: 1px solid var(--border-subtle);
    min-width: 80px;
}

.attack-windows-table th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
}

.attack-windows-table th.port-name-header {
    background: var(--bg-dark);
    text-align: left;
    min-width: 150px;
    position: sticky;
    left: 0;
    z-index: 20;
}

.attack-windows-table td.port-name-cell {
    background: var(--bg-dark);
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 5;
    color: var(--text-bright);
}

.faction-cell {
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    font-weight: 500;
    position: relative;
    user-select: none;
}

.faction-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.faction-cell.Nuestro {
    background: rgba(59, 130, 246, 0.7);
    color: #ffffff;
    border-color: #3b82f6;
}

.faction-cell.Pirata {
    background: rgba(239, 68, 68, 0.7);
    color: #ffffff;
    border-color: #ef4444;
}

.faction-cell.KAI {
    background: rgba(139, 92, 246, 0.7);
    color: #ffffff;
    border-color: #8b5cf6;
}

.faction-cell.Anilla {
    background: rgba(245, 158, 11, 0.7);
    color: #ffffff;
    border-color: #f59e0b;
}

.faction-cell .faction-icon {
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

.faction-cell .faction-short-name {
    font-size: var(--text-xs);
    text-transform: uppercase;
    font-weight: 700;
}

/* Territorial Summary */
#territorialSummaryContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.territorial-summary-item {
    background: var(--bg-elevated);
    border: 2px solid;
    border-radius: var(--radius-md);
    padding: var(--space-4);
    text-align: center;
    transition: transform 0.2s var(--ease-out);
}

.territorial-summary-item:hover {
    transform: translateY(-4px);
}

.territorial-summary-item .faction-icon {
    font-size: 32px;
    margin-bottom: var(--space-2);
}

.territorial-summary-item .faction-name {
    font-weight: 600;
    font-size: var(--text-lg);
    margin-bottom: var(--space-1);
}

.territorial-summary-item .control-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-bright);
}

.territorial-summary-item .control-percentage {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.territorial-summary-item .control-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: var(--space-2);
    overflow: hidden;
}

.territorial-summary-item .control-bar-fill {
    height: 100%;
    transition: width 0.3s var(--ease-out);
}

/* Dark Mode Styles */
body.dark-mode .attack-windows-table th.port-name-header,
body.dark-mode .attack-windows-table td.port-name-cell {
    background: #000510;
    border-color: #1a1a3a;
}

body.dark-mode .card {
    background: #000a14;
    border-color: #1a1a3a;
}

body.dark-mode .attack-windows-table th {
    background: #000a14;
}

/* Modal Styles */
.config-modal,
.import-modal {
    max-width: 600px;
}

.import-preview {
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    border: 1px solid var(--border-subtle);
}

/* Responsive */
@media (max-width: 768px) {
    .control-panel-buttons {
        flex-direction: column;
    }

    .control-panel-buttons button {
        width: 100%;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .attack-windows-table {
        font-size: var(--text-xs);
    }

    .faction-cell {
        min-width: 60px;
        padding: var(--space-1) var(--space-2);
    }

    .faction-cell .faction-icon {
        font-size: 14px;
    }

    .faction-cell .faction-short-name {
        font-size: 10px;
    }

    #timezoneConversionsContainer {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    #factionLegendContainer {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    #territorialSummaryContainer {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

/* ========================================
   ATTACK WINDOWS GRID - Ventanas de Ataque
   ======================================== */

.attack-windows-container {
    overflow-x: auto;
    margin: var(--space-4) 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.attack-windows-grid {
    display: grid;
    grid-template-columns: 150px 100px repeat(19, 60px) repeat(6, 140px);
    background: var(--bg-elevated);
    width: max-content;
}

.attack-windows-cell {
    min-height: 44px;
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-2) var(--space-3);
    position: relative;
    display: flex;
    align-items: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.attack-windows-header {
    background: var(--bg-deep);
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-medium);
}

.attack-windows-header.timezone {
    font-size: var(--text-sm);
    line-height: 1.4;
    padding: var(--space-3);
}

.attack-windows-header.timezone .timezone-name {
    color: var(--text-bright);
    font-weight: 500;
    font-size: var(--text-base);
}

.attack-windows-header.timezone .timezone-offset {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.attack-windows-port-cell {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-deep);
    border-right: 2px solid var(--border-medium);
    padding: 0 var(--space-3);
    height: 44px;
    cursor: move;
}

.attack-windows-port-cell:hover {
    background: var(--bg-hover);
}

.attack-windows-port-cell.dragging {
    opacity: 0.5;
    background: var(--bg-elevated);
}

.attack-windows-port-cell.drag-over {
    border-top: 2px solid var(--accent-lime);
}

.attack-windows-port-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 10px currentColor, 0 0 16px currentColor;
}

.attack-windows-region-cell {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-deep);
    border-right: 2px solid var(--border-medium);
    min-width: 200px;
    height: 44px;
    padding: 0 var(--space-3);
}

.attack-windows-faction-cell {
    background: var(--bg-deep);
    padding: 0;
    border-right: 2px solid var(--border-medium);
    min-width: 100px;
    height: 44px;
}

.attack-windows-faction-cell select {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    color: inherit;
    font-weight: 500;
}

.attack-windows-faction-cell select:hover {
    background: var(--bg-hover);
}

.attack-windows-faction-cell select:focus {
    outline: none;
    background: var(--bg-hover);
}

.attack-windows-hour-cell {
    border-right: 1px dashed var(--border-subtle);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-dim);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    user-select: none;
    height: 44px;
    justify-content: center;
}

.attack-windows-hour-cell:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.attack-windows-hour-cell.selected {
    background: var(--accent-lime-dim);
    color: var(--accent-lime);
    border-color: var(--accent-lime);
    font-weight: 600;
}

/* Primera celda seleccionada (inicio) */
.attack-windows-hour-cell.selected:first-of-type {
    background: rgba(191, 255, 0, 0.15);
    border-left: 3px solid var(--accent-lime);
}

/* Última celda seleccionada (fin) */
.attack-windows-hour-cell.selected:last-of-type {
    background: rgba(191, 255, 0, 0.15);
    border-right: 3px solid var(--accent-lime);
}

.attack-windows-bar {
    position: absolute;
    top: 5px;
    height: calc(100% - 10px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.attack-windows-conv-cell {
    text-align: center;
    font-size: var(--text-sm);
    line-height: 1.4;
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
}

.attack-windows-next-day {
    font-size: var(--text-xs);
    color: var(--state-warning);
    font-style: italic;
    display: block;
    margin-top: 4px;
}

.attack-windows-legend {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
    font-size: var(--text-sm);
}

.attack-windows-legend span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 500;
}

/* Responsive para grid de ventanas de ataque */
@media (max-width: 1400px) {
    .attack-windows-grid {
        grid-template-columns: 140px 90px repeat(19, 52px) repeat(6, 130px);
    }

    .attack-windows-port-cell {
        font-size: var(--text-xs);
    }
}

/* ==================== ROLE PICKER ==================== */
/* Componente reutilizable para elegir un rol a mencionar.
   Estilo Discord: chip con color del rol + dropdown con dots. */

.role-picker {
    position: relative;
    display: block;
}

.role-picker-display {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 38px;
    padding: 6px 10px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.15s ease;
    font-size: var(--text-sm);
}

.role-picker-display:hover {
    border-color: var(--border-default);
}

.role-picker-display.role-picker-open {
    border-color: var(--accent-lime);
    box-shadow: 0 0 0 2px var(--accent-lime-dim);
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: rgba(var(--role-color-rgb, 88, 101, 242), 0.15);
    color: rgb(var(--role-color-rgb, 88, 101, 242));
    border: 1px solid rgba(var(--role-color-rgb, 88, 101, 242), 0.4);
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

.role-chip-dot {
    width: 8px;
    height: 8px;
    background: rgb(var(--role-color-rgb, 88, 101, 242));
    border-radius: 50%;
    flex-shrink: 0;
}

.role-chip-clear {
    margin-left: 4px;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.7;
}

.role-chip-clear:hover {
    opacity: 1;
}

.role-placeholder {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.role-arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 10px;
    transition: transform 0.15s ease;
}

.role-picker-open .role-arrow {
    transform: rotate(180deg);
}

.role-picker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-height: 280px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.role-picker-dropdown.role-picker-open {
    display: flex;
}

.role-picker-search {
    padding: 8px 10px;
    background: var(--bg-subtle);
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: var(--text-sm);
    outline: none;
}

.role-picker-list {
    overflow-y: auto;
    max-height: 220px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: var(--text-sm);
    transition: background 0.1s ease;
}

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

.role-option.selected {
    background: var(--accent-lime-dim);
    color: var(--accent-lime);
}

.role-option-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-option-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-option-check {
    color: var(--accent-lime);
    font-size: 14px;
    margin-left: auto;
    opacity: 0;
}

.role-option.selected .role-option-check {
    opacity: 1;
}

.role-option-none {
    color: var(--text-muted);
    font-style: italic;
}

.role-picker-empty {
    padding: var(--space-3);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Línea de preview debajo del picker */
.role-picker-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    background: var(--bg-subtle);
    border-left: 3px solid var(--accent-lime);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.role-picker-preview-icon {
    font-size: 13px;
}

/* ==================== Verificación LAI ==================== */

.lai-summary {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.lai-pill {
    font-size: var(--text-sm);
    font-weight: 600;
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    border: 1px solid transparent;
}

.lai-pill.ok    { color: var(--state-success); background: rgba(34, 197, 94, 0.08);  border-color: rgba(34, 197, 94, 0.25); }
.lai-pill.warn  { color: var(--state-warning);  background: rgba(234, 179, 8, 0.08);  border-color: rgba(234, 179, 8, 0.25); }
.lai-pill.err   { color: var(--state-error);   background: rgba(239, 68, 68, 0.08);  border-color: rgba(239, 68, 68, 0.25); }
.lai-pill.neutral { color: var(--text-secondary); background: var(--bg-subtle); border-color: var(--border-subtle); }

.lai-section-title {
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
    font-size: var(--text-base);
    font-weight: 700;
}
.lai-section-title.ok   { color: var(--state-success); }
.lai-section-title.warn { color: var(--state-warning); }
.lai-section-title.err  { color: var(--state-error); }

.lai-list {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
    background: var(--bg-elevated);
}

.lai-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}
.lai-row:last-child { border-bottom: none; }

.lai-nick {
    flex: 1;
    min-width: 0;
    color: var(--text-primary);
    font-size: var(--text-base);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== INFLUENCIA DEL CLAN ==================== */
#influenciaRoot {
    grid-template-columns: 1fr 360px;
}
@media (max-width: 1100px) {
    #influenciaRoot {
        grid-template-columns: 1fr;
    }
}
.influencia-cell-input {
    width: 70px;
    padding: 4px 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 4px);
    color: var(--text-primary);
    font-size: var(--text-sm);
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease;
    -moz-appearance: textfield;
}
.influencia-cell-input::-webkit-outer-spin-button,
.influencia-cell-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.influencia-cell-input:hover {
    background: var(--bg-subtle);
    border-color: var(--border-subtle);
}
.influencia-cell-input:focus {
    background: var(--bg-elevated);
    border-color: var(--state-success, #22c55e);
    outline: none;
}

/* ==================== APORTES AL CLAN (cofres) ==================== */
/* Alineación consistente entre cabecera y cuerpo. */
#aportesTable th,
#aportesTable td {
    vertical-align: middle;
}
#aportesTable .th-name, #aportesTable .td-name { text-align: left; }
#aportesTable .th-role, #aportesTable .td-role { text-align: center; }
#aportesTable .th-points, #aportesTable .td-points { width: 160px; text-align: center; }
#aportesTable .td-sumar { text-align: center; }
.aportes-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.cofres-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.2;
}
.cofres-total { font-weight: 700; }
.cofres-updated { font-size: 10px; color: var(--text-secondary); font-weight: 400; }

.aportes-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2, 6px);
}
.aportes-delta-input {
    width: 80px;
    padding: 5px 6px;
    background: var(--bg-input, var(--bg-elevated, #1a1a1a));
    border: 1px solid var(--border-subtle, #333);
    border-radius: var(--radius-sm, 6px);
    color: var(--text-primary);
    font-size: var(--text-sm);
    text-align: center;
    -moz-appearance: textfield;
}
.aportes-delta-input::-webkit-outer-spin-button,
.aportes-delta-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.aportes-delta-input:focus {
    outline: none;
    border-color: var(--state-success, #22c55e);
}
.aportes-actions .btn-sm {
    min-width: 34px;
    padding: 5px 9px;
    font-size: 1rem;
    line-height: 1;
}
.aportes-btn-sumar { color: #22c55e !important; }
.aportes-btn-restar { color: #f59e0b !important; }

/* ==================== CANALES DE VOZ TEMPORALES (admin) ==================== */

/* Chips multi-select de roles — combo con .role-picker estándar del proyecto */
#voice-tempSection .vtc-roles-chips {
    background: var(--bg-subtle, var(--bg-input, #1a1a1a));
    border: 1px solid var(--border, var(--border-color, #333));
    border-radius: var(--radius, 8px);
    padding: var(--space-2, 8px);
    min-height: 48px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

#voice-tempSection .vtc-roles-chips .chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 2px solid var(--border, #444);
    background: transparent;
    color: var(--text, #fff);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1.2;
}

#voice-tempSection .vtc-roles-chips .chip-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#voice-tempSection .vtc-roles-chips .chip-btn:active {
    transform: translateY(0);
}

#voice-tempSection .vtc-roles-chips .chip-btn.chip-on {
    font-weight: 600;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.2), 0 4px 12px var(--chip-glow, rgba(88,101,242,0.5));
}

#voice-tempSection .vtc-roles-chips .chip-btn .chip-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

#voice-tempSection .vtc-roles-chips .vtc-chips-footer {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border, #333);
    font-size: 0.85rem;
    color: var(--text-muted, #aaa);
}

/* ==================== TRADUCCIÓN POR REACCIÓN (admin) ==================== */

/* Grid de tarjetas de banderas — más grandes y visuales que los chips */
#translateSection .tr-flags-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 10px !important;
    margin-top: 10px;
}

#translateSection .tr-flag-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    padding: 14px 10px;
    border-radius: 12px;
    border: 2px solid var(--border, #333);
    background: var(--bg-subtle, #1a1a1a);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    text-align: center;
    min-height: 90px;
    position: relative;
    overflow: hidden;
}

#translateSection .tr-flag-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, #5865F2);
    opacity: 0;
    transition: opacity 0.2s;
}

#translateSection .tr-flag-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent, #5865F2);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

#translateSection .tr-flag-card.tr-flag-on {
    border-color: var(--accent, #5865F2);
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.05));
    box-shadow: 0 0 0 2px var(--accent, #5865F2), 0 6px 16px rgba(88, 101, 242, 0.4);
}

#translateSection .tr-flag-card.tr-flag-on::before {
    opacity: 1;
}

#translateSection .tr-flag-card.tr-flag-on::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 8px;
    color: var(--accent, #5865F2);
    font-weight: 700;
    font-size: 0.9rem;
}

#translateSection .tr-flag-emoji {
    font-size: 2.2rem;
    line-height: 1;
}

#translateSection .tr-flag-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text, #fff);
    line-height: 1.2;
}

#translateSection .tr-flag-code {
    font-size: 0.7rem;
    color: var(--text-muted, #aaa);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

#translateSection .tr-flag-card.tr-flag-on .tr-flag-code {
    color: var(--accent, #5865F2);
}

@media (max-width: 600px) {
    #translateSection .tr-flags-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #translateSection .tr-flag-emoji {
        font-size: 1.8rem;
    }
}



#voice-tempSection .vtc-roles-chips .vtc-chips-footer {
    width: 100%;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border, #333);
    font-size: 0.8rem;
    color: var(--text-muted, #aaa);
}


