:root {
  --bg: #f8fbff;
  --text: #101828;
  --muted: #667085;
  --panel: rgba(255, 255, 255, 0.76);
  --line: rgba(15, 23, 42, 0.12);
  --accent-pink: #ec4899;
  --accent-blue: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-lime: #84cc16;
  --shadow: 0 24px 80px rgba(30, 41, 59, 0.18);
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 15%, rgba(236, 72, 153, 0.22), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(6, 182, 212, 0.22), transparent 25rem),
    linear-gradient(135deg, #f8fbff, #eef6ff 45%, #fff1f7);
  overflow-x: hidden;
}
body.dark {
  --bg: #07111f;
  --text: #f8fafc;
  --muted: #a4b1c6;
  --panel: rgba(15, 23, 42, 0.78);
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  background:
    radial-gradient(circle at 12% 15%, rgba(236, 72, 153, 0.23), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(14, 165, 233, 0.22), transparent 25rem),
    linear-gradient(135deg, #020617, #0f172a 52%, #111827);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  outline: none;
}
body.dark input, body.dark textarea { background: rgba(2, 6, 23, 0.58); }
textarea { resize: vertical; min-height: 7rem; }
label { display: grid; gap: 0.45rem; color: var(--muted); font-weight: 700; font-size: 0.88rem; }
main { width: min(1180px, calc(100vw - 32px)); margin: 0 auto 3rem; }
.topbar { width: min(1180px, calc(100vw - 32px)); margin: 1rem auto 0; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 0.7rem; font-size: 1.05rem; }
.brand-logo { width: 48px; height: 48px; border-radius: 15px; object-fit: cover; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, 0.36); }
.brand span, .avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 15px; background: linear-gradient(135deg, var(--accent-pink), var(--accent-cyan)); color: white; font-weight: 900; box-shadow: var(--shadow); }
.brand-mark-image { width: 72px; height: 72px; border-radius: 22px; object-fit: cover; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, 0.36); }
.panel { border: 1px solid var(--line); border-radius: 30px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.hidden { display: none !important; }
.ghost { padding: 0.75rem 1rem; border-radius: 999px; color: var(--text); background: rgba(255, 255, 255, 0.36); border: 1px solid var(--line); }
body.dark .ghost { background: rgba(15, 23, 42, 0.6); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2rem; align-items: center; min-height: calc(100vh - 90px); }
.hero-copy h1 { margin: 0; max-width: 780px; font-size: clamp(2.4rem, 6vw, 5rem); line-height: 0.93; letter-spacing: -0.075em; }
.hero-copy p { color: var(--muted); font-size: 1.08rem; line-height: 1.8; max-width: 680px; }
.eyebrow { margin: 0 0 0.75rem; color: var(--accent-pink); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.feature-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }
.feature-row span { padding: 0.75rem 1rem; border-radius: 999px; background: rgba(255, 255, 255, 0.46); border: 1px solid var(--line); font-weight: 800; }
.auth-card { padding: 1.25rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0.35rem; margin-bottom: 1rem; border-radius: 999px; background: rgba(148, 163, 184, 0.14); }
.tab { padding: 0.78rem; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 900; }
.tab.active { background: linear-gradient(135deg, var(--accent-blue), var(--accent-pink)); color: white; }
.stack { display: grid; gap: 1rem; }
.auth-form button, .generate-button, .admin-create-grid button, .admin-password-grid button { min-height: 3.1rem; border-radius: 18px; color: white; font-weight: 900; background: linear-gradient(135deg, var(--accent-blue), var(--accent-pink)); box-shadow: 0 16px 36px rgba(37, 99, 235, 0.25); }
.message { min-height: 1.2rem; color: var(--muted); font-weight: 700; }
.app-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; margin-top: 1.2rem; align-items: start; }
.page-menu { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 0.7rem; position: sticky; top: 0.85rem; z-index: 20; width: min(100%, 860px); justify-self: center; padding: 0.55rem 4.25rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.68); backdrop-filter: blur(18px); box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12); }
body.dark .page-menu { background: rgba(15, 23, 42, 0.76); }
.user-card { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem; border-radius: 20px; background: rgba(148, 163, 184, 0.14); }
.user-card span { display: block; color: var(--muted); font-size: 0.82rem; }
.nav-button { position: relative; text-align: center; padding: 0.9rem 1.25rem; border-radius: 999px; color: var(--muted); background: transparent; font-weight: 900; overflow: visible; }
.nav-button.active { color: white; background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)); box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18); }
.menu-label { position: relative; z-index: 2; white-space: nowrap; }
.nav-preview { position: absolute; left: 50%; top: calc(100% + 0.85rem); width: 220px; min-height: 128px; display: grid; gap: 0.5rem; padding: 0.85rem; border-radius: 18px; color: #0f172a; background: #ffffff; border: 1px solid rgba(148, 163, 184, 0.32); box-shadow: 0 28px 65px rgba(15, 23, 42, 0.22); opacity: 0; pointer-events: none; transform: translate(-50%, -12px); transition: opacity 180ms ease, transform 220ms ease; }
.nav-button:hover .nav-preview, .nav-button:focus-visible .nav-preview { opacity: 1; transform: translate(-50%, 0); }
.nav-preview::before { content: ''; position: absolute; inset: -8px -8px auto; height: 8px; }
.preview-title { font-size: 0.78rem; font-weight: 900; text-align: left; color: #334155; }
.preview-chart { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 0.35rem; height: 48px; padding: 0.45rem; border-radius: 12px; background: #eff6ff; }
.preview-chart i { display: block; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #06b6d4, #2563eb); }
.preview-chart i:nth-child(1) { height: 48%; } .preview-chart i:nth-child(2) { height: 78%; } .preview-chart i:nth-child(3) { height: 62%; }
.preview-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.preview-kpi b { display: grid; place-items: center; min-height: 42px; border-radius: 13px; background: #ecfeff; color: #0f766e; }
.preview-row { display: block; height: 9px; border-radius: 999px; background: #cbd5e1; }
.preview-row.short { width: 66%; }
.economy-preview { background: linear-gradient(135deg, #ffffff, #eff6ff); }
.stock-preview { background: linear-gradient(135deg, #ffffff, #f0fdf4); }
.destruction-preview { background: linear-gradient(135deg, #ffffff, #fff1f2); }
.admin-preview { background: linear-gradient(135deg, #ffffff, #f8fafc); }
.profile-menu { position: absolute; right: 0.65rem; margin-left: auto; }
.profile-toggle { width: 46px; height: 46px; padding: 0; border-radius: 999px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line); box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12); }
.profile-toggle:hover, .profile-toggle:focus-visible { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(37, 99, 235, 0.2); }
.small-avatar { width: 34px; height: 34px; font-size: 0.78rem; }
.profile-panel { position: absolute; top: calc(100% + 0.8rem); right: 0; width: 245px; display: grid; gap: 0.8rem; padding: 0.9rem; border-radius: 22px; background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line); box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22); opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity 180ms ease, transform 200ms ease; }
body.dark .profile-panel { background: rgba(15, 23, 42, 0.95); }
.profile-menu.open .profile-panel { opacity: 1; pointer-events: auto; transform: translateY(0); }
.profile-panel.hidden { display: grid !important; }
.profile-panel-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem; border-radius: 18px; background: rgba(148, 163, 184, 0.13); }
.profile-panel-head span:not(.avatar) { display: block; color: var(--muted); font-size: 0.82rem; }
.profile-panel .ghost { width: 100%; }
.page { max-width: 1180px; width: 100%; justify-self: center; padding: clamp(1rem, 3vw, 2rem); }
.page-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -0.055em; }
.page-heading p:not(.eyebrow) { color: var(--muted); }
.economy-form, .stock-form, .destruction-form { display: grid; gap: 1rem; }
.data-card { border-radius: 26px; padding: 1.2rem; border: 1px solid var(--line); }
.revenue-card { background: linear-gradient(135deg, rgba(37, 99, 235, 0.13), rgba(236, 72, 153, 0.12)); }
.units-card { background: linear-gradient(135deg, rgba(6, 182, 212, 0.13), rgba(132, 204, 22, 0.13)); }
.trend-card { background: linear-gradient(135deg, rgba(234, 88, 12, 0.12), rgba(37, 99, 235, 0.1)); }
.stock-card { background: linear-gradient(135deg, rgba(22, 163, 74, 0.13), rgba(6, 182, 212, 0.1)); }
.stock-comparison-card { background: linear-gradient(135deg, rgba(100, 116, 139, 0.12), rgba(37, 99, 235, 0.09)); }
.destruction-card { background: linear-gradient(135deg, rgba(220, 38, 38, 0.12), rgba(236, 72, 153, 0.1)); }
.destruction-calculator-card { margin-top: 1rem; background: linear-gradient(135deg, rgba(37, 99, 235, 0.11), rgba(6, 182, 212, 0.1)); }
.top-destruction-card { margin-top: 1rem; background: linear-gradient(135deg, rgba(234, 88, 12, 0.11), rgba(220, 38, 38, 0.09)); }
.data-card h3, .theme-picker h3 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.data-card p { margin: 0 0 1rem; color: var(--muted); }
.trend-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.dynamic-entry-grid { grid-template-columns: 1fr; margin-bottom: 0.8rem; }
.entry-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.75rem; align-items: end; padding: 0.85rem; border-radius: 20px; background: rgba(255, 255, 255, 0.28); border: 1px solid var(--line); }
body.dark .entry-row { background: rgba(15, 23, 42, 0.42); }
.remove-entry-button { min-height: 3rem; }
.add-entry-button { justify-self: start; font-weight: 900; }
.theme-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; align-items: stretch; }
.theme-picker h3 { grid-column: 1 / -1; }
.theme-option { min-height: 86px; display: flex; align-items: end; justify-content: space-between; border: 1px solid var(--line); border-radius: 22px; padding: 1rem; color: white; font-weight: 900; }
.theme-option input { width: auto; }
.theme-option.aurora { background: linear-gradient(135deg, #ffffff 0%, #eef8ff 48%, #e0f2fe 100%); border-color: rgba(2, 132, 199, 0.28); color: #0f172a; }
.theme-option.executive { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 45%, #dbeafe 100%); border-color: rgba(29, 78, 216, 0.28); color: #111827; }
.theme-option.sunset { background: linear-gradient(135deg, #ffffff 0%, #fff7ed 48%, #ffedd5 100%); border-color: rgba(234, 88, 12, 0.28); color: #1f2937; }
.theme-option.neon { background: linear-gradient(135deg, #ffffff 0%, #f7fee7 45%, #ecfeff 100%); border-color: rgba(101, 163, 13, 0.28); color: #111827; }
.admin-create-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; align-items: end; padding: 1rem; border-radius: 24px; background: rgba(148, 163, 184, 0.14); }
.admin-section { display: grid; gap: 0.8rem; margin-top: 1.3rem; padding: 1rem; border-radius: 24px; background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(236, 72, 153, 0.1)); border: 1px solid var(--line); }
.admin-section h3 { margin: 0; font-size: 1.25rem; }
.admin-section p { margin: 0; color: var(--muted); }
.admin-password-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.85rem; align-items: end; }
.user-list-wrap { margin-top: 1.5rem; }
.user-list { display: grid; gap: 0.65rem; }
.user-row { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 1rem; border-radius: 18px; background: rgba(255, 255, 255, 0.34); border: 1px solid var(--line); }
body.dark .user-row { background: rgba(15, 23, 42, 0.5); }
.file-drop { margin-bottom: 1rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 20px; background: rgba(255, 255, 255, 0.28); }
.file-drop input { margin-top: 0.35rem; }
.destruction-calculator-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.85rem; align-items: end; }
.destruction-rate-result { margin-top: 0.85rem; padding: 0.9rem 1rem; border-radius: 18px; border: 1px solid var(--line); color: var(--muted); font-weight: 900; background: rgba(255, 255, 255, 0.26); }
.destruction-rate-result.ok { color: #16a34a; }
.destruction-results { display: grid; gap: 1rem; margin-top: 1rem; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
.summary-card { padding: 1rem; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, 0.32); }
body.dark .summary-card, body.dark .file-drop { background: rgba(15, 23, 42, 0.42); }
.summary-card span { display: block; color: var(--muted); font-weight: 800; font-size: 0.85rem; }
.summary-card strong { display: block; margin-top: 0.4rem; font-size: clamp(1.35rem, 3vw, 2.05rem); letter-spacing: -0.04em; }
.top-product-list { display: grid; gap: 0.7rem; }
.top-product { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; border-radius: 18px; background: rgba(255, 255, 255, 0.34); border: 1px solid var(--line); }
.top-product span { color: var(--muted); font-weight: 800; }
.table-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.4rem; }
.table-actions h3 { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 22px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; background: rgba(255, 255, 255, 0.2); }
.data-table th, .data-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.data-table td:nth-child(3) { font-weight: 900; }
.feedback-widget { position: fixed; left: 1rem; bottom: 1rem; z-index: 60; display: grid; justify-items: start; gap: 0.75rem; }
.feedback-toggle { min-height: 3rem; padding: 0.85rem 1.1rem; border-radius: 999px; color: white; font-weight: 900; background: linear-gradient(135deg, var(--accent-blue), var(--accent-pink)); box-shadow: 0 18px 45px rgba(37, 99, 235, 0.28); }
.feedback-panel { width: min(360px, calc(100vw - 2rem)); padding: 1rem; border-radius: 26px; background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line); box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24); backdrop-filter: blur(18px); }
body.dark .feedback-panel { background: rgba(15, 23, 42, 0.96); }
.feedback-head { display: flex; align-items: start; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.85rem; }
.feedback-head strong, .feedback-head span { display: block; }
.feedback-head span { margin-top: 0.2rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.feedback-head .ghost { width: 2.2rem; height: 2.2rem; padding: 0; font-size: 1.2rem; line-height: 1; }
.feedback-form { display: grid; gap: 0.8rem; }
.feedback-form .generate-button { min-height: 2.9rem; }
.blob { position: fixed; pointer-events: none; filter: blur(20px); opacity: 0.7; z-index: -1; }
.blob-one { inset: 8% auto auto 4%; width: 18rem; height: 18rem; border-radius: 50%; background: rgba(236,72,153,.25); }
.blob-two { right: 5%; bottom: 8%; width: 20rem; height: 20rem; border-radius: 50%; background: rgba(6,182,212,.22); }
@media (max-width: 880px) {
  .hero-grid, .app-layout, .theme-picker, .trend-grid, .admin-create-grid, .admin-password-grid, .summary-grid, .destruction-calculator-grid { grid-template-columns: 1fr; }
  .feedback-widget { right: 1rem; justify-items: stretch; }
  .feedback-toggle { justify-self: start; }
  .page-menu { position: static; flex-wrap: wrap; border-radius: 24px; padding: 0.55rem; }
  .nav-button { flex: 1 1 180px; }
  .profile-menu { position: relative; right: auto; margin-left: 0; }
  .profile-panel { right: 50%; transform: translate(50%, -8px); }
  .profile-menu.open .profile-panel { transform: translate(50%, 0); }
  .nav-preview { display: none; }
  .sidebar { position: static; }
  .entry-grid, .entry-row { grid-template-columns: 1fr; }
}
