:root {
  --blue-dark: #06264f;
  --blue: #0b4388;
  --blue-soft: #1b73c9;
  --yellow: #ffc928;
  --yellow-soft: #ffe27a;
  --white: #ffffff;
  --text: #f8fbff;
  --muted: #c9def7;
  --danger: #ff7a7a;
  --success: #72f0ba;
  --panel: rgba(9, 52, 105, 0.92);
  --panel-dark: rgba(4, 29, 61, 0.96);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 22px 60px rgba(2, 19, 45, 0.36);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Poppins", system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% 8%, rgba(104, 201, 255, 0.23), transparent 23rem),
    radial-gradient(circle at 90% 0%, rgba(255, 201, 40, 0.18), transparent 19rem),
    linear-gradient(180deg, #0d4385 0%, #082c5a 45%, #051b39 100%);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, .primary-btn, .ghost-btn, .eyebrow, .badge, .sidebar-brand strong { font-family: "Baloo 2", cursive; }

.ocean-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.12));
  opacity: 0.2;
  animation: bubbleFloat 15s linear infinite;
}

.b1 { width: 90px; height: 90px; left: 5%; bottom: -100px; animation-delay: 0s; }
.b2 { width: 50px; height: 50px; right: 9%; bottom: -70px; animation-delay: 3s; }
.b3 { width: 70px; height: 70px; left: 70%; bottom: -80px; animation-delay: 6s; }
.b4 { width: 38px; height: 38px; left: 45%; bottom: -60px; animation-delay: 9s; }

@keyframes bubbleFloat {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-120vh) scale(1.22); }
}

.is-hidden { display: none !important; }

.login-screen {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 430px;
  align-items: center;
  gap: 22px;
}

.login-screen.login-only {
  grid-template-columns: minmax(0, 430px);
  justify-content: center;
  align-items: center;
}

.login-screen.login-only .login-card {
  width: 100%;
}

.login-hero, .login-card, .panel-card, .stat-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(20, 84, 158, 0.92), rgba(9, 53, 108, 0.96));
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.login-hero, .login-card { padding: clamp(24px, 4vw, 36px); }
.brand-logo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 30px;
  background: var(--white);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.eyebrow, .badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  color: var(--yellow-soft);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.badge.ready { color: #063b27; background: var(--success); }
.badge.wait { color: #6d4600; background: var(--yellow-soft); }

.login-hero h1, .topbar h1 {
  margin: 12px 0 10px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.02;
}

.login-hero p, .login-card p, .muted, .topbar p, .stat-card small, table td, .warning-card p {
  color: var(--muted);
  line-height: 1.75;
}

.mini-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  align-items: center;
}
.mini-flow span {
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  font-weight: 800;
}
.mini-flow b { color: var(--yellow); }

.login-card h2, .panel-card h2 { margin: 0; font-size: 2rem; }
label {
  display: grid;
  gap: 8px;
  margin-top: 15px;
  color: var(--muted);
  font-weight: 700;
}

input, textarea {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 18px;
  padding: 13px 15px;
  min-height: 50px;
  color: var(--text);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.08);
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(255,255,255,0.58); }
input:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(255, 201, 40, 0.28); }

.primary-btn, .ghost-btn, .logout-btn, .side-nav button, .action-btn {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 11px 18px;
  font-weight: 800;
  transition: 0.2s ease;
}
.primary-btn:hover, .ghost-btn:hover, .side-nav button:hover, .logout-btn:hover, .action-btn:hover { transform: translateY(-2px); }
.primary-btn {
  color: #4d3100;
  background: linear-gradient(180deg, var(--yellow-soft), var(--yellow));
  box-shadow: 0 10px 24px rgba(255, 201, 40, 0.34);
}
.ghost-btn {
  color: var(--text);
  background: rgba(255,255,255,0.11);
  border: 1px solid var(--border);
}
.full { width: 100%; margin-top: 20px; }
.back-link { display: block; margin-top: 16px; text-align: center; color: var(--yellow-soft); font-weight: 800; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: rgba(4, 31, 64, 0.95);
  border-right: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 18px;
  background: var(--white);
}
.sidebar-brand strong { display: block; font-size: 1.34rem; }
.sidebar-brand small { color: var(--yellow-soft); }

.side-nav { display: grid; gap: 10px; margin-top: 28px; }
.side-nav button, .logout-btn {
  width: 100%;
  color: var(--muted);
  background: transparent;
  text-align: left;
  border-radius: 18px;
}
.side-nav button.active, .side-nav button:hover, .logout-btn:hover {
  color: var(--yellow-soft);
  background: rgba(255,255,255,0.10);
}
.logout-btn {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  width: calc(100% - 44px);
  color: #ffd5d5;
}

.main-panel { padding: 26px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.topbar h1 { font-size: clamp(2.3rem, 4vw, 3.8rem); }
.topbar p { margin: 0; }
.top-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.view { display: none; }
.view.active { display: block; animation: viewIn 0.35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.stat-card { padding: 20px; }
.stat-card span { color: var(--muted); font-weight: 800; }
.stat-card strong {
  display: block;
  margin: 8px 0;
  color: var(--yellow-soft);
  font-size: 1.85rem;
  line-height: 1.05;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 18px;
}
.products-layout { grid-template-columns: 390px 1fr; }
.panel-card { padding: 22px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.warning-card {
  background: linear-gradient(180deg, rgba(121, 72, 0, 0.8), rgba(77, 42, 0, 0.72));
  border-color: rgba(255, 226, 122, 0.25);
}

.timeline { display: grid; gap: 12px; }
.timeline div {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.10);
}
.timeline b {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #4d3100;
  background: linear-gradient(180deg, var(--yellow-soft), var(--yellow));
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,0.10); text-align: left; vertical-align: top; }
th { color: var(--yellow-soft); }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-btn { min-height: 36px; padding: 8px 12px; border-radius: 12px; color: var(--text); background: rgba(255,255,255,0.12); }
.action-btn.danger { color: #fff2f2; background: rgba(255, 122, 122, 0.24); }
.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  color: #4d3100;
  background: var(--yellow-soft);
  font-weight: 800;
}
.status-pill.done { color: #073b27; background: var(--success); }
.status-pill.cancel { color: #681111; background: #ffb1b1; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.code-card pre {
  overflow: auto;
  margin: 16px 0;
  padding: 16px;
  border-radius: 20px;
  background: rgba(2, 18, 42, 0.65);
  color: var(--yellow-soft);
}
.checklist { display: grid; gap: 12px; }
.checklist label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.10);
}
.checklist input { width: 18px; min-height: 18px; accent-color: var(--yellow); }
.settings-card { max-width: 780px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%) translateY(120px);
  opacity: 0;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--panel-dark);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--yellow-soft);
  font-weight: 800;
  transition: 0.25s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 1120px) {
  .app-shell, .login-screen, .two-column, .products-layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .logout-btn { position: static; width: 100%; margin-top: 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .login-screen, .main-panel, .sidebar { padding: 16px; }
  .topbar { flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  .stat-grid { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .brand-logo { width: 120px; height: 120px; }
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.08);
}
.check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: auto;
  accent-color: var(--yellow);
}
label small {
  color: var(--yellow-soft);
  font-weight: 700;
}
.toast[data-type="error"] {
  background: linear-gradient(180deg, #ff9c9c, #ff6262);
  color: #3b0606;
}
.status-pill.done {
  background: rgba(114, 240, 186, 0.18);
  color: #b9ffdc;
}
.status-pill.cancel {
  background: rgba(255, 122, 122, 0.18);
  color: #ffd2d2;
}
