:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef5f3;
  --line: #d9e3ea;
  --text: #15202b;
  --muted: #657481;
  --green: #149567;
  --green-dark: #0d7255;
  --blue: #2676d9;
  --amber: #f0a12b;
  --rose: #e15353;
  --shadow: 0 14px 40px rgba(30, 51, 73, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.boot-screen, .login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.boot-logo { width: 96px; margin: 0 auto 12px; border-radius: 24px; }

.login-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-panel h1 { margin: 12px 0 8px; font-size: 30px; }
.login-panel p { margin: 0 0 22px; color: var(--muted); line-height: 1.55; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: #fbfcfd;
  border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; }
.brand strong { display: block; font-size: 18px; }
.brand span { color: var(--muted); font-size: 13px; }

.nav-list { display: grid; gap: 8px; }
.nav-btn {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}
.nav-btn.active { background: #e8f4ef; color: var(--green-dark); font-weight: 700; }

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px 24px 96px;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0; font-size: 26px; }
.topbar p { margin: 3px 0 0; color: var(--muted); }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn, .plain-btn {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.primary-btn, .secondary-btn, .danger-btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}
.primary-btn { background: var(--green); color: #fff; }
.secondary-btn { background: #e9f2ff; color: #155aa8; }
.danger-btn { background: #ffecec; color: #a31d1d; }
.primary-btn:disabled, .secondary-btn:disabled { opacity: .55; cursor: not-allowed; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 51, 73, 0.07);
}
.panel { padding: 18px; }
.card { padding: 14px; }

.hero {
  overflow: hidden;
  min-height: 250px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  background: #e6f3ef;
}
.hero-copy { padding: 24px; }
.hero-copy h2 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 44px); }
.hero-copy p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.hero img { height: 100%; width: 100%; object-fit: cover; align-self: stretch; }

.stat { padding: 16px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 6px; font-size: 24px; }

.quick-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.input, .select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  outline: none;
}
.input:focus, .select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20, 149, 103, .13); }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; }
.section-title h2 { margin: 0; font-size: 18px; }

.mission, .history-row, .notification-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.badge, .status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}
.badge { background: #fff4df; color: #9a5b00; }
.status.pending { background: #fff4df; color: #8c5b00; }
.status.success { background: #e3f7ed; color: #087046; }
.status.failed { background: #ffe9e9; color: #a82020; }

.store-logo { width: 46px; height: 46px; border-radius: 8px; object-fit: contain; background: #f6f8fa; padding: 6px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.mobile-tabs {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.mobile-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.mobile-tabs button.active { background: #e8f4ef; color: var(--green-dark); font-weight: 800; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  z-index: 10;
  width: min(460px, calc(100% - 28px));
  padding: 13px 14px;
  border-radius: 8px;
  color: #fff;
  background: #24313b;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .side-nav { display: none; }
  .mobile-tabs { display: grid; }
  .content { padding: 16px 14px 92px; }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 22px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero img { max-height: 190px; }
  .quick-link { grid-template-columns: 1fr; }
  .mission, .history-row, .notification-row { grid-template-columns: auto minmax(0, 1fr); }
  .mission .primary-btn, .history-row .status { grid-column: 1 / -1; width: 100%; }
}
