/* ==========================================================================
   CCBE (Compañía Comercial del Borde Exterior) - Tactical HR Portal Styles
   Glassmorphism Sci-Fi HUD Theme with Multi-Division Dynamic Accents
   ========================================================================== */

:root {
  --bg-space: #060913;
  --bg-surface: #0c1222;
  --bg-surface-glass: rgba(12, 18, 34, 0.85);
  --bg-card: rgba(16, 24, 45, 0.7);
  --bg-card-hover: rgba(22, 33, 62, 0.85);
  --border-glass: rgba(56, 189, 248, 0.15);
  --border-glass-bright: rgba(56, 189, 248, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* CCBE Corporate Colors */
  --ccbe-blue: #2563eb;
  --ccbe-blue-light: #60a5fa;
  --ccbe-gold: #f59e0b;
  --ccbe-gold-glow: rgba(245, 158, 11, 0.25);

  /* Division Theme Accents */
  --div-merr: #10b981;
  --div-merr-glow: rgba(16, 185, 129, 0.25);
  --div-merr-bg: rgba(16, 185, 129, 0.12);

  --div-trade: #f59e0b;
  --div-trade-glow: rgba(245, 158, 11, 0.25);
  --div-trade-bg: rgba(245, 158, 11, 0.12);

  --div-opes: #06b6d4;
  --div-opes-glow: rgba(6, 182, 212, 0.25);
  --div-opes-bg: rgba(6, 182, 212, 0.12);

  --div-mando: #ef4444;
  --div-mando-glow: rgba(239, 68, 68, 0.25);
  --div-mando-bg: rgba(239, 68, 68, 0.12);

  /* Active Accent Variable */
  --theme-accent: #38bdf8;
  --theme-glow: rgba(56, 189, 248, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Division-specific contextual theme classes */
body[data-active-div="merr"] {
  --theme-accent: var(--div-merr);
  --theme-glow: var(--div-merr-glow);
}
body[data-active-div="trade"] {
  --theme-accent: var(--div-trade);
  --theme-glow: var(--div-trade-glow);
}
body[data-active-div="opes"] {
  --theme-accent: var(--div-opes);
  --theme-glow: var(--div-opes-glow);
}
body[data-active-div="mandalorianos"] {
  --theme-accent: var(--div-mando);
  --theme-glow: var(--div-mando-glow);
}
body[data-active-div="all"] {
  --theme-accent: #38bdf8;
  --theme-glow: rgba(56, 189, 248, 0.25);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-space);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, var(--theme-glow) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(15, 23, 42, 0.6) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Top Divisional Command Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-surface-glass);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.brand-logo {
  height: 44px;
  width: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
  transition: var(--transition);
}

.brand-logo:hover {
  transform: scale(1.05);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-text .subtext {
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Division Switcher Bar */
.division-switcher {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.2rem;
}

.div-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.div-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-div-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
}

.div-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.div-btn.div-all .dot { background: #38bdf8; }
.div-btn.div-merr .dot { background: var(--div-merr); }
.div-btn.div-trade .dot { background: var(--div-trade); }
.div-btn.div-opes .dot { background: var(--div-opes); }
.div-btn.div-mando .dot { background: var(--div-mando); }

.div-btn.active {
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.div-btn.div-all.active {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.div-btn.div-merr.active {
  background: var(--div-merr-bg);
  border: 1px solid var(--div-merr);
}
.div-btn.div-trade.active {
  background: var(--div-trade-bg);
  border: 1px solid var(--div-trade);
}
.div-btn.div-opes.active {
  background: var(--div-opes-bg);
  border: 1px solid var(--div-opes);
}
.div-btn.div-mando.active {
  background: var(--div-mando-bg);
  border: 1px solid var(--div-mando);
}

/* Header User Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.system-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.user-badge-clickable {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-full);
  padding: 0.1rem 0.3rem 0.1rem 0.1rem;
  transition: background 0.2s;
}

.user-badge-clickable:hover {
  background: rgba(56, 189, 248, 0.12);
}

.user-avatar-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-glass);
}

.user-avatar-fallback {
  font-size: 0.95rem;
}

.role-tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-tag.role-admin { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.role-tag.role-instructor { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.role-tag.role-member { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.3); }

.btn-header-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.btn-header-logout:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* Main Navigation Tabs */
.nav-tabs-bar {
  background: rgba(10, 15, 28, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.nav-tabs-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
}

.nav-tab {
  padding: 0.85rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.nav-tab.active {
  color: #fff;
  border-bottom-color: var(--theme-accent);
}

/* Division Banner Card */
.division-hero-banner {
  max-width: 1500px;
  margin: 1.5rem auto 0 auto;
  padding: 0 1.5rem;
}

.hero-glass-card {
  background: linear-gradient(135deg, rgba(16, 24, 45, 0.85) 0%, rgba(12, 18, 34, 0.95) 100%);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--theme-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: var(--transition);
}

.hero-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.hero-logo-img {
  height: 56px;
  width: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px var(--theme-glow));
}

.hero-titles h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
}

.hero-titles .hero-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.hero-stats-badge {
  display: flex;
  gap: 1.5rem;
}

.hero-stat-box {
  text-align: right;
}

.hero-stat-box .num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--theme-accent);
  line-height: 1.1;
}

.hero-stat-box .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Layout Container */
.main-content {
  max-width: 1500px;
  margin: 1.5rem auto;
  padding: 0 1.5rem 3rem 1.5rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-pane.active {
  display: block;
}

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

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glass-bright);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.kpi-text .kpi-num {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.kpi-text .kpi-title {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.kpi-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.kpi-emerald { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.kpi-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.kpi-cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.kpi-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* 4 Divisions Interactive Overview Cards */
.divisions-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.div-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.div-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.div-card.card-merr::before { background: var(--div-merr); }
.div-card.card-trade::before { background: var(--div-trade); }
.div-card.card-opes::before { background: var(--div-opes); }
.div-card.card-mando::before, .div-card.card-mandalorianos::before { background: var(--div-mando); }

.div-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.div-card.card-merr:hover { border-color: var(--div-merr); }
.div-card.card-trade:hover { border-color: var(--div-trade); }
.div-card.card-opes:hover { border-color: var(--div-opes); }
.div-card.card-mando:hover, .div-card.card-mandalorianos:hover { border-color: var(--div-mando); }

.div-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.div-badge-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.card-merr .div-badge-tag { background: var(--div-merr-bg); color: var(--div-merr); border: 1px solid var(--div-merr); }
.card-trade .div-badge-tag { background: var(--div-trade-bg); color: var(--div-trade); border: 1px solid var(--div-trade); }
.card-opes .div-badge-tag { background: var(--div-opes-bg); color: var(--div-opes); border: 1px solid var(--div-opes); }
.card-mando .div-badge-tag, .card-mandalorianos .div-badge-tag { background: var(--div-mando-bg); color: var(--div-mando); border: 1px solid var(--div-mando); }

.div-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
}

.div-card .full-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 48px;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.div-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
  font-size: 0.78rem;
}

.div-card-footer .leader {
  color: var(--text-muted);
}

.div-card-footer .leader strong {
  color: var(--text-primary);
}

.div-card-footer .count-tag {
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

/* Modern Data Tables */
.table-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  margin-bottom: 2rem;
}

.panel-header {
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.panel-title p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.input-search, .select-filter {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition);
}

.input-search:focus, .select-filter:focus {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 2px var(--theme-glow);
}

.select-filter option {
  background: #0f172a;
  color: #fff;
}

/* Table */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.data-table th {
  background: rgba(10, 15, 28, 0.9);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.data-table th.sortable:hover {
  color: #fff;
  background: rgba(30, 41, 59, 0.95);
}

.data-table th.sortable .sort-indicator {
  display: inline-block;
  margin-left: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.55;
  vertical-align: middle;
  transition: transform 0.15s ease, opacity 0.15s ease, color 0.15s ease;
}

.data-table th.sortable:hover .sort-indicator {
  opacity: 1;
  color: var(--theme-accent);
}

.data-table th.sortable.sorted-asc,
.data-table th.sortable.sorted-desc {
  color: #fff;
  background: rgba(30, 41, 59, 0.98);
  border-bottom: 2px solid var(--theme-accent) !important;
}

.data-table th.sortable.sorted-asc .sort-indicator,
.data-table th.sortable.sorted-desc .sort-indicator {
  opacity: 1;
  color: var(--theme-accent);
  font-weight: 800;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Division Pill Badges in Tables */
.div-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  margin: 0.1rem;
}

.div-pill.merr { background: var(--div-merr-bg); color: var(--div-merr); border: 1px solid var(--div-merr); }
.div-pill.trade { background: var(--div-trade-bg); color: var(--div-trade); border: 1px solid var(--div-trade); }
.div-pill.opes { background: var(--div-opes-bg); color: var(--div-opes); border: 1px solid var(--div-opes); }
.div-pill.mandalorianos { background: var(--div-mando-bg); color: var(--div-mando); border: 1px solid var(--div-mando); }
.div-pill.general { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* In-panel Matrix Division Selector Buttons */
.matrix-division-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.btn-matrix-div {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.28rem 0.6rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-matrix-div img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.btn-matrix-div:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-matrix-div.active {
  color: #fff;
}

.btn-matrix-div.merr.active {
  background: var(--div-merr-bg);
  border-color: var(--div-merr);
  color: var(--div-merr);
}

.btn-matrix-div.trade.active {
  background: var(--div-trade-bg);
  border-color: var(--div-trade);
  color: var(--div-trade);
}

.btn-matrix-div.opes.active {
  background: var(--div-opes-bg);
  border-color: var(--div-opes);
  color: var(--div-opes);
}

.btn-matrix-div.mandalorianos.active {
  background: var(--div-mando-bg);
  border-color: var(--div-mando);
  color: var(--div-mando);
}

/* Modal Attendance Checklist Items */
.attendee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.attendee-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.attendee-row.is-selected {
  background: rgba(56, 189, 248, 0.08);
}

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

.attendee-highlight {
  background: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 0 0.15rem;
  border-radius: 2px;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--theme-accent);
  color: #040813;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--theme-glow);
}

.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 14px var(--theme-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-excel {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-excel:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #fff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.btn-sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 16, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #0d1527;
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(15px);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-box {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: rgba(10, 15, 28, 0.8);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

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

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #0f172a;
  border-left: 4px solid var(--theme-accent);
  border-top: 1px solid var(--border-glass);
  border-right: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: slideIn 0.2s ease-out;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast.toast-success {
  border-left-color: #10b981;
}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .division-switcher {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .hero-glass-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-stats-badge {
    align-self: flex-start;
    text-align: left;
  }
  .hero-stat-box {
    text-align: left;
  }
}

/* Discord Voice Time & Activity Pills */
.tiempo-voz-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(88, 101, 242, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(88, 101, 242, 0.35);
}

/* Organigrama Táctico Corporativo */
.organigrama-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}

.org-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.org-level-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.org-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
}

.org-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  min-width: 240px;
  max-width: 290px;
  flex: 1 1 240px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: var(--transition);
  position: relative;
  text-align: center;
}

.org-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.org-card.card-consejo {
  border-top: 3px solid #f59e0b;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.1) 0%, rgba(16, 24, 45, 0.85) 100%);
}

.org-card.card-lider {
  border-top: 3px solid var(--theme-accent);
}

.org-card.card-instructor {
  border-top: 3px solid #38bdf8;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(16, 24, 45, 0.85) 100%);
}

.org-card.card-altomando {
  border-top: 3px solid #f43f5e;
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.08) 0%, rgba(16, 24, 45, 0.85) 100%);
}

.org-card.card-altomando.card-merr {
  border-top: 3px solid var(--div-merr);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 24, 45, 0.85) 100%);
}
.org-card.card-altomando.card-trade {
  border-top: 3px solid var(--div-trade);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(16, 24, 45, 0.85) 100%);
}
.org-card.card-altomando.card-opes {
  border-top: 3px solid var(--div-opes);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(16, 24, 45, 0.85) 100%);
}
.org-card.card-altomando.card-mandalorianos {
  border-top: 3px solid var(--div-mando);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, rgba(16, 24, 45, 0.85) 100%);
}

.org-card.card-reclutador {
  border-top: 3px solid #a855f7;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08) 0%, rgba(16, 24, 45, 0.85) 100%);
}

.org-card.card-embajador {
  border-top: 3px solid #06b6d4;
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, rgba(16, 24, 45, 0.85) 100%);
}

.org-card-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin: 0 auto 0.5rem auto;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.6));
}

.org-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.org-cargo {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.org-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

/* Division Control Dashboard Elements */
.course-progress-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  transition: var(--transition);
}

.course-progress-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.course-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.course-progress-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.course-progress-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--theme-accent);
}

.progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress-bar {
  height: 100%;
  background: var(--theme-accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.instructor-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.instructor-chip .chip-star {
  color: #38bdf8;
  font-size: 0.85rem;
}

/* Multi-Role Selector in Member Form */
.roles-selection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
}

.role-chip-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.role-chip-btn input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-chip-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

.role-chip-btn:hover .role-chip-content {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.role-chip-btn input[type="checkbox"]:checked + .role-chip-content {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.role-chip-btn input[value="Consejo"]:checked + .role-chip-content {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.role-chip-btn input[value="Alto Mando"]:checked + .role-chip-content {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  color: #fda4af;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.role-chip-btn input[value="Reclutador"]:checked + .role-chip-content {
  background: rgba(168, 85, 247, 0.25);
  border-color: #c084fc;
  color: #f3e8ff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.role-chip-btn input[value="Embajador"]:checked + .role-chip-content {
  background: rgba(6, 182, 212, 0.25);
  border-color: #22d3ee;
  color: #cffafe;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.role-chip-btn input[value="Veterano"]:checked + .role-chip-content {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #d1fae5;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Condecoraciones de Honor CCBE (Geometría Uniforme: Recuadro con Círculo de Color) */
.condec-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 24px;
  padding: 0 0.55rem;
  border-radius: 4px;
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.condec-badge:hover {
  transform: translateY(-1px);
}

.condec-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.condec-title {
  display: inline-block;
  line-height: 1;
}

/* 1. Insignia Negra */
.condec-negra {
  background: linear-gradient(135deg, #27272a 0%, #121214 100%);
  color: #e4e4e7;
  border: 1px solid #52525b;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}
.condec-negra .condec-indicator {
  background: #09090b;
  border: 1.5px solid #a1a1aa;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.25);
}

/* 2. Insignia Plateada */
.condec-plateada {
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.18) 0%, rgba(148, 163, 184, 0.35) 100%);
  color: #f8fafc;
  border: 1px solid #cbd5e1;
  box-shadow: 0 0 8px rgba(203, 213, 225, 0.3);
}
.condec-plateada .condec-indicator {
  background: #f1f5f9;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
}

/* 3. Insignia Dorada (Activa: acumulable por año de actividad continuada) */
.condec-dorada {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.48) 100%);
  color: #fef08a;
  border: 1px solid #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}
.condec-dorada .condec-indicator {
  background: #fbbf24;
  border: 1.5px solid #fffbeb;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.95);
}

/* 4. Insignia Dorada Legacy (Atenuada por inactividad de 1 año) */
.condec-dorada-legacy {
  background: linear-gradient(135deg, rgba(115, 95, 60, 0.18) 0%, rgba(68, 64, 60, 0.28) 100%);
  color: #d6cbbe;
  border: 1px solid rgba(168, 145, 100, 0.4);
  box-shadow: none;
  opacity: 0.88;
}
.condec-dorada-legacy .condec-indicator {
  background: #786b59;
  border: 1.5px solid #a89f91;
  box-shadow: none;
}

/* ==========================================================
   SELECCIÓN DE FORMACIONES / CURSOS EN EDICIÓN DE EFECTIVO
   ========================================================== */
.member-courses-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 768px) {
  .member-courses-edit-grid {
    grid-template-columns: 1fr;
  }
}

.div-courses-group-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  transition: all 0.2s;
  position: relative;
}

.div-courses-group-card.card-merr { border-top: 3px solid var(--div-merr); }
.div-courses-group-card.card-trade { border-top: 3px solid var(--div-trade); }
.div-courses-group-card.card-opes { border-top: 3px solid var(--div-opes); }
.div-courses-group-card.card-mandalorianos { border-top: 3px solid var(--div-mando); }

.div-courses-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.div-courses-group-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.div-courses-group-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.course-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.35rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
}

.course-toggle-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.course-toggle-item.checked {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
}

.course-toggle-item.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.course-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
}

.course-toggle-left input[type="checkbox"] {
  accent-color: #10b981;
  transform: scale(1.15);
  cursor: pointer;
}

.course-toggle-name {
  font-size: 0.78rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-toggle-badge {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 0.4rem;
}

.course-toggle-item.checked .course-toggle-badge {
  color: #10b981;
}

.course-toggle-item:not(.checked) .course-toggle-badge {
  color: #64748b;
}

/* Monthly calendar: retains the portal's existing division palette and cards. */
.hr-calendar-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.hr-calendar-toolbar h2 { text-transform:capitalize; margin:0; }
.calendar-navigation { display:inline-flex; align-items:center; justify-content:center; padding:8px 14px; border:1px solid #334155; border-radius:8px; text-decoration:none; color:#e2e8f0; background:#0f172a; }
.calendar-navigation:hover { border-color:var(--div-color, #38bdf8); }
.hr-calendar-scroll { overflow-x:auto; margin-top:16px; }
.hr-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); min-width:630px; gap:1px; background:#334155; border:1px solid #334155; border-radius:8px; overflow:hidden; }
.calendar-weekday { padding:10px 6px; text-align:center; background:#101b2e; color:#cbd5e1; font-size:12px; font-weight:700; }
.calendar-day { background:#0c1524; padding:8px; min-height:112px; min-width:0; }
.calendar-day.outside-month { background:#080f1b; }
.outside-month .calendar-day-number { color:#64748b; }
.calendar-day-number { display:block; font-size:13px; color:#cbd5e1; margin-bottom:8px; }
.calendar-today { box-shadow:inset 0 0 0 2px var(--div-color,#38bdf8); }
.calendar-today .calendar-day-number { color:#7dd3fc; font-weight:700; }
.calendar-day button.calendar-event { display:block; width:100%; padding:7px; margin:5px 0 0; text-align:left; height:auto; min-width:0; white-space:normal; border:1px solid #245373; border-left:3px solid var(--div-color,#38bdf8); border-radius:6px; background:#122a3c; color:#e2f4ff; font-size:11px; line-height:1.35; }
.calendar-event-title { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.calendar-event-time { display:block; font-weight:700; color:#7dd3fc; margin-bottom:2px; }
.calendar-event-status { display:block; font-size:10px; color:#b5cbdc; margin-top:4px; }
.calendar-day button.calendar-event:hover { background:#1b3b53; border-color:#7dd3fc; }
.calendar-day button.state-confirmada { border-left-color:#34d399; }
.calendar-day button.state-curso { border-left-color:#fbbf24; }
.calendar-day button.state-finalizada { border-left-color:#94a3b8; }
.calendar-day button.state-cancelada { border-left-color:#f87171; opacity:.75; }
.calendar-event-description { white-space:pre-wrap; overflow-wrap:anywhere; }
.restored-hr .hr-calendar .calendar-day button.calendar-event[data-action] { background:#11283a; color:#e2f0ff; }
.restored-hr .hr-calendar .calendar-day button.calendar-event[data-action]:hover { background:#1b3b53; }
@media(max-width:650px) { .hr-calendar.card { padding:12px; } .hr-calendar-toolbar { gap:10px; } .hr-calendar-toolbar h2 { font-size:19px; } }


/* Event sheet in the calendar: event data and your answer on the left, who is going (sign-ups and Discord reactions) on the right. */
dialog:has(.ev-sheet) { width:min(1040px,calc(100% - 30px)); margin:auto; }
.ev-sheet { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(0,1fr); gap:18px; align-items:start; }
.ev-card, .ev-roster { border:1px solid #1d3d55; border-radius:12px; background:#0a1525; overflow:hidden; }
.ev-card { --ev-state:#38bdf8; }
.ev-card.state-confirmada { --ev-state:#34d399; }
.ev-card.state-curso { --ev-state:#fbbf24; }
.ev-card.state-finalizada { --ev-state:#94a3b8; }
.ev-card.state-cancelada { --ev-state:#f87171; }
.ev-bar { height:3px; background:var(--ev-state); box-shadow:0 0 12px var(--ev-state); }
.ev-card.state-finalizada .ev-bar, .ev-card.state-cancelada .ev-bar { box-shadow:none; }
.ev-card.state-curso .ev-bar { animation:ev-pulse 2.2s ease-in-out infinite; }
@keyframes ev-pulse { 0%,100% { opacity:.4; } 50% { opacity:1; } }
@media (prefers-reduced-motion:reduce) { .ev-card.state-curso .ev-bar { animation:none; } }
.ev-label { font:600 10.5px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.14em; text-transform:uppercase; color:#7f9bb2; }
.ev-head { display:flex; flex-direction:column; gap:8px; padding:16px 18px; border-bottom:1px solid #15304a; background:#0d1c2e; }
.ev-kicker { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ev-badge { flex:none; padding:3px 9px; border:1px solid var(--ev-state); border-radius:999px; color:var(--ev-state); font:600 10.5px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.12em; text-transform:uppercase; }
.ev-title { margin:0; font-size:24px; font-weight:700; line-height:1.15; color:#f1f6fb; text-wrap:balance; overflow-wrap:anywhere; }
.ev-by { font-size:13px; color:#a9bccc; }
.ev-by .ev-label { margin-right:6px; }
.ev-card.state-cancelada .ev-title { text-decoration:line-through; text-decoration-thickness:1.5px; }
.ev-card.state-finalizada .ev-head, .ev-card.state-cancelada .ev-head { filter:saturate(.5); }
.ev-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.ev-fact { display:flex; flex-direction:column; gap:3px; min-width:0; padding:11px 18px; border-bottom:1px solid #15304a; }
.ev-fact:nth-child(odd) { border-right:1px solid #15304a; }
.ev-fact strong { font-size:15px; font-weight:600; color:#e8f1f8; overflow-wrap:anywhere; }
.ev-fact strong::first-letter { text-transform:uppercase; }
.ev-fact small { font-size:12px; color:#7f9bb2; }
.ev-section { display:flex; flex-direction:column; gap:8px; padding:14px 18px; border-bottom:1px solid #15304a; }
.ev-prose { display:flex; flex-direction:column; gap:8px; font-size:14px; line-height:1.55; color:#c9d7e4; overflow-wrap:anywhere; }
.ev-prose p { white-space:pre-line; }
.ev-prose ul, .ev-prose ol { display:flex; flex-direction:column; gap:4px; padding-left:22px; }
.ev-prose ul { list-style:disc; }
.ev-prose ol { list-style:decimal; }
.ev-prose li::marker { color:#38bdf8; }
.ev-prose a { color:#7dd3fc; }
.ev-prose a:hover { color:#bae6fd; }
.ev-answer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; padding:14px 18px; background:#081120; }
.ev-answer-text { display:flex; flex-direction:column; gap:4px; flex:1 1 220px; min-width:0; }
.ev-answer-text p { font-size:13px; line-height:1.45; color:#a9bccc; }
.ev-answer .discord-link { flex:none; }
.ev-roster-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding:12px 16px; border-bottom:1px solid #15304a; }
.ev-count { font:600 12.5px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#d7e3ee; font-variant-numeric:tabular-nums; }
.ev-roster progress { display:block; width:100%; height:4px; border:0; background:#15304a; appearance:none; -webkit-appearance:none; }
.ev-roster progress::-webkit-progress-bar { background:#15304a; }
.ev-roster progress::-webkit-progress-value { background:#38bdf8; }
.ev-roster progress::-moz-progress-bar { background:#38bdf8; }
.ev-people { list-style:none; max-height:420px; overflow:auto; }
.ev-person { --ev-div:#64748b; display:flex; align-items:center; gap:10px; padding:8px 16px; border-bottom:1px solid #12283e; }
.ev-person[data-div="merr"] { --ev-div:var(--div-merr); }
.ev-person[data-div="trade"] { --ev-div:var(--div-trade); }
.ev-person[data-div="opes"] { --ev-div:var(--div-opes); }
.ev-person[data-div="mandalorianos"] { --ev-div:var(--div-mando); }
.ev-avatar { flex:none; display:grid; place-items:center; width:30px; height:30px; border:2px solid var(--ev-div); border-radius:50%; font:600 11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#e2e8f0; }
.ev-who { display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.ev-who strong { font-size:14px; font-weight:600; color:#eef4f9; overflow-wrap:anywhere; }
.ev-who small { font:11.5px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:var(--ev-div); }
.ev-person:not([data-div="merr"]):not([data-div="trade"]):not([data-div="opes"]):not([data-div="mandalorianos"]) .ev-who small { color:#7f9bb2; }
.ev-empty, .ev-warn, .ev-attended, .ev-foot { padding:10px 16px; font-size:13px; line-height:1.45; color:#a9bccc; }
.ev-warn { color:#fcd34d; }
.ev-attended { border-top:1px solid #15304a; }
.ev-attended strong { color:#34d399; font-variant-numeric:tabular-nums; }
.ev-others { display:flex; flex-direction:column; gap:6px; padding:10px 16px; font-size:13px; line-height:1.45; color:#c9d7e4; }
.ev-others .ev-label { margin-right:8px; }
.ev-foot { font-size:12px; color:#7f9bb2; border-top:1px solid #15304a; }
.ev-manage { display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:14px 16px; border-top:1px solid #15304a; }
.ev-manage-actions { display:flex; flex-wrap:wrap; gap:8px; }
.ev-manage small { font-size:12px; color:#7f9bb2; }
@media (max-width:760px) { .ev-sheet { grid-template-columns:1fr; } .ev-title { font-size:21px; } .ev-people { max-height:none; } }
@media (max-width:460px) { .ev-facts { grid-template-columns:1fr; } .ev-fact:nth-child(odd) { border-right:0; } .ev-answer { padding:12px 14px; } }

/* Overview «Próximos 7 días»: a strip with today and the next six days, and the chosen day's operation below (as in the local web). */
.week-planner { display:flex; flex-direction:column; gap:14px; margin-bottom:18px; }
.week-planner-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; }
.week-planner-head h2 { margin:0; font-size:18px; }
.week-planner-count { font:600 11px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.12em; text-transform:uppercase; color:#7f9bb2; }
.week-planner-head .calendar-navigation { margin-left:auto; }
.week-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); border:1px solid #1d3d55; border-radius:10px; overflow:hidden; }
.week-day { display:flex; flex-direction:column; gap:6px; min-width:0; min-height:112px; padding:10px 8px; border-right:1px solid #15304a; background:#0a1525; cursor:pointer; }
.week-day:last-child { border-right:0; }
.week-day:hover { background:#0f1e31; }
.week-day:focus-visible { outline:3px solid #96f2ff; outline-offset:-3px; }
.week-day.is-today { background:#0d1d30; }
.week-day.is-selected { background:#10283d; box-shadow:inset 0 -2px 0 #38bdf8; }
.week-day-head { display:flex; align-items:baseline; gap:6px; }
.week-day-name { font:600 10.5px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.12em; text-transform:uppercase; color:#7f9bb2; }
.week-day-number { font-size:18px; font-weight:700; color:#c9d7e4; font-variant-numeric:tabular-nums; }
.week-day.is-today .week-day-name, .week-day.is-today .week-day-number { color:#38bdf8; }
.week-chip { --chip:#38bdf8; display:flex; flex-direction:column; gap:1px; min-width:0; padding:4px 6px; border:1px solid #1d3d55; border-left:3px solid var(--chip); border-radius:6px; background:#0d1c2e; }
.week-chip.state-confirmada { --chip:#34d399; }
.week-chip.state-curso { --chip:#fbbf24; }
.week-chip.state-finalizada { --chip:#94a3b8; }
.week-chip.state-cancelada { --chip:#f87171; opacity:.75; }
.week-chip-time { font:600 10.5px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#7dd3fc; }
.week-chip-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; line-height:1.3; color:#e2f0ff; }
.week-card:empty { display:none; }
.week-empty { padding:14px 16px; border:1px dashed #1d3d55; border-radius:10px; font-size:14px; color:#a9bccc; }
.week-intro { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:13.5px; line-height:1.45; color:#a9bccc; }
.week-facts { grid-template-columns:repeat(4,minmax(0,1fr)); }
.week-facts .ev-fact { border-bottom:0; border-right:1px solid #15304a; }
.week-facts .ev-fact:last-child { border-right:0; }
.week-foot { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; border-top:1px solid #15304a; background:#081120; }
.week-avatars { display:flex; align-items:center; min-height:30px; }
.week-avatars .ev-avatar { --ev-div:#64748b; margin-left:-6px; background:#0a1525; }
.week-avatars .ev-avatar:first-child { margin-left:0; }
.week-avatars .ev-avatar[data-div="merr"] { --ev-div:var(--div-merr); }
.week-avatars .ev-avatar[data-div="trade"] { --ev-div:var(--div-trade); }
.week-avatars .ev-avatar[data-div="opes"] { --ev-div:var(--div-opes); }
.week-avatars .ev-avatar[data-div="mandalorianos"] { --ev-div:var(--div-mando); }
.week-more { margin-left:8px; font:600 12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#a9bccc; }
.week-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.week-joined { padding:9px 12px; border:1px solid #34d39966; border-radius:6px; background:#34d3991a; font:600 12px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.08em; text-transform:uppercase; color:#34d399; }
@media (max-width:760px) {
 .week-day { flex-direction:row; flex-wrap:wrap; justify-content:center; align-content:flex-start; gap:4px; min-height:66px; padding:8px 2px; }
 .week-day-head { flex-basis:100%; flex-direction:column; align-items:center; gap:0; }
 .week-chip { width:8px; height:8px; padding:0; border:0; border-radius:50%; background:var(--chip); }
 .week-chip-time, .week-chip-title { display:none; }
 .week-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .week-facts .ev-fact:nth-child(2) { border-right:0; }
 .week-facts .ev-fact:nth-child(-n+2) { border-bottom:1px solid #15304a; }
 .week-planner-head .calendar-navigation { margin-left:0; }
}

/* Who goes to an operation: each division in the colour of its Discord role, so members recognise it at a glance. The two darkest
   (M.E.R.R. and O.P.E.S.) are too dark for small text on this background, so the colour fills the initials circle and a dot by the label. */
.restored-hr { --discord-merr:#9c0000; --discord-mando:#ff5300; --discord-opes:#206694; --discord-trade:#e91e63; }
.ev-person[data-div="merr"], .week-avatars .ev-avatar[data-div="merr"] { --ev-div:var(--discord-merr); }
.ev-person[data-div="mandalorianos"], .week-avatars .ev-avatar[data-div="mandalorianos"] { --ev-div:var(--discord-mando); }
.ev-person[data-div="opes"], .week-avatars .ev-avatar[data-div="opes"] { --ev-div:var(--discord-opes); }
.ev-person[data-div="trade"], .week-avatars .ev-avatar[data-div="trade"] { --ev-div:var(--discord-trade); }
.ev-person:is([data-div="merr"],[data-div="mandalorianos"],[data-div="opes"],[data-div="trade"]) .ev-avatar,
.week-avatars .ev-avatar:is([data-div="merr"],[data-div="mandalorianos"],[data-div="opes"],[data-div="trade"]) { background:var(--ev-div); border-color:var(--ev-div); color:#fff; font-weight:700; }
.week-avatars .ev-avatar { box-shadow:0 0 0 2px #081120; }
.ev-person .ev-who small { display:flex; align-items:center; gap:6px; color:#c9d7e4; }
.ev-person:is([data-div="merr"],[data-div="mandalorianos"],[data-div="opes"],[data-div="trade"]) .ev-who small::before { content:""; flex:none; width:8px; height:8px; border-radius:50%; background:var(--ev-div); }

/* Overview bottom: each division's training over its own members, and the latest operations held. */
.overview-bottom { align-items:start; }
.overview-panel { display:flex; flex-direction:column; gap:12px; }
.overview-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; }
.overview-head h2 { margin:0; font-size:18px; }
.overview-count { font:600 11px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.12em; text-transform:uppercase; color:#7f9bb2; }
.overview-head .calendar-navigation { margin-left:auto; }
.course-group { --div-color:#64748b; display:flex; flex-direction:column; gap:8px; padding-top:12px; border-top:1px solid #15304a; }
.course-group[data-div="merr"] { --div-color:var(--discord-merr); }
.course-group[data-div="mandalorianos"] { --div-color:var(--discord-mando); }
.course-group[data-div="opes"] { --div-color:var(--discord-opes); }
.course-group[data-div="trade"] { --div-color:var(--discord-trade); }
.course-group h3 { display:flex; align-items:center; gap:8px; margin:0; font-size:14px; font-weight:700; color:#eef4f9; }
.course-group h3 small { margin-left:auto; font:600 11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#7f9bb2; }
.course-dot { flex:none; width:10px; height:10px; border-radius:50%; background:var(--div-color); }
.course-list { list-style:none; display:flex; flex-direction:column; gap:8px; }
.course-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(80px,140px) auto; align-items:center; gap:12px; font-size:13.5px; color:#d7e3ee; }
.course-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.course-row progress { width:100%; height:6px; border:0; border-radius:999px; background:#15304a; appearance:none; -webkit-appearance:none; overflow:hidden; }
.course-row progress::-webkit-progress-bar { background:#15304a; border-radius:999px; }
.course-row progress::-webkit-progress-value { background:var(--div-color); border-radius:999px; }
.course-row progress::-moz-progress-bar { background:var(--div-color); border-radius:999px; }
.course-count { min-width:56px; text-align:right; font:600 12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#a9bccc; font-variant-numeric:tabular-nums; }
.course-none { font-size:13px; color:#7f9bb2; }
.recent-list { list-style:none; display:flex; flex-direction:column; }
.recent-op { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px; padding:10px 6px; border-top:1px solid #15304a; cursor:pointer; }
.recent-list li:first-child .recent-op { border-top:0; }
.recent-op:hover { background:#0f1e31; }
.recent-op:focus-visible { outline:3px solid #96f2ff; outline-offset:-3px; }
.recent-date { display:flex; flex-direction:column; align-items:center; justify-content:center; width:46px; height:46px; border:1px solid #1d3d55; border-radius:8px; background:#0d1c2e; font:600 10px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.1em; text-transform:uppercase; color:#7f9bb2; }
.recent-date strong { font-size:18px; line-height:1; letter-spacing:0; color:#e8f1f8; font-variant-numeric:tabular-nums; }
.recent-main { display:flex; flex-direction:column; gap:3px; min-width:0; }
.recent-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:600; color:#eef4f9; }
.recent-meta { font:11.5px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#7f9bb2; }
.recent-attended { display:flex; flex-direction:column; align-items:flex-end; font-size:11px; color:#a9bccc; }
.recent-attended strong { font-size:18px; line-height:1.1; color:#34d399; font-variant-numeric:tabular-nums; }
.recent-attended.is-empty { max-width:110px; text-align:right; font-size:11.5px; color:#64748b; }
@media (max-width:760px) { .course-row { grid-template-columns:minmax(0,1fr) auto; } .course-row progress { grid-column:1 / -1; grid-row:2; } }

/* ===== Listas con filtros y orden (Efectivos y Formaciones) ===== */
.restored-hr .list-filters { display:grid; gap:14px; margin-bottom:0; }
.restored-hr .list-top { display:flex; gap:12px; align-items:flex-end; }
.restored-hr .list-filters label { display:flex; flex-direction:column; gap:7px; min-width:0; font-size:12px; color:#c4cedf; }
.restored-hr .list-search { flex:1; }
.restored-hr .list-filters select, .restored-hr .list-filters input { width:100%; min-width:0; }
.restored-hr .list-toggle { display:none; }
.restored-hr .list-facets { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.restored-hr .list-facets.is-six { grid-template-columns:repeat(6,minmax(0,1fr)); }
.restored-hr .list-filters select:disabled { opacity:.5; }
.restored-hr .list-bottom { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px 20px; border-top:1px solid rgba(56,189,248,.15); padding-top:14px; }
.restored-hr .list-chips { display:flex; flex-wrap:wrap; gap:8px; align-items:center; min-width:0; }
.restored-hr .list-chips:focus { outline:none; }
.restored-hr .list-chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:#dcf5ff; background:rgba(56,189,248,.1); border:1px solid rgba(56,189,248,.35); border-radius:999px; padding:3px 4px 3px 11px; }
.restored-hr .list-chip b { font-weight:600; color:#94a3b8; }
.restored-hr .list-chip a { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; color:#9fdcf3; text-decoration:none; font-size:12px; }
.restored-hr .list-chip a:hover, .restored-hr .list-chip a:focus-visible { background:rgba(56,189,248,.2); color:#fff; outline:none; }
.restored-hr .list-clear { font-size:12px; font-weight:600; }
.restored-hr .list-none { font-size:12px; color:#64748b; }
.restored-hr .list-sort { display:flex; align-items:center; gap:8px; font-size:12px; color:#c4cedf; }
.restored-hr .list-sort label { display:inline; }
.restored-hr .list-sort select { width:auto; }
.restored-hr .list-bar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px 16px; margin:16px 0 12px; }
.restored-hr .list-bar .actions { margin:0; align-items:center; }
.restored-hr .list-count { margin:0; font-size:13px; color:#94a3b8; font-variant-numeric:tabular-nums; }
.restored-hr .list-count strong { color:#f8fafc; }
.restored-hr .list-scroll-hint { display:none; margin:0 0 8px; font-size:12px; color:#94a3b8; }
.restored-hr .list-table th { white-space:nowrap; vertical-align:bottom; }
.restored-hr .th-sort { display:inline-flex; align-items:center; gap:6px; color:inherit; text-decoration:none; }
.restored-hr .th-sort span { display:inline-block; width:10px; font-size:10px; opacity:0; transition:opacity .15s; }
.restored-hr .list-table th:hover .th-sort span, .restored-hr .th-sort:focus-visible span { opacity:.55; }
.restored-hr .th-sort.is-on { color:#e0f7ff; }
.restored-hr .th-sort.is-on span { opacity:1; color:#7ee7f5; }
.restored-hr .th-sort:focus-visible { outline:2px solid #38bdf8; outline-offset:3px; border-radius:3px; }
.restored-hr .list-table td.is-sorted { background:rgba(56,189,248,.045); }
.restored-hr .list-div { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }
.restored-hr .list-div::before { content:""; flex:none; width:10px; height:10px; border-radius:50%; background:#64748b; box-shadow:0 0 0 2px rgba(255,255,255,.12); }
.restored-hr .list-div[data-div="merr"]::before { background:var(--discord-merr); }
.restored-hr .list-div[data-div="mandalorianos"]::before { background:var(--discord-mando); }
.restored-hr .list-div[data-div="opes"]::before { background:var(--discord-opes); }
.restored-hr .list-div[data-div="trade"]::before { background:var(--discord-trade); }
.restored-hr .list-div.is-none { color:#64748b; font-weight:500; }
.restored-hr .list-div.is-none::before { background:transparent; box-shadow:inset 0 0 0 1.5px #64748b; }
.restored-hr .list-div.is-dot { margin-right:6px; vertical-align:-1px; }
.restored-hr .list-status, .restored-hr .list-course { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; border-radius:999px; padding:3px 10px 3px 8px; border:1px solid rgba(148,163,184,.36); color:#aab4c5; background:rgba(148,163,184,.1); white-space:nowrap; }
.restored-hr .list-status::before, .restored-hr .list-course::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.restored-hr .list-status[data-status="Activo"], .restored-hr .list-course.is-done { color:#56d364; background:rgba(63,185,80,.12); border-color:rgba(63,185,80,.4); }
.restored-hr .list-status[data-status="Reservista"] { color:#7cb8ff; background:rgba(96,165,250,.1); border-color:rgba(96,165,250,.38); }
.restored-hr .list-status[data-status="Baja"] { color:#ff8f8f; background:rgba(248,113,113,.1); border-color:rgba(248,113,113,.4); }
.restored-hr .list-course.is-pending { color:#fbbf24; background:rgba(251,191,36,.1); border-color:rgba(251,191,36,.38); }
.restored-hr .list-stale { color:#fbbf24; }
.restored-hr .list-hidden { color:#64748b; font-weight:500; }
.restored-hr .list-cert { display:inline-block; margin-left:7px; padding:1px 7px; border:1px solid rgba(63,185,80,.45); border-radius:999px; font-size:10px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:#56d364; vertical-align:1px; }
.restored-hr .list-progress { display:inline-flex; gap:3px; margin-right:7px; vertical-align:middle; }
.restored-hr .list-progress i { width:14px; height:6px; border-radius:2px; background:#22324d; }
.restored-hr .list-progress i.on { background:#22c6de; }
.restored-hr .list-progress.is-full i.on { background:#3fb950; }
.restored-hr .list-progress-cell { white-space:nowrap; font-variant-numeric:tabular-nums; }
.restored-hr .list-table th.is-course { min-width:120px; max-width:150px; white-space:normal; line-height:1.35; }
.restored-hr .list-table th.is-course .th-sort { align-items:flex-start; }
.restored-hr .list-table th.is-pick, .restored-hr .list-table td.is-pick { background:rgba(251,191,36,.07); }
.restored-hr .list-course-edit { display:inline-block; padding:2px; border-radius:8px; cursor:pointer; }
.restored-hr .list-course-edit:hover, .restored-hr .list-course-edit:focus-visible { background:rgba(56,189,248,.12); box-shadow:0 0 0 1px rgba(56,189,248,.45); outline:none; }
.restored-hr .metric-link { display:block; color:inherit; text-decoration:none; transition:border-color .2s, background .2s; }
.restored-hr .metric-link:hover, .restored-hr .metric-link:focus-visible { border-color:rgba(56,189,248,.45); background:rgba(22,33,62,.85); outline:none; }
.restored-hr a.course-name { color:inherit; text-decoration:none; }
.restored-hr a.course-name:hover, .restored-hr a.course-name:focus-visible { color:#7ee7f5; text-decoration:underline; }
@media (max-width:1100px) { .restored-hr .list-facets.is-six { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:700px) {
  .restored-hr .list-toggle { display:inline-flex; }
  .restored-hr .list-facets, .restored-hr .list-facets.is-six { display:none; grid-template-columns:1fr 1fr; }
  .restored-hr .list-facets.is-open { display:grid; }
  .restored-hr .list-bottom { flex-direction:column; align-items:stretch; }
  .restored-hr .list-sort { display:grid; grid-template-columns:minmax(0,1fr) auto; }
  .restored-hr .list-sort label { grid-column:1 / -1; }
  .restored-hr .list-sort select { width:100%; }
  .restored-hr .list-scroll-hint { display:block; }
  .restored-hr .list-table th:first-child, .restored-hr .list-table td:first-child { position:sticky; left:0; z-index:1; background:#0e1629; }
}
@media (prefers-reduced-motion:reduce) { .restored-hr .th-sort span, .restored-hr .metric-link { transition:none; } }

/* ===== Fases 2 y 3: historial de operaciones, Ascensos, Cuentas, Registro de cambios, Flota de la Org y «Ver» ===== */
/* Botones de modo (Operaciones, Ascensos, Administración): el estilo general de los botones (con :not(#close-dialog), que cuenta
   como un ID) los dejaba todos iguales y no se veía cuál está activo. Mismo :not() y una clase más para ganarle. */
.restored-hr .view-mode-toggles button.view-mode-btn:not(#close-dialog):not(.icon) { background:transparent; color:#8b929f; border:1px solid transparent; border-radius:6px; clip-path:none; padding:8px 14px; font-size:12.5px; font-weight:600; letter-spacing:normal; }
.restored-hr .view-mode-toggles button.view-mode-btn:not(#close-dialog):not(.icon):hover { color:#eef1f6; background:rgba(255,255,255,.04); }
.restored-hr .view-mode-toggles button.view-mode-btn.active:not(#close-dialog):not(.icon) { color:#c2f8ff; background:#12475b; border-color:#74eaff; font-weight:700; }
.restored-hr .view-mode-toggles { flex-wrap:wrap; max-width:100%; }
.restored-hr .list-facets.is-five { grid-template-columns:repeat(5,minmax(0,1fr)); }
.restored-hr .list-facets.is-two { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:560px; }
.restored-hr .list-filters input[type="date"] { color-scheme:dark; }
.restored-hr .list-nowrap { white-space:nowrap; }
.restored-hr .list-div[data-div="global"]::before { background:transparent; box-shadow:inset 0 0 0 2px #7ee7f5; }
.restored-hr .list-unrecorded { color:#fbbf24; font-weight:700; }
/* Candidatos: cada requisito con ✓ o ! */
.restored-hr .list-crit { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; color:#fcd9a0; }
.restored-hr .list-crit > span { display:inline-grid; place-items:center; width:18px; height:18px; border-radius:50%; font-size:11px; font-weight:800; color:#2a1a02; background:#fbbf24; }
.restored-hr .list-crit.is-ok { color:inherit; }
.restored-hr .list-crit.is-ok > span { color:#0b1a12; background:#3fb950; }
.restored-hr .list-elig, .restored-hr .list-job, .restored-hr .list-perm { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; border-radius:999px; padding:3px 10px; border:1px solid rgba(148,163,184,.3); color:#c9d3e1; background:rgba(148,163,184,.08); white-space:nowrap; }
.restored-hr .list-elig.is-yes { color:#56d364; background:rgba(63,185,80,.12); border-color:rgba(63,185,80,.4); }
/* Historial de ascensos: estado de los roles de Discord */
.restored-hr .list-job { padding-left:8px; }
.restored-hr .list-job::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.restored-hr .list-job[data-job="applied"] { color:#56d364; background:rgba(63,185,80,.12); border-color:rgba(63,185,80,.4); }
.restored-hr .list-job[data-job="pending"] { color:#fbbf24; background:rgba(251,191,36,.1); border-color:rgba(251,191,36,.38); }
.restored-hr .list-job[data-job="error"] { color:#ff8f8f; background:rgba(248,113,113,.1); border-color:rgba(248,113,113,.4); }
.restored-hr .list-job[data-job="cancelled"] { color:#aab4c5; background:rgba(148,163,184,.1); border-color:rgba(148,163,184,.36); }
.restored-hr .list-job[data-job="none"] { color:#64748b; border-color:transparent; background:none; padding-left:0; font-weight:600; }
.restored-hr .list-job[data-job="none"]::before { display:none; }
.restored-hr .list-code { font:11.5px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#a5d8ee; word-break:break-all; }
.restored-hr .list-arrow { color:#64748b; margin:0 5px; }
/* Cuentas y permisos */
.restored-hr .list-perm[data-role="admin"] { color:#7ee7f5; background:rgba(34,198,222,.12); border-color:rgba(34,198,222,.45); }
.restored-hr .list-perm[data-role="lider_division"] { color:#fbd38d; background:rgba(251,191,36,.1); border-color:rgba(251,191,36,.38); }
.restored-hr .list-perm[data-role="instructor"] { color:#c4b5fd; background:rgba(167,139,250,.1); border-color:rgba(167,139,250,.38); }
.restored-hr .list-perm[data-role="none"] { color:#ff8f8f; background:rgba(248,113,113,.08); border-color:rgba(248,113,113,.35); }
.restored-hr .list-origin { font-size:12px; color:#94a3b8; }
.restored-hr .list-origin.is-manual { color:#fbbf24; font-weight:700; }
.restored-hr .list-status[data-status="approved"] { color:#56d364; background:rgba(63,185,80,.12); border-color:rgba(63,185,80,.4); }
/* Registro de cambios */
.restored-hr .list-area { display:inline-block; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#22c6de; }
.restored-hr .list-archive-head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:10px 16px; margin-bottom:12px; }
.restored-hr .list-archive-head h2 { margin:0; }
.restored-hr .list-archive-kind { display:flex; flex-direction:column; gap:6px; font-size:12px; color:#c4cedf; }
/* Flota de la Org */
.restored-hr .org-stat-of { font-size:16px; color:#7d8493; }
.restored-hr .org-fleet-ship-variant { font-size:11.5px; color:#8b929f; }
.restored-hr .org-owner-div .list-div { font-size:11.5px; }
.restored-hr .org-fleet-owner-box .btn-profile-secondary { flex:none; white-space:nowrap; }
/* «Ver»: asistencia de un evento, solo de consulta */
.restored-hr dialog:has(.att-view) { width:min(1000px,calc(100% - 30px)); }
.restored-hr .att-view { display:grid; gap:14px; }
.restored-hr .att-sub, .restored-hr .att-summary { margin:0; color:#94a3b8; font-size:13px; }
.restored-hr .att-summary { font-size:14px; }
.restored-hr .att-summary strong { color:#f8fafc; font-size:16px; }
.restored-hr .att-filters { display:grid; grid-template-columns:minmax(0,1.4fr) repeat(4,minmax(0,1fr)); gap:12px; }
.restored-hr .att-filters label { display:flex; flex-direction:column; gap:7px; min-width:0; font-size:12px; color:#c4cedf; }
.restored-hr .att-filters input, .restored-hr .att-filters select { width:100%; min-width:0; }
.restored-hr .att-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px 12px; max-height:min(52vh,520px); overflow:auto; padding:2px; }
.restored-hr .att-row { display:flex; align-items:center; gap:10px; padding:7px 10px; border:1px solid #1d2a42; border-radius:8px; background:#0b1222; min-width:0; }
.restored-hr .att-who { display:grid; gap:3px; min-width:0; flex:1; }
.restored-hr .att-who strong { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.restored-hr .att-meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; font-size:11.5px; }
.restored-hr .att-answer { font-size:11px; font-weight:700; border-radius:999px; padding:1px 7px; border:1px solid; white-space:nowrap; }
.restored-hr .att-answer.is-yes { color:#56d364; border-color:rgba(63,185,80,.45); }
.restored-hr .att-answer.is-no { color:#ff8f8f; border-color:rgba(248,113,113,.45); }
.restored-hr .att-state { flex:none; font-size:11px; font-weight:700; border-radius:999px; padding:1px 8px; border:1px solid rgba(148,163,184,.35); color:#aab4c5; white-space:nowrap; }
.restored-hr .att-state[data-state="yes"] { color:#56d364; border-color:rgba(63,185,80,.45); background:rgba(63,185,80,.1); }
.restored-hr .att-state[data-state="none"] { color:#fbbf24; border-color:rgba(251,191,36,.38); }
.restored-hr .att-note { margin:0; font-size:12.5px; color:#c4b5fd; border:1px dashed rgba(167,139,250,.45); border-radius:8px; padding:9px 12px; }
.restored-hr .att-link { color:#a5b4fc; white-space:nowrap; }
@media (max-width:1100px) {
  .restored-hr .list-facets.is-five { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .restored-hr .att-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:700px) {
  .restored-hr .list-facets.is-five, .restored-hr .list-facets.is-two { display:none; grid-template-columns:1fr 1fr; max-width:none; }
  .restored-hr .list-facets.is-five.is-open, .restored-hr .list-facets.is-two.is-open { display:grid; }
  .restored-hr .att-filters { grid-template-columns:1fr 1fr; }
  .restored-hr .att-search { grid-column:1 / -1; }
  .restored-hr .att-list { grid-template-columns:1fr; max-height:none; }
}
