:root {
  --primary: #42e0d1;
  --bg: #ffffff;
  --card: #ffffff;
  --muted: #f8f9fa;
  --text: #1f2937;
  --text-soft: #6b7280;
  --gold: #f1c40f;
  --gold-2: #ffd700;
  --border: rgba(31, 41, 55, 0.08);
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.10);
  --shadow-soft: 0 10px 28px rgba(66, 224, 209, 0.14);
  --radius: 22px;
  --radius-sm: 14px;
  --transition: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  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 top left, rgba(66, 224, 209, 0.08), transparent 32%),
    radial-gradient(circle at top right, rgba(241, 196, 15, 0.08), transparent 28%),
    linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.app {
  min-height: 100vh;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  transition: opacity 450ms ease, transform 450ms ease;
}

.screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.99);
}

.login-screen {
  display: grid;
  place-items: center;
  padding: 32px 16px;
  overflow: hidden;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(66, 224, 209, 0.18), transparent 20%),
    radial-gradient(circle at 80% 20%, rgba(241, 196, 15, 0.14), transparent 18%),
    radial-gradient(circle at 50% 80%, rgba(66, 224, 209, 0.08), transparent 22%);
  pointer-events: none;
  filter: blur(0px);
}

.particle {
  position: absolute;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.4), rgba(241, 196, 15, 0.25));
  filter: blur(1px);
  animation: drift linear infinite;
  opacity: 0.9;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, -120px, 0) scale(1.1); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(66, 224, 209, 0.18);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
  transform-origin: center;
  animation: floatIn 700ms cubic-bezier(0.18, 0.9, 0.22, 1) both;
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-hero {
  padding: 30px 28px 24px;
  background:
    linear-gradient(135deg, rgba(66, 224, 209, 0.16), rgba(241, 196, 15, 0.14)),
    linear-gradient(180deg, #ffffff, #fafbfc);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(66, 224, 209, 0.16), rgba(241, 196, 15, 0.22));
  box-shadow: inset 0 0 0 1px rgba(66, 224, 209, 0.18);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.brand-title {
  font-size: 1.2rem;
  line-height: 1;
}

.login-hero h1 {
  margin: 22px 0 10px;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.login-hero p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.credential-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hint-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(248, 249, 250, 0.95);
  border: 1px solid rgba(31, 41, 55, 0.06);
  color: var(--text);
  font-size: 0.86rem;
}

.hint-badge strong {
  color: var(--primary);
}

.login-form {
  padding: 24px 28px 28px;
}

.field {
  margin-bottom: 16px;
}

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

.input {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  background: #fff;
  padding: 0 14px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  outline: none;
}

.input::placeholder { color: #9ca3af; }

.input:focus {
  border-color: rgba(66, 224, 209, 0.7);
  box-shadow: 0 0 0 4px rgba(66, 224, 209, 0.12);
  transform: translateY(-1px);
}

.primary-btn, .secondary-btn, .ghost-btn, .upgrade-btn {
  border: 0;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), opacity var(--transition);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.primary-btn {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #24c7b8);
  color: #07363b;
  box-shadow: 0 16px 28px rgba(66, 224, 209, 0.28);
}

.primary-btn:hover,
.primary-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(66, 224, 209, 0.34), 0 0 0 4px rgba(241, 196, 15, 0.12);
  background: linear-gradient(135deg, #4ef0e2, #1fbfb1);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.upgrade-btn:active {
  transform: translateY(1px) scale(0.99);
}

.small-note {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.55;
}

.dashboard-screen {
  display: flex;
  flex-direction: column;
  opacity: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dashboard-screen.visible { opacity: 1; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  min-height: 100px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.04);
}

.nav-left, .nav-right, .nav-center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.nav-brand-logo {
  height: 40px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

.nav-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-copy strong { font-size: 0.98rem; }
.nav-copy span {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(248, 249, 250, 0.95);
  border: 1px solid rgba(31, 41, 55, 0.06);
}

.tab-btn {
  position: relative;
  border: 0;
  background: transparent;
  color: #4b5563;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.tab-btn:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.18), rgba(241, 196, 15, 0.18));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(66, 224, 209, 0.22);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(248, 249, 250, 0.95);
  border: 1px solid rgba(31, 41, 55, 0.06);
  white-space: nowrap;
  font-size: 0.9rem;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #5f4200;
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.88), rgba(255, 215, 0, 0.7));
  box-shadow: 0 10px 26px rgba(241, 196, 15, 0.25);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.plan-badge::after {
  content: "";
  position: absolute;
  inset: -30% -15%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.38), transparent);
  transform: translateX(-120%) rotate(20deg);
  animation: sparkleSweep 3.8s ease-in-out infinite;
}

@keyframes sparkleSweep {
  0%, 50% { transform: translateX(-120%) rotate(20deg); }
  100% { transform: translateX(140%) rotate(20deg); }
}

.plan-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.18);
  position: relative;
  z-index: 1;
}

.logout-btn {
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(31, 41, 55, 0.05);
  border: 1px solid rgba(31, 41, 55, 0.08);
  color: var(--text);
}

.logout-btn:hover,
.ghost-btn:hover,
.secondary-btn:hover {
  background: rgba(31, 41, 55, 0.07);
  transform: translateY(-1px);
}

.upgrade-btn {
  height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.14), rgba(241, 196, 15, 0.12));
  color: #5b4200;
  box-shadow: 0 14px 28px rgba(241, 196, 15, 0.22);
}

.upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(241, 196, 15, 0.30);
  filter: saturate(1.05);
}

.content {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #ffffff, rgba(66, 224, 209, 0.05));
  border: 1px solid rgba(66, 224, 209, 0.16);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 2.05rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--text-soft);
  max-width: 64ch;
  line-height: 1.6;
}

.top-meta {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.plan-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.10), rgba(66, 224, 209, 0.08));
  border: 1px solid rgba(241, 196, 15, 0.18);
  font-weight: 700;
}

.plan-card small {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  color: var(--text-soft);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 92px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 24px;
  box-shadow: 0 16px 38px rgba(31, 41, 55, 0.08);
  padding: 18px;
}

.sidebar h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.side-list {
  display: grid;
  gap: 8px;
}

.side-item {
  border: 0;
  cursor: pointer;
  padding: 14px 14px;
  border-radius: 16px;
  text-align: left;
  background: rgba(248, 249, 250, 0.92);
  color: #374151;
  font-weight: 700;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.side-item:hover {
  transform: translateX(2px);
  box-shadow: inset 0 0 0 1px rgba(66, 224, 209, 0.18);
}

.side-item.active {
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.16), rgba(241, 196, 15, 0.12));
  box-shadow: inset 0 0 0 1px rgba(66, 224, 209, 0.24);
  color: var(--text);
}

.sidebar-info {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 249, 250, 0.96), #fff);
  border: 1px solid rgba(31, 41, 55, 0.06);
  color: var(--text-soft);
  line-height: 1.65;
}

.main-panel { min-width: 0; }

.section {
  display: none;
  animation: sectionIn 340ms ease;
}

.section.active { display: block; }

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(31, 41, 55, 0.06);
  padding: 18px;
}

.metric {
  grid-column: auto;
  position: relative;
  overflow: hidden;
  min-height: 138px;
}

.metric.gold {
  overflow: visible;
  z-index: 2;
}

.metric::before {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66, 224, 209, 0.17), transparent 68%);
}

.metric.gold::before {
  background: radial-gradient(circle, rgba(241, 196, 15, 0.20), transparent 68%);
}

.metric-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.9rem;
}

.metric-value {
  margin-top: 16px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.metric-sub {
  margin-top: 8px;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.92rem;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(66, 224, 209, 0.12);
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 700;
  margin-left: 4px;
}

.stack {
  display: grid;
  gap: 16px;
}

.other-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.other-cards > section.card:first-child {
  width: 100%;
}

.credits-card .panel-header {
  margin-bottom: 10px;
}

.credits-facts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  margin-top: 12px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.95rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(66, 224, 209, 0.18);
  background: rgba(66, 224, 209, 0.08);
  color: #0f766e;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27c17d;
  box-shadow: 0 0 0 5px rgba(39, 193, 125, 0.12);
}

.drive-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.secondary-btn {
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(31, 41, 55, 0.05);
  color: var(--text);
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.message-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(66, 224, 209, 0.18);
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.08), rgba(241, 196, 15, 0.08));
  color: #0f3d41;
  display: none;
}

.message-box.show {
  display: block;
  animation: sectionIn 320ms ease;
}

.overview-facts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.fact {
  padding: 14px;
  border-radius: 18px;
  background: rgba(248, 249, 250, 0.9);
  border: 1px solid rgba(31, 41, 55, 0.06);
}

.fact span {
  display: block;
  color: var(--text-soft);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.fact strong { font-size: 1rem; }

.canvas-wrap {
  position: relative;
  min-height: 360px;
}

#analyticsChart {
  width: 100%;
  height: 320px;
  display: block;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 249, 250, 0.92), rgba(255,255,255,0.92));
  border: 1px solid rgba(31, 41, 55, 0.06);
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -120%);
  padding: 10px 12px;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.15);
  transition: opacity 140ms ease;
  white-space: nowrap;
}

.chart-tooltip.visible { opacity: 1; }

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: #fff;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  background: rgba(248, 249, 250, 0.95);
  color: #4b5563;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody td {
  padding: 14px 16px;
  border-top: 1px solid rgba(31, 41, 55, 0.06);
  color: var(--text);
  vertical-align: top;
}

tbody tr:hover { background: rgba(66, 224, 209, 0.03); }

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(66, 224, 209, 0.10);
  color: #0f766e;
  font-weight: 700;
  font-size: 0.88rem;
  word-break: break-all;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.setting-row {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(248, 249, 250, 0.96);
  border: 1px solid rgba(31, 41, 55, 0.06);
}

.toggle-meta {
  display: grid;
  gap: 4px;
}

.toggle-meta strong { font-size: 0.98rem; }
.toggle-meta span {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.switch {
  width: 56px;
  height: 32px;
  position: relative;
  flex: 0 0 auto;
  opacity: 0.65;
  cursor: not-allowed;
}

.switch input {
  appearance: none;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.12);
  outline: none;
  cursor: not-allowed;
}

.switch input::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform var(--transition);
}

.switch input:checked { background: rgba(66, 224, 209, 0.55); }
.switch input:checked::before { transform: translateX(24px); }

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(241, 196, 15, 0.10);
  color: #8a6700;
  border: 1px solid rgba(241, 196, 15, 0.18);
  font-size: 0.82rem;
  font-weight: 700;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 60;
}

.toast {
  min-width: 280px;
  max-width: 360px;
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255,255,255,0.08);
  animation: toastIn 260ms ease;
}

.toast strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.toast p {
  margin: 0;
  color: rgba(255,255,255,0.82);
  line-height: 1.45;
  font-size: 0.92rem;
}

.toast.success { border-left: 4px solid var(--primary); }
.toast.error { border-left: 4px solid #fb7185; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fade-out { animation: fadeOut 340ms ease forwards; }
.fade-in { animation: fadeIn 420ms ease forwards; }

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .two-col, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-left, .nav-center, .nav-right { flex-wrap: wrap; }
  .nav-center { justify-content: flex-start; }
  .topbar { flex-direction: column; }
  .top-meta { width: 100%; }
  .overview-facts { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .login-card { border-radius: 22px; }
  .login-hero, .login-form {
    padding-left: 18px;
    padding-right: 18px;
  }

  .content {
    width: min(100%, calc(100% - 18px));
    margin-top: 16px;
  }

  .drive-form { grid-template-columns: 1fr; }
  .nav-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .tab-btn {
    flex: 1;
    padding-inline: 10px;
  }

  .toast-container {
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: unset;
    max-width: none;
  }
}

.accounts-dropdown {
  position: relative;
}

.account-select-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.12), rgba(241, 196, 15, 0.10));
  border: 1px solid rgba(66, 224, 209, 0.22);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}

.account-select-btn:hover {
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.18), rgba(241, 196, 15, 0.14));
  box-shadow: inset 0 0 0 1px rgba(66, 224, 209, 0.30);
}

.account-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #07363b;
  flex-shrink: 0;
}

.account-icon svg {
  width: 16px;
  height: 16px;
}

.account-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.account-platform {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(66, 224, 209, 0.20);
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
}

.dropdown-arrow {
  width: 18px;
  height: 18px;
  color: var(--text-soft);
  flex-shrink: 0;
}

.accounts-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(31, 41, 55, 0.10);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(31, 41, 55, 0.14);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
  z-index: 30;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.accounts-list.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 150ms ease;
}

.account-option:hover {
  background: rgba(66, 224, 209, 0.06);
}

.account-option.selected {
  background: rgba(66, 224, 209, 0.10);
}

.account-option .platform-badge {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.account-option .platform-badge.tiktok {
  background: rgba(0, 0, 0, 0.08);
  color: #1f2937;
}

.account-option .platform-badge.instagram {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.15), rgba(252, 175, 69, 0.15));
  color: #c13584;
}

.chart-container, .engagement-chart-container {
  position: relative;
  height: 300px;
  padding: 16px;
}

.chart-time-badge {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(66, 224, 209, 0.12);
  color: #0d9488;
  border-radius: 20px;
  font-weight: 500;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px;
}

.video-card {
  background: #f9fafb;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(31, 41, 55, 0.12);
}

.video-thumb {
  height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 8px;
}

.video-duration {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.video-info {
  padding: 12px;
}

.video-desc {
  font-size: 13px;
  color: #374151;
  margin: 0 0 8px 0;
  font-weight: 500;
}

.video-stats {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
}

.eng-high {
  color: #0d9488;
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
}

.modal-content h3 {
  margin: 0 0 16px 0;
  color: #1f2937;
}

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

.stat-box {
  text-align: center;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.stat-box strong {
  display: block;
  font-size: 18px;
  color: #1f2937;
}

.stat-box span {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
}

.modal-date {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

/* Account checkboxes for submission form */
.account-checkboxes {
  display: grid;
  gap: 8px;
}

.account-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(248, 249, 250, 0.96);
  border: 1px solid rgba(31, 41, 55, 0.08);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.account-checkbox:hover {
  background: rgba(66, 224, 209, 0.06);
  border-color: rgba(66, 224, 209, 0.22);
}

.account-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.account-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.account-checkbox-name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.92rem;
}

.account-checkbox-platform {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.account-checkbox-platform.tiktok {
  background: rgba(0, 0, 0, 0.08);
  color: #1f2937;
}

.account-checkbox-platform.instagram {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.15), rgba(252, 175, 69, 0.15));
  color: #c13584;
}

.account-checkbox-followers {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 0.82rem;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge.pending {
  background: rgba(241, 196, 15, 0.12);
  color: #8a6700;
}

.status-badge.processing {
  background: rgba(66, 224, 209, 0.12);
  color: #0f766e;
}

.status-badge.completed {
  background: rgba(39, 193, 125, 0.12);
  color: #0d7a4d;
}

.status-badge.rejected {
  background: rgba(251, 113, 133, 0.12);
  color: #be123c;
}

/* Admin complete button */
.admin-complete-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(66, 224, 209, 0.30);
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.12), rgba(241, 196, 15, 0.08));
  color: #0f766e;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.admin-complete-btn:hover {
  background: linear-gradient(135deg, rgba(66, 224, 209, 0.22), rgba(241, 196, 15, 0.14));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 224, 209, 0.18);
}

/* Admin complete form inline */
.admin-complete-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.admin-complete-form .input {
  width: 100%;
}

.admin-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-submit-complete-btn,
.admin-reject-btn,
.admin-cancel-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.admin-submit-complete-btn {
  background: linear-gradient(135deg, var(--primary), #24c7b8);
  color: #07363b;
  box-shadow: 0 8px 18px rgba(66, 224, 209, 0.22);
}

.admin-submit-complete-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(66, 224, 209, 0.30);
}

.admin-reject-btn {
  background: rgba(251, 113, 133, 0.12);
  color: #be123c;
  border: 1px solid rgba(251, 113, 133, 0.22);
}

.admin-reject-btn:hover {
  background: rgba(251, 113, 133, 0.20);
  transform: translateY(-1px);
}

.admin-cancel-btn {
  background: rgba(31, 41, 55, 0.05);
  color: var(--text-soft);
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.admin-cancel-btn:hover {
  background: rgba(31, 41, 55, 0.10);
  transform: translateY(-1px);
}

/* Admin textarea */
textarea.input {
  height: auto;
  min-height: 60px;
  padding: 12px 14px;
  resize: vertical;
  font-family: inherit;
}

/* ---- Bundle Video Form ---- */
.profile-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.bundle-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost-btn {
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(66, 224, 209, 0.3);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.ghost-btn:hover {
  background: rgba(66, 224, 209, 0.08);
  transform: translateY(-1px);
}

.delete-row-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: background var(--transition), transform var(--transition);
}
.delete-row-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  transform: scale(1.05);
}

#bundleVideosTable td {
  padding: 8px 10px;
  vertical-align: middle;
}
#bundleVideosTable td .input {
  height: 42px;
  font-size: 0.88rem;
}
#bundleVideosTable th:first-child,
#bundleVideosTable td:first-child {
  text-align: center;
  font-weight: 700;
  color: var(--text-soft);
  width: 50px;
  user-select: none;
}

.row-error .input {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.row-error td:first-child {
  color: #ef4444;
}
