:root {
  --bg: #050816;
  --bg-elevated: #0b1220;
  --bg-elevated-soft: #0f172a;
  --border-subtle: #1f2937;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --accent-strong: #6366f1;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --success: #22c55e;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 60px rgba(15, 23, 42, 0.66);
  --transition-fast: 150ms ease-out;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #0b1120 0, #020617 45%, #000 100%);
  color: var(--text-main);
}

.app-root {
  position: relative;
  min-height: 100vh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Halo */

.bg-accent {
  position: fixed;
  inset: -40%;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(circle at top right, rgba(129, 140, 248, 0.18), transparent 50%),
    radial-gradient(circle at bottom, rgba(16, 185, 129, 0.12), transparent 60%);
  opacity: 0.5;
  filter: blur(8px);
  pointer-events: none;
  z-index: -1;
}

/* LOGIN VIEW */

.login-view {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 560px;
  border-radius: 26px;
  padding: 24px 24px 22px;
  background: radial-gradient(circle at top left, #111827, #020617);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.96);
}

.login-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.brand-logo-lg {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: radial-gradient(circle at 25% 0, #f9fafb, #6366f1 45%, #111827);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: #e5e7eb;
  box-shadow: 0 16px 35px rgba(79, 70, 229, 0.7);
}

.login-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
}

.login-header p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.login-body {
  margin-top: 8px;
}

.login-copy {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-points {
  margin: 0 0 14px 0;
  padding-left: 18px;
  font-size: 13px;
  color: #e5e7eb;
}

.login-points li {
  margin-bottom: 4px;
}

.login-footnote {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* DASHBOARD VIEW */

.dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(18px);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 0, #f9fafb, #6366f1 50%, #1f2937);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #e5e7eb;
  box-shadow: 0 12px 25px rgba(79, 70, 229, 0.6);
}

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

.brand-title {
  font-size: 15px;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 12px;
  color: var(--text-muted);
}

/* Main dashboard layout */

.app-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
}

.hero-text h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}

.hero-text p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pill-soft {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
}

.hero-card {
  background: radial-gradient(circle at top left, #111827, #020617);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.hero-card-body {
  font-size: 13px;
  color: var(--text-main);
}

/* Content card */

.content {
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-soft);
  padding: 18px 16px 20px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.toolbar-left h3 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 600;
}

.toolbar-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Alert */

.alert {
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alert.error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.alert.success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.6);
  color: #bbf7d0;
}

.alert-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

/* Tiles */

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.tile {
  position: relative;
  border-radius: 18px;
  padding: 14px 13px 12px;
  background: linear-gradient(135deg, #020617, #020617);
  border: 1px solid rgba(55, 65, 81, 0.7);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    opacity 120ms ease-out;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.7);
  background: radial-gradient(circle at top, #020617, #020617);
  box-shadow: 0 18px 60px rgba(30, 64, 175, 0.9);
}

.tile.locked {
  opacity: 0.55;
}

.tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.tile-title {
  font-size: 14px;
  font-weight: 600;
}

.tile-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.badge {
  font-size: 11px;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}

.badge-active {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(74, 222, 128, 0.85);
  color: #bbf7d0;
}

.badge-expired {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.85);
  color: #fecaca;
}

.badge-not-started {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(96, 165, 250, 0.85);
  color: #bfdbfe;
}

.tile-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr);
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.meta-label {
  opacity: 0.7;
}

.meta-value {
  color: #e5e7eb;
}

/* Timer */

.timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timer-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.timer-dot.expired {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

/* Buttons */

.btn {
  border-radius: var(--radius-pill);
  border: none;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    opacity 120ms ease-out;
}

.btn-lg {
  padding: 10px 18px;
  font-size: 13px;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #e5e7eb;
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.7);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.9);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.9);
}

/* Actions */

.tile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-top: 4px;
}

/* Access details */

.access {
  margin-top: 6px;
  font-size: 11px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
  max-height: 86px;
  overflow: auto;
  word-break: break-all;
}

/* Skeleton */

.tiles-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.skeleton-card {
  height: 130px;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    rgba(31, 41, 55, 0.5) 25%,
    rgba(55, 65, 81, 0.65) 37%,
    rgba(31, 41, 55, 0.5) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.1s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -80% 0;
  }
  100% {
    background-position: 140% 0;
  }
}

/* Empty state */

.empty-state {
  text-align: center;
  padding: 28px 16px 22px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.8);
}

.empty-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.empty-state h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.empty-state p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Utility */

.hidden {
  display: none !important;
}

/* Responsive */

@media (max-width: 860px) {
  .app-root {
    padding-inline: 12px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .content {
    padding: 14px 12px 16px;
  }
}

@media (max-width: 600px) {
  .login-card {
    padding-inline: 16px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 18px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .tile-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Access panel */

.access-panel {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.access-panel.visible {
  display: flex;
}

.access-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6); /* dark overlay */
}

.access-panel-content {
  position: relative;
  max-width: 680px;
  width: 100%;
  margin: 0 1rem;
  background: #0b1120;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 1.5rem 1.75rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
}

.access-panel-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.access-panel-meta {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.access-panel-body {
  background: #020617;
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 0.8rem;
  overflow-x: auto;
  max-height: 320px;
  border: 1px solid rgba(55, 65, 81, 0.7);
}

.access-panel-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1rem;
  cursor: pointer;
}

.access-panel-close:hover {
  color: #f9fafb;
}

/* helper for hiding */
.hidden {
  display: none !important;
}


/* ---------- Secondary button (Access details) ---------- */
.btn-secondary {
  background: #334155;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  filter: brightness(1.05);
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Modal (Access Details) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  width: min(680px, calc(100% - 32px));
  margin: 10vh auto;
  background: #0b1220;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.modal-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
}

.modal-body {
  padding: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.modal-body pre {
  margin: 0;
  padding: 12px;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: auto;
  max-height: 55vh;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-secondary {
  background: #334155;
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.12);
}


.btn-success {
  background: #16a34a;              /* green */
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.12);
}

.btn-success:hover {
  filter: brightness(1.05);
}

.btn-success:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

