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

[data-theme="dark"] {
  --bg-base: #0a0e1a;
  --bg-elevated: #131827;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-header-row: rgba(0, 0, 0, 0.22);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.18);
  --text-primary: #f5f5f7;
  --text-secondary: rgba(245, 245, 247, 0.72);
  --text-tertiary: rgba(245, 245, 247, 0.48);
  --accent-gold: #d4b572;
  --accent-gold-dim: #9a8352;
  --accent-gold-text: #0a0e1a;
  --danger: #f87171;
  --auth-orbit: rgba(212, 181, 114, 0.18);
  --auth-panel: rgba(19, 24, 39, 0.78);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-base: #f8f7f4;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-card-hover: #ffffff;
  --bg-header-row: rgba(26, 43, 74, 0.05);
  --border-subtle: rgba(26, 43, 74, 0.1);
  --border-medium: rgba(26, 43, 74, 0.18);
  --text-primary: #1a2b4a;
  --text-secondary: rgba(26, 43, 74, 0.72);
  --text-tertiary: rgba(26, 43, 74, 0.48);
  --accent-gold: #a8884d;
  --accent-gold-dim: #7f683c;
  --accent-gold-text: #ffffff;
  --danger: #dc2626;
  --auth-orbit: rgba(168, 136, 77, 0.16);
  --auth-panel: rgba(255, 255, 255, 0.78);
  color-scheme: light;
}

body {
  min-height: 100vh;
  padding: 32px 16px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: Inter, Arial, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto auto;
  width: 640px;
  height: 640px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(212, 181, 114, 0.16), transparent 70%);
}

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

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

.container.narrow {
  width: min(760px, 100%);
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(212, 181, 114, 0.14) 0%, transparent 24%),
    linear-gradient(155deg, transparent 0%, transparent 48%, rgba(255, 255, 255, 0.055) 48%, rgba(255, 255, 255, 0.055) 58%, transparent 58%),
    linear-gradient(35deg, rgba(255, 255, 255, 0.035) 0%, transparent 38%),
    var(--bg-base);
  background-size: 140% 140%, 180% 180%, 150% 150%, auto;
  animation: auth-bg-shift 18s ease-in-out infinite alternate;
}

.auth-page .auth-shell::before,
.auth-page .auth-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(6px);
}

.auth-page .auth-shell::before {
  top: -72px;
  right: -96px;
  width: 180px;
  height: 180px;
  border: 1px solid var(--auth-orbit);
  background: radial-gradient(circle, var(--auth-orbit), transparent 62%);
  animation: auth-float 8s ease-in-out infinite;
}

.auth-page .auth-shell::after {
  bottom: -88px;
  left: -120px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(96, 165, 250, 0.12);
  background: radial-gradient(circle, rgba(96, 165, 250, 0.13), transparent 66%);
  animation: auth-float 10s ease-in-out infinite reverse;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: auth-grid-drift 22s linear infinite;
  mask-image: linear-gradient(90deg, transparent 0%, #000 24%, #000 76%, transparent 100%);
}

.auth-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 14, 26, 0.92) 0%, rgba(10, 14, 26, 0.42) 45%, rgba(10, 14, 26, 0.92) 100%),
    linear-gradient(180deg, rgba(10, 14, 26, 0.2) 0%, rgba(10, 14, 26, 0.86) 100%);
}

[data-theme="light"] .auth-page {
  background:
    linear-gradient(115deg, rgba(168, 136, 77, 0.16) 0%, transparent 26%),
    linear-gradient(155deg, transparent 0%, transparent 48%, rgba(26, 43, 74, 0.055) 48%, rgba(26, 43, 74, 0.055) 58%, transparent 58%),
    linear-gradient(35deg, rgba(26, 43, 74, 0.035) 0%, transparent 38%),
    var(--bg-base);
  background-size: 140% 140%, 180% 180%, 150% 150%, auto;
}

[data-theme="light"] .auth-page::before {
  background-image:
    linear-gradient(rgba(26, 43, 74, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 43, 74, 0.052) 1px, transparent 1px);
}

[data-theme="light"] .auth-page::after {
  background:
    linear-gradient(90deg, rgba(248, 247, 244, 0.9) 0%, rgba(248, 247, 244, 0.38) 45%, rgba(248, 247, 244, 0.92) 100%),
    linear-gradient(180deg, rgba(248, 247, 244, 0.08) 0%, rgba(248, 247, 244, 0.78) 100%);
}

.auth-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.105), transparent 36%),
    var(--auth-panel);
  padding: 36px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0.75;
}

[data-theme="light"] .auth-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.68));
  box-shadow: 0 28px 90px rgba(26, 43, 74, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

.auth-theme-toggle {
  width: 78px;
  height: 38px;
  flex: 0 0 auto;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 0;
  box-shadow: 0 12px 30px rgba(212, 181, 114, 0.18);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(212, 181, 114, 0.25);
}

.auth-card .form-group input {
  min-height: 46px;
  background: rgba(255, 255, 255, 0.055);
}

[data-theme="light"] .auth-card .form-group input {
  background: rgba(255, 255, 255, 0.86);
}

.auth-card .header-sub {
  max-width: 320px;
}

.auth-link {
  display: block;
  margin-top: 18px;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.auth-link a {
  color: var(--accent-gold);
  font-weight: 800;
}

.auth-link a:hover {
  text-decoration: underline;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--accent-gold);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .icon-eye-off,
.password-toggle.is-visible .icon-eye {
  display: none;
}

.password-toggle.is-visible .icon-eye-off {
  display: block;
}

@keyframes auth-bg-shift {
  from {
    background-position: 0% 0%, 100% 30%, 10% 100%, 0 0;
  }
  to {
    background-position: 100% 40%, 0% 65%, 90% 0%, 0 0;
  }
}

@keyframes auth-grid-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 48px 48px, 48px 48px;
  }
}

@keyframes auth-float {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(14px, -12px, 0) scale(1.05);
  }
}


.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 12px;
  border: 1px solid rgba(212, 181, 114, 0.45);
  border-radius: 999px;
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

h1 {
  color: var(--text-primary);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1;
}

h1 span {
  color: var(--accent-gold);
  font-style: italic;
}

.header-sub {
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.header-actions,
.export-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-toggle {
  position: relative;
  display: flex;
  width: 92px;
  height: 42px;
  padding: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.16);
  isolation: isolate;
  overflow: hidden;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: -1;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 0.22s ease;
}

.theme-toggle.is-dark::before {
  transform: translateX(100%);
}

[data-theme="light"] .theme-toggle {
  background: rgba(26, 43, 74, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 22px rgba(26, 43, 74, 0.08);
}

.theme-toggle-option,
.btn-secondary,
.btn-add,
.export-btn,
.btn-icon {
  min-height: 38px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.theme-toggle-option {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  transition: color 0.2s ease;
}

.theme-toggle-option svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-option.active {
  color: var(--accent-gold-text);
}

.theme-toggle-option:not(.active):hover {
  color: var(--text-primary);
}

.btn-add {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
  color: var(--accent-gold-text);
  font-weight: 700;
}

.btn-add,
.btn-secondary,
.export-btn,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
}

.btn-secondary,
.export-btn,
.btn-icon {
  background: var(--bg-card);
  color: var(--text-secondary);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--danger);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.btn-secondary:hover,
.export-btn:hover,
.btn-icon:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}

.notice.danger {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
}

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 58px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--toast-border, rgba(52, 211, 153, 0.38));
  border-radius: 8px;
  background: var(--toast-bg, rgba(6, 78, 59, 0.94));
  color: var(--toast-text, #a7f3d0);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  --toast-bg: rgba(6, 78, 59, 0.94);
  --toast-border: rgba(52, 211, 153, 0.42);
  --toast-text: #a7f3d0;
  --toast-icon: #6ee7b7;
}

.toast-error {
  --toast-bg: rgba(127, 29, 29, 0.94);
  --toast-border: rgba(248, 113, 113, 0.46);
  --toast-text: #fecaca;
  --toast-icon: #fca5a5;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.toast-icon svg {
  width: 34px;
  height: 34px;
  stroke: var(--toast-icon);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-ring {
  opacity: 0.35;
  stroke-dasharray: 57;
  stroke-dashoffset: 57;
  animation: toast-draw 0.42s ease forwards;
}

.toast-check {
  stroke-dasharray: 18;
  stroke-dashoffset: 18;
  animation: toast-draw 0.28s ease 0.24s forwards;
}

.toast-line {
  stroke-dasharray: 12;
  stroke-dashoffset: 12;
}

.toast-line-one {
  animation: toast-draw 0.2s ease 0.22s forwards;
}

.toast-line-two {
  animation: toast-draw 0.2s ease 0.36s forwards;
}

@keyframes toast-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card,
.table-wrapper,
.form-panel,
.export-row {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(18px);
}

.stat-card {
  padding: 22px;
}

.stat-label {
  margin-bottom: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.stat-value {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 42px;
  font-weight: 800;
}

.stat-change {
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.controls input,
.controls select,
.form-group input,
.form-group select,
.form-group textarea {
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  outline: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  color-scheme: inherit;
}

.controls select option,
.form-group select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

[data-theme="dark"] .controls select option,
[data-theme="dark"] .form-group select option {
  background: #131827;
  color: #f5f5f7;
}

[data-theme="dark"] .controls select option:checked,
[data-theme="dark"] .form-group select option:checked {
  background: #2b2f3d;
  color: #f5f5f7;
}

.controls input,
.controls select {
  padding: 0 14px;
}

.controls input {
  flex: 1 1 260px;
}

.controls input:focus,
.controls select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-gold);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

th {
  background: var(--bg-header-row);
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: var(--text-secondary);
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

.nowrap,
.actions-cell {
  white-space: nowrap;
}

.idea-title {
  margin-bottom: 5px;
  color: var(--text-primary);
  font-weight: 700;
}

.idea-note {
  max-width: 360px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.5;
}

.cat-badge,
.badge,
.effort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.cat-badge,
.badge {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.cat-badge {
  --cat-bg: rgba(148, 163, 184, 0.13);
  --cat-border: rgba(148, 163, 184, 0.28);
  --cat-text: var(--text-secondary);
  background: var(--cat-bg);
  border-color: var(--cat-border);
  color: var(--cat-text);
}

.badge {
  background: var(--bg-header-row);
}

.cat-content {
  --cat-bg: rgba(96, 165, 250, 0.13);
  --cat-border: rgba(96, 165, 250, 0.32);
  --cat-text: #93c5fd;
}

.cat-marketing {
  --cat-bg: rgba(244, 114, 182, 0.13);
  --cat-border: rgba(244, 114, 182, 0.32);
  --cat-text: #f9a8d4;
}

.cat-sales {
  --cat-bg: rgba(52, 211, 153, 0.13);
  --cat-border: rgba(52, 211, 153, 0.32);
  --cat-text: #6ee7b7;
}

.cat-operasional {
  --cat-bg: rgba(251, 191, 36, 0.13);
  --cat-border: rgba(251, 191, 36, 0.34);
  --cat-text: #fcd34d;
}

.cat-community {
  --cat-bg: rgba(167, 139, 250, 0.13);
  --cat-border: rgba(167, 139, 250, 0.34);
  --cat-text: #c4b5fd;
}

.cat-branding {
  --cat-bg: rgba(212, 181, 114, 0.15);
  --cat-border: rgba(212, 181, 114, 0.38);
  --cat-text: var(--accent-gold);
}

.effort-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  height: 18px;
  padding: 2px 0;
}

.effort-bar {
  width: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.effort-bar:nth-child(1) {
  height: 8px;
}

.effort-bar:nth-child(2) {
  height: 12px;
}

.effort-bar:nth-child(3) {
  height: 16px;
}

.effort-bar.filled {
  background: currentColor;
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 42%, transparent);
}

.effort:hover .effort-bar.filled {
  transform: translateY(-1px);
}

.badge.active {
  color: #6ee7b7;
}

.badge.processing {
  color: #fcd34d;
}

.badge.parked {
  color: #93c5fd;
}

.badge.done {
  color: #c4b5fd;
}

.badge.archived {
  color: #cbd5e1;
}

.effort-low,
.effort-rendah {
  color: #6ee7b7;
}

.effort-medium,
.effort-sedang {
  color: #fcd34d;
}

.effort-high,
.effort-tinggi {
  color: #f87171;
}

.impact-tinggi,
.impact-high {
  color: var(--accent-gold);
  font-weight: 700;
}

.impact-medium,
.impact-sedang {
  color: var(--text-secondary);
}

.impact-rendah,
.impact-low {
  color: var(--text-tertiary);
}

.inline-form {
  display: inline;
}

.btn-icon {
  margin-right: 6px;
  padding: 8px 10px;
}

.btn-icon.danger,
.export-btn.danger {
  color: var(--danger);
}

.empty,
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
}

.export-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
  color: var(--text-tertiary);
}

.export-actions form {
  display: inline-flex;
}

.footer {
  margin-top: 24px;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}

.form-panel {
  padding: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 13px;
}

.form-group textarea {
  resize: vertical;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 8, 15, 0.68);
  backdrop-filter: blur(14px);
}

[data-theme="light"] .modal-backdrop {
  background: rgba(26, 43, 74, 0.28);
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  scrollbar-color: rgba(245, 245, 247, 0.35) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.modal-card::-webkit-scrollbar {
  width: 10px;
}

.modal-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}

.modal-card::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.35);
  background-clip: padding-box;
}

.modal-card-small {
  width: min(460px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px 10px;
}

.modal-header h2 {
  color: var(--text-primary);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 34px;
  line-height: 1;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.modal-form {
  padding: 18px 28px 28px;
}

.modal-copy {
  margin-bottom: 22px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-copy strong {
  color: var(--text-primary);
}

@media (max-width: 820px) {
  body {
    padding: 18px 10px;
  }

  .header,
  .export-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal-backdrop {
    padding: 14px;
  }

  .modal-header,
  .modal-form {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 520px) {
  .auth-page {
    padding: 16px;
  }

  .auth-card {
    padding: 28px 22px;
  }

  .auth-top {
    align-items: center;
  }

  .auth-card h1 {
    font-size: 42px;
  }

  .toast {
    top: 14px;
    right: 14px;
    left: 14px;
    max-width: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .controls > *,
  .header-actions,
  .header-actions > * {
    width: 100%;
  }

  .theme-toggle-option {
    flex: 1;
  }
}
