/* ==========================================================================
   CARTAGENA ROLEPLAY - OFFICIAL DASHBOARD STYLESHEET
   Palette:
   - Primary Black: #0B0B0B
   - Secondary Black: #111111
   - Dark Gray: #1A1A1A
   - Golden Yellow: #F5B700
   - Orange: #FF8A00
   - Dark Gold: #C58A00
   - White: #FFFFFF
   ========================================================================== */

:root {
  --bg-primary: #0B0B0B;
  --bg-secondary: #111111;
  --bg-card: #1A1A1A;
  --bg-hover: #242424;
  --border-color: #2D2D2D;
  --gold-primary: #F5B700;
  --gold-dark: #C58A00;
  --orange-primary: #FF8A00;
  --text-white: #FFFFFF;
  --text-muted: #B0B0B0;
  --danger: #E53935;
  --success: #2E7D32;
  --info: #0288D1;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Montserrat', system-ui, -apple-system, sans-serif;
  --sidebar-width: 280px;
  --topbar-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --shadow-gold: 0 4px 20px rgba(245, 183, 0, 0.15);

  /* Extended design tokens */
  --text-soft: #D6D6D6;
  --gold-soft: rgba(245, 183, 0, 0.08);
  --gold-soft-strong: rgba(245, 183, 0, 0.16);
  --gold-border: rgba(245, 183, 0, 0.45);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
  --control-height: 42px;
  --control-height-sm: 34px;
  --focus-ring: 0 0 0 3px rgba(245, 183, 0, 0.28);
  --card-padding: 24px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

svg {
  max-width: 100%;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}

::selection {
  background: rgba(245, 183, 0, 0.35);
  color: var(--text-white);
}

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

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

a:hover {
  color: var(--orange-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Layout Wrapper */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.35);
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  min-height: var(--topbar-height);
  background: linear-gradient(180deg, rgba(245, 183, 0, 0.05) 0%, transparent 100%);
}

.sidebar-header .btn-icon {
  margin-left: auto;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(245, 183, 0, 0.3));
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--gold-primary);
  line-height: 1;
}

.brand-subtitle {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.25;
  border-radius: var(--radius-md);
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.nav-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-icon {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  flex-shrink: 0;
  stroke: var(--text-muted);
  transition: stroke var(--transition-fast);
}

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

.nav-item:hover .nav-icon {
  stroke: var(--gold-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(245, 183, 0, 0.16) 0%, rgba(255, 138, 0, 0.04) 100%);
  color: var(--gold-primary);
  font-weight: 600;
  border-left-color: var(--gold-primary);
}

.nav-item.active .nav-icon {
  stroke: var(--gold-primary);
}

/* Sidebar nav groups */
.nav-group-toggle {
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.nav-chevron {
  margin-left: auto;
  transition: transform var(--transition-fast);
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-subitems {
  display: none;
  list-style: none;
  padding-left: 36px;
  margin: 4px 0 8px;
}

.nav-group.open .nav-subitems {
  display: block;
}

.nav-subitem {
  display: block;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.nav-subitem.active,
.nav-subitem:hover {
  color: var(--gold-primary);
  background: var(--gold-soft);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.discord-icon {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0;
}

.user-mini-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-card);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.user-role-badge {
  font-size: 0.7rem;
  color: var(--orange-primary);
  font-weight: 600;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px 32px;
  min-height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Topbar Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-height);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title h1 {
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--text-white);
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background-color: var(--gold-soft);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 40px;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
}

.topbar-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}

.topbar-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.topbar-role {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.erlc-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-soft);
  white-space: nowrap;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.erlc-status-pill.online {
  color: #A5D6A7;
  border-color: rgba(76, 175, 80, 0.4);
  background-color: rgba(76, 175, 80, 0.08);
}

.erlc-status-pill.offline {
  color: #EF9A9A;
  border-color: rgba(244, 67, 54, 0.4);
  background-color: rgba(244, 67, 54, 0.08);
}

.erlc-status-pill.online .status-dot {
  background-color: #4CAF50;
  box-shadow: 0 0 8px #4CAF50;
}

.erlc-status-pill.offline .status-dot {
  background-color: #F44336;
}

/* Content Sections */
.content-section {
  display: none;
  animation: fadeIn var(--transition-normal);
}

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

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

/* Welcome Hero */
.welcome-hero {
  background: linear-gradient(135deg, #1A1A1A 0%, #111111 100%);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-gold), var(--shadow-sm);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.welcome-hero::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -10%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(245, 183, 0, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-hero > * {
  position: relative;
}

.welcome-text h2 {
  font-size: 1.8rem;
  color: var(--gold-primary);
}

.welcome-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md), var(--shadow-gold);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
}

.stat-icon.gold {
  background-color: rgba(245, 183, 0, 0.1);
  color: var(--gold-primary);
}

.stat-icon.orange {
  background-color: rgba(255, 138, 0, 0.1);
  color: var(--orange-primary);
}

.stat-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-white);
}

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

/* Cards & Containers */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  margin-bottom: 24px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

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

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

/* Service Control Panel */
.service-control-panel {
  border-top: 4px solid var(--gold-primary);
}

.service-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.live-timer {
  background-color: var(--bg-secondary);
  border: 1px solid var(--gold-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-align: right;
}

.timer-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.timer-clock {
  font-family: monospace;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-white);
}

.service-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-active-box {
  background: rgba(245, 183, 0, 0.05);
  border: 1px dashed var(--gold-primary);
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Form Controls & Buttons */
.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row > .form-group {
  min-width: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}

.form-control,
select,
input[type="time"] {
  width: 100%;
  min-height: var(--control-height);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-control::placeholder {
  color: #7d7d7d;
  opacity: 1;
}

.form-control:hover,
select:hover,
input[type="time"]:hover {
  border-color: #404040;
}

.form-control:focus,
.form-control:focus-visible,
select:focus,
select:focus-visible,
input[type="time"]:focus,
input[type="time"]:focus-visible {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: var(--focus-ring);
  background-color: #0e0e0e;
}

.form-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

select,
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23F5B700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1.5 6 6.5 11 1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

select option {
  background-color: var(--bg-secondary);
  color: var(--text-white);
}

input[type="time"] {
  color-scheme: dark;
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.form-control-sm {
  min-height: var(--control-height-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
}

select.form-control-sm {
  padding-right: 34px;
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-bar .form-control {
  width: auto;
  min-width: 200px;
  max-width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--orange-primary) 100%);
  color: #000;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  color: #000;
  box-shadow: 0 4px 14px rgba(245, 183, 0, 0.3);
}

.btn-danger {
  background-color: var(--danger);
  color: #FFF;
}

.btn-danger:hover:not(:disabled) {
  background-color: #C62828;
  color: #FFF;
  box-shadow: 0 4px 14px rgba(229, 57, 53, 0.3);
}

.btn-danger:focus-visible {
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.35);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-white);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background-color: var(--gold-soft);
}

.btn-discord {
  background-color: #5865F2;
  color: #FFF;
}

.btn-discord:hover:not(:disabled) {
  background-color: #4752C4;
  color: #FFF;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}

.btn-discord:focus-visible {
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.4);
}

.btn-sm {
  min-height: var(--control-height-sm);
  padding: 6px 12px;
  font-size: 0.75rem;
}

.w-full { width: 100%; }
.flex-1 { flex: 1; }

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
}

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

.table th {
  background-color: var(--bg-secondary);
  padding: 12px 16px;
  color: var(--gold-primary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--gold-border);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-white);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.table td .btn {
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}

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

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

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

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-gold { background: rgba(245, 183, 0, 0.15); color: var(--gold-primary); border: 1px solid var(--gold-primary); }
.badge-orange { background: rgba(255, 138, 0, 0.15); color: var(--orange-primary); border: 1px solid var(--orange-primary); }
.badge-success { background: rgba(46, 125, 50, 0.2); color: #81C784; border: 1px solid #4CAF50; }
.badge-danger { background: rgba(229, 57, 53, 0.2); color: #E57373; border: 1px solid #F44336; }
.badge-info { background: rgba(2, 136, 209, 0.2); color: #64B5F6; border: 1px solid #2196F3; }

/* Convocations Grid */
.convocations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 20px;
}

.convocation-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.convocation-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md), var(--shadow-gold);
}

.convocation-banner {
  width: 100%;
  aspect-ratio: 16 / 7;
  flex-shrink: 0;
  background-color: #222;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.convocation-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.convocation-body > div {
  width: 100%;
}

.convocation-body h3 {
  font-size: 1.05rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.convocation-body p {
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Tabs */
.tab-header {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-header::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  position: relative;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 18px;
  margin-bottom: -1px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-white);
  background-color: var(--bg-hover);
}

.tab-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--gold-border);
}

.tab-btn.active {
  color: var(--gold-primary);
  background: linear-gradient(180deg, transparent 0%, var(--gold-soft) 100%);
  border-bottom-color: var(--gold-primary);
}

.tab-content {
  display: none;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-top: 3px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.modal-lg { max-width: 800px; }

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 18px 24px;
  gap: 16px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Header "X" button only; footer cancel buttons keep their .btn styles */
.modal-close:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.modal-close:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.modal-close.btn {
  font-size: 0.85rem;
  color: var(--text-white);
  border: 1px solid var(--border-color);
}

.modal-close.btn:hover {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
}

.toast {
  background-color: var(--bg-card);
  color: var(--text-white);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--gold-primary);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  min-width: 280px;
  max-width: 100%;
  overflow-wrap: anywhere;
  animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: #4CAF50; }
.toast.error { border-left-color: var(--danger); }

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

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.divider { border: 0; border-top: 1px solid var(--border-color); margin: 16px 0; }

/* Active Roblox Users */
.roblox-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.roblox-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.roblox-user-item:hover {
  border-color: var(--gold-border);
  background-color: var(--bg-hover);
}
.roblox-user-name {
  flex: 1;
  min-width: 0;
  color: var(--text-white);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roblox-user-time { font-size: 0.85rem; }
.mobile-only { display: none; }

/* Login Screen */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 183, 0, 0.08) 0%, transparent 55%),
    linear-gradient(160deg, #0B0B0B 0%, #111111 60%, #0B0B0B 100%);
  overflow: hidden;
}

.login-glow {
  position: fixed;
  top: -25%;
  left: 50%;
  width: 720px;
  height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(245, 183, 0, 0.22) 0%, rgba(255, 138, 0, 0.08) 40%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
  animation: glowPulse 7s ease-in-out infinite;
  z-index: 0;
}

.login-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 183, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 183, 0, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.95) 0%, rgba(17, 17, 17, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 44px 36px 36px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), var(--shadow-gold);
  animation: loginCardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.login-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(245, 183, 0, 0.35));
  animation: logoFloat 5s ease-in-out infinite;
}

.login-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  color: var(--gold-primary);
  line-height: 1.1;
}

.login-subtitle {
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login-desc {
  margin-top: 22px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.login-btn {
  margin-top: 26px;
  width: 100%;
  padding: 14px 20px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(88, 101, 242, 0.5);
}

.login-note {
  margin-top: 22px;
  font-size: 0.74rem;
  line-height: 1.6;
  color: #6f6f6f;
}

.login-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5d5d5d;
}

.login-footer-dot {
  color: var(--gold-dark);
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes glowPulse {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

/* Sidebar nav groups */
.nav-group-toggle { width: 100%; background: transparent; border: none; cursor: pointer; text-align: left; }
.nav-chevron { margin-left: auto; transition: transform var(--transition-fast); }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-subitems { display: none; list-style: none; padding-left: 36px; margin: 4px 0 8px; }
.nav-group.open .nav-subitems { display: block; }
.nav-subitem { display: block; padding: 8px 12px; font-size: 0.88rem; color: var(--text-muted); border-radius: var(--radius-sm); }
.nav-subitem.active, .nav-subitem:hover { color: var(--gold-primary); background: var(--gold-soft); }
.nav-subitem.hidden, .nav-group.hidden { display: none; }

/* Responsive Media Queries */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    max-width: 85vw;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content {
    margin-left: 0;
    padding: 16px;
    max-width: 100%;
  }
  .mobile-only {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  :root {
    --card-padding: 16px;
  }

  .dashboard-wrapper {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .main-content {
    padding: 14px;
    gap: 18px;
  }

  /* Topbar: stack into a compact, wrapping row */
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
  }

  .topbar-title h1 {
    font-size: 1.25rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .topbar-user {
    min-width: 0;
    max-width: 100%;
  }

  .topbar-name {
    max-width: 120px;
  }

  /* Cards stack vertically */
  .welcome-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .welcome-text h2 {
    font-size: 1.4rem;
  }

  .stats-grid,
  .convocations-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 14px;
  }

  .stat-card {
    padding: 16px;
  }

  .card {
    margin-bottom: 18px;
  }

  .card-header,
  .service-control-header,
  .service-active-box {
    flex-direction: column;
    align-items: stretch;
  }

  .live-timer {
    text-align: left;
  }

  .timer-clock {
    font-size: 1.5rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row > .form-group {
    flex: none;
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .form-control,
  .filter-bar .btn {
    width: 100%;
    min-width: 0;
  }

  /* Tables: horizontal scroll, no clipped cells */
  .table-responsive {
    max-width: 100%;
  }

  .table {
    min-width: 640px;
  }

  .table th,
  .table td {
    padding: 10px 12px;
  }

  .table td {
    overflow-wrap: normal;
  }

  .tab-btn {
    padding: 10px 14px;
  }

  /* Modals */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-card {
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-md) var(--radius-md);
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }

  .toast {
    min-width: 0;
  }

  .login-card {
    padding: 36px 22px 28px;
  }
}

@media (max-width: 480px) {
  .topbar-user-info {
    display: none;
  }

  .topbar-user {
    padding: 4px;
  }

  .erlc-status-pill {
    font-size: 0.78rem;
    padding: 6px 12px;
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* =====================================================================
   PREMIUM VISUAL OVERRIDES — Cartagena Roleplay
   Base styles are intentionally retained above for all existing components.
   ===================================================================== */

/* CARTAGENA ROLEPLAY — Premium interface refresh
   Maintains existing selectors and component contracts used by app.js. */
:root {
  color-scheme: dark;
  --bg-primary: #080909;
  --bg-secondary: #0e1010;
  --bg-card: #131615;
  --bg-hover: #1b201e;
  --border-color: #29302b;
  --gold-primary: #f5b700;
  --gold-dark: #c58a00;
  --orange-primary: #ff8a00;
  --text-white: #f7f8f6;
  --text-muted: #9da69f;
  --text-soft: #d6ddd7;
  --danger: #e05252;
  --success: #42b883;
  --info: #8b9a90;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Montserrat', 'Inter', system-ui, sans-serif;
  --sidebar-width: 264px;
  --topbar-height: 72px;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --transition-fast: .18s ease;
  --transition-normal: .26s ease;
  --shadow-gold: 0 10px 32px rgba(245,183,0,.08);
  --gold-soft: rgba(245,183,0,.075);
  --gold-soft-strong: rgba(245,183,0,.14);
  --gold-border: rgba(245,183,0,.32);
  --border-subtle: rgba(255,255,255,.065);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.16);
  --shadow-md: 0 12px 28px rgba(0,0,0,.24);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.58);
  --control-height: 44px;
  --control-height-sm: 36px;
  --focus-ring: 0 0 0 3px rgba(245,183,0,.2);
  --card-padding: 24px;
}
* { box-sizing:border-box; margin:0; padding:0; }
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; scroll-behavior:smooth; }
body { min-height:100vh; overflow-x:hidden; color:var(--text-white); background:var(--bg-primary); font:400 14px/1.55 var(--font-family); -webkit-font-smoothing:antialiased; }
svg,img { max-width:100%; }
a { color:var(--gold-primary); text-decoration:none; transition:color var(--transition-fast),background var(--transition-fast); }
a:hover { color:#ffd34f; }
h1,h2,h3,h4,h5,h6 { font-family:var(--font-heading); font-weight:700; letter-spacing:-.035em; line-height:1.25; }
button,input,select,textarea { font:inherit; }
:focus-visible { outline:2px solid var(--gold-primary); outline-offset:3px; }
::selection { background:rgba(245,183,0,.28); color:#fff; }
.dashboard-wrapper { display:flex; min-height:100vh; }
.sidebar { width:var(--sidebar-width); background:linear-gradient(180deg,#101311 0%,#0b0d0c 100%); border-right:1px solid #252b26; display:flex; flex-direction:column; position:fixed; inset:0 auto 0 0; z-index:100; transition:transform var(--transition-normal); box-shadow:12px 0 36px rgba(0,0,0,.12); }
.sidebar-header { padding:22px 20px; display:flex; align-items:center; gap:12px; min-height:88px; border-bottom:1px solid var(--border-subtle); background:linear-gradient(135deg,rgba(245,183,0,.055),transparent 65%); }
.sidebar-logo { width:46px; height:46px; flex:0 0 46px; object-fit:contain; filter:drop-shadow(0 3px 10px rgba(245,183,0,.14)); }
.sidebar-brand { display:flex; flex-direction:column; min-width:0; }
.brand-title { font:900 1rem/1.2 var(--font-heading); color:var(--text-white); letter-spacing:.08em; }
.brand-subtitle { margin-top:3px; font-size:.64rem; font-weight:700; color:var(--gold-primary); letter-spacing:.32em; }
.sidebar-header .btn-icon { margin-left:auto; }
.sidebar-nav { padding:22px 12px; display:flex; flex-direction:column; gap:6px; flex:1; overflow-y:auto; }
.nav-group { margin-bottom:4px; }
.nav-item { position:relative; width:100%; display:flex; align-items:center; gap:12px; padding:12px 14px; color:#a5aea7; font-size:.88rem; font-weight:600; line-height:1.3; border:1px solid transparent; border-radius:11px; transition:all var(--transition-fast); }
.nav-item > span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.nav-icon { width:19px!important;height:19px!important;max-width:19px!important;max-height:19px!important;flex-shrink:0;stroke:currentColor; opacity:.85; }
.nav-item:hover { background:#181d19; color:#fff; }
.nav-item:hover .nav-icon { color:var(--gold-primary); }
.nav-item.active { color:var(--gold-primary); background:linear-gradient(100deg,rgba(245,183,0,.12),rgba(245,183,0,.025)); border-color:rgba(245,183,0,.14); box-shadow:inset 3px 0 0 var(--gold-primary); }
.nav-item.active .nav-icon { color:var(--gold-primary); }
.nav-group-toggle { width:100%; background:transparent; border:0; cursor:pointer; text-align:left; }
.nav-chevron { margin-left:auto; font-size:.85rem; color:#788078; transition:transform var(--transition-fast); }
.nav-group.open .nav-chevron { transform:rotate(180deg); }
.nav-subitems { display:none; list-style:none; padding:5px 0 5px 34px; margin:3px 0 8px; }
.nav-group.open .nav-subitems { display:block; }
.nav-subitem { display:block; padding:8px 12px; margin:2px 0; font-size:.83rem; font-weight:500; color:#929c94; border-radius:8px; }
.nav-subitem.active,.nav-subitem:hover { color:var(--gold-primary); background:rgba(245,183,0,.065); }
.sidebar-footer { padding:16px 14px 18px; border-top:1px solid var(--border-subtle); display:flex; flex-direction:column; gap:12px; background:rgba(0,0,0,.12); }
.user-mini-profile { display:flex;align-items:center;gap:10px;background:#151916;padding:10px;border-radius:12px;border:1px solid var(--border-color); }
.avatar-img { width:36px;height:36px;border-radius:50%;object-fit:cover;border:1px solid var(--gold-dark); }
.user-info { display:flex;flex-direction:column;overflow:hidden; }
.user-name { font-weight:650;font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.user-role-badge { font-size:.7rem;color:var(--gold-primary);font-weight:650; }
.main-content { margin-left:var(--sidebar-width); flex:1; padding:28px clamp(20px,3vw,46px) 40px; min-height:100vh; min-width:0; display:flex; flex-direction:column; gap:26px; max-width:calc(100% - var(--sidebar-width)); }
.topbar { display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:var(--topbar-height);padding-bottom:20px;border-bottom:1px solid var(--border-subtle); }
.topbar-title { min-width:0;flex:1; }
.topbar-title h1 { font-size:clamp(1.25rem,1.9vw,1.75rem);color:#f5f6f3;letter-spacing:-.045em;overflow-wrap:anywhere; }
.topbar-actions { display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:10px; }
.btn-icon { display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;flex-shrink:0;background:#151916;border:1px solid var(--border-color);border-radius:10px;color:#e8ede8;font-size:1.4rem;line-height:1;cursor:pointer;transition:all var(--transition-fast); }
.btn-icon:hover { border-color:var(--gold-border);color:var(--gold-primary);background:var(--gold-soft); }
.topbar-user { display:flex;align-items:center;gap:10px;padding:5px 13px 5px 5px;background:#151916;border:1px solid var(--border-color);border-radius:999px; }
.topbar-avatar { width:34px;height:34px;border-radius:50%;object-fit:cover;border:1px solid var(--gold-dark); }
.topbar-user-info { display:flex;flex-direction:column;line-height:1.25;overflow:hidden; }
.topbar-name { font-size:.8rem;font-weight:650;color:var(--text-white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px; }
.topbar-role { font-size:.64rem;font-weight:750;color:var(--gold-primary);text-transform:uppercase;letter-spacing:.07em; }
.erlc-status-pill { display:flex;align-items:center;gap:8px;min-height:38px;padding:8px 13px;border-radius:999px;font-size:.75rem;font-weight:650;line-height:1.2;color:var(--text-soft);white-space:nowrap;background:#151916;border:1px solid var(--border-color); }
.status-dot { width:7px;height:7px;flex-shrink:0;border-radius:50%;background:#848b85; }
.erlc-status-pill.online { color:#9be5bc;border-color:rgba(66,184,131,.26);background:rgba(66,184,131,.07); }
.erlc-status-pill.offline { color:#e59b91;border-color:rgba(224,82,82,.24);background:rgba(224,82,82,.06); }
.erlc-status-pill.online .status-dot { background:#42b883;box-shadow:0 0 9px rgba(66,184,131,.6); }
.erlc-status-pill.offline .status-dot { background:#e05252; }
.content-section { display:none;animation:fadeIn var(--transition-normal); }
.content-section.active { display:block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)} }
.welcome-hero { position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:22px;margin-bottom:24px;padding:clamp(26px,3vw,40px);border:1px solid rgba(245,183,0,.18);border-radius:22px;background:linear-gradient(115deg,#191b16 0%,#121512 52%,#17120c 100%);box-shadow:var(--shadow-md); }
.welcome-hero::before { content:"";position:absolute;z-index:-1;right:-60px;top:-170px;width:390px;height:390px;border-radius:50%;background:radial-gradient(circle,rgba(245,183,0,.13),rgba(255,138,0,.035) 42%,transparent 70%);pointer-events:none; }
.welcome-hero::after { content:"";position:absolute;z-index:-1;left:0;top:22px;bottom:22px;width:3px;border-radius:4px;background:linear-gradient(180deg,var(--gold-primary),var(--orange-primary)); }
.welcome-hero > * { position:relative; }
.welcome-text h2 { font-size:clamp(1.45rem,2.2vw,2rem);color:#fff;letter-spacing:-.045em; }
.welcome-subtitle { color:#a4ada5;font-size:.9rem;margin-top:9px; }
.welcome-action { display:flex;align-items:center;gap:10px; }
.stats-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;margin-bottom:26px; }
.stat-card { position:relative;overflow:hidden;background:linear-gradient(145deg,#161a17,#121513);border:1px solid #252c27;border-radius:16px;padding:19px;display:flex;align-items:center;gap:14px;min-width:0;box-shadow:var(--shadow-sm);transition:transform var(--transition-fast),border-color var(--transition-fast),background var(--transition-fast); }
.stat-card::after { content:"";position:absolute;right:-26px;bottom:-44px;width:105px;height:105px;border-radius:50%;background:rgba(245,183,0,.035);pointer-events:none; }
.stat-card:hover { transform:translateY(-2px);border-color:rgba(245,183,0,.28);background:linear-gradient(145deg,#191d19,#141714); }
.stat-icon { width:43px;height:43px;border-radius:13px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border:1px solid rgba(245,183,0,.12); }
.stat-icon svg { width:21px!important;height:21px!important;max-width:21px!important;max-height:21px!important; }
.stat-icon.gold { background:rgba(245,183,0,.085);color:var(--gold-primary); }
.stat-icon.orange { background:rgba(255,138,0,.075);color:var(--orange-primary);border-color:rgba(255,138,0,.12); }
.stat-details { display:flex;flex-direction:column;min-width:0;position:relative;z-index:1; }
.stat-value { font-size:clamp(1.1rem,1.3vw,1.42rem);font-weight:750;color:#f6f7f4;letter-spacing:-.03em;overflow-wrap:anywhere; }
.stat-label { font-size:.74rem;color:#9da69f;line-height:1.4;margin-top:3px; }
.card { min-width:0;margin-bottom:24px;padding:var(--card-padding);border:1px solid #252c27;border-radius:17px;background:linear-gradient(145deg,rgba(21,25,22,.98),rgba(17,20,18,.98));box-shadow:var(--shadow-sm); }
.card-header { display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid var(--border-subtle); }
.card-header h2,.card-header h3 { font-size:1.05rem;color:#f3f5f1; }
.card-header p { margin-top:7px;max-width:760px; }
.card-section > h2,.service-control-header h2 { font-size:1.2rem; }
.service-control-panel { border-top:2px solid var(--gold-dark); }
.service-control-header { display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;flex-wrap:wrap;gap:18px; }
.text-muted { color:var(--text-muted); }
.live-timer { background:#0b0e0c;border:1px solid rgba(245,183,0,.28);padding:12px 18px;border-radius:13px;text-align:right; }
.timer-label { display:block;font-size:.62rem;font-weight:750;color:var(--gold-primary);letter-spacing:.13em; }
.timer-clock { font:750 1.75rem/1.25 ui-monospace,SFMono-Regular,Menlo,monospace;color:#f6f7f4;letter-spacing:.03em; }
.service-form { display:flex;flex-direction:column;gap:14px; }
.service-active-box { background:rgba(245,183,0,.045);border:1px solid rgba(245,183,0,.25);padding:18px;border-radius:13px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px; }
.form-row { display:flex;gap:16px;flex-wrap:wrap; }
.form-row > .form-group { min-width:0; }
.form-group { display:flex;flex-direction:column;gap:7px;margin-bottom:14px; }
.form-group label { font-size:.8rem;font-weight:650;color:#d6ddd7; }
.form-control,select,input[type="time"] { width:100%;min-height:var(--control-height);background:#0d100e;border:1px solid #303832;color:var(--text-white);padding:10px 13px;border-radius:10px;font-family:inherit;font-size:.87rem;line-height:1.4;transition:border-color var(--transition-fast),box-shadow var(--transition-fast),background var(--transition-fast); }
.form-control::placeholder { color:#727c74;opacity:1; }
.form-control:hover,select:hover,input[type="time"]:hover { border-color:#465047; }
.form-control:focus,.form-control:focus-visible,select:focus,select:focus-visible,input[type="time"]:focus,input[type="time"]:focus-visible { outline:none;border-color:var(--gold-dark);box-shadow:var(--focus-ring);background:#0e120f; }
.form-control:disabled { opacity:.6;cursor:not-allowed; }
select,select.form-control { appearance:none;-webkit-appearance:none;cursor:pointer;padding-right:38px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23F5B700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1.5 6 6.5 11 1.5'/></svg>");background-repeat:no-repeat;background-position:right 14px center;background-size:12px 8px; }
select option { background:#101411;color:#fff; }
input[type="time"] { color-scheme:dark; }
textarea.form-control { min-height:100px;resize:vertical; }
.form-control-sm { min-height:var(--control-height-sm);padding:7px 12px;font-size:.82rem; }
select.form-control-sm { padding-right:34px; }
.filter-bar { display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:17px; }
.filter-bar .form-control { width:auto;min-width:190px;max-width:100%; }
.btn { display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:var(--control-height);padding:10px 17px;font-family:var(--font-heading);font-weight:700;font-size:.8rem;line-height:1.2;text-align:center;border-radius:10px;border:1px solid transparent;cursor:pointer;transition:transform var(--transition-fast),border-color var(--transition-fast),background var(--transition-fast),box-shadow var(--transition-fast),color var(--transition-fast); }
.btn:active:not(:disabled) { transform:translateY(1px); }
.btn:focus-visible { outline:none;box-shadow:var(--focus-ring); }
.btn:disabled,.btn[disabled] { opacity:.55;cursor:not-allowed;filter:grayscale(.3); }
.btn-primary { background:linear-gradient(115deg,#f5c52e 0%,#f5b700 58%,#e99900 100%);color:#171306;box-shadow:0 5px 15px rgba(245,183,0,.1); }
.btn-primary:hover:not(:disabled) { filter:brightness(1.06);color:#171306;box-shadow:0 8px 20px rgba(245,183,0,.18);transform:translateY(-1px); }
.btn-danger { background:#a93636;color:#fff;border-color:rgba(255,255,255,.08); }
.btn-danger:hover:not(:disabled) { background:#c34343;color:#fff;box-shadow:0 5px 16px rgba(224,82,82,.16); }
.btn-danger:focus-visible { box-shadow:0 0 0 3px rgba(224,82,82,.25); }
.btn-outline { background:#151916;border-color:#343c35;color:#e2e7e1; }
.btn-outline:hover:not(:disabled) { border-color:rgba(245,183,0,.4);color:var(--gold-primary);background:rgba(245,183,0,.055); }
.btn-discord { background:#5865f2;color:#fff;border-color:rgba(255,255,255,.06); }
.btn-discord:hover:not(:disabled) { background:#4752c4;color:#fff;box-shadow:0 5px 16px rgba(88,101,242,.2); }
.btn-discord:focus-visible { box-shadow:0 0 0 3px rgba(88,101,242,.3); }
.btn-sm { min-height:var(--control-height-sm);padding:7px 12px;font-size:.73rem;border-radius:8px; }
.w-full { width:100%; }
.flex-1 { flex:1; }
.table-responsive { width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid #2a312b;border-radius:12px;background:#111512; }
.table { width:100%;border-collapse:collapse;text-align:left;font-size:.81rem; }
.table th { background:#171b18;padding:13px 15px;color:#c4a94e;font-size:.66rem;font-weight:750;text-transform:uppercase;letter-spacing:.09em;border-bottom:1px solid #31382f;white-space:nowrap; }
.table td { padding:13px 15px;border-bottom:1px solid rgba(255,255,255,.055);color:#e4e9e3;vertical-align:middle;overflow-wrap:anywhere; }
.table td .btn { margin:2px 4px 2px 0;white-space:nowrap; }
.table tbody tr:last-child td { border-bottom:none; }
.table tbody tr { transition:background var(--transition-fast); }
.table tbody tr:hover td { background:rgba(255,255,255,.022); }
.badge { display:inline-block;padding:4px 8px;border-radius:6px;font-size:.64rem;font-weight:750;line-height:1.35;letter-spacing:.055em;text-transform:uppercase;white-space:nowrap; }
.badge-gold { background:rgba(245,183,0,.09);color:#f6cd48;border:1px solid rgba(245,183,0,.26); }
.badge-orange { background:rgba(255,138,0,.08);color:#ffb15e;border:1px solid rgba(255,138,0,.24); }
.badge-success { background:rgba(66,184,131,.09);color:#81d6a9;border:1px solid rgba(66,184,131,.27); }
.badge-danger { background:rgba(224,82,82,.1);color:#f08f8f;border:1px solid rgba(224,82,82,.28); }
.badge-info { background:rgba(148,163,151,.09);color:#c4d0c7;border:1px solid rgba(148,163,151,.22); }
.convocations-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));grid-auto-rows:1fr;align-items:stretch;gap:16px; }
.convocation-card { background:linear-gradient(145deg,#151916,#101311);border:1px solid #2a312b;border-radius:15px;overflow:hidden;display:flex;flex-direction:column;height:100%;min-width:0;box-shadow:var(--shadow-sm);transition:transform var(--transition-fast),border-color var(--transition-fast),box-shadow var(--transition-fast); }
.convocation-card:hover { transform:translateY(-3px);border-color:rgba(245,183,0,.3);box-shadow:var(--shadow-md); }
.convocation-banner { width:100%;aspect-ratio:16/7;flex-shrink:0;background-color:#222;background-size:cover;background-position:center;background-repeat:no-repeat;border-bottom:1px solid var(--border-color);position:relative; }
.convocation-body { padding:18px;display:flex;flex-direction:column;align-items:flex-start;gap:10px;flex:1;min-width:0; }
.convocation-body > div { width:100%; }
.convocation-body h3 { font-size:1rem;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere; }
.convocation-body p { line-height:1.55;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;color:var(--text-muted); }
.tab-header { display:flex;gap:5px;border-bottom:1px solid #2a312b;margin-bottom:20px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none; }
.tab-header::-webkit-scrollbar { display:none; }
.tab-btn { position:relative;flex-shrink:0;background:transparent;border:0;color:#98a198;padding:12px 16px;margin-bottom:-1px;font-family:var(--font-heading);font-weight:700;font-size:.78rem;white-space:nowrap;cursor:pointer;border-bottom:2px solid transparent;border-radius:9px 9px 0 0;transition:all var(--transition-fast); }
.tab-btn:hover { color:#f0f3ed;background:rgba(255,255,255,.025); }
.tab-btn:focus-visible { outline:none;box-shadow:inset 0 0 0 2px var(--gold-border); }
.tab-btn.active { color:var(--gold-primary);background:linear-gradient(180deg,transparent,rgba(245,183,0,.06));border-bottom-color:var(--gold-primary); }
.tab-content { display:none; }
.tab-content.active { display:block; }
.modal-overlay { position:fixed;inset:0;background:rgba(3,5,4,.84);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px;animation:fadeIn .2s ease; }
.modal-card { background:#151916;border:1px solid rgba(245,183,0,.25);border-top:2px solid var(--gold-primary);border-radius:17px;width:100%;max-width:550px;max-height:90vh;overflow-y:auto;box-shadow:var(--shadow-lg); }
.modal-lg { max-width:800px; }
.modal-header { position:sticky;top:0;z-index:1;padding:18px 22px;gap:16px;background:#151916;border-bottom:1px solid var(--border-color);display:flex;align-items:center;justify-content:space-between; }
.modal-header h3 { font-size:1.05rem;line-height:1.35;min-width:0;overflow-wrap:anywhere; }
.modal-close { background:transparent;border:0;color:var(--text-muted);font-size:1.5rem;cursor:pointer; }
.modal-close:not(.btn) { display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;height:36px;line-height:1;border-radius:9px;transition:all var(--transition-fast); }
.modal-close:not(.btn):hover { color:#fff;background:var(--bg-hover); }
.modal-close:focus-visible { outline:none;box-shadow:var(--focus-ring); }
.modal-close.btn { font-size:.8rem;color:var(--text-white);border:1px solid var(--border-color); }
.modal-close.btn:hover { color:var(--gold-primary);border-color:var(--gold-primary); }
.modal-body { padding:22px; }
.modal-footer { display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:22px;padding-top:18px;border-top:1px solid var(--border-color); }
.toast-container { position:fixed;bottom:20px;right:20px;z-index:2000;display:flex;flex-direction:column;gap:10px;max-width:calc(100vw - 40px); }
.toast { background:#171b18;color:var(--text-white);border:1px solid #303830;border-left:3px solid var(--gold-primary);padding:13px 17px;border-radius:12px;box-shadow:var(--shadow-md);font-size:.82rem;min-width:280px;max-width:100%;overflow-wrap:anywhere;animation:slideIn .25s ease; }
.toast.success { border-left-color:#42b883; }
.toast.error { border-left-color:var(--danger); }
@keyframes slideIn { from{transform:translateX(18px);opacity:0}to{transform:translateX(0);opacity:1} }
.hidden { display:none!important; }
.text-center { text-align:center; }
.divider { border:0;border-top:1px solid var(--border-color);margin:16px 0; }
.roblox-users-list { display:flex;flex-direction:column;gap:8px; }
.roblox-user-item { display:flex;align-items:center;gap:12px;padding:11px 13px;background:#101411;border:1px solid #282f29;border-radius:11px;transition:border-color var(--transition-fast),background var(--transition-fast); }
.roblox-user-item:hover { border-color:rgba(245,183,0,.25);background:#171b18; }
.roblox-user-name { flex:1;min-width:0;color:var(--text-white);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.roblox-user-time { font-size:.82rem;color:var(--text-muted); }
.mobile-only { display:none; }
/* Login page uses the same visual system */
.login-body { min-height:100vh;background:radial-gradient(ellipse at 50% 0%,rgba(245,183,0,.09),transparent 48%),linear-gradient(160deg,#080909,#111512 60%,#080909);overflow:hidden; }
.login-glow { position:fixed;top:-25%;left:50%;width:720px;height:720px;transform:translateX(-50%);background:radial-gradient(circle,rgba(245,183,0,.17),rgba(255,138,0,.045) 40%,transparent 70%);filter:blur(35px);pointer-events:none;animation:glowPulse 7s ease-in-out infinite;z-index:0; }
.login-grid { position:fixed;inset:0;background-image:linear-gradient(rgba(245,183,0,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(245,183,0,.035) 1px,transparent 1px);background-size:48px 48px;mask-image:radial-gradient(circle at 50% 40%,#000,transparent 75%);-webkit-mask-image:radial-gradient(circle at 50% 40%,#000,transparent 75%);pointer-events:none;z-index:0; }
.login-page { position:relative;z-index:1;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:25px;padding:32px 20px; }
.login-card { width:100%;max-width:440px;background:linear-gradient(180deg,rgba(23,27,24,.98),rgba(14,17,15,.98));border:1px solid #2b322c;border-top:2px solid var(--gold-primary);border-radius:20px;padding:42px 36px 34px;text-align:center;box-shadow:0 24px 65px rgba(0,0,0,.5),var(--shadow-gold);animation:loginCardIn .55s cubic-bezier(.22,1,.36,1) both; }
.login-logo-wrap { display:flex;justify-content:center;margin-bottom:20px; }
.login-logo { width:92px;height:92px;object-fit:contain;filter:drop-shadow(0 5px 16px rgba(245,183,0,.23));animation:logoFloat 5s ease-in-out infinite; }
.login-title { font-family:var(--font-heading);font-weight:900;font-size:1.5rem;letter-spacing:.015em;color:#f7f8f5;line-height:1.15; }
.login-subtitle { margin-top:7px;font-size:.68rem;font-weight:750;letter-spacing:.32em;text-transform:uppercase;color:var(--gold-primary); }
.login-desc { margin-top:22px;font-size:.88rem;line-height:1.65;color:#a6afa7; }
.login-btn { margin-top:26px;width:100%;padding:14px 20px;font-size:.9rem;border-radius:11px; }
.login-btn:hover { transform:translateY(-1px); }
.login-note { margin-top:20px;font-size:.73rem;line-height:1.6;color:#7e887f; }
.login-footer { display:flex;align-items:center;gap:10px;font-size:.7rem;letter-spacing:.07em;text-transform:uppercase;color:#69736b; }
.login-footer-dot { color:var(--gold-dark); }
@keyframes loginCardIn { from{opacity:0;transform:translateY(20px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes logoFloat { 0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)} }
@keyframes glowPulse { 0%,100%{opacity:.7;transform:translateX(-50%) scale(1)}50%{opacity:.95;transform:translateX(-50%) scale(1.06)} }
/* Keep navigation visibility and mobile behavior intact. */
.nav-subitem.hidden,.nav-group.hidden { display:none; }
@media (min-width:1500px) { .stats-grid { grid-template-columns:repeat(5,minmax(0,1fr)); } }
@media (max-width:1150px) { .main-content { padding:22px 22px 34px; } .stats-grid { grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); } }
@media (max-width:992px) {
  .sidebar { transform:translateX(-100%);box-shadow:none;max-width:86vw; }
  .sidebar.open { transform:translateX(0);box-shadow:var(--shadow-lg); }
  .main-content { margin-left:0;padding:20px;max-width:100%; }
  .mobile-only { display:inline-flex; }
}
@media (max-width:768px) {
  :root { --card-padding:16px; }
  .dashboard-wrapper { max-width:100vw;overflow-x:hidden; }
  .main-content { padding:14px;gap:17px; }
  .topbar { flex-wrap:wrap;gap:12px;padding-bottom:15px; }
  .topbar-title h1 { font-size:1.2rem; }
  .topbar-actions { width:100%;justify-content:flex-start;gap:8px; }
  .topbar-user { min-width:0;max-width:100%; }
  .topbar-name { max-width:120px; }
  .welcome-hero { flex-direction:column;align-items:flex-start;padding:23px 20px; }
  .welcome-text h2 { font-size:1.45rem; }
  .stats-grid,.convocations-grid { grid-template-columns:1fr;grid-auto-rows:auto;gap:11px; }
  .stat-card { padding:15px; }
  .card { margin-bottom:17px; }
  .card-header,.service-control-header,.service-active-box { flex-direction:column;align-items:stretch; }
  .live-timer { text-align:left; }
  .timer-clock { font-size:1.45rem; }
  .form-row { flex-direction:column;gap:0; }
  .form-row > .form-group { flex:none;width:100%; }
  .filter-bar { flex-direction:column;align-items:stretch; }
  .filter-bar .form-control,.filter-bar .btn { width:100%;min-width:0; }
  .table-responsive { max-width:100%; }
  .table { min-width:640px; }
  .table th,.table td { padding:10px 12px; }
  .table td { overflow-wrap:normal; }
  .tab-btn { padding:10px 13px; }
  .modal-overlay { padding:10px;align-items:flex-end; }
  .modal-card { max-height:92vh;border-radius:17px 17px 12px 12px; }
  .modal-header { padding:14px 16px; }
  .modal-body { padding:16px; }
  .modal-footer { flex-direction:column-reverse;align-items:stretch; }
  .modal-footer .btn { width:100%; }
  .toast-container { left:14px;right:14px;bottom:14px;max-width:none; }
  .toast { min-width:0; }
  .login-card { padding:35px 22px 28px; }
}
@media (max-width:480px) {
  .topbar-user-info { display:none; }
  .topbar-user { padding:4px; }
  .erlc-status-pill { font-size:.72rem;padding:6px 10px;min-height:34px; }
  .welcome-action,.welcome-action .btn { width:100%; }
  .stats-grid { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important; } }


/* ==========================================================================
   MICRO-ANIMATIONS — Section transitions and subtle idle motion
   ========================================================================== */
.content-section.active {
  animation: sectionEnter 360ms cubic-bezier(.2,.75,.25,1) both;
  transform-origin: top center;
}
@keyframes sectionEnter {
  from { opacity: 0; transform: translateY(10px) scale(.996); filter: blur(2px); }
  65% { filter: blur(0); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
/* Gentle movement only on decorative/interactive elements while idle. */
.welcome-hero::before {
  animation: ambientGlow 12s ease-in-out infinite alternate;
}
@keyframes ambientGlow {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: .72; }
  to { transform: translate3d(-12px, 10px, 0) scale(1.06); opacity: 1; }
}
.stat-card {
  animation: cardArrive 420ms cubic-bezier(.2,.75,.25,1) both;
}
.stats-grid .stat-card:nth-child(2) { animation-delay: 45ms; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 90ms; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 135ms; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 180ms; }
@keyframes cardArrive {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-item .nav-icon {
  transition: transform 180ms ease, color 180ms ease, stroke 180ms ease;
}
.nav-item:hover .nav-icon { transform: translateX(2px); }
.btn:not(:disabled) { transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease; }
@media (prefers-reduced-motion: reduce) {
  .content-section.active, .welcome-hero::before, .stat-card {
    animation: none !important;
    filter: none !important;
    transform: none !important;
  }
}


/* ==========================================================================
   CARTAGENA ROLEPLAY — FULL DASHBOARD LAYOUT SYSTEM
   Refined hierarchy, spacing, navigation and responsive behavior
   ========================================================================== */
:root {
  --sidebar-width: 264px;
  --topbar-height: 76px;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 19px;
  --card-padding: 25px;
  --layout-gutter: clamp(18px, 2.6vw, 38px);
  --surface-raised: #151515;
  --surface-deep: #0e0e0e;
}
body {
  background:
    radial-gradient(ellipse at 78% -10%, rgba(245,183,0,.055), transparent 32rem),
    var(--bg-primary);
}
.dashboard-wrapper { align-items: stretch; }
.sidebar {
  background: linear-gradient(180deg, #121212 0%, #0d0d0d 100%);
  border-right-color: rgba(255,255,255,.075);
  box-shadow: 12px 0 40px rgba(0,0,0,.16);
}
.sidebar-header {
  padding: 22px 19px;
  min-height: 88px;
  background: transparent;
  border-bottom-color: rgba(255,255,255,.07);
}
.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
}
.sidebar-home-link:hover { color: inherit; }
.sidebar-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  filter: drop-shadow(0 0 12px rgba(245,183,0,.2));
}
.brand-title { font-size: 1rem; letter-spacing: .035em; }
.brand-subtitle { margin-top: 4px; font-size: .66rem; letter-spacing: .24em; }
.sidebar-nav {
  padding: 24px 14px;
  gap: 12px;
}
.sidebar-nav-label {
  padding: 0 12px 7px;
  color: #777;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .16em;
}
.nav-group {
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 15px;
  transition: background .22s ease, border-color .22s ease;
}
.nav-group.open {
  background: rgba(255,255,255,.018);
  border-color: rgba(255,255,255,.055);
}
.nav-item, .nav-group-toggle {
  min-height: 48px;
  padding: 13px 13px;
  gap: 12px;
  border: 0;
  border-radius: 11px;
  font-size: .9rem;
  font-weight: 650;
}
.nav-group.open > .nav-group-toggle,
.nav-group > .nav-group-toggle:hover {
  background: rgba(245,183,0,.075);
  color: #fff;
}
.nav-group.open > .nav-group-toggle .nav-icon,
.nav-group > .nav-group-toggle:hover .nav-icon { stroke: var(--gold-primary); }
.nav-chevron { color: #777; font-size: .72rem; }
.nav-subitems {
  padding: 6px 0 5px 13px;
  margin: 3px 0 0 16px;
  border-left: 1px solid rgba(245,183,0,.22);
}
.nav-subitem {
  position: relative;
  padding: 10px 12px;
  margin: 2px 0;
  color: #a5a5a5;
  font-size: .82rem;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.nav-subitem:hover { transform: translateX(2px); }
.nav-subitem.active {
  color: var(--gold-primary);
  background: rgba(245,183,0,.095);
  font-weight: 700;
}
.nav-section-label {
  padding: 14px 12px 5px;
  color: #696969;
  font-size: .63rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sidebar-footer {
  padding: 16px 14px 18px;
  border-top-color: rgba(255,255,255,.07);
  background: rgba(0,0,0,.12);
}
.user-mini-profile {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.075);
  padding: 11px;
}
.main-content {
  width: calc(100% - var(--sidebar-width));
  max-width: 1760px;
  margin-left: var(--sidebar-width);
  padding: 28px var(--layout-gutter) 42px;
  gap: 26px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -28px calc(-1 * var(--layout-gutter)) 0;
  padding: 18px var(--layout-gutter);
  min-height: 82px;
  background: rgba(11,11,11,.88);
  border-bottom: 1px solid rgba(255,255,255,.075);
  backdrop-filter: blur(18px);
}
.topbar-title h1 { font-size: clamp(1.3rem, 1.7vw, 1.75rem); letter-spacing: -.045em; }
.topbar-title p, .topbar-title .text-muted { margin-top: 4px; font-size: .82rem; }
.topbar-actions { gap: 10px; }
.topbar-user {
  border-color: rgba(255,255,255,.09);
  background: #151515;
}
.content-section { width: 100%; max-width: 1500px; margin: 0 auto; }
.content-section.active { animation: sectionEnter 320ms cubic-bezier(.2,.75,.25,1) both; }
.welcome-hero {
  min-height: 190px;
  padding: clamp(25px, 3vw, 42px);
  margin-bottom: 25px;
  border: 1px solid rgba(245,183,0,.28);
  background: linear-gradient(115deg, rgba(245,183,0,.085), transparent 48%), linear-gradient(135deg,#191919,#101010 72%);
  box-shadow: 0 18px 45px rgba(0,0,0,.19), inset 0 1px rgba(255,255,255,.025);
}
.welcome-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -95% 45%;
  height: 260px;
  background: radial-gradient(ellipse, rgba(255,138,0,.075), transparent 67%);
  pointer-events: none;
}
.welcome-text h2 { font-size: clamp(1.55rem, 2.2vw, 2.15rem); letter-spacing: -.045em; }
.welcome-subtitle { max-width: 650px; line-height: 1.7; }
.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 28px;
}
.stat-card {
  min-height: 112px;
  padding: 20px;
  background: linear-gradient(145deg,#191919,#131313);
  border-color: rgba(255,255,255,.075);
  box-shadow: 0 7px 22px rgba(0,0,0,.13);
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(245,183,0,.35); }
.stat-icon { border: 1px solid rgba(245,183,0,.08); }
.stat-value { font-size: clamp(1.2rem, 1.55vw, 1.55rem); letter-spacing: -.035em; }
.card {
  padding: var(--card-padding);
  background: linear-gradient(145deg, rgba(25,25,25,.98), rgba(17,17,17,.98));
  border-color: rgba(255,255,255,.075);
  box-shadow: 0 12px 34px rgba(0,0,0,.13);
}
.card-section { margin-bottom: 22px; }
.card-header {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom-color: rgba(255,255,255,.075);
}
.card-header h2, .card-header h3 { letter-spacing: -.025em; }
.table-responsive {
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 12px;
  background: rgba(0,0,0,.12);
}
.table { border-collapse: separate; border-spacing: 0; }
.table thead th {
  background: #171717;
  color: #c5c5c5;
  font-size: .72rem;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.table th, .table td { border-bottom-color: rgba(255,255,255,.055); }
.table tbody tr { transition: background .16s ease; }
.table tbody tr:hover { background: rgba(245,183,0,.035); }
.form-control {
  min-height: 44px;
  background-color: #101010;
  border-color: rgba(255,255,255,.12);
  border-radius: 10px;
}
.form-control:focus {
  border-color: rgba(245,183,0,.65);
  box-shadow: var(--focus-ring);
}
.btn { border-radius: 10px; font-weight: 650; }
.btn-primary { box-shadow: 0 5px 16px rgba(245,183,0,.11); }
.tab-header {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 13px;
  background: #101010;
}
.tab-btn {
  border-radius: 9px;
  color: #969696;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.tab-btn.active {
  background: linear-gradient(135deg, rgba(245,183,0,.17), rgba(255,138,0,.07));
  box-shadow: inset 0 0 0 1px rgba(245,183,0,.12);
  color: var(--gold-primary);
}
.filter-bar { gap: 12px; align-items: center; }
.modal-card {
  border-color: rgba(245,183,0,.18);
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
}
@media (min-width: 1500px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-content { padding-left: 24px; padding-right: 24px; }
  .topbar { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 992px) {
  .main-content { width: 100%; padding: 20px 22px 32px; }
  .topbar { position: sticky; top: 0; margin: -20px -22px 0; padding: 14px 22px; min-height: 70px; }
  .sidebar { background: #101010; }
}
@media (max-width: 768px) {
  .main-content { padding: 14px 14px 28px; gap: 18px; }
  .topbar { margin: -14px -14px 0; padding: 13px 14px; }
  .topbar-actions { width: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .stat-card { align-items: flex-start; flex-direction: column; gap: 12px; min-height: 128px; padding: 15px; }
  .stat-icon { width: 40px; height: 40px; }
  .welcome-hero { min-height: 0; gap: 18px; }
  .card { padding: 16px; }
  .card-header { align-items: flex-start; }
  .nav-group { padding: 3px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 90px; align-items: center; flex-direction: row; }
  .topbar { align-items: flex-start; }
  .topbar-title { flex-basis: 100%; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .erlc-status-pill { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .content-section.active, .welcome-hero::before, .welcome-hero::after, .stat-card { animation: none !important; }
}


/* ==========================================================================
   CARTAGENA ROLEPLAY — DASHBOARD EXPERIENCE REFRESH
   Premium institutional UI: charcoal, gold and orange.
   ========================================================================== */
:root {
  --bg-primary: #080808;
  --bg-secondary: #101010;
  --bg-card: #141414;
  --bg-hover: #202020;
  --border-color: rgba(255,255,255,.085);
  --gold-primary: #F5B700;
  --gold-dark: #C58A00;
  --orange-primary: #FF8A00;
  --text-white: #FAFAFA;
  --text-muted: #A4A4A4;
  --shadow-panel: 0 18px 54px rgba(0,0,0,.24);
  --focus-ring: 0 0 0 3px rgba(245,183,0,.22);
}

html { background: var(--bg-primary); scroll-behavior: smooth; }
body {
  background:
    radial-gradient(ellipse at 82% -10%, rgba(245,183,0,.075), transparent 34rem),
    radial-gradient(ellipse at -10% 35%, rgba(255,138,0,.035), transparent 30rem),
    var(--bg-primary);
  color: var(--text-white);
}
.dashboard-wrapper { min-height: 100vh; background: transparent; }
.sidebar {
  background: rgba(13,13,13,.96);
  border-right: 1px solid rgba(255,255,255,.075);
  box-shadow: 14px 0 40px rgba(0,0,0,.12);
  backdrop-filter: blur(18px);
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-logo { filter: drop-shadow(0 5px 14px rgba(245,183,0,.13)); }
.brand-title { letter-spacing: .13em; }
.sidebar-nav { padding-top: 18px; }
.sidebar-nav-label {
  color: #737373;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .16em;
}
.nav-group { margin: 5px 10px; border: 1px solid transparent; border-radius: 13px; }
.nav-group.open { background: rgba(255,255,255,.018); border-color: rgba(255,255,255,.045); }
.nav-item, .nav-subitem {
  border-radius: 10px;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-item { min-height: 44px; }
.nav-item:hover, .nav-subitem:hover { background: rgba(255,255,255,.055); }
.nav-item.active {
  color: var(--gold-primary);
  background: linear-gradient(100deg, rgba(245,183,0,.15), rgba(255,138,0,.045));
  box-shadow: inset 3px 0 0 var(--gold-primary);
}
.nav-subitem.active {
  color: #FFE08A;
  background: rgba(245,183,0,.085);
  box-shadow: inset 2px 0 0 var(--gold-dark);
}
.main-content { gap: 26px; padding-top: 28px; }
.topbar {
  min-height: 76px;
  margin-bottom: 4px;
  padding: 16px 22px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 18px;
  background: rgba(17,17,17,.78);
  box-shadow: 0 12px 36px rgba(0,0,0,.14);
  backdrop-filter: blur(16px);
}
.topbar-title h1 { font-size: clamp(1.05rem, 1.7vw, 1.35rem); letter-spacing: -.035em; }
.erlc-status-pill { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.035); }
.content-section { animation-duration: .22s; }
.welcome-hero {
  min-height: 200px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(245,183,0,.34);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 90% 10%, rgba(245,183,0,.14), transparent 23rem),
    linear-gradient(120deg, #181818 0%, #101010 65%, #17110a 100%);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255,255,255,.035);
}
.welcome-hero::before { opacity: .55; }
.welcome-text h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.055em; }
.welcome-subtitle { margin-top: 9px; line-height: 1.6; }
.card, .stat-card {
  border-color: rgba(255,255,255,.075);
  background: linear-gradient(145deg, rgba(24,24,24,.98), rgba(17,17,17,.98));
  box-shadow: var(--shadow-panel);
}
.card { border-radius: 17px; }
.card-section { padding: clamp(18px, 2.4vw, 28px); }
.card-header {
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(255,255,255,.065);
}
.card-header h2, .card-header h3 { letter-spacing: -.025em; }
.card-header p { max-width: 720px; line-height: 1.65; }
.stats-grid { gap: 16px; }
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
}
.stat-card::after {
  content: "";
  position: absolute;
  top: 0; left: 18px; right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,183,0,.28), transparent);
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(245,183,0,.25); }
.stat-value { letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat-label { color: #A5A5A5; letter-spacing: .045em; }
.btn { min-height: 42px; border-radius: 10px; font-weight: 750; letter-spacing: -.01em; }
.btn-primary { box-shadow: 0 7px 20px rgba(245,183,0,.12); }
.btn-outline { border-color: rgba(255,255,255,.14); }
.btn-outline:hover { background: rgba(245,183,0,.075); }
.form-control {
  border-color: rgba(255,255,255,.12);
  border-radius: 10px;
  background-color: #101010;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.form-control:focus { border-color: rgba(245,183,0,.68); box-shadow: var(--focus-ring); outline: none; }
.filter-bar { padding: 14px; border: 1px solid rgba(255,255,255,.065); border-radius: 13px; background: rgba(0,0,0,.18); }
.table-responsive { border-radius: 13px; border-color: rgba(255,255,255,.075); background: rgba(0,0,0,.12); }
.table { border-collapse: separate; border-spacing: 0; }
.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1B1B1B;
  color: #C8C8C8;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(245,183,0,.2);
}
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgba(245,183,0,.035); }
.table td { border-bottom-color: rgba(255,255,255,.055); }
.badge-gold, .badge-orange { border: 1px solid rgba(245,183,0,.16); }
.alert { border-radius: 12px; }
#ranking-period-info { background: rgba(245,183,0,.055); border: 1px solid rgba(245,183,0,.15); }
.service-control-panel { border-top: 2px solid rgba(245,183,0,.65); }
.service-active-box {
  border: 1px solid rgba(46,125,50,.28);
  border-radius: 15px;
  background: linear-gradient(120deg, rgba(46,125,50,.08), rgba(0,0,0,.12));
}
.pagination-controls { gap: 7px; }
.modal-card { border-radius: 18px; overflow: hidden; }
.toast { border-radius: 12px; box-shadow: 0 16px 42px rgba(0,0,0,.4); }
:focus-visible { outline: 2px solid rgba(245,183,0,.85); outline-offset: 3px; }
@media (max-width: 992px) {
  .main-content { gap: 18px; padding-top: 18px; }
  .topbar { border-radius: 14px; }
}
@media (max-width: 600px) {
  .main-content { padding-top: 12px; }
  .welcome-hero { padding: 23px 20px; border-radius: 17px; }
  .card-section { padding: 16px; }
  .card-header { flex-direction: column; align-items: stretch; }
  .card-header > .btn, .card-header > button { width: 100%; }
  .filter-bar { padding: 11px; }
  .filter-bar .form-control { width: 100%; min-width: 0; }
  .table thead th { font-size: .64rem; }
}


/* Dashboard home — category-panel layout inspired by the supplied reference */
.category-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin:30px 0 16px; }
.category-heading .eyebrow { display:inline-block; margin-bottom:8px; color:var(--gold-primary,#F5B700); font-size:.68rem; font-weight:800; letter-spacing:.16em; }
.category-heading h2 { margin:0 0 7px; font-size:clamp(1.25rem,2.2vw,1.65rem); letter-spacing:-.035em; }
.category-heading p { margin:0; color:var(--text-muted,#92949b); font-size:.9rem; line-height:1.6; }
.dashboard-category-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; margin-bottom:28px; }
.dashboard-category-card { --panel-accent:#F5B700; --panel-glow:rgba(245,183,0,.10); position:relative; display:flex; min-height:190px; flex-direction:column; align-items:flex-start; overflow:hidden; padding:21px; border:1px solid rgba(255,255,255,.075); border-radius:19px; background:linear-gradient(145deg,var(--panel-glow),rgba(18,19,23,.92) 62%); color:var(--text-primary,#f5f5f6); text-decoration:none; transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease; }
.dashboard-category-card::before { position:absolute; top:0; left:20px; right:20px; height:2px; border-radius:0 0 5px 5px; background:linear-gradient(90deg,var(--panel-accent),transparent); content:""; opacity:.85; }
.dashboard-category-card::after { position:absolute; top:-60px; right:-60px; width:150px; height:150px; border-radius:50%; background:var(--panel-glow); content:""; filter:blur(12px); pointer-events:none; }
.dashboard-category-card:hover { transform:translateY(-3px); border-color:color-mix(in srgb,var(--panel-accent) 44%,transparent); box-shadow:0 14px 36px rgba(0,0,0,.24); }
.dashboard-category-card:focus-visible { outline:2px solid var(--panel-accent); outline-offset:3px; }
.category-symbol { display:grid; width:42px; height:42px; place-items:center; margin-bottom:18px; border:1px solid color-mix(in srgb,var(--panel-accent) 22%,transparent); border-radius:13px; background:var(--panel-glow); color:var(--panel-accent); font-size:1.35rem; font-weight:800; }
.category-card-title { margin-bottom:8px; font-size:1rem; font-weight:750; letter-spacing:-.015em; }
.category-card-description { max-width:31ch; color:var(--text-muted,#9b9da5); font-size:.8rem; line-height:1.55; }
.category-card-action { display:flex; width:100%; align-items:center; justify-content:space-between; margin-top:auto; padding-top:20px; color:var(--panel-accent); font-size:.75rem; font-weight:750; }
.category-card-action span { display:grid; width:28px; height:28px; place-items:center; border:1px solid rgba(255,255,255,.08); border-radius:50%; background:rgba(255,255,255,.035); font-size:1rem; transition:transform .2s ease; }
.dashboard-category-card:hover .category-card-action span { transform:translate(2px,-2px); }
.category-services { --panel-accent:#F5B700; --panel-glow:rgba(245,183,0,.09); }
.category-history { --panel-accent:#FF8A00; --panel-glow:rgba(255,138,0,.085); }
.category-rankings { --panel-accent:#b49aff; --panel-glow:rgba(130,90,230,.11); }
.category-forms { --panel-accent:#49d6b0; --panel-glow:rgba(25,175,135,.09); }
.category-staff { --panel-accent:#72a8ff; --panel-glow:rgba(55,115,220,.10); }
.category-applications { --panel-accent:#ff7b88; --panel-glow:rgba(230,65,90,.09); }
@media (min-width:1200px) { .dashboard-category-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:900px) { .dashboard-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { .category-heading { margin-top:24px; } .dashboard-category-grid { grid-template-columns:1fr; gap:12px; } .dashboard-category-card { min-height:165px; padding:18px; } .category-symbol { margin-bottom:13px; } }


/* Cartagena-specific dashboard identity: operations console, not a template clone */
.category-heading { position:relative; padding:6px 0 0 17px; border-left:3px solid var(--gold-primary,#F5B700); }
.category-heading::after { position:absolute; top:8px; right:0; color:rgba(255,255,255,.055); content:"CR / OPS"; font-size:clamp(2rem,5vw,4rem); font-weight:900; letter-spacing:-.08em; pointer-events:none; }
.category-heading > div { position:relative; z-index:1; }
.category-heading .eyebrow { letter-spacing:.2em; }
.dashboard-category-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.dashboard-category-card { min-height:205px; padding:20px; border-radius:15px; background:linear-gradient(150deg,rgba(255,255,255,.035),rgba(17,18,22,.94) 52%); box-shadow:inset 0 1px rgba(255,255,255,.025); }
.dashboard-category-card::before { left:0; right:auto; top:18px; bottom:18px; width:2px; height:auto; border-radius:0 3px 3px 0; background:var(--panel-accent); opacity:.75; }
.dashboard-category-card::after { top:auto; right:-42px; bottom:-55px; width:130px; height:130px; border:1px solid color-mix(in srgb,var(--panel-accent) 15%,transparent); background:transparent; filter:none; }
.dashboard-category-card:nth-child(1) { grid-column:span 2; min-height:225px; padding:24px; }
.dashboard-category-card:nth-child(1) .category-card-title { font-size:1.2rem; }
.dashboard-category-card:nth-child(1) .category-card-description { max-width:42ch; }
.dashboard-category-card:nth-child(2), .dashboard-category-card:nth-child(3) { min-height:225px; }
.category-symbol { border-radius:11px; box-shadow:0 5px 18px var(--panel-glow); }
.category-card-action { position:relative; z-index:1; }
.dashboard-category-card:hover { transform:translateY(-4px); box-shadow:0 18px 40px rgba(0,0,0,.22),inset 0 1px rgba(255,255,255,.04); }
@media (min-width:1200px) { .dashboard-category-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:900px) { .dashboard-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .dashboard-category-card:nth-child(1) { grid-column:span 2; } }
@media (max-width:560px) { .category-heading::after { font-size:2.2rem; top:18px; } .dashboard-category-grid { grid-template-columns:1fr; } .dashboard-category-card:nth-child(1) { grid-column:auto; min-height:190px; } .dashboard-category-card:nth-child(2), .dashboard-category-card:nth-child(3) { min-height:175px; } }


/* ==========================================================================
   CARTAGENA ROLEPLAY — UNIFIED DASHBOARD DESIGN SYSTEM
   Visual refresh: original civic / operations-console identity.
   This layer intentionally styles existing components without changing app logic.
   ========================================================================== */
:root {
  --cr-bg: #090a0c;
  --cr-surface: #101216;
  --cr-surface-raised: #15181e;
  --cr-surface-hover: #1a1e25;
  --cr-border: rgba(255,255,255,.075);
  --cr-border-strong: rgba(255,255,255,.13);
  --cr-text: #f4f5f7;
  --cr-muted: #9298a3;
  --cr-gold: #f5b700;
  --cr-orange: #ff8a00;
  --cr-green: #36c99a;
  --cr-red: #f06b76;
  --cr-radius: 18px;
  --cr-shadow: 0 18px 50px rgba(0,0,0,.22);
}
html { scroll-behavior:smooth; background:var(--cr-bg); }
body {
  color:var(--cr-text);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(245,183,0,.055), transparent 34rem),
    radial-gradient(ellipse at 100% 35%, rgba(255,138,0,.025), transparent 32rem),
    var(--cr-bg);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button, input, select, textarea { font:inherit; }
a { transition:color .18s ease,border-color .18s ease,background .18s ease; }
.hidden { display:none !important; }
.dashboard-wrapper { min-height:100vh; background:transparent; }
.sidebar {
  background:linear-gradient(180deg,#101216 0%,#0c0e11 100%);
  border-right:1px solid var(--cr-border);
  box-shadow:12px 0 35px rgba(0,0,0,.12);
}
.sidebar-header { padding:24px 20px 22px; border-bottom:1px solid var(--cr-border); }
.sidebar-home-link { gap:12px; min-width:0; }
.sidebar-logo { width:43px; height:43px; object-fit:contain; filter:drop-shadow(0 0 14px rgba(245,183,0,.12)); }
.brand-title { color:#fff; font-weight:850; letter-spacing:.08em; }
.brand-subtitle { color:var(--cr-gold); font-size:.69rem; font-weight:800; letter-spacing:.2em; }
.sidebar-nav { padding:20px 12px; }
.sidebar-nav-label { padding:0 12px; color:#737984; font-size:.64rem; font-weight:800; letter-spacing:.16em; }
.nav-group { margin:5px 0; }
.nav-item {
  display:flex; align-items:center; gap:12px; min-height:44px; padding:11px 13px;
  border:1px solid transparent; border-radius:12px; color:#aeb3bc;
  font-size:.86rem; font-weight:600; transition:background .18s,border-color .18s,color .18s;
}
.nav-item:hover,.nav-subitem:hover { color:#fff; background:rgba(255,255,255,.045); }
.nav-item.active,.nav-item[aria-current="page"] {
  color:#fff; border-color:rgba(245,183,0,.16);
  background:linear-gradient(100deg,rgba(245,183,0,.13),rgba(245,183,0,.035));
}
.nav-item.active .nav-icon { color:var(--cr-gold); }
.nav-icon { flex-shrink:0; color:#8b919b; }
.nav-chevron { margin-left:auto; color:#737984; }
.nav-subitems { margin:4px 0 10px 21px; padding-left:13px; border-left:1px solid rgba(255,255,255,.09); }
.nav-subitem { display:block; padding:9px 11px; border-radius:9px; color:#9298a3; font-size:.81rem; }
.nav-subitem.active { color:var(--cr-gold); background:rgba(245,183,0,.07); }
.sidebar-footer { padding:14px; border-top:1px solid var(--cr-border); background:rgba(0,0,0,.12); }
.user-mini-profile { padding:10px; border:1px solid var(--cr-border); border-radius:13px; margin-bottom:12px; }
.avatar-img { border:1px solid rgba(245,183,0,.25); }
.user-name { color:#f5f5f6; font-weight:700; }
.user-role-badge { color:var(--cr-gold); }
.main-content { min-width:0; padding:26px clamp(16px,3vw,42px) 42px; gap:22px; }
.topbar {
  position:sticky; top:12px; z-index:30; display:flex; align-items:center; gap:18px;
  min-height:72px; padding:14px 20px; border:1px solid var(--cr-border);
  border-radius:16px; background:rgba(16,18,22,.88); backdrop-filter:blur(18px);
  box-shadow:0 12px 35px rgba(0,0,0,.15);
}
.topbar-title h1 { margin:0; color:#f6f6f7; font-size:clamp(1rem,1.5vw,1.28rem); font-weight:800; letter-spacing:-.035em; }
.topbar-actions { gap:12px; }
.erlc-status-pill { padding:8px 12px; border:1px solid var(--cr-border-strong); border-radius:999px; background:rgba(255,255,255,.025); font-size:.74rem; font-weight:700; }
.erlc-status-pill.online { border-color:rgba(54,201,154,.25); color:#74e1bd; background:rgba(54,201,154,.07); }
.erlc-status-pill.offline { color:#a9aeb7; }
.status-dot { box-shadow:0 0 0 4px rgba(255,255,255,.035); }
.topbar-user { padding:5px 10px 5px 6px; border:1px solid var(--cr-border); border-radius:13px; }
.topbar-avatar { border:1px solid rgba(245,183,0,.3); }
.topbar-name { color:#f7f7f8; font-weight:700; }
.topbar-role { color:var(--cr-muted); font-size:.72rem; }
.content-section { width:100%; max-width:1500px; margin:0 auto; animation:cr-view-in .24s ease both; }
@keyframes cr-view-in { from { opacity:.5; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
.welcome-hero {
  position:relative; display:flex; align-items:center; justify-content:space-between; gap:24px;
  min-height:172px; padding:clamp(24px,4vw,42px); overflow:hidden;
  border:1px solid rgba(255,255,255,.085); border-radius:24px;
  background:linear-gradient(115deg,rgba(245,183,0,.085),transparent 38%),linear-gradient(135deg,#1a1d23,#111318 70%);
  box-shadow:var(--cr-shadow);
}
.welcome-hero::after { content:""; position:absolute; right:-60px; top:-145px; width:310px; height:310px; border:1px solid rgba(245,183,0,.10); border-radius:50%; box-shadow:0 0 0 32px rgba(245,183,0,.018),0 0 0 70px rgba(245,183,0,.012); pointer-events:none; }
.welcome-text,.welcome-action { position:relative; z-index:1; }
.welcome-text h2 { max-width:800px; margin:0 0 10px; color:#fff; font-family:Montserrat,Inter,sans-serif; font-size:clamp(1.65rem,3.4vw,2.8rem); font-weight:900; line-height:1.1; letter-spacing:-.055em; }
.welcome-text h2 span,.welcome-text h2 strong { color:var(--cr-gold); }
.welcome-subtitle { margin:0; color:#a5aab3; font-size:.92rem; line-height:1.7; }
.welcome-action { flex-shrink:0; }
.stats-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:13px; margin:18px 0 26px; }
.stat-card {
  display:flex; align-items:center; gap:13px; min-width:0; padding:17px 15px;
  border:1px solid var(--cr-border); border-radius:16px;
  background:linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.012));
  transition:transform .18s,border-color .18s,background .18s;
}
.stat-card:hover { transform:translateY(-2px); border-color:rgba(245,183,0,.2); background:var(--cr-surface-raised); }
.stat-icon { display:grid; place-items:center; width:42px; height:42px; flex:0 0 42px; border-radius:13px; }
.stat-icon.gold { color:var(--cr-gold); background:rgba(245,183,0,.1); }
.stat-icon.orange { color:var(--cr-orange); background:rgba(255,138,0,.1); }
.stat-details { min-width:0; }
.stat-value { display:block; overflow-wrap:anywhere; color:#f8f8f9; font-size:clamp(.98rem,1.3vw,1.28rem); font-weight:800; letter-spacing:-.04em; }
.stat-label { display:block; margin-top:4px; color:var(--cr-muted); font-size:.69rem; line-height:1.4; }
.category-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin:30px 0 16px; }
.category-heading .eyebrow { display:block; margin-bottom:8px; color:var(--cr-gold); font-size:.65rem; font-weight:850; letter-spacing:.18em; }
.category-heading h2 { margin:0 0 7px; color:#f7f7f8; font-size:clamp(1.35rem,2vw,1.7rem); font-weight:800; letter-spacing:-.045em; }
.category-heading p { margin:0; color:var(--cr-muted); font-size:.85rem; line-height:1.6; }
.dashboard-category-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; margin:0 0 30px; }
.dashboard-category-card {
  --panel-accent:var(--cr-gold); --panel-glow:rgba(245,183,0,.075);
  position:relative; display:flex; flex-direction:column; align-items:flex-start; min-width:0; min-height:202px;
  padding:22px; overflow:hidden; border:1px solid var(--cr-border); border-radius:19px;
  color:var(--cr-text); text-decoration:none; isolation:isolate;
  background:linear-gradient(145deg,var(--panel-glow),rgba(17,19,23,.94) 66%);
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}
.dashboard-category-card::before { position:absolute; top:0; left:22px; right:22px; height:2px; border-radius:0 0 4px 4px; background:linear-gradient(90deg,var(--panel-accent),transparent); content:""; opacity:.8; }
.dashboard-category-card::after { position:absolute; z-index:-1; right:-50px; top:-60px; width:170px; height:170px; border-radius:50%; background:var(--panel-glow); filter:blur(22px); content:""; }
.dashboard-category-card:hover { transform:translateY(-3px); border-color:color-mix(in srgb,var(--panel-accent) 38%,transparent); box-shadow:0 16px 40px rgba(0,0,0,.24); color:#fff; }
.dashboard-category-card:focus-visible { outline:2px solid var(--panel-accent); outline-offset:3px; }
.category-symbol { display:grid; place-items:center; width:44px; height:44px; margin-bottom:18px; border:1px solid color-mix(in srgb,var(--panel-accent) 24%,transparent); border-radius:14px; background:var(--panel-glow); color:var(--panel-accent); font-size:1.25rem; font-weight:800; }
.category-card-title { margin-bottom:8px; color:#f7f7f8; font-size:1rem; font-weight:800; letter-spacing:-.02em; }
.category-card-description { max-width:36ch; color:#969ca6; font-size:.79rem; line-height:1.6; }
.category-card-action { display:flex; align-items:center; justify-content:space-between; width:100%; gap:10px; margin-top:auto; padding-top:19px; color:var(--panel-accent); font-size:.74rem; font-weight:800; }
.category-card-action span { display:grid; place-items:center; width:29px; height:29px; border:1px solid var(--cr-border); border-radius:50%; background:rgba(255,255,255,.035); font-size:1rem; transition:transform .2s; }
.dashboard-category-card:hover .category-card-action span { transform:translate(2px,-2px); }
.category-services { --panel-accent:#f5b700; --panel-glow:rgba(245,183,0,.085); }
.category-history { --panel-accent:#ff9a42; --panel-glow:rgba(255,138,0,.075); }
.category-rankings { --panel-accent:#b5a0ff; --panel-glow:rgba(130,100,245,.085); }
.category-forms { --panel-accent:#54d7b0; --panel-glow:rgba(40,190,145,.075); }
.category-staff { --panel-accent:#78aaff; --panel-glow:rgba(70,125,240,.08); }
.category-applications { --panel-accent:#ff818e; --panel-glow:rgba(240,80,105,.075); }
.card,.card-section {
  min-width:0; border:1px solid var(--cr-border); border-radius:var(--cr-radius);
  background:linear-gradient(145deg,rgba(255,255,255,.027),rgba(255,255,255,.009)),var(--cr-surface);
  box-shadow:0 12px 32px rgba(0,0,0,.11);
}
.card-section { padding:clamp(17px,2.2vw,25px); margin-bottom:18px; }
.card-header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.card-header h2,.card-header h3 { margin:0; color:#f5f6f7; font-size:1.02rem; font-weight:800; letter-spacing:-.025em; }
.card-header p { margin:7px 0 0; color:var(--cr-muted); font-size:.82rem; line-height:1.55; }
.service-control-panel { padding:clamp(20px,3vw,32px); }
.service-control-header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; padding-bottom:24px; border-bottom:1px solid var(--cr-border); }
.service-control-header h2 { margin:0 0 9px; color:#fff; font-size:clamp(1.3rem,2vw,1.8rem); font-weight:850; letter-spacing:-.045em; }
.service-control-header p { max-width:66ch; margin:0; color:var(--cr-muted); font-size:.88rem; line-height:1.65; }
.live-timer { padding:12px 16px; border:1px solid rgba(245,183,0,.22); border-radius:14px; background:rgba(245,183,0,.065); text-align:right; }
.timer-label { display:block; color:var(--cr-gold); font-size:.63rem; font-weight:850; letter-spacing:.12em; }
.timer-clock { display:block; margin-top:5px; color:#fff; font-size:1.5rem; font-weight:850; font-variant-numeric:tabular-nums; }
.service-form { padding-top:22px; }
.form-group { min-width:0; margin-bottom:17px; }
.form-group label,.form-label { display:block; margin-bottom:8px; color:#dfe1e5; font-size:.81rem; font-weight:700; }
.form-control {
  width:100%; min-height:44px; padding:11px 13px; border:1px solid rgba(255,255,255,.11);
  border-radius:11px; outline:none; background:#0d0f13; color:#f5f6f7;
  transition:border-color .18s,box-shadow .18s,background .18s;
}
.form-control::placeholder { color:#676e79; }
.form-control:hover { border-color:rgba(255,255,255,.19); }
.form-control:focus { border-color:rgba(245,183,0,.68); background:#101217; box-shadow:0 0 0 3px rgba(245,183,0,.1); }
.form-control:disabled { opacity:.55; cursor:not-allowed; }
textarea.form-control { min-height:110px; resize:vertical; }
.form-row { gap:16px; }
.form-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:20px; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:41px;
  padding:10px 15px; border:1px solid transparent; border-radius:11px; font-size:.81rem;
  font-weight:750; line-height:1.25; text-decoration:none; cursor:pointer;
  transition:transform .16s,background .16s,border-color .16s,box-shadow .16s;
}
.btn:hover { transform:translateY(-1px); }
.btn:active { transform:translateY(0); }
.btn:focus-visible,.btn-icon:focus-visible { outline:2px solid var(--cr-gold); outline-offset:3px; }
.btn-primary { color:#16130a; border-color:#f5c52c; background:linear-gradient(135deg,#ffd24a,#f5b700 75%); box-shadow:0 5px 16px rgba(245,183,0,.12); }
.btn-primary:hover { color:#111; background:linear-gradient(135deg,#ffdc69,#ffc21b); box-shadow:0 8px 22px rgba(245,183,0,.18); }
.btn-outline,.btn-outline-danger { border-color:var(--cr-border-strong); background:rgba(255,255,255,.025); color:#d7dae0; }
.btn-outline:hover { border-color:rgba(245,183,0,.32); background:rgba(245,183,0,.055); color:#fff; }
.btn-danger { color:#fff; border-color:rgba(240,107,118,.25); background:linear-gradient(135deg,#c74653,#a82d3a); }
.btn-danger:hover { background:linear-gradient(135deg,#dd5865,#b73543); }
.btn-discord { background:#5865f2; color:white; }
.btn-discord:hover { background:#4752c4; }
.btn-sm { min-height:34px; padding:7px 10px; border-radius:9px; font-size:.73rem; }
.btn-icon { display:grid; place-items:center; width:40px; height:40px; border:1px solid var(--cr-border); border-radius:11px; background:rgba(255,255,255,.035); color:#e7e8eb; cursor:pointer; }
.service-active-box { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:22px; padding:20px; border:1px solid rgba(54,201,154,.2); border-radius:15px; background:rgba(54,201,154,.055); }
.active-details p { margin:10px 0 0; color:#b8c0c7; font-size:.85rem; }
.badge { display:inline-flex; align-items:center; gap:5px; padding:5px 9px; border:1px solid transparent; border-radius:999px; font-size:.67rem; font-weight:800; letter-spacing:.015em; }
.badge-gold { color:#f8ce4c; border-color:rgba(245,183,0,.18); background:rgba(245,183,0,.1); }
.badge-orange { color:#ffb66d; border-color:rgba(255,138,0,.18); background:rgba(255,138,0,.1); }
.badge-success { color:#6ee0b9; border-color:rgba(54,201,154,.18); background:rgba(54,201,154,.09); }
.badge-danger { color:#ff929c; border-color:rgba(240,107,118,.18); background:rgba(240,107,118,.09); }
.badge-info { color:#9bc5ff; border-color:rgba(100,160,255,.18); background:rgba(100,160,255,.09); }
.table-responsive { width:100%; overflow-x:auto; border:1px solid var(--cr-border); border-radius:13px; }
.table { width:100%; margin:0; border-collapse:separate; border-spacing:0; color:#d8dbe0; font-size:.8rem; }
.table thead th { position:sticky; top:0; z-index:1; padding:13px 14px; border-bottom:1px solid rgba(245,183,0,.16); background:#17191e; color:#aeb4be; font-size:.67rem; font-weight:850; letter-spacing:.075em; text-align:left; text-transform:uppercase; white-space:nowrap; }
.table tbody td { padding:13px 14px; border-bottom:1px solid rgba(255,255,255,.045); vertical-align:middle; }
.table tbody tr:last-child td { border-bottom:0; }
.table tbody tr { background:rgba(255,255,255,.006); transition:background .15s; }
.table tbody tr:hover { background:rgba(245,183,0,.035); }
.table td .btn { margin:2px 3px 2px 0; }
.text-muted { color:var(--cr-muted) !important; }
.text-center { text-align:center; }
.filter-bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:0 0 16px; padding:12px; border:1px solid var(--cr-border); border-radius:13px; background:rgba(255,255,255,.018); }
.filter-bar .form-control { width:auto; min-width:180px; flex:1 1 180px; }
.alert { padding:13px 15px; border:1px solid var(--cr-border); border-radius:12px; background:rgba(255,255,255,.025); line-height:1.55; }
.alert-info { border-color:rgba(245,183,0,.18); background:rgba(245,183,0,.045); }
.pagination-controls { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; margin-top:16px; }
.pagination-controls button,.pagination-controls a { min-width:34px; min-height:34px; padding:7px 10px; border:1px solid var(--cr-border); border-radius:9px; background:#14161a; color:#dce0e5; }
.modal,.modal-overlay { backdrop-filter:blur(8px); }
.modal-content,.modal-dialog { max-width:min(760px,calc(100vw - 28px)); border:1px solid var(--cr-border-strong); border-radius:20px; background:#13151a; box-shadow:0 28px 90px rgba(0,0,0,.55); }
.modal-header,.modal-footer { border-color:var(--cr-border); }
.toast { border:1px solid var(--cr-border-strong); border-radius:12px; box-shadow:0 15px 40px rgba(0,0,0,.4); }
.empty-state,.empty-message { padding:32px 18px; color:var(--cr-muted); text-align:center; }
hr { border:0; border-top:1px solid var(--cr-border); }
:focus-visible { outline-color:var(--cr-gold); }
@media (max-width:1250px) {
  .stats-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dashboard-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:900px) {
  .main-content { padding:18px 18px 32px; }
  .topbar { top:8px; min-height:64px; padding:11px 14px; }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .service-control-header { flex-direction:column; }
  .live-timer { text-align:left; }
}
@media (max-width:600px) {
  .main-content { padding:12px 12px 26px; gap:15px; }
  .topbar { position:relative; top:auto; flex-wrap:wrap; gap:10px; padding:12px; border-radius:13px; }
  .topbar-title { flex:1; }
  .topbar-actions { width:100%; justify-content:space-between; }
  .welcome-hero { min-height:0; flex-direction:column; align-items:flex-start; gap:20px; padding:24px 20px; border-radius:19px; }
  .welcome-text h2 { font-size:1.85rem; }
  .welcome-action { width:100%; }
  .welcome-action .btn { width:100%; }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin:12px 0 20px; }
  .stat-card { align-items:flex-start; flex-direction:column; gap:10px; padding:13px; border-radius:13px; }
  .stat-icon { width:36px; height:36px; flex-basis:36px; border-radius:11px; }
  .stat-icon svg { width:19px; height:19px; }
  .stat-value { font-size:1.02rem; }
  .stat-label { font-size:.65rem; }
  .category-heading { margin:24px 0 14px; }
  .dashboard-category-grid { grid-template-columns:1fr; gap:11px; }
  .dashboard-category-card { min-height:175px; padding:18px; border-radius:16px; }
  .category-symbol { width:40px; height:40px; margin-bottom:13px; }
  .card-section { padding:15px; }
  .card-header { align-items:stretch; flex-direction:column; gap:12px; }
  .card-header > .btn,.card-header > button { width:100%; }
  .filter-bar { align-items:stretch; flex-direction:column; }
  .filter-bar .form-control { width:100%; min-width:0; flex:auto; }
  .form-row { flex-direction:column; gap:0; }
  .service-active-box { align-items:stretch; flex-direction:column; padding:15px; }
  .service-active-box .btn { width:100%; }
  .form-actions .btn { width:100%; }
  .table { min-width:650px; }
  .table thead th { font-size:.62rem; }
  .table tbody td { padding:11px; }
  .pagination-controls { justify-content:center; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}


/* Workspace-level top navigation shared by related dashboard views */
.workspace-panel-header {
  display:flex; flex-direction:column; gap:19px; margin:0 0 24px; padding:24px 25px 0;
  border:1px solid var(--cr-border,rgba(255,255,255,.075)); border-radius:18px;
  background:linear-gradient(120deg,rgba(245,183,0,.055),transparent 48%),rgba(16,18,22,.9);
  box-shadow:0 12px 32px rgba(0,0,0,.12);
}
.workspace-panel-copy { min-width:0; }
.workspace-kicker { display:block; margin-bottom:7px; color:var(--cr-gold,#F5B700); font-size:.64rem; font-weight:850; letter-spacing:.17em; }
.workspace-panel-copy h2 { margin:0 0 7px; color:#f7f7f8; font-size:clamp(1.25rem,2vw,1.7rem); font-weight:850; letter-spacing:-.04em; }
.workspace-panel-copy p { margin:0; color:var(--cr-muted,#9298a3); font-size:.83rem; line-height:1.6; }
.workspace-topnav {
  display:flex; align-items:center; gap:5px; max-width:100%; overflow-x:auto; padding:0 0 0;
  border-bottom:1px solid var(--cr-border,rgba(255,255,255,.075)); scrollbar-width:thin;
}
.workspace-tab {
  position:relative; display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center;
  min-height:46px; padding:12px 15px; border:0; border-radius:10px 10px 0 0;
  background:transparent; color:#9da3ad; font-size:.79rem; font-weight:750;
  text-decoration:none; white-space:nowrap; transition:color .18s,background .18s;
}
.workspace-tab:hover { color:#fff; background:rgba(255,255,255,.035); }
.workspace-tab.is-current { color:var(--cr-gold,#F5B700); background:rgba(245,183,0,.055); }
.workspace-tab.is-current::after { position:absolute; right:12px; bottom:-1px; left:12px; height:2px; border-radius:3px 3px 0 0; background:var(--cr-gold,#F5B700); content:""; }
.workspace-tab:focus-visible { outline:2px solid var(--cr-gold,#F5B700); outline-offset:-3px; }
.content-section > .workspace-panel-header + * { margin-top:0; }
@media (max-width:650px) {
  .workspace-panel-header { gap:15px; margin-bottom:18px; padding:19px 15px 0; border-radius:15px; }
  .workspace-topnav { margin-right:-15px; margin-left:-15px; padding:0 10px; }
  .workspace-tab { min-height:43px; padding:11px 12px; font-size:.75rem; }
}


/* ==========================================================================
   MOBILE RELIABILITY PATCH — PORTRAIT + LANDSCAPE
   Layout corrections for narrow screens and short landscape viewports.
   Keep this block last so it overrides legacy fixed-width rules.
   ========================================================================== */
html { width:100%; max-width:100%; overflow-x:clip; }
body { width:100%; max-width:100%; min-width:0; overflow-x:clip; }
img,svg,video,canvas,iframe { max-width:100%; }
button,a,input,select,textarea { min-width:0; }
.content-section,.main-content,.dashboard-wrapper,.card,.card-section,
.workspace-panel-header,.workspace-panel-copy,.table-responsive { min-width:0; }
.content-section { overflow-wrap:anywhere; }
.workspace-panel-header { width:100%; box-sizing:border-box; }
.workspace-topnav {
  width:100%; min-width:0; max-width:100%; box-sizing:border-box;
  overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch;
  touch-action:pan-x pan-y; scroll-snap-type:x proximity;
}
.workspace-tab { scroll-snap-align:start; flex-shrink:0; }
.dashboard-category-grid > *, .stats-grid > *, .form-row > *,
.card-header > *, .topbar > *, .welcome-hero > * { min-width:0; }
.table-responsive { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
.table-responsive table { width:100%; }
.form-control { max-width:100%; box-sizing:border-box; }
.btn { max-width:100%; white-space:normal; }
.topbar-title,.topbar-actions,.topbar-user { min-width:0; }
.topbar-name,.user-name { overflow-wrap:anywhere; }
.welcome-text h2 { overflow-wrap:anywhere; }
.nav-item,.nav-subitem { overflow-wrap:anywhere; }
@media screen and (max-width: 768px) {
  .dashboard-wrapper { display:block; width:100%; }
  .main-content { width:100%; max-width:100%; min-width:0; margin:0; padding:14px 14px 28px; }
  .content-section { width:100%; max-width:100%; }
  .workspace-panel-header {
    display:flex; flex-direction:column; gap:14px; margin:0 0 18px;
    padding:19px 16px 0; border-radius:16px;
  }
  .workspace-panel-copy h2 { font-size:clamp(1.2rem,5vw,1.55rem); line-height:1.2; }
  .workspace-panel-copy p { max-width:60ch; font-size:.82rem; }
  .workspace-topnav {
    display:flex; flex-wrap:nowrap; gap:3px; margin:0 -16px; padding:0 10px;
    overflow-x:auto; overflow-y:hidden; scrollbar-width:thin;
  }
  .workspace-tab { min-height:46px; padding:12px 13px; font-size:.78rem; }
  .welcome-hero { width:100%; box-sizing:border-box; }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .card-section { width:100%; box-sizing:border-box; }
  .filter-bar { width:100%; box-sizing:border-box; }
  .filter-bar .form-control { min-width:0; width:100%; }
  .form-row { display:grid; grid-template-columns:minmax(0,1fr); }
  .service-control-header { flex-direction:column; }
  .service-active-box { flex-wrap:wrap; }
  .modal-content,.modal-dialog { width:calc(100vw - 24px); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; }
  .sidebar { max-width:min(86vw,320px); }
}
@media screen and (max-width: 480px) {
  .main-content { padding:10px 10px 22px; }
  .topbar { align-items:flex-start; }
  .topbar-actions { flex-wrap:wrap; }
  .welcome-hero { padding:20px 17px; }
  .welcome-text h2 { font-size:clamp(1.55rem,7vw,2rem); }
  .stats-grid { gap:8px; }
  .stat-card { padding:11px; }
  .dashboard-category-grid { grid-template-columns:minmax(0,1fr); }
  .dashboard-category-card { min-height:155px; }
  .workspace-panel-header { padding:17px 13px 0; }
  .workspace-topnav { margin-right:-13px; margin-left:-13px; padding-right:8px; padding-left:8px; }
  .workspace-tab { min-height:44px; padding:11px 10px; font-size:.74rem; }
  .card-section { padding:13px; }
  .form-actions { display:flex; flex-direction:column; align-items:stretch; }
  .form-actions .btn { width:100%; }
}
@media screen and (max-height: 520px) and (orientation: landscape) {
  .main-content { padding:10px 16px 20px; }
  .topbar { position:relative; top:auto; min-height:54px; padding:8px 13px; }
  .welcome-hero { min-height:0; padding:18px 22px; }
  .welcome-text h2 { font-size:clamp(1.35rem,4vw,2rem); }
  .workspace-panel-header { gap:10px; margin-bottom:14px; padding:15px 18px 0; }
  .workspace-panel-copy h2 { font-size:1.25rem; }
  .workspace-topnav { overflow-x:auto; }
  .workspace-tab { min-height:40px; padding:9px 12px; }
  .stats-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dashboard-category-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dashboard-category-card { min-height:140px; padding:14px; }
  .category-symbol { width:34px; height:34px; margin-bottom:10px; }
  .card-section { padding:14px; }
  .modal-content,.modal-dialog { max-height:calc(100dvh - 16px); overflow-y:auto; }
}
@media screen and (min-width: 481px) and (max-width: 900px) and (orientation: portrait) {
  .dashboard-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media screen and (min-width: 481px) and (max-width: 900px) and (orientation: landscape) {
  .main-content { padding:12px 16px 24px; }
  .stats-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dashboard-category-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .workspace-panel-header { padding:17px 18px 0; }
  .workspace-topnav { overflow-x:auto; }
}


/* Workspace return-to-home action */
.workspace-panel-heading-row {
  display:flex; align-items:flex-start; justify-content:space-between; gap:18px; min-width:0;
}
.workspace-panel-copy { flex:1 1 auto; }
.workspace-back-button {
  display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; gap:8px;
  min-height:40px; padding:9px 13px; border:1px solid rgba(245,183,0,.24);
  border-radius:11px; background:rgba(245,183,0,.065); color:#f5c842;
  font-size:.77rem; font-weight:800; text-decoration:none;
  transition:background .18s,border-color .18s,transform .18s;
}
.workspace-back-button > span:first-child { font-size:1.15rem; line-height:1; }
.workspace-back-button:hover { transform:translateX(-2px); border-color:rgba(245,183,0,.48); background:rgba(245,183,0,.12); color:#ffe28a; }
.workspace-back-button:focus-visible { outline:2px solid var(--cr-gold,#F5B700); outline-offset:3px; }
@media screen and (max-width:600px) {
  .workspace-panel-heading-row { align-items:flex-start; gap:12px; }
  .workspace-back-button { min-height:38px; padding:8px 10px; gap:6px; font-size:.72rem; }
}
@media screen and (max-width:380px) {
  .workspace-panel-heading-row { flex-direction:column; align-items:stretch; }
  .workspace-back-button { align-self:flex-start; }
}
@media screen and (max-height:520px) and (orientation:landscape) {
  .workspace-panel-heading-row { align-items:center; }
  .workspace-back-button { min-height:34px; padding:7px 10px; }
}


/* Full-width layout: legacy sidebar navigation removed in favor of the three home panels. */
.dashboard-wrapper { display:block; width:100%; }
.main-content { width:100%; max-width:100%; margin-left:0 !important; min-width:0; }
.topbar-actions { min-width:0; }
#btn-login-discord, #btn-logout { white-space:nowrap; }
@media screen and (max-width:600px) {
  .main-content { padding:16px 12px; }
  .topbar { align-items:flex-start; flex-wrap:wrap; }
  .topbar-title { flex:1 1 100%; order:0; }
  .topbar-actions { width:100%; justify-content:flex-start; gap:8px; }
  .erlc-status-pill { padding:8px 10px; font-size:.72rem; }
  #btn-login-discord, #btn-logout { font-size:.75rem; padding:9px 11px; }
}


/* Navigation cleanup: the three home panels and their workspace tabs are the only navigation. */
.sidebar,
.sidebar-nav,
#sidebar,
#mobile-menu-open,
#mobile-menu-close,
.nav-group-toggle {
  display: none !important;
}
.dashboard-wrapper {
  display: block;
  width: 100%;
  min-width: 0;
}
.main-content {
  width: 100%;
  max-width: 100%;
  margin-left: 0 !important;
  min-width: 0;
}
.dashboard-main-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
}
.dashboard-main-panels > .dashboard-category-card {
  min-width: 0;
}
@media (max-width: 760px) and (orientation: portrait) {
  .dashboard-main-panels {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 900px) and (orientation: landscape) {
  .dashboard-main-panels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .dashboard-main-panels > .dashboard-category-card {
    min-height: 140px;
  }
}


/* ==========================================================================
   HOME SCREEN REFRESH — Cartagena Roleplay
   Scoped to Inicio to avoid changing the other workspace screens.
   ========================================================================== */
#view-inicio {
  --home-gold: #F5B700;
  --home-orange: #FF8A00;
  --home-line: rgba(255,255,255,.09);
}
#view-inicio .home-hero {
  min-height: 238px;
  margin-bottom: 22px;
  padding: clamp(24px, 3.4vw, 42px);
  align-items: center;
  border: 1px solid rgba(245,183,0,.28);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 85% 18%, rgba(245,183,0,.12), transparent 34%),
    radial-gradient(ellipse at 100% 100%, rgba(255,138,0,.08), transparent 35%),
    linear-gradient(115deg, #171717 0%, #101010 58%, #15120c 100%);
  box-shadow: 0 18px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035);
}
#view-inicio .home-hero::before {
  top: -85%;
  right: 12%;
  width: 390px;
  height: 390px;
  background: radial-gradient(circle, rgba(245,183,0,.10), transparent 69%);
}
#view-inicio .home-hero-copy { max-width: 690px; z-index: 1; }
#view-inicio .home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 15px;
  color: #d9b74c;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
}
#view-inicio .home-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--home-gold);
  box-shadow: 0 0 14px rgba(245,183,0,.75);
}
#view-inicio .welcome-text h2 {
  max-width: 100%;
  margin: 0;
  color: #fff;
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3.2vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.13;
  overflow-wrap: anywhere;
}
#view-inicio .welcome-subtitle {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(245,183,0,.18);
  border-radius: 8px;
  background: rgba(245,183,0,.07);
  color: #e6c85f;
  font-size: .77rem;
  font-weight: 650;
}
#view-inicio .home-hero-description {
  max-width: 590px;
  margin: 13px 0 0;
  color: #b9b9b9;
  font-size: .92rem;
  line-height: 1.75;
}
#view-inicio .home-hero-mark {
  position: relative;
  display: flex;
  width: clamp(112px, 14vw, 168px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 3% 10px 18px;
  border: 1px solid rgba(245,183,0,.25);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(245,183,0,.09), rgba(255,138,0,.025));
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.012), 0 0 48px rgba(245,183,0,.055);
  color: var(--home-gold);
}
#view-inicio .home-hero-mark-ring {
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(245,183,0,.26);
  border-radius: 50%;
}
#view-inicio .home-hero-mark-main {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  font-weight: 900;
  letter-spacing: -.09em;
  line-height: 1;
}
#view-inicio .home-hero-mark-caption {
  margin-top: 7px;
  font-size: .54rem;
  font-weight: 800;
  letter-spacing: .3em;
}
#view-inicio .home-hero-footer {
  position: absolute;
  right: 28px;
  bottom: 17px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #777;
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .14em;
}
#view-inicio .home-hero-line { width: 38px; height: 1px; background: linear-gradient(90deg, var(--home-gold), transparent); }
#view-inicio .stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
#view-inicio .stat-card {
  position: relative;
  min-height: 108px;
  padding: 17px 15px;
  gap: 12px;
  align-items: flex-start;
  border-color: var(--home-line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(30,30,30,.98), rgba(17,17,17,.98));
}
#view-inicio .stat-card::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  background: linear-gradient(90deg, rgba(245,183,0,.6), transparent 82%);
  content: "";
  opacity: .7;
}
#view-inicio .stat-card:hover { transform: translateY(-2px); border-color: rgba(245,183,0,.3); }
#view-inicio .stat-icon { width: 39px; height: 39px; border-radius: 11px; }
#view-inicio .stat-icon svg { width: 20px !important; height: 20px !important; }
#view-inicio .stat-details { gap: 6px; padding-top: 1px; }
#view-inicio .stat-value { font-size: clamp(1rem, 1.4vw, 1.3rem); letter-spacing: -.035em; line-height: 1.25; overflow-wrap: anywhere; }
#view-inicio .stat-label { font-size: .7rem; line-height: 1.45; }
#view-inicio .home-section-heading {
  align-items: flex-end;
  margin: 0 0 16px;
}
#view-inicio .home-section-heading h2 {
  color: #f6f6f6;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -.045em;
}
#view-inicio .home-section-heading p { max-width: 650px; line-height: 1.7; }
#view-inicio .home-section-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--home-line);
  border-radius: 9px;
  color: #888;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .11em;
}
#view-inicio .home-section-index strong { color: var(--home-gold); font-size: .85rem; }
#view-inicio .dashboard-main-panels { gap: 16px; margin-bottom: 28px; }
#view-inicio .dashboard-main-panels .dashboard-category-card {
  min-height: 208px;
  padding: 24px;
  border-color: rgba(255,255,255,.09);
  border-radius: 17px;
  background: linear-gradient(145deg, var(--panel-glow), rgba(20,20,20,.98) 68%);
}
#view-inicio .dashboard-main-panels .category-symbol { width: 46px; height: 46px; margin-bottom: 20px; font-size: 1.3rem; }
#view-inicio .dashboard-main-panels .category-card-title { font-family: var(--font-heading); font-size: 1.13rem; font-weight: 800; letter-spacing: -.025em; }
#view-inicio .dashboard-main-panels .category-card-description { max-width: 34ch; color: #aaa; font-size: .82rem; line-height: 1.7; }
#view-inicio .dashboard-main-panels .category-card-action { margin-top: auto; padding-top: 18px; font-size: .76rem; font-weight: 800; letter-spacing: .015em; }
#view-inicio .category-services { --panel-accent:#F5B700; --panel-glow:rgba(245,183,0,.095); }
#view-inicio .category-forms { --panel-accent:#FF8A00; --panel-glow:rgba(255,138,0,.085); }
#view-inicio .category-staff { --panel-accent:#e4c75c; --panel-glow:rgba(228,199,92,.075); }
#view-inicio .home-active-users {
  padding: 22px;
  border: 1px solid var(--home-line);
  border-radius: 17px;
  background: linear-gradient(145deg, #171717, #111);
}
#view-inicio .home-active-users-header {
  align-items: flex-start;
  margin-bottom: 17px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--home-line);
}
#view-inicio .home-active-users-header .eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #c4a444;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .13em;
}
#view-inicio .home-active-users-header h3 { margin: 0; color: #f4f4f4; font-size: 1.05rem; }
#view-inicio .home-active-users-header p { margin: 6px 0 0; color: #929292; font-size: .8rem; line-height: 1.5; }
#view-inicio .home-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid rgba(71,185,117,.2);
  border-radius: 7px;
  background: rgba(71,185,117,.06);
  color: #8cc9a4;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .08em;
}
#view-inicio .home-live-indicator > span { width: 6px; height: 6px; border-radius: 50%; background: #55bd7b; box-shadow: 0 0 10px rgba(85,189,123,.55); }
#view-inicio .home-active-users .roblox-users-list:empty { min-height: 12px; }
@media (max-width: 1200px) {
  #view-inicio .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  #view-inicio .home-hero-mark { width: 112px; margin-right: 0; }
  #view-inicio .dashboard-main-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-inicio .dashboard-main-panels > .category-staff { grid-column: 1 / -1; }
  #view-inicio .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #view-inicio .home-hero { min-height: 0; padding: 23px 19px 48px; }
  #view-inicio .home-hero-mark { display: none; }
  #view-inicio .home-eyebrow { font-size: .57rem; letter-spacing: .1em; }
  #view-inicio .home-hero-description { font-size: .84rem; }
  #view-inicio .home-hero-footer { right: 18px; bottom: 16px; left: 19px; font-size: .5rem; }
  #view-inicio .stats-grid { gap: 9px; }
  #view-inicio .stat-card { min-height: 96px; padding: 13px 11px; gap: 9px; }
  #view-inicio .stat-icon { width: 32px; height: 32px; }
  #view-inicio .stat-icon svg { width: 17px !important; height: 17px !important; }
  #view-inicio .stat-label { font-size: .65rem; }
  #view-inicio .home-section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  #view-inicio .home-section-index { align-self: flex-start; }
  #view-inicio .dashboard-main-panels { grid-template-columns: minmax(0,1fr); gap: 12px; }
  #view-inicio .dashboard-main-panels > .category-staff { grid-column: auto; }
  #view-inicio .dashboard-main-panels .dashboard-category-card { min-height: 175px; padding: 20px; }
  #view-inicio .home-active-users { padding: 17px; }
  #view-inicio .home-active-users-header { gap: 10px; }
  #view-inicio .home-live-indicator { padding: 6px 7px; font-size: .55rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #view-inicio .home-hero { min-height: 170px; padding: 20px 24px 40px; }
  #view-inicio .home-hero-mark { width: 94px; }
  #view-inicio .welcome-text h2 { font-size: 1.6rem; }
  #view-inicio .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #view-inicio .dashboard-main-panels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #view-inicio .dashboard-main-panels .dashboard-category-card { min-height: 155px; padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  #view-inicio .dashboard-category-card,
  #view-inicio .stat-card { transition: none; }
}


/* ==========================================================================
   Workspace polish + locked Fundación entry
   Scoped to dashboard panels; keeps the existing black/gold/orange identity.
   ========================================================================== */
.fundacion-entry.fundacion-locked {
  --panel-accent: #777b82 !important;
  --panel-glow: rgba(135,139,145,.055) !important;
  border-color: rgba(160,164,170,.16) !important;
  background: linear-gradient(145deg, rgba(95,99,105,.11), rgba(24,25,27,.96) 68%) !important;
  color: #9a9da3 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  filter: saturate(.18);
}
.fundacion-entry.fundacion-locked:hover { transform:none !important; border-color:rgba(160,164,170,.2) !important; box-shadow:none !important; }
.fundacion-entry.fundacion-locked .category-symbol {
  border-color:rgba(160,164,170,.16) !important;
  background:rgba(140,144,150,.07) !important;
  color:#858991 !important;
}
.fundacion-entry.fundacion-locked .category-card-title,
.fundacion-entry.fundacion-locked .category-card-description { color:#898c92 !important; }
.fundacion-entry .fundacion-action-locked { display:none; }
.fundacion-entry.fundacion-locked .fundacion-action-open { display:none; }
.fundacion-entry.fundacion-locked .fundacion-action-locked {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border:1px solid rgba(160,164,170,.2);
  border-radius:8px;
  background:rgba(120,124,130,.08);
  color:#b2b5bb;
  font-size:.7rem;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.fundacion-entry.fundacion-locked .fundacion-action-locked [aria-hidden="true"] { font-size:.8rem; }

/* Shared premium treatment for Services, Forms and Fundación workspaces. */
.content-section:not(#view-inicio) .workspace-panel-header {
  position:relative;
  margin:0 0 23px;
  padding:25px 25px 0;
  overflow:hidden;
  border:1px solid rgba(245,183,0,.19);
  border-radius:19px;
  background:
    radial-gradient(ellipse at 92% 0%, rgba(245,183,0,.09), transparent 34%),
    linear-gradient(135deg,#191919,#111 66%,#15120d);
  box-shadow:0 12px 32px rgba(0,0,0,.16),inset 0 1px 0 rgba(255,255,255,.025);
}
.content-section:not(#view-inicio) .workspace-panel-header::before {
  position:absolute;
  top:0;
  left:25px;
  right:25px;
  height:2px;
  content:"";
  background:linear-gradient(90deg,#F5B700,#FF8A00,transparent 82%);
}
.content-section:not(#view-inicio) .workspace-panel-copy .workspace-kicker {
  display:inline-block;
  margin-bottom:10px;
  color:#d5b34b;
  font-size:.64rem;
  font-weight:850;
  letter-spacing:.16em;
}
.content-section:not(#view-inicio) .workspace-panel-copy h2 {
  margin:0;
  color:#fafafa;
  font-size:clamp(1.45rem,2.6vw,2.05rem);
  font-weight:850;
  letter-spacing:-.045em;
  line-height:1.15;
}
.content-section:not(#view-inicio) .workspace-panel-copy p {
  max-width:68ch;
  margin:10px 0 0;
  color:#a8a8a8;
  font-size:.87rem;
  line-height:1.75;
}
.content-section:not(#view-inicio) .workspace-topnav {
  display:flex;
  gap:7px;
  margin-top:23px;
  padding:0 0 13px;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scrollbar-width:thin;
  scrollbar-color:rgba(245,183,0,.28) transparent;
}
.content-section:not(#view-inicio) .workspace-tab {
  position:relative;
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
  min-height:39px;
  padding:9px 13px;
  border:1px solid transparent;
  border-radius:10px;
  background:rgba(255,255,255,.025);
  color:#a6a6a6;
  font-size:.76rem;
  font-weight:750;
  text-decoration:none;
  white-space:nowrap;
  transition:background .18s,border-color .18s,color .18s;
}
.content-section:not(#view-inicio) .workspace-tab:hover {
  border-color:rgba(245,183,0,.18);
  background:rgba(245,183,0,.06);
  color:#f5d56b;
}
.content-section:not(#view-inicio) .workspace-tab.is-current,
.content-section:not(#view-inicio) .workspace-tab[aria-current="page"] {
  border-color:rgba(245,183,0,.23);
  background:linear-gradient(135deg,rgba(245,183,0,.15),rgba(255,138,0,.06));
  color:#f5cd4b;
}
.content-section:not(#view-inicio) .workspace-back-button {
  min-height:39px;
  border-color:rgba(245,183,0,.22);
  border-radius:10px;
  background:rgba(245,183,0,.055);
  color:#f3cd52;
}
.content-section:not(#view-inicio) .workspace-back-button:hover {
  transform:translateY(-1px);
  border-color:rgba(245,183,0,.4);
  background:rgba(245,183,0,.1);
}
.content-section:not(#view-inicio) > .card,
.content-section:not(#view-inicio) > .service-control-panel {
  border:1px solid rgba(255,255,255,.075);
  border-radius:17px;
  background:linear-gradient(145deg,rgba(26,26,26,.98),rgba(16,16,16,.98));
  box-shadow:0 12px 30px rgba(0,0,0,.13),inset 0 1px 0 rgba(255,255,255,.025);
}
.content-section:not(#view-inicio) > .card .card-header {
  gap:15px;
  padding-bottom:16px;
  border-bottom:1px solid rgba(255,255,255,.065);
}
.content-section:not(#view-inicio) > .card .card-header h2,
.content-section:not(#view-inicio) > .card .card-header h3 {
  color:#f6f6f6;
  font-weight:800;
  letter-spacing:-.025em;
}
.content-section:not(#view-inicio) > .card .card-header p {
  max-width:75ch;
  line-height:1.7;
}
.content-section:not(#view-inicio) .table-responsive {
  border:1px solid rgba(255,255,255,.065);
  border-radius:12px;
  overflow-x:auto;
}
.content-section:not(#view-inicio) .table thead th {
  background:rgba(245,183,0,.055);
  color:#d6bd69;
  font-size:.68rem;
  font-weight:850;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.content-section:not(#view-inicio) .table tbody tr:hover { background:rgba(255,255,255,.025); }
.content-section:not(#view-inicio) .form-control,
.content-section:not(#view-inicio) select.form-control,
.content-section:not(#view-inicio) textarea.form-control {
  min-height:42px;
  border-color:rgba(255,255,255,.12);
  border-radius:10px;
  background:#111;
}
.content-section:not(#view-inicio) .form-control:focus {
  border-color:rgba(245,183,0,.52);
  box-shadow:0 0 0 3px rgba(245,183,0,.08);
}
.content-section:not(#view-inicio) .btn { border-radius:10px; font-weight:750; }
.content-section:not(#view-inicio) .btn-primary {
  border-color:#dca500;
  background:linear-gradient(135deg,#F5B700,#d98a00);
  color:#17130a;
  box-shadow:0 5px 14px rgba(245,183,0,.09);
}
.content-section:not(#view-inicio) .btn-primary:hover { filter:brightness(1.06); transform:translateY(-1px); }
#view-servicios .service-control-panel { overflow:hidden; }
#view-servicios .service-control-header { align-items:center; }
#view-servicios .service-form { padding-top:20px; }
#view-formularios .convocations-grid { gap:16px; }
#view-formularios .convocation-card {
  overflow:hidden;
  border-color:rgba(255,255,255,.09);
  border-radius:15px;
  background:linear-gradient(150deg,#1b1b1b,#111);
  box-shadow:0 9px 24px rgba(0,0,0,.15);
}
#view-formularios .convocation-card:hover {
  border-color:rgba(245,183,0,.32);
  box-shadow:0 15px 34px rgba(0,0,0,.23);
}
#view-formularios .convocation-body { padding:21px; gap:12px; }
#view-formularios .convocation-body h3 { color:#f5f5f5; font-size:1.04rem; font-weight:800; }
#view-admin-status .card-section,
#view-admin-services .card-section,
#view-admin-convocatorias .card-section,
#view-admin-plantillas .card-section,
#view-admin-solicitudes .card-section { padding:clamp(16px,2.2vw,25px); }
.content-section:not(#view-inicio) .action-bar { gap:12px; flex-wrap:wrap; }
.content-section:not(#view-inicio) .filter-bar { align-items:center; flex-wrap:wrap; }
@media (max-width: 768px) {
  .content-section:not(#view-inicio) .workspace-panel-header { padding:20px 16px 0; }
  .content-section:not(#view-inicio) .workspace-panel-heading-row { align-items:flex-start; flex-direction:column; gap:13px; }
  .content-section:not(#view-inicio) .workspace-back-button { align-self:flex-start; }
  .content-section:not(#view-inicio) .workspace-topnav { margin-top:18px; margin-right:-2px; }
  .content-section:not(#view-inicio) .workspace-tab { min-height:38px; padding:9px 11px; font-size:.72rem; }
  .content-section:not(#view-inicio) > .card .card-header { align-items:flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .content-section:not(#view-inicio) .workspace-tab,
  .content-section:not(#view-inicio) .workspace-back-button,
  .content-section:not(#view-inicio) .btn { transition:none; }
}


/* Fix: nested action labels in the Fundación card were inheriting the
   generic circular-arrow styles from .category-card-action span. */
#view-inicio .fundacion-entry .category-card-action {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  min-width:0;
}
#view-inicio .fundacion-entry .category-card-action > .fundacion-action-open,
#view-inicio .fundacion-entry .category-card-action > .fundacion-action-locked {
  display:inline-flex;
  width:auto;
  height:auto;
  min-width:0;
  max-width:100%;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:0;
  border-radius:0;
  background:transparent;
  font-size:inherit;
  line-height:1.35;
  white-space:normal;
  transform:none;
}
#view-inicio .fundacion-entry .category-card-action .fundacion-action-open > span {
  display:grid;
  width:28px;
  height:28px;
  flex:0 0 28px;
  place-items:center;
  border:1px solid rgba(255,255,255,.08);
  border-radius:50%;
  background:rgba(255,255,255,.035);
  font-size:1rem;
}
#view-inicio .fundacion-entry.fundacion-locked .category-card-action > .fundacion-action-locked {
  padding:7px 11px;
  border:1px solid rgba(160,164,170,.2);
  border-radius:8px;
  background:rgba(120,124,130,.08);
  color:#b2b5bb;
  font-size:.7rem;
  font-weight:850;
  letter-spacing:.08em;
  line-height:1.2;
  text-transform:uppercase;
}
#view-inicio .fundacion-entry .category-card-action .fundacion-action-locked > span[aria-hidden="true"] {
  display:inline;
  width:auto;
  height:auto;
  flex:0 0 auto;
  border:0;
  border-radius:0;
  background:transparent;
  font-size:.8rem;
}
#view-inicio .fundacion-entry .category-card-action > .fundacion-action-open { display:inline-flex; }
#view-inicio .fundacion-entry.fundacion-locked .category-card-action > .fundacion-action-open { display:none; }
#view-inicio .fundacion-entry .category-card-action > .fundacion-action-locked { display:none; }
#view-inicio .fundacion-entry.fundacion-locked .category-card-action > .fundacion-action-locked { display:inline-flex; }
@media (max-width: 560px) {
  #view-inicio .fundacion-entry .category-card-action { align-items:flex-start; }
  #view-inicio .fundacion-entry.fundacion-locked .category-card-action > .fundacion-action-locked { padding:7px 9px; }
}


/* ==========================================================================
   LOGIN SCREEN REFRESH — Cartagena Roleplay
   Premium institutional style, accessible contrast and mobile-safe layout.
   ========================================================================== */
.login-body {
  position:relative;
  min-height:100svh;
  overflow-x:hidden;
  overflow-y:auto;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(245,183,0,.085), transparent 32%),
    radial-gradient(ellipse at 88% 82%, rgba(255,138,0,.055), transparent 30%),
    linear-gradient(135deg,#090909 0%,#111 52%,#0b0b0b 100%);
}
.login-body::before {
  position:fixed;
  inset:0;
  content:"";
  pointer-events:none;
  opacity:.35;
  background:linear-gradient(115deg,transparent 0 49.8%,rgba(245,183,0,.045) 50%,transparent 50.2%);
}
.login-glow {
  top:-30%;
  left:50%;
  width:min(780px,100vw);
  height:min(780px,100vw);
  background:radial-gradient(circle,rgba(245,183,0,.16) 0%,rgba(255,138,0,.055) 42%,transparent 70%);
  filter:blur(38px);
  animation:glowPulse 9s ease-in-out infinite;
}
.login-grid {
  background-image:
    linear-gradient(rgba(245,183,0,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(245,183,0,.035) 1px,transparent 1px);
  background-size:56px 56px;
  mask-image:radial-gradient(ellipse at 50% 45%,#000 0%,transparent 76%);
  -webkit-mask-image:radial-gradient(ellipse at 50% 45%,#000 0%,transparent 76%);
}
.login-page {
  min-height:100svh;
  gap:22px;
  padding:clamp(22px,5vh,52px) 18px 24px;
}
.login-card {
  position:relative;
  isolation:isolate;
  max-width:468px;
  padding:clamp(28px,5vw,46px) clamp(22px,5vw,42px) 34px;
  overflow:hidden;
  border:1px solid rgba(245,183,0,.2);
  border-top:0;
  border-radius:22px;
  background:
    radial-gradient(ellipse at 50% 0%,rgba(245,183,0,.075),transparent 38%),
    linear-gradient(155deg,rgba(28,28,28,.97),rgba(14,14,14,.985) 72%);
  box-shadow:0 30px 90px rgba(0,0,0,.58),inset 0 1px 0 rgba(255,255,255,.035);
  animation:loginCardIn .65s cubic-bezier(.22,1,.36,1) both;
}
.login-card::before {
  position:absolute;
  z-index:-1;
  top:0;
  left:10%;
  right:10%;
  height:2px;
  content:"";
  background:linear-gradient(90deg,transparent,#F5B700 28%,#FF8A00 72%,transparent);
}
.login-card::after {
  position:absolute;
  z-index:-1;
  top:-110px;
  right:-110px;
  width:220px;
  height:220px;
  content:"";
  border:1px solid rgba(245,183,0,.055);
  border-radius:50%;
  box-shadow:0 0 0 22px rgba(245,183,0,.018),0 0 0 46px rgba(245,183,0,.012);
  pointer-events:none;
}
.login-logo-wrap {
  width:112px;
  height:112px;
  align-items:center;
  justify-content:center;
  margin:0 auto 24px;
  border:1px solid rgba(245,183,0,.22);
  border-radius:50%;
  background:linear-gradient(145deg,rgba(245,183,0,.09),rgba(255,138,0,.025));
  box-shadow:0 0 34px rgba(245,183,0,.055),inset 0 1px 0 rgba(255,255,255,.035);
}
.login-logo {
  width:78px;
  height:78px;
  filter:drop-shadow(0 5px 16px rgba(245,183,0,.23));
  animation:logoFloat 6s ease-in-out infinite;
}
.login-title {
  margin:0;
  color:#f6ce52;
  font-size:clamp(1.25rem,4.5vw,1.62rem);
  font-weight:900;
  letter-spacing:.035em;
  line-height:1.2;
  overflow-wrap:anywhere;
}
.login-subtitle {
  display:inline-flex;
  margin-top:11px;
  padding:7px 11px;
  border:1px solid rgba(245,183,0,.18);
  border-radius:8px;
  background:rgba(245,183,0,.055);
  color:#bdb7a5;
  font-size:.66rem;
  font-weight:800;
  letter-spacing:.19em;
}
.login-desc {
  max-width:35ch;
  margin:22px auto 0;
  color:#b4b4b4;
  font-size:.91rem;
  line-height:1.8;
}
.login-btn {
  display:flex;
  min-height:54px;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-top:27px;
  padding:14px 18px;
  border:1px solid rgba(245,183,0,.32);
  border-radius:12px;
  background:linear-gradient(110deg,#f5b700 0%,#e8a600 56%,#d98a00 100%);
  box-shadow:0 10px 24px rgba(245,183,0,.12),inset 0 1px 0 rgba(255,255,255,.22);
  color:#17130a;
  font-size:.91rem;
  font-weight:850;
  text-decoration:none;
  transition:transform .2s ease,filter .2s ease,box-shadow .2s ease;
}
.login-btn .discord-icon {
  width:21px;
  height:21px;
  flex:0 0 auto;
}
.login-btn:hover {
  transform:translateY(-2px);
  filter:brightness(1.055);
  box-shadow:0 14px 30px rgba(245,183,0,.18),inset 0 1px 0 rgba(255,255,255,.24);
}
.login-btn:focus-visible {
  outline:3px solid rgba(245,183,0,.7);
  outline-offset:4px;
}
.login-note {
  max-width:39ch;
  margin:20px auto 0;
  color:#858585;
  font-size:.74rem;
  line-height:1.75;
}
.login-footer {
  flex-wrap:wrap;
  justify-content:center;
  gap:9px;
  color:#777;
  font-size:.63rem;
  font-weight:700;
  letter-spacing:.1em;
  line-height:1.7;
  text-align:center;
}
.login-footer-dot { color:#d5a600; }
@media (max-width:480px) {
  .login-page { justify-content:center; gap:18px; padding:20px 14px; }
  .login-card { max-width:420px; padding:28px 21px 25px; border-radius:18px; }
  .login-logo-wrap { width:92px; height:92px; margin-bottom:20px; }
  .login-logo { width:65px; height:65px; }
  .login-desc { margin-top:18px; font-size:.85rem; }
  .login-btn { min-height:51px; margin-top:23px; font-size:.86rem; }
  .login-note { margin-top:17px; font-size:.7rem; }
  .login-footer { font-size:.57rem; }
}
@media (max-height:650px) and (min-width:481px) {
  .login-page { justify-content:flex-start; gap:14px; padding-top:18px; }
  .login-card { padding-top:23px; padding-bottom:22px; }
  .login-logo-wrap { width:78px; height:78px; margin-bottom:15px; }
  .login-logo { width:57px; height:57px; }
  .login-desc { margin-top:15px; }
  .login-btn { margin-top:18px; }
  .login-note { margin-top:14px; }
}
@media (prefers-reduced-motion:reduce) {
  .login-glow,.login-logo { animation:none; }
  .login-card { animation:none; }
  .login-btn { transition:none; }
  .login-btn:hover { transform:none; }
}


/* Ocultar la barra superior completa al desplazarse hacia abajo. */
.main-content > .topbar {
  position: relative;
  z-index: 30;
  transform: translateY(0);
  opacity: 1;
  transition: transform 220ms ease, opacity 180ms ease, visibility 180ms ease;
  will-change: transform, opacity;
}

.main-content > .topbar.topbar--hidden-on-scroll {
  transform: translateY(calc(-100% - 12px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .main-content > .topbar {
    transition: none;
  }
}


/* Categorías de inicio: cuatro tarjetas iguales en una única fila en todos los tamaños. */
#view-inicio .dashboard-main-panels {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: 260px !important;
  grid-auto-flow: column;
  align-items: stretch;
  gap: clamp(10px, 1.2vw, 18px);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

#view-inicio .dashboard-main-panels > .dashboard-category-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 260px !important;
  height: 260px !important;
  max-height: 260px;
  display: flex;
  flex-direction: column;
}

#view-inicio .dashboard-main-panels > .dashboard-category-card .category-card-description {
  flex: 1 1 auto;
}

#view-inicio .dashboard-main-panels > .dashboard-category-card .category-card-action {
  margin-top: auto;
}

@media (max-width: 560px) {
  #view-inicio .dashboard-main-panels {
    grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
    grid-template-rows: 260px !important;
  }
}


/* Fuerza dimensiones idénticas para los cuatro accesos principales. */
#view-inicio .dashboard-category-grid.dashboard-main-panels {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: 260px !important;
  grid-auto-columns: minmax(0, 1fr) !important;
  grid-auto-flow: row !important;
  align-items: stretch !important;
  gap: 18px !important;
  width: 100%;
  overflow-x: visible;
}

#view-inicio .dashboard-category-grid.dashboard-main-panels > .dashboard-category-card {
  grid-column: auto !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 260px !important;
  height: 260px !important;
  max-height: 260px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

#view-inicio .dashboard-category-grid.dashboard-main-panels > .dashboard-category-card .category-card-description {
  flex: 1 1 auto;
}

#view-inicio .dashboard-category-grid.dashboard-main-panels > .dashboard-category-card .category-card-action {
  margin-top: auto;
}

@media (max-width: 900px) {
  #view-inicio .dashboard-category-grid.dashboard-main-panels {
    grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
    overflow-x: auto;
  }
}


/* Marca Cartagena Roleplay en la barra superior. */
.main-content > .topbar .topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.main-content > .topbar .topbar-brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid rgba(245, 183, 0, .32);
  background: #111111;
  padding: 3px;
  box-sizing: border-box;
}

.main-content > .topbar #page-heading {
  min-width: 0;
}

@media (max-width: 600px) {
  .main-content > .topbar .topbar-brand-logo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .main-content > .topbar .topbar-title {
    gap: 8px;
  }
}


/* Enlaces para volver a la landing pública desde login y dashboard. */
.return-home-link,
.dashboard-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #f5b700;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.return-home-link {
  margin: 20px auto 0;
  padding: 10px 14px;
  border: 1px solid rgba(245, 183, 0, .35);
  border-radius: 6px;
}
.return-home-link:hover,
.dashboard-home-link:hover {
  color: #ff8a00;
}
.return-home-link:hover {
  border-color: #ff8a00;
  background: rgba(245, 183, 0, .06);
}
.login-card .return-home-link {
  align-self: center;
}
.topbar-actions .dashboard-home-link {
  padding: 10px 12px;
  border: 1px solid rgba(245, 183, 0, .32);
  border-radius: 8px;
  background: rgba(245, 183, 0, .05);
  white-space: nowrap;
}
.topbar-actions .dashboard-home-link:hover {
  border-color: #ff8a00;
  background: rgba(255, 138, 0, .08);
}
@media (max-width: 760px) {
  .topbar-actions .dashboard-home-link {
    padding: 8px 9px;
    font-size: 11px;
    white-space: normal;
    text-align: center;
  }
}


/* Refinamiento visual de los enlaces existentes: más contraste y mejor alineación. */
.return-home-link,
.dashboard-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffd34a;
  background: linear-gradient(120deg, rgba(245, 183, 0, .14), rgba(255, 138, 0, .045));
  border: 1px solid rgba(245, 183, 0, .48);
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .025em;
  line-height: 1.25;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.return-home-link {
  width: fit-content;
  max-width: 100%;
  margin: 22px auto 0;
  padding: 12px 18px;
}
.return-home-link:hover,
.dashboard-home-link:hover {
  color: #080808;
  border-color: #ff8a00;
  background: linear-gradient(115deg, #ffd34a, #f5b700 55%, #ff8a00);
  box-shadow: 0 8px 22px rgba(245, 183, 0, .16);
  transform: translateY(-1px);
}
.return-home-link:focus-visible,
.dashboard-home-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.login-card .return-home-link { align-self: center; }
.topbar-actions .dashboard-home-link {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 10px 15px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .topbar-actions .dashboard-home-link {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 10px;
    white-space: normal;
    text-align: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .return-home-link, .dashboard-home-link { transition: none; }
}


/* ============================================================
   CARTAGENA ROLEPLAY — REDISEÑO VISUAL GLOBAL
   Paleta: carbón, marfil cálido, oro y cobre. Solo presentación.
   ============================================================ */
:root {
  --cr-ink: #0b0b0a;
  --cr-surface: #131311;
  --cr-surface-raised: #1b1a17;
  --cr-border: #343027;
  --cr-gold: #e7b84b;
  --cr-gold-bright: #ffd778;
  --cr-copper: #d97736;
  --cr-text: #f5f0e6;
  --cr-muted: #aaa397;
}
body {
  background: var(--cr-ink);
  color: var(--cr-text);
}
#app, .dashboard-wrapper, .main-content {
  background-color: var(--cr-ink);
}
.main-content > .topbar,
.topbar {
  background: linear-gradient(110deg, #151512 0%, #10100f 62%, #1d1810 100%);
  border: 1px solid #302a1c;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
}
.main-content > .topbar #page-heading,
.topbar-title h1 {
  color: #fff8e9;
  letter-spacing: -.035em;
}
.sidebar,
.sidebar-nav,
.workspace-sidebar {
  background: #10100e;
  border-color: #302d25;
}
.sidebar .nav-item,
.sidebar-nav .nav-item,
.workspace-tab {
  border-radius: 9px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.sidebar .nav-item.active,
.sidebar-nav .nav-item.active,
.workspace-tab.active {
  color: #ffe4a0;
  background: linear-gradient(100deg, rgba(231,184,75,.17), rgba(217,119,54,.07));
  border-color: rgba(231,184,75,.32);
}
.content-section .card,
.stat-card,
.dashboard-category-card,
.modal-card,
.panel-card,
.table-container {
  background: linear-gradient(145deg, #171715 0%, #121211 100%);
  border-color: #302d26;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}
.welcome-hero,
.home-hero {
  background:
    radial-gradient(ellipse at 88% 5%, rgba(217,119,54,.16), transparent 34%),
    radial-gradient(ellipse at 72% 0%, rgba(231,184,75,.12), transparent 43%),
    linear-gradient(115deg, #171715 0%, #111110 60%, #1d1810 100%);
  border: 1px solid #5c4823;
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(0,0,0,.2);
}
.welcome-hero h2,
.home-hero h2,
.content-section h2,
.content-section h3 {
  color: #fff8e9;
}
.stat-card,
.dashboard-category-card {
  border-top-color: rgba(231,184,75,.62);
}
.stat-icon.gold,
.stat-icon.orange,
.category-card-icon {
  background: rgba(231,184,75,.1);
  border: 1px solid rgba(231,184,75,.2);
  color: var(--cr-gold-bright);
  border-radius: 11px;
}
.btn-primary,
.button-primary,
.btn-gold,
.category-card-action,
.topbar-actions .dashboard-home-link {
  color: #1b160b;
  background: linear-gradient(115deg, #f5d27c, #e7b84b 58%, #d97736);
  border: 1px solid #f0c665;
  box-shadow: 0 6px 18px rgba(231,184,75,.12);
  font-weight: 800;
}
.btn-primary:hover,
.button-primary:hover,
.btn-gold:hover,
.category-card-action:hover,
.topbar-actions .dashboard-home-link:hover {
  color: #100e09;
  background: linear-gradient(115deg, #ffe8a7, #f0c665 55%, #e58b4a);
  border-color: #ffe8a7;
}
.btn-outline,
.btn-secondary,
.btn-outline-danger,
.btn-discord {
  border-radius: 9px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #ffd778;
  outline-offset: 3px;
}
input.form-control,
select.form-control,
textarea.form-control,
.form-control {
  background: #0e0e0c;
  color: #f5f0e6;
  border-color: #3b362a;
  border-radius: 9px;
}
input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus,
.form-control:focus {
  border-color: #d5a744;
  box-shadow: 0 0 0 3px rgba(231,184,75,.12);
}
table thead th,
.table thead th {
  color: #f3d58d;
  background: #1c1a15;
}
table tbody tr:hover,
.table tbody tr:hover {
  background: rgba(231,184,75,.045);
}
.badge-success,
.status-online {
  filter: saturate(.8);
}
.return-home-link,
.dashboard-home-link {
  color: #f7d98d;
  background: linear-gradient(120deg, rgba(231,184,75,.13), rgba(217,119,54,.05));
  border: 1px solid rgba(231,184,75,.45);
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: .015em;
  transition: all .18s ease;
}
.return-home-link:hover,
.dashboard-home-link:hover {
  color: #15110a;
  background: linear-gradient(115deg, #f5d27c, #e7b84b 58%, #d97736);
  border-color: #f5d27c;
  box-shadow: 0 8px 20px rgba(231,184,75,.14);
}
.login-body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(217,119,54,.13), transparent 45%),
    radial-gradient(ellipse at 12% 100%, rgba(231,184,75,.08), transparent 42%),
    #0b0b0a;
}
.login-grid {
  opacity: .55;
  background-image: linear-gradient(rgba(231,184,75,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(231,184,75,.025) 1px, transparent 1px);
}
.login-card {
  background: linear-gradient(145deg, rgba(27,26,23,.98), rgba(15,15,13,.99));
  border: 1px solid #443922;
  border-top: 2px solid #e7b84b;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0,0,0,.48), 0 0 45px rgba(217,119,54,.045);
}
.login-title { color: #fff8e9; }
.login-subtitle { color: #e7b84b; }
.login-desc, .login-note { color: #b8b0a0; }
.login-btn {
  background: linear-gradient(115deg, #f5d27c, #e7b84b 58%, #d97736);
  border: 1px solid #f0c665;
  color: #17120a;
  font-weight: 800;
}
.login-btn:hover {
  background: linear-gradient(115deg, #ffe8a7, #f0c665 55%, #e58b4a);
  color: #100e09;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* ============================================================
   CR DESIGN SYSTEM — dashboard + login
   Repair category-card actions before applying visual tokens.
   ============================================================ */
:root {
  --bg-primary: #0b0d10;
  --bg-secondary: #111419;
  --bg-card: #191d23;
  --bg-hover: #222831;
  --border-color: #303640;
  --gold-primary: #f0b94b;
  --gold-dark: #b9852e;
  --orange-primary: #ed8738;
  --text-white: #f4f1e9;
  --text-muted: #a5aab4;
  --text-soft: #d1d2d3;
  --danger: #df565b;
  --success: #2bbd91;
  --info: #7c9fbe;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Montserrat', 'Inter', system-ui, sans-serif;
  --gold-soft: rgba(240,185,75,.08);
  --gold-soft-strong: rgba(240,185,75,.15);
  --gold-border: rgba(240,185,75,.34);
  --focus-ring: 0 0 0 3px rgba(240,185,75,.24);
  --shadow-gold: 0 8px 26px rgba(240,185,75,.08);
}
body {
  background:
    radial-gradient(ellipse at 78% 0%, rgba(237,135,56,.055), transparent 35%),
    #0b0d10;
  color: var(--text-white);
  font-family: var(--font-family);
}
#app, .dashboard-wrapper, .main-content { background: transparent; }
h1,h2,h3,h4,h5,h6,.btn,.tab-btn,.nav-item,.workspace-tab {
  font-family: var(--font-heading);
}
.main-content > .topbar, .topbar {
  background: linear-gradient(110deg, #15191f 0%, #101318 68%, #201a13 100%);
  border: 1px solid #303640;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.main-content > .topbar #page-heading { color: #f4f1e9; }
.sidebar, .sidebar-nav, .workspace-sidebar {
  background: #101318;
  border-color: #2d333d;
}
.sidebar .nav-item, .sidebar-nav .nav-item, .workspace-tab {
  color: #b3b8c1;
  border-radius: 9px;
}
.sidebar .nav-item:hover, .sidebar-nav .nav-item:hover, .workspace-tab:hover {
  color: #fff1ce;
  background: rgba(240,185,75,.075);
}
.sidebar .nav-item.active, .sidebar-nav .nav-item.active, .workspace-tab.active {
  color: #ffdfa0;
  background: linear-gradient(100deg, rgba(240,185,75,.16), rgba(237,135,56,.055));
  border-color: rgba(240,185,75,.3);
}
.content-section .card, .stat-card, .modal-card, .panel-card, .table-container {
  background: linear-gradient(145deg, #191d23, #13171c);
  border: 1px solid #303640;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}
#view-inicio .welcome-hero, #view-inicio .home-hero {
  background:
    radial-gradient(ellipse at 88% 8%, rgba(237,135,56,.15), transparent 34%),
    radial-gradient(ellipse at 70% 0%, rgba(240,185,75,.09), transparent 42%),
    linear-gradient(115deg, #20232a, #14181e 62%, #211a13);
  border: 1px solid #3b3b39;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.2);
}
#view-inicio .dashboard-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
#view-inicio .dashboard-main-panels > .dashboard-category-card {
  grid-column: auto;
  display: flex;
  min-width: 0;
  min-height: 198px;
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  overflow: hidden;
  color: #f4f1e9;
  text-decoration: none;
  border: 1px solid #303640;
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 100% 0%, var(--panel-glow, rgba(240,185,75,.08)), transparent 48%),
    linear-gradient(145deg, #1b2026, #12161b);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
#view-inicio .dashboard-main-panels > .dashboard-category-card::before {
  top: 0;
  bottom: auto;
  left: 20px;
  right: 20px;
  width: auto;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--panel-accent), transparent);
  opacity: .9;
}
#view-inicio .dashboard-main-panels > .dashboard-category-card::after {
  z-index: 0;
  top: auto;
  right: -42px;
  bottom: -48px;
  width: 128px;
  height: 128px;
  border: 1px solid color-mix(in srgb, var(--panel-accent) 18%, transparent);
  border-radius: 50%;
  background: transparent;
  filter: none;
  pointer-events: none;
}
#view-inicio .dashboard-main-panels > .dashboard-category-card > * {
  position: relative;
  z-index: 1;
}
#view-inicio .dashboard-main-panels > .dashboard-category-card:nth-child(1) { --panel-accent: #34c6a0; --panel-glow: rgba(52,198,160,.11); }
#view-inicio .dashboard-main-panels > .dashboard-category-card:nth-child(2) { --panel-accent: #e9b04b; --panel-glow: rgba(233,176,75,.10); }
#view-inicio .dashboard-main-panels > .dashboard-category-card:nth-child(3) { --panel-accent: #e68b47; --panel-glow: rgba(230,139,71,.09); }
#view-inicio .dashboard-main-panels > .dashboard-category-card:nth-child(4) { --panel-accent: #7e9ec5; --panel-glow: rgba(126,158,197,.08); }
#view-inicio .dashboard-main-panels > .dashboard-category-card:hover:not([aria-disabled="true"]) {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--panel-accent) 50%, #303640);
  box-shadow: 0 15px 32px rgba(0,0,0,.24);
  color: #fff;
}
#view-inicio .dashboard-main-panels > .dashboard-category-card:focus-visible {
  outline: 2px solid var(--panel-accent);
  outline-offset: 3px;
}
#view-inicio .dashboard-main-panels .category-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  margin: 0 0 16px;
  border: 1px solid color-mix(in srgb, var(--panel-accent) 28%, transparent);
  border-radius: 12px;
  background: var(--panel-glow);
  color: var(--panel-accent);
  font-size: 1.25rem;
}
#view-inicio .dashboard-main-panels .category-card-title {
  display: block;
  margin: 0 0 7px;
  color: #f4f1e9;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}
#view-inicio .dashboard-main-panels .category-card-description {
  display: block;
  max-width: 34ch;
  margin: 0;
  color: #aab0ba;
  font-size: .78rem;
  line-height: 1.55;
}
#view-inicio .dashboard-main-panels .category-card-action {
  display: flex !important;
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: auto 0 0;
  padding: 15px 0 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--panel-accent);
  font-family: var(--font-heading);
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .01em;
}
#view-inicio .dashboard-main-panels .category-card-action > span:not(.fundacion-action-open):not(.fundacion-action-locked) {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
  background: rgba(255,255,255,.035);
  color: #c8cbd0;
  font-size: 1rem;
  transition: transform .18s ease, background .18s ease;
}
#view-inicio .dashboard-main-panels > .dashboard-category-card:hover .category-card-action > span:not(.fundacion-action-open):not(.fundacion-action-locked) {
  transform: translate(2px,-1px);
  background: rgba(255,255,255,.08);
}
#view-inicio .dashboard-main-panels .fundacion-entry .category-card-action > .fundacion-action-open,
#view-inicio .dashboard-main-panels .fundacion-entry .category-card-action > .fundacion-action-locked {
  display: inline-flex;
  width: auto;
  height: auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
#view-inicio .dashboard-main-panels .fundacion-entry .category-card-action .fundacion-action-open > span,
#view-inicio .dashboard-main-panels .fundacion-entry .category-card-action .fundacion-action-locked > span {
  display: inline;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
}
#view-inicio .dashboard-main-panels .category-coming-soon {
  cursor: default;
  opacity: .76;
}
.btn-primary {
  color: #17140c;
  border-color: #e9bc61;
  background: linear-gradient(115deg, #f5d58e, #e9b04b 60%, #dc8544);
  box-shadow: 0 5px 16px rgba(233,176,75,.1);
}
.btn-primary:hover:not(:disabled) {
  color: #14110b;
  background: linear-gradient(115deg, #ffe7b0, #f2c46b 60%, #e99a59);
  box-shadow: 0 8px 22px rgba(233,176,75,.17);
}
.btn-discord {
  background: #242a33;
  color: #f4f1e9;
  border-color: #424956;
}
.btn-discord:hover:not(:disabled) { background: #303844; color: #fff; }
.btn-outline, .btn-secondary {
  color: #e2e4e8;
  background: #1a1e24;
  border-color: #3b424c;
}
.btn-outline:hover:not(:disabled), .btn-secondary:hover:not(:disabled) {
  color: #ffe3a1;
  background: #252a31;
  border-color: #c79b47;
}
.btn-danger, .btn-outline-danger {
  border-radius: 9px;
}
input.form-control, select.form-control, textarea.form-control, .form-control {
  color: #f4f1e9;
  background: #101318;
  border-color: #343b46;
  border-radius: 9px;
}
input.form-control:focus, select.form-control:focus, textarea.form-control:focus, .form-control:focus {
  border-color: #d9ad53;
  box-shadow: 0 0 0 3px rgba(233,176,75,.12);
}
.table thead th, table thead th { color: #f4d89b; background: #20232a; }
.table tbody tr:hover, table tbody tr:hover { background: rgba(233,176,75,.045); }
.login-body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(237,135,56,.13), transparent 43%),
    radial-gradient(ellipse at 10% 100%, rgba(240,185,75,.07), transparent 40%),
    #0b0d10;
}
.login-grid {
  opacity: .42;
  background-image: linear-gradient(rgba(240,185,75,.026) 1px, transparent 1px), linear-gradient(90deg, rgba(240,185,75,.026) 1px, transparent 1px);
}
.login-card {
  background: linear-gradient(145deg, rgba(28,32,39,.98), rgba(16,19,24,.99));
  border: 1px solid #353a43;
  border-top: 2px solid #e9b04b;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0,0,0,.48), 0 0 42px rgba(237,135,56,.045);
}
.login-title { color: #f4f1e9; }
.login-subtitle { color: #e9b04b; }
.login-desc, .login-note { color: #aeb3bc; }
.login-btn {
  background: linear-gradient(115deg, #f5d58e, #e9b04b 60%, #dc8544);
  border: 1px solid #e9bc61;
  color: #17140c;
  font-weight: 800;
}
.login-btn:hover { background: linear-gradient(115deg, #ffe7b0, #f2c46b 60%, #e99a59); color: #14110b; }
.return-home-link, .dashboard-home-link {
  color: #f1d18a;
  background: rgba(233,176,75,.07);
  border-color: rgba(233,176,75,.32);
}
.return-home-link:hover, .dashboard-home-link:hover {
  color: #ffe9b7;
  background: rgba(233,176,75,.13);
  border-color: #e9b04b;
}
@media (max-width: 900px) {
  #view-inicio .dashboard-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #view-inicio .dashboard-category-grid { grid-template-columns: minmax(0, 1fr); }
  #view-inicio .dashboard-main-panels > .dashboard-category-card { min-height: 168px; padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  #view-inicio .dashboard-main-panels > .dashboard-category-card,
  #view-inicio .dashboard-main-panels .category-card-action > span { transition: none; }
}


/* Estado Fundación: la etiqueta depende del permiso real, no de estilos heredados. */
#view-inicio .fundacion-entry.fundacion-authorized .fundacion-action-open { display: inline-flex !important; }
#view-inicio .fundacion-entry.fundacion-authorized .fundacion-action-locked { display: none !important; }
#view-inicio .fundacion-entry.fundacion-locked .fundacion-action-open { display: none !important; }
#view-inicio .fundacion-entry.fundacion-locked .fundacion-action-locked { display: inline-flex !important; }
#view-inicio .fundacion-entry .fundacion-action-open[hidden],
#view-inicio .fundacion-entry .fundacion-action-locked[hidden] { display: none !important; }


/* Responsive refinements: preserve the existing layout and section order. */
html, body, #app, .main-content, .content-section { min-width: 0; }
img, svg, video, canvas { max-width: 100%; }
.table-responsive { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
input, select, textarea, button { max-width: 100%; }
.topbar, .topbar-actions, .topbar-title, .workspace-panel-heading-row,
.service-control-header, .card-header, .filter-bar, .form-row { min-width: 0; }
.topbar-title h1 { overflow-wrap: anywhere; }
.content-section { width: 100%; }
.dashboard-category-card { cursor: pointer; }
.dashboard-category-card[aria-disabled="true"], .dashboard-category-card.category-coming-soon { cursor: not-allowed; }
#view-inicio .dashboard-main-panels .category-card-action { justify-content: flex-end; }
#view-inicio .dashboard-main-panels .category-card-action > span:not(.fundacion-action-open):not(.fundacion-action-locked) { margin-left: auto; }
#view-inicio .dashboard-main-panels .fundacion-entry .category-card-action { justify-content: flex-end; }
#view-inicio .dashboard-main-panels .fundacion-entry .fundacion-action-open,
#view-inicio .dashboard-main-panels .fundacion-entry .fundacion-action-locked { margin-left: auto; }
@media (max-width: 1024px) {
  .topbar { gap: 14px; }
  .topbar-actions { gap: 10px; flex-wrap: wrap; }
  .topbar-title { flex: 1 1 260px; }
  .workspace-panel-heading-row { gap: 16px; }
  .workspace-panel-copy { min-width: 0; }
  .card, .card-section, .service-control-panel { min-width: 0; }
}
@media (max-width: 768px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px; }
  .topbar-actions { width: 100%; align-items: center; }
  .topbar-title { width: 100%; }
  .workspace-panel-heading-row { align-items: flex-start; flex-direction: column; }
  .workspace-back-button { align-self: flex-start; }
  .workspace-topnav { max-width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row, .filter-bar { flex-wrap: wrap; }
  .filter-bar > * { min-width: min(100%, 180px); }
  .card-header, .service-control-header { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .modal-dialog, .modal-content, .login-card { width: min(100%, 100%); max-width: 100%; }
}
@media (max-width: 560px) {
  .topbar { padding: 13px; }
  .topbar-title { gap: 10px; }
  .topbar-brand-logo { width: 38px; height: 38px; flex: 0 0 38px; }
  .topbar-title h1 { font-size: clamp(1rem, 4.2vw, 1.3rem); overflow-wrap: anywhere; }
  .topbar-actions { align-items: stretch; }
  .topbar-actions > * { max-width: 100%; }
  .dashboard-home-link { white-space: normal; }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  #view-inicio .home-hero { padding: 22px 18px; min-height: 0; }
  #view-inicio .home-hero h2 { font-size: clamp(1.65rem, 8vw, 2.3rem); overflow-wrap: anywhere; }
  #view-inicio .home-section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  #view-inicio .dashboard-main-panels { grid-template-columns: minmax(0, 1fr); }
  #view-inicio .dashboard-main-panels > .dashboard-category-card { min-height: 150px; padding: 18px; }
  .table { min-width: 680px; }
  .modal-overlay { padding: 12px; overflow-y: auto; }
  .modal-dialog { margin: 0 auto; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; }
  .filter-bar > * { width: 100%; min-width: 0; }
}
@media (min-width: 561px) and (max-width: 900px) {
  #view-inicio .dashboard-main-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-inicio .dashboard-main-panels > .dashboard-category-card { min-height: 188px; padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
