/* FABIE Design System - Extracted from concept HTML */
:root {
  --bg: #0b1220;
  --panel: #0f1a2e;
  --card: #101f38;
  --muted: #93a4c7;
  --text: #e8efff;
  --brand: #3b82f6;
  --brand2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --hover: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(
      1200px 600px at 20% 0%,
      rgba(59, 130, 246, 0.25),
      transparent 55%
    ),
    radial-gradient(
      900px 500px at 80% 20%,
      rgba(34, 197, 94, 0.16),
      transparent 60%
    ),
    linear-gradient(180deg, var(--bg) 0%, #070b14 100%);
  background-attachment: fixed;
  background-size: 100% 100%;
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(7, 11, 20, 0.65);
  border-bottom: 1px solid var(--border);
}

.topbar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.logoMark {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.25);
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.nav a.active {
  background: rgba(59, 130, 246, 0.16);
  color: var(--text);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  transition: background 0.15s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn.primary {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.95),
    rgba(124, 58, 237, 0.95)
  );
  border-color: rgba(255, 255, 255, 0.14);
}

.btn.good {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.95),
    rgba(16, 185, 129, 0.95)
  );
  border-color: rgba(255, 255, 255, 0.14);
}

.btn.danger {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.95),
    rgba(220, 38, 38, 0.95)
  );
  border-color: rgba(255, 255, 255, 0.14);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.btn.block {
  width: 100%;
}

/* Grid System */
.grid {
  display: grid;
  gap: 18px;
}

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

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

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

@media (max-width: 980px) {
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
  .topbar .inner {
    padding: 12px 14px;
  }
}

/* Cards */
.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card .pad {
  padding: 18px;
}

.card .pad.sm {
  padding: 14px;
}

.cardHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Typography */
.h1 {
  font-size: 44px;
  line-height: 1.05;
  margin: 0 0 10px 0;
  letter-spacing: -0.8px;
}

.h2 {
  font-size: 24px;
  margin: 0 0 10px 0;
}

.h3 {
  font-size: 16px;
  margin: 0 0 6px 0;
  letter-spacing: 0.2px;
}

.p {
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.03);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.badge.verified {
  background: rgba(34, 197, 94, 0.12);
  color: #c8f6dc;
  border-color: rgba(34, 197, 94, 0.25);
}

.badge.basic {
  background: rgba(148, 163, 184, 0.1);
  color: #dbe7ff;
  border-color: rgba(148, 163, 184, 0.22);
}

.badge.warn {
  background: rgba(245, 158, 11, 0.12);
  color: #ffe9c1;
  border-color: rgba(245, 158, 11, 0.25);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ffd1d1;
  border-color: rgba(239, 68, 68, 0.25);
}

/* Forms */
.input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: inherit;
}

.input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.08);
}

/* Checkboxes */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand);
  border-radius: 4px;
}

input[type="checkbox"]:checked {
  background-color: var(--brand);
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #2563eb;
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #2563eb;
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.4);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

/* Select dropdown options styling */
select option {
  background: var(--card);
  color: var(--text);
  padding: 8px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px 2px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  gap: 12px;
}

@media (max-width: 720px) {
  .row {
    flex-direction: column;
  }
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.table th,
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 14px;
}

.table th {
  color: #cfe0ff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

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

/* Layout */
.split {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
}

@media (max-width: 980px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
}

@media (max-width: 980px) {
  .sidebar {
    position: relative;
    top: auto;
  }
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -120px -120px auto -120px;
  height: 420px;
  background: radial-gradient(
    closest-side,
    rgba(59, 130, 246, 0.35),
    transparent 65%
  );
  filter: blur(0px);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -160px -160px auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(
    closest-side,
    rgba(34, 197, 94, 0.2),
    transparent 65%
  );
}

.hero .pad {
  position: relative;
}

/* Utility Components */
.mini {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.icon svg {
  opacity: 0.95;
}

.footer {
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding: 18px 0;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notice {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

/* Toast */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 26, 46, 0.92);
  box-shadow: var(--shadow);
  color: #e8efff;
  max-width: 360px;
  display: none;
  z-index: 100;
}

.toast.show {
  display: block;
  animation: slideIn 0.3s ease;
}

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

.toast .t {
  font-weight: 800;
  margin: 0 0 4px 0;
}

.toast .m {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

/* Card hover states */
a.card {
  transition: transform 0.2s, box-shadow 0.2s;
}

a.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* Form layouts */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 720px) {
  .form-grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

.form-section {
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Status indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.active {
  background: var(--brand2);
}

.status-dot.draft {
  background: var(--muted);
}

.status-dot.pending {
  background: var(--warn);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  margin-bottom: 16px;
}

/* Message thread styles */
.message-bubble {
  max-width: 80%;
}

.message-bubble.self {
  margin-left: auto;
  background: rgba(59, 130, 246, 0.15);
}

/* Certificate styles */
.certificate {
  background: white;
  color: #1a1a1a;
  padding: 40px;
  border-radius: 8px;
  font-family: "Times New Roman", serif;
}

.certificate h1 {
  text-align: center;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 10px;
}

/* Dropdown menu styles */
.dropdown-menu {
  background: var(--card) !important;
  color: var(--text) !important;
}

.dropdown-menu a {
  color: var(--text) !important;
}

.dropdown-menu a:hover {
  background: var(--hover) !important;
  color: var(--text) !important;
}

/* Select element dropdown - ensure proper colors */
select {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text) !important;
}

select option {
  background-color: var(--card) !important;
  color: var(--text) !important;
}

/* Responsive adjustments */
@media (max-width: 720px) {
  .h1 {
    font-size: 28px;
  }
  
  .h2 {
    font-size: 20px;
  }
  
  .container {
    padding: 16px;
  }
}


