:root {
  --bg-1: #f6f8f5;
  --bg-2: #eaf1fb;
  --surface: #ffffff;
  --surface-soft: #f6fbff;
  --ink: #17303a;
  --muted: #58707a;
  --brand: #0f766e;
  --brand-strong: #0a4f4d;
  --accent: #c76911;
  --line: #d6e4ea;
  --line-strong: #bdd3dc;
  --shadow-sm: 0 8px 20px rgba(15, 36, 44, 0.06);
  --shadow-md: 0 16px 36px rgba(15, 36, 44, 0.1);
  --radius: 16px;
  --container-max: 1260px;
  --base-font: 16px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: var(--base-font);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 700px at -10% -10%, rgba(15, 118, 110, 0.17), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(199, 105, 17, 0.16), transparent 58%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.card-header {
  font-family: "Sora", "Trebuchet MS", sans-serif;
  letter-spacing: 0.01em;
}

a {
  text-decoration: none;
}

.container {
  max-width: var(--container-max);
  padding-left: 18px;
  padding-right: 18px;
}

.app-webview .container-fluid {
  background: transparent;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
}

.app-nav-inner {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink) !important;
  font-weight: 700;
}

.app-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-size: 0.78rem;
  box-shadow: var(--shadow-sm);
}

.app-nav-list {
  gap: 0.35rem;
}

.app-nav-link {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem !important;
  color: #264650 !important;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.app-nav-link:hover {
  background: #edf5f8;
  color: #1d3e49 !important;
  transform: translateY(-1px);
}

.app-nav-link.active {
  color: #fff !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 8px 22px rgba(10, 79, 77, 0.35);
}

.hero-wrap {
  padding: 1.15rem 0 0.75rem;
}

.hero-panel {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 64%, #fff5e8 100%);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-md);
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.hero-copy {
  max-width: 760px;
}

.hero-eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--brand-strong);
  font-weight: 700;
}

.hero-title {
  margin: 0.2rem 0 0.25rem;
  font-size: clamp(1.18rem, 2.2vw, 1.6rem);
}

.hero-text {
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.app-main {
  padding-bottom: 2.5rem;
  animation: rise-in 0.35s ease;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f9fcff, #f3f8fb);
  font-weight: 600;
}

.text-muted,
.small.text-muted,
.form-text {
  color: var(--muted) !important;
}

.form-control,
.form-select,
.input-group-text {
  border-color: var(--line-strong);
  border-radius: 12px;
}

.form-control,
.form-select {
  padding: 0.52rem 0.7rem;
  background: #fff;
}

.form-control:focus,
.form-select:focus {
  border-color: #7ba8b8;
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.18);
}

.input-group > .form-control,
.input-group > .form-select {
  border-radius: 12px;
}

.btn {
  border-radius: 12px;
  font-weight: 600;
}

.btn-primary {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--brand-strong);
  background: linear-gradient(135deg, #10857c, #0b605d);
}

.btn-outline-primary {
  border-color: #2f8f87;
  color: #1f6863;
}

.btn-outline-primary:hover {
  background: #2f8f87;
  border-color: #2f8f87;
}

.btn-outline-secondary {
  border-color: #b7cbd4;
  color: #36535d;
}

.btn-outline-secondary:hover {
  background: #e6f0f4;
  border-color: #b7cbd4;
  color: #1f404a;
}

.btn-outline-danger {
  border-color: #de7f7f;
  color: #9d2f2f;
}

.btn-success {
  background: linear-gradient(135deg, #17966c, #117e5a);
  border-color: #117e5a;
}

.table {
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  border-bottom-color: #e7eff3;
  padding-top: 0.58rem;
  padding-bottom: 0.58rem;
  vertical-align: middle;
}

.table thead th {
  color: #234750;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pagination .page-link {
  border-color: var(--line);
  color: #274851;
  border-radius: 11px !important;
  min-width: 40px;
  text-align: center;
}

.pagination .page-item.active .page-link {
  border-color: var(--brand);
  background: var(--brand);
}

.alert {
  border: 1px solid transparent;
  border-radius: 12px;
}

.alert-info {
  border-color: #9ed6e2;
  background: #e8f7fb;
  color: #0f5263;
}

.alert-success {
  border-color: #93d2b5;
  background: #ebfaf2;
  color: #1c6346;
}

.alert-danger {
  border-color: #e7acac;
  background: #fff1f1;
  color: #7a1f1f;
}

pre {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4fafc;
  padding: 0.85rem;
}

canvas {
  max-width: 100%;
}

.surface-intro {
  margin-bottom: 1rem;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  color: var(--muted);
  font-weight: 600;
}

.kpi-value {
  margin-top: 0.15rem;
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  line-height: 1.2;
  font-weight: 700;
}

.kpi-help {
  margin-top: 0.3rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.empty-state {
  border: 1px dashed #b9ced7;
  border-radius: 14px;
  background: #f9fcfd;
  color: var(--muted);
  padding: 1.1rem 1rem;
  text-align: center;
}

/* Legacy tiles for shopping/webview pages */
.app-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.app-tile {
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 14px;
  background: #fff;
  border: 1px solid #e7f0f4;
  box-shadow: var(--shadow-sm);
  min-height: 116px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.app-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 34px rgba(11, 34, 40, 0.11);
}

.app-tile .icon {
  font-size: 21px;
  margin-bottom: 8px;
  color: var(--brand);
}

.app-tile .tile-label {
  text-align: center;
  line-height: 1.1;
}

.bring-list .item-card {
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.bring-list .icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4fbff;
  color: var(--ink);
}

#appToasts .toast {
  margin-top: 0.5rem;
  border-radius: 10px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991.98px) {
  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .app-nav-list {
    padding-top: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  :root {
    --base-font: 15px;
  }

  .app-brand-mark {
    width: 30px;
    height: 30px;
  }

  .hero-wrap {
    padding-top: 0.8rem;
  }

  .hero-panel {
    padding: 0.92rem;
  }
}
