:root {
  --navy: #15184f;
  --deep: #24115f;
  --purple: #6d28d9;
  --violet: #8b5cf6;
  --blue: #2563eb;
  --cyan: #0891b2;
  --teal: #0f766e;
  --green: #16803a;
  --orange: #ea580c;
  --red: #dc2626;
  --yellow: #b7791f;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --soft: #f7f8fc;
  --white: #ffffff;
  --shadow: 0 24px 55px rgba(21, 24, 79, .18);
  --radius: 28px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(109,40,217,.20), transparent 32%),
    radial-gradient(circle at bottom right, rgba(37,99,235,.18), transparent 28%),
    linear-gradient(135deg, #f7f9ff 0%, #ffffff 48%, #f4f0ff 100%);
}

button {
  font-family: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.mobile-frame {
  width: min(430px, 100%);
  height: min(920px, calc(100vh - 44px));
  min-height: 720px;
  background: var(--soft);
  border-radius: 44px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 10px solid #0f172a;
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  background: linear-gradient(145deg, var(--deep), var(--purple) 58%, var(--blue));
  color: white;
  padding: calc(24px + env(safe-area-inset-top)) 22px 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 4px;
  color: rgba(255,255,255,.76);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .03em;
}

.app-topbar h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -.04em;
  line-height: 1;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.14);
  color: white;
  border-radius: 16px;
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.screen {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  padding-bottom: 100px;
  scroll-behavior: smooth;
}

.hero-card {
  background: white;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(15,23,42,.08);
}

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

.greeting h2 {
  margin: 0;
  color: var(--navy);
  letter-spacing: -.03em;
  font-size: 24px;
  line-height: 1.08;
}

.greeting p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.priority-badge {
  background: #fee2e2;
  color: var(--red);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 14px;
}

.stat {
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 12px;
}

.stat b {
  display: block;
  color: var(--deep);
  font-size: 22px;
  letter-spacing: -.04em;
}

.stat span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.section-title {
  margin: 20px 2px 12px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.section-title h3 {
  margin: 0;
  font-size: 17px;
  color: var(--navy);
  letter-spacing: -.02em;
}

.section-title small {
  color: var(--muted);
  font-weight: 800;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.action-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.action-icon,
.notification-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 20px;
}

.action-card strong {
  display: block;
  color: #111827;
  font-size: 14px;
  margin-bottom: 2px;
}

.action-card p {
  margin: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.chev {
  color: #94a3b8;
  font-weight: 900;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin: -2px 0 8px;
}

.filter-chip {
  border: 1px solid #d8deea;
  background: white;
  color: #475569;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  border-color: transparent;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  cursor: pointer;
  position: relative;
}

.notification-card.unread::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.notification-card h4 {
  margin: 0 24px 4px 0;
  color: #0f172a;
  font-size: 14px;
}

.notification-card p {
  margin: 0;
  color: #667085;
  font-size: 12.5px;
  line-height: 1.38;
}

.meta-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.tag.urgent { background: #fee2e2; color: #b91c1c; }
.tag.action { background: #ffedd5; color: #c2410c; }
.tag.info { background: #dbeafe; color: #1d4ed8; }
.tag.done { background: #dcfce7; color: #166534; }
.tag.neutral { background: #f1f5f9; color: #475569; }

.detail-header {
  color: white;
  margin: -18px -18px 18px;
  padding: 20px 18px 22px;
  background: linear-gradient(135deg, var(--deep), var(--blue));
}

.back-button {
  border: 0;
  background: rgba(255,255,255,.13);
  color: white;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  margin-bottom: 16px;
  cursor: pointer;
}

.detail-header h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.detail-header p {
  margin: 0;
  color: rgba(255,255,255,.82);
  line-height: 1.45;
}

.info-panel {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #eef2f7;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row span {
  color: #64748b;
  font-size: 13px;
}

.info-row strong {
  text-align: right;
  color: #111827;
  font-size: 13px;
}

.primary-button,
.secondary-button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 15px 16px;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
}

.secondary-button {
  background: white;
  border: 1px solid #dbe3ef;
  color: var(--deep);
  margin-top: 10px;
}

.ai-card {
  background: linear-gradient(145deg, #f5f3ff, #eff6ff);
  border: 1px solid #ddd6fe;
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 12px;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--purple);
  font-weight: 950;
  margin-bottom: 8px;
}

.ai-card p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
  font-size: 14px;
}

.profile-list {
  display: grid;
  gap: 10px;
}

.profile-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.profile-item strong {
  color: #0f172a;
}

.profile-item span {
  color: #64748b;
  font-size: 13px;
  text-align: right;
}

.trust-note {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 14px;
  color: #475569;
  line-height: 1.5;
  font-size: 12.5px;
  margin-top: 12px;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(76px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96);
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  backdrop-filter: blur(15px);
}

.nav-button {
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  color: #64748b;
  font-weight: 900;
  cursor: pointer;
  padding: 8px 4px;
}

.nav-button span {
  font-size: 23px;
  line-height: 1;
}

.nav-button small {
  font-size: 10.5px;
  margin-top: 2px;
}

.nav-button.active {
  color: var(--purple);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  width: min(390px, calc(100% - 28px));
  background: #0f172a;
  color: white;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 20px 50px rgba(15,23,42,.2);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  z-index: 50;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .app-shell {
    padding: 0;
    place-items: stretch;
  }

  .mobile-frame {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }
}


/* v0.4 agency dashboard additions */
.dashboard-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.dashboard-metric {
  background: linear-gradient(180deg, #f8fafc, #fff);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
}

.dashboard-metric b {
  display: block;
  font-size: 25px;
  color: var(--deep);
  letter-spacing: -.04em;
}

.dashboard-metric span {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 850;
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-row {
  display: grid;
  grid-template-columns: 78px 1fr 42px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #334155;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
}

.search-box {
  width: 100%;
  border: 1px solid #dbe3ef;
  background: white;
  border-radius: 18px;
  padding: 13px 14px;
  font: inherit;
  font-weight: 750;
  color: var(--ink);
  outline: none;
  margin-bottom: 12px;
}

.search-box:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, .10);
}

.insight-card {
  background: linear-gradient(145deg, #eef2ff, #f8fafc);
  border: 1px solid #dbe3ff;
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 10px;
}

.insight-card strong {
  display: block;
  color: var(--deep);
  margin-bottom: 4px;
}

.insight-card p {
  margin: 0;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.45;
}

.bottom-nav {
  grid-template-columns: repeat(5, 1fr);
}

.nav-button small {
  font-size: 9.8px;
}


/* v0.4.1 greeting layout update */
.greeting-label {
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

.greeting-name {
  margin: 0;
  color: var(--navy);
  letter-spacing: -.03em;
  font-size: 24px;
  line-height: 1.08;
}
