
/* CCU Competence Credit System - Emerald Matrix + Galactic Night Theme */

:root {
  --bg-main: #02040a;
  --bg-panel: rgba(3, 10, 25, 0.95);
  --bg-panel-soft: rgba(6, 18, 40, 0.9);
  --emerald: #24e59f;
  --emerald-soft: rgba(36, 229, 159, 0.16);
  --emerald-glow: 0 0 25px rgba(36, 229, 159, 0.9);
  --gold: #f5d26b;
  --danger: #ff4b81;
  --text-main: #f5f7ff;
  --text-soft: #9fa8c6;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent-neon: #4d7bff;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.75);
  --blur: 32px;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #05101f 0, #000 55%, #000 100%);
  color: var(--text-main);
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* GLOBAL STARFIELD BACKGROUND */
.matrix-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(circle at 10% 0%, rgba(36, 229, 159, 0.18) 0, transparent 35%),
    radial-gradient(circle at 90% 0%, rgba(77, 123, 255, 0.2) 0, transparent 40%),
    radial-gradient(circle at 50% 120%, rgba(245, 210, 107, 0.08) 0, transparent 55%),
    #000;
}

.matrix-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.24;
  background-image: linear-gradient(
      to bottom,
      rgba(36, 229, 159, 0.08) 0,
      transparent 60%
    );
  background-size: 2px 22px;
  mix-blend-mode: screen;
}

/* LAYOUT */
.ccu-shell {
  width: 100%;
  max-width: 1240px;
  margin: 32px auto;
  padding: 16px;
}

@media (max-width: 768px) {
  .ccu-shell {
    margin: 12px auto;
    padding: 12px;
  }
}

.card-glass {
  background: radial-gradient(circle at top left, rgba(36, 229, 159, 0.25), transparent 60%),
    radial-gradient(circle at bottom right, rgba(77, 123, 255, 0.25), transparent 65%),
    rgba(3, 10, 25, 0.94);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  padding: 28px 26px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(var(--blur));
}

.card-glass::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0 0, rgba(36, 229, 159, 0.12) 0, transparent 50%),
    radial-gradient(circle at 100% 0, rgba(77, 123, 255, 0.12) 0, transparent 50%);
  opacity: 0.8;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* HEADER / BRAND STRIP */
.ccu-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.ccu-logo-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px solid rgba(36, 229, 159, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(36, 229, 159, 0.55);
  position: relative;
}

.ccu-logo-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(245, 210, 107, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.ccu-logo-ring::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px dashed rgba(36, 229, 159, 0.3);
  animation: orbit 12s linear infinite;
}

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

.ccu-header-text h1 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--emerald);
}

.ccu-header-text h2 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-soft);
  letter-spacing: 0.18em;
}

.ccu-header-pill {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(245, 210, 107, 0.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  background: radial-gradient(circle at top, rgba(245, 210, 107, 0.18), transparent);
}

.ccu-header-pill span.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(36, 229, 159, 0.9);
}

/* BUTTONS */
.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 18px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  background: none;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease-out;
}

.btn-primary {
  background: radial-gradient(circle at 0 0, rgba(245, 210, 107, 0.35), transparent 70%),
    linear-gradient(120deg, #1b9f6b, #24e59f);
  border-color: rgba(36, 229, 159, 0.7);
  color: #010305;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.9);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(5, 14, 30, 0.9);
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: rgba(245, 210, 107, 0.5);
  color: var(--gold);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

/* GRID / PANELS */
.ccu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 22px;
  margin-top: 18px;
}

@media (max-width: 880px) {
  .ccu-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel {
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(36, 229, 159, 0.24), transparent 60%),
    radial-gradient(circle at bottom, rgba(77, 123, 255, 0.23), transparent 60%),
    var(--bg-panel-soft);
  border: 1px solid var(--border-subtle);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(36, 229, 159, 0.12), transparent 65%);
  opacity: 0.2;
  mix-blend-mode: screen;
  pointer-events: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-soft);
}

.panel-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--emerald);
}

/* STATS */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.stat-chip {
  flex: 1 1 120px;
  min-width: 0;
  border-radius: 999px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-soft);
  background: radial-gradient(circle at top left, rgba(36, 229, 159, 0.16), transparent 60%);
}

.stat-chip .label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.stat-chip .value {
  color: var(--gold);
  font-weight: 500;
}

/* METER */
.meter-wrap {
  margin-top: 10px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.meter-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 50%, rgba(36, 229, 159, 0.15), transparent 60%),
    rgba(2, 9, 22, 0.95);
  overflow: hidden;
  border: 1px solid rgba(36, 229, 159, 0.45);
}

.meter-fill {
  position: absolute;
  inset: 0;
  width: 64%;
  background: linear-gradient(90deg, #1b9f6b, #24e59f, #f5d26b);
  box-shadow: var(--emerald-glow);
  transform-origin: left;
  transform: scaleX(0.64);
}

/* GLOWY TEXT */
.text-hero {
  font-size: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 10px 0 4px;
}

.text-hero span {
  color: var(--emerald);
}

.text-sub {
  font-size: 13px;
  color: var(--text-soft);
  max-width: 520px;
}

/* AI VOICE BAR */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 0 0, rgba(77, 123, 255, 0.26), transparent 70%),
    rgba(2, 9, 22, 0.95);
  border: 1px solid rgba(77, 123, 255, 0.5);
  margin-top: 16px;
}

.voice-pill {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(245, 210, 107, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.voice-wave {
  flex: 1;
  height: 18px;
  display: flex;
  gap: 3px;
  align-items: flex-end;
}

.voice-bar-line {
  flex: 1;
  border-radius: 999px;
  background: linear-gradient(to top, rgba(36, 229, 159, 0.1), rgba(36, 229, 159, 0.9));
  animation: wave 1.2s ease-in-out infinite alternate;
}

.voice-bar-line:nth-child(2) { animation-delay: 0.1s; }
.voice-bar-line:nth-child(3) { animation-delay: 0.2s; }
.voice-bar-line:nth-child(4) { animation-delay: 0.3s; }
.voice-bar-line:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  from { height: 3px; }
  to { height: 16px; }
}

.voice-text {
  font-size: 11px;
  color: var(--text-soft);
}

.toggle {
  width: 40px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  padding: 2px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.toggle-knob {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(36, 229, 159, 0.8);
  transform: translateX(0);
  transition: transform 0.2s ease-out;
}

.toggle.on {
  background: rgba(36, 229, 159, 0.2);
  border-color: rgba(36, 229, 159, 0.8);
}

.toggle.on .toggle-knob {
  transform: translateX(18px);
}

/* TABLE / LISTS */
.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.log-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.log-list span.label {
  color: var(--text-soft);
}

.log-list span.value {
  color: var(--emerald);
}

/* TAGS */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 9px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 7px rgba(36, 229, 159, 0.9);
}

/* FORMS */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
}

.field input,
.field select,
.field textarea {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 14, 30, 0.9);
  padding: 9px 12px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.field textarea {
  border-radius: 16px;
  min-height: 80px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(36, 229, 159, 0.8);
  box-shadow: 0 0 0 1px rgba(36, 229, 159, 0.4);
}

/* SIMPLE LAYOUT HELPERS */
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.row > * {
  flex: 1 1 140px;
}

/* PAGE-SPECIFIC SMALL STYLES */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.footer-note {
  margin-top: 18px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(159, 168, 198, 0.7);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-note span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 4px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.badge-pill.gold {
  border-color: rgba(245, 210, 107, 0.8);
  color: var(--gold);
}

.badge-pill.emerald {
  border-color: rgba(36, 229, 159, 0.8);
  color: var(--emerald);
}

/* ADMIN TABLE */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table thead tr {
  background: rgba(4, 14, 30, 0.98);
}

.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
}

.table td {
  color: var(--text-main);
}

.table tr:nth-child(even) td {
  background: rgba(3, 10, 25, 0.7);
}

.status-pill {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-ok {
  background: rgba(36, 229, 159, 0.16);
  color: var(--emerald);
  border: 1px solid rgba(36, 229, 159, 0.7);
}

.status-pending {
  background: rgba(245, 210, 107, 0.18);
  color: var(--gold);
  border: 1px solid rgba(245, 210, 107, 0.7);
}

.status-locked {
  background: rgba(255, 75, 129, 0.16);
  color: var(--danger);
  border: 1px solid rgba(255, 75, 129, 0.7);
}

/* SMALL BADGE GRID */
.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-token {
  min-width: 120px;
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-token span {
  font-size: 10px;
  color: var(--text-soft);
}

/* MOBILE TWEAKS */
@media (max-width: 640px) {
  .card-glass {
    padding: 20px 16px;
  }
  .text-hero {
    font-size: 19px;
  }
  .ccu-header-text h1 {
    font-size: 17px;
  }
}
