@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(148, 163, 184, 0.18);
  --primary: #6366f1;
  --primary-strong: #4f46e5;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

[x-cloak] { display: none !important; }

html { background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%); }
body {
  font-family: 'Inter', 'Poppins', sans-serif;
  color: var(--text);
  background: transparent;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

@media (min-width: 640px) {
  .page-shell { padding: 1.75rem 1.5rem 3.5rem; }
}

@media (min-width: 1024px) {
  .page-shell { padding: 2.25rem 2rem 4rem; }
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: clamp(1.875rem, 3vw, 2.75rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
}

.page-subtitle {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1rem;
}

.panel,
.app-panel {
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.surface-muted {
  background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(248,250,252,0.95));
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 16px;
  font-weight: 700;
  transition: all 0.2s ease;
  padding: 0.8rem 1.15rem;
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.26);
}

.primary-btn:hover { transform: translateY(-1px); background: linear-gradient(135deg, var(--primary-strong), #6d28d9); }
.secondary-btn {
  background: white;
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: var(--primary-strong);
}
.secondary-btn:hover { background: #eef2ff; }
.ghost-btn {
  color: #475569;
  background: rgba(241, 245, 249, 0.9);
}
.ghost-btn:hover { background: rgba(226, 232, 240, 1); }
.danger-btn {
  color: white;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.danger-btn:hover { transform: translateY(-1px); }

.field-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.55rem;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255,255,255,0.94);
  padding: 0.9rem 1rem;
  transition: all 0.2s ease;
  color: var(--text);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  outline: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 20px;
  padding: 2rem 1.25rem;
  text-align: center;
  background: rgba(248, 250, 252, 0.8);
  color: #64748b;
}

.inline-error {
  margin-top: 0.9rem;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  background: rgba(254, 226, 226, 0.8);
  color: #b91c1c;
  font-size: 0.92rem;
}

.loading-card {
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: white;
  padding: 1rem;
}

.loading-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 37%, #e2e8f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
}

.loading-line {
  height: 0.9rem;
  border-radius: 999px;
}

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}

.site-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.95rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 640px) {
  .site-nav-inner { padding: 1rem 1.5rem; }
}

@media (min-width: 1024px) {
  .site-nav-inner { padding: 1rem 2rem; }
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-strong);
  background: rgba(238, 242, 255, 0.95);
}

.nav-link-active {
  color: var(--primary-strong);
  background: rgba(224, 231, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.lang-switch {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.95);
}

.lang-btn {
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.lang-btn:hover { transform: translateY(-1px); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: white;
  width: 44px;
  height: 44px;
  color: #334155;
}

.mobile-menu {
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255,255,255,0.94);
}

.mobile-menu-panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem 1rem;
}

.mobile-menu-links {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.mobile-menu-links .nav-link {
  justify-content: flex-start;
  border-radius: 16px;
  padding: 0.8rem 1rem;
}

.toast-shell {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
}

.toast-card {
  min-width: min(92vw, 320px);
  max-width: 360px;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  color: white;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  font-weight: 700;
}

.toast-success { background: linear-gradient(135deg, #22c55e, #16a34a); }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }

.stack-mobile {
  display: grid;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .stack-mobile { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
}


.mobile-only {
  display: none !important;
}

.mobile-summary-card {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94));
}

.mobile-summary-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  -webkit-overflow-scrolling: touch;
}

.mobile-summary-pill {
  min-width: 132px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0.85rem 0.95rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.mobile-summary-label {
  font-size: 0.74rem;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-summary-value {
  margin-top: 0.4rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.mobile-tab-strip {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
}

.mobile-tab-strip::-webkit-scrollbar,
.mobile-summary-strip::-webkit-scrollbar {
  display: none;
}

.mobile-sticky-actions {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 440px);
  display: none;
  gap: 0.7rem;
  padding: 0.7rem;
  border-radius: 24px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(18px);
  z-index: 60;
}

.mobile-sticky-actions > * {
  flex: 1 1 0;
}

.mobile-grid-stack {
  display: grid;
  gap: 1rem;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }

  .page-shell {
    padding: 1rem 0.9rem 7.25rem;
  }

  .page-header {
    margin-bottom: 1rem;
    gap: 0.85rem;
  }

  .page-title {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .panel,
  .app-panel {
    border-radius: 20px;
  }

  .mobile-sticky-actions {
    display: flex;
  }
}
