/* shadcn design system — tokens & base */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-sans);
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

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

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { line-height: 1.3; font-weight: 600; letter-spacing: -0.025em; color: hsl(var(--foreground)); }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { color: hsl(var(--muted-foreground)); }

/* ── Button ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  border-radius: var(--radius); border: 1px solid transparent;
  padding: 9px 16px; cursor: pointer; transition: all 0.15s ease;
  white-space: nowrap; text-decoration: none; outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary));
}
.btn-primary:hover { opacity: 0.9; }

.btn-outline {
  background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--border));
}
.btn-outline:hover { background: hsl(var(--accent)); }

.btn-secondary {
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
}
.btn-secondary:hover { background: hsl(var(--secondary) / 0.8); }

.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); }

.btn-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-destructive:hover { opacity: 0.9; }

.btn-sm { font-size: 13px; padding: 6px 12px; }
.btn-lg { font-size: 15px; padding: 11px 24px; }
.btn-block { width: 100%; }

/* ── Card ── */
.card {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 24px;
}

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 500;
  padding: 2px 10px; border-radius: 9999px;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
}
.badge-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.badge-success { background: hsl(142 76% 36%); color: #fff; }
.badge-warning { background: hsl(38 92% 50%); color: #fff; }
.badge-outline { background: transparent; border: 1px solid hsl(var(--border)); }

/* ── Input ── */
.input, .textarea {
  width: 100%; font-family: var(--font-sans); font-size: 14px;
  padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid hsl(var(--input)); background: transparent;
  color: hsl(var(--foreground)); outline: none; transition: border-color 0.15s;
}
.input::placeholder, .textarea::placeholder { color: hsl(var(--muted-foreground)); }
.input:focus, .textarea:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.1);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.input:disabled { opacity: 0.5; background: hsl(var(--muted)); }

.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: hsl(var(--foreground)); }
.form-hint { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 4px; }

/* ── Separator ── */
.separator { border: none; border-top: 1px solid hsl(var(--border)); margin: 24px 0; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: hsl(var(--background) / 0.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600; color: hsl(var(--foreground));
}
.navbar-brand svg { width: 24px; height: 24px; }
.navbar-nav {
  display: flex; align-items: center; gap: 4px; list-style: none;
}
.navbar-nav a {
  font-size: 14px; padding: 6px 12px; border-radius: var(--radius);
  color: hsl(var(--muted-foreground)); transition: all 0.15s;
}
.navbar-nav a:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.navbar-nav a.active { color: hsl(var(--foreground)); font-weight: 500; }
.navbar-nav .nav-btn {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)) !important;
  padding: 6px 16px; border-radius: var(--radius); font-weight: 500;
}
.navbar-nav .nav-btn:hover { opacity: 0.9; background: hsl(var(--primary)); }

.menu-toggle {
  display: none; background: none; border: none; cursor: pointer; padding: 6px;
  flex-direction: column; gap: 4px;
}
.menu-toggle span { display: block; width: 18px; height: 2px; background: hsl(var(--foreground)); border-radius: 1px; }

/* ── Section ── */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { font-size: 16px; max-width: 600px; margin: 0 auto; }

/* ── Footer ── */
.footer { border-top: 1px solid hsl(var(--border)); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.footer-desc { font-size: 13px; color: hsl(var(--muted-foreground)); line-height: 1.7; }
.footer h4 { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; }
.footer li a { font-size: 13px; color: hsl(var(--muted-foreground)); transition: color 0.15s; }
.footer li a:hover { color: hsl(var(--foreground)); }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid hsl(var(--border));
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: hsl(var(--muted-foreground));
}
.footer-bottom a { color: hsl(var(--muted-foreground)); margin-left: 16px; transition: color 0.15s; }
.footer-bottom a:hover { color: hsl(var(--foreground)); }

/* ── Toast ── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; background: hsl(var(--card));
  border: 1px solid hsl(var(--border)); box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  opacity: 0; transform: translateY(-12px); transition: all 0.2s ease;
  color: hsl(var(--foreground));
}
.toast-success { border-left: 3px solid hsl(142 76% 36%); }
.toast-error { border-left: 3px solid hsl(var(--destructive)); }
.toast-info { border-left: 3px solid hsl(221 83% 53%); }

/* ── Progress ── */
.progress { height: 8px; background: hsl(var(--muted)); border-radius: 9999px; overflow: hidden; }
.progress-bar { height: 100%; background: hsl(var(--primary)); border-radius: 9999px; transition: width 0.3s ease; }

/* ── Table ── */
.table-wrapper { overflow-x: auto; border: 1px solid hsl(var(--border)); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: hsl(var(--muted)); }
th { font-weight: 500; text-align: left; padding: 10px 16px; color: hsl(var(--muted-foreground)); font-size: 13px; }
td { padding: 10px 16px; border-top: 1px solid hsl(var(--border)); }
tbody tr:hover { background: hsl(var(--muted) / 0.5); }

/* ── Skeleton loading ── */
@keyframes shimmer { 0%{background-position:-200% 0}100%{background-position:200% 0} }
.skeleton {
  background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--muted)/0.5) 50%, hsl(var(--muted)) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }
  .section { padding: 48px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

  .menu-toggle { display: flex; }
  .navbar-nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: hsl(var(--background)); border-bottom: 1px solid hsl(var(--border));
    flex-direction: column; padding: 16px 24px; gap: 4px;
  }
  .navbar-nav.open { display: flex; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
