/* DueTomorrow
   The look: the evening before. Deep twilight for the frame, a dawn-amber accent for
   "tomorrow", and quiet lavender paper for the working screens. */
:root {
  --twilight: #1E1A4D;
  --twilight-deep: #151238;
  --twilight-soft: #2C2769;
  --dawn: #FFB020;
  --dawn-deep: #F08A00;
  --ink: #17143A;
  --muted: #5B5878;
  --paper: #F5F4FB;
  --surface: #FFFFFF;
  --line: #E3E1F0;
  --line-soft: #EDECF6;
  --field-line: #8C89A8;
  --action: #4B3FE0;
  --action-deep: #372CB8;
  --nav-text: #CFCBEE;
  --ok-bg: #DDF5EC; --ok-ink: #0A5C45;
  --bad-bg: #FDE7E4; --bad-ink: #A3261A;
  --info-bg: #E9E6FD; --info-ink: #3A2FB5;
  --off-bg: #ECEBF3; --off-ink: #4A4766;
  --display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(30, 26, 77, 0.06), 0 8px 24px rgba(30, 26, 77, 0.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--action); text-underline-offset: 3px; }
a:hover { color: var(--action-deep); }
h1, h2 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.1; }
h1 { margin: 0; font-size: 38px; font-weight: 800; }
h2 { margin: 0; font-size: 21px; font-weight: 700; }
p { margin: 0; }
.loading { padding: 48px 16px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 23px; font-weight: 800; letter-spacing: -0.02em; color: #FFFFFF; padding: 0 12px; }
.brand-mark { width: 26px; height: 13px; flex: none; border-radius: 26px 26px 0 0; background: var(--dawn); box-shadow: 0 3px 0 -1px var(--twilight), 0 5px 0 -1px var(--dawn); margin-bottom: 4px; }

/* Layout */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 1 1 230px; background: var(--twilight); padding: 28px 16px 24px; display: flex; flex-direction: column; gap: 28px; }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 12px; text-decoration: none; font-weight: 500; color: var(--nav-text); }
.nav-link::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; }
.nav-link:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.06); }
.nav-link.active { background: var(--twilight-soft); color: #FFFFFF; font-weight: 600; }
.nav-link.active::before { background: var(--dawn); }
.nav-foot { margin-top: auto; padding: 16px 14px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; flex-direction: column; gap: 2px; }
.nav-business { font-weight: 600; color: #FFFFFF; overflow-wrap: anywhere; }
.nav-email { font-size: 13px; color: var(--nav-text); overflow-wrap: anywhere; }
.nav-usage { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.nav-usage-text { font-size: 13px; color: var(--nav-text); }
.meter { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--dawn); }
.meter-full .meter-fill { background: #FF7A6B; }
td select { width: auto; min-width: 0; min-height: 44px; padding: 0 8px; }
td .btn { min-height: 44px; padding: 0 16px; }
.link-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: none; background: none; font: inherit; font-size: 14px; color: var(--nav-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.link-button:hover { color: #FFFFFF; }
.main { flex: 999 1 560px; min-width: 0; padding: 36px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
.main > * { width: 100%; max-width: 1180px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.page-head p { margin-top: 8px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .narrow { flex: 1 1 280px; }
.split > .wide { flex: 3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* Home: tomorrow */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 30px 32px; border-radius: 24px; color: #FFFFFF;
  background: radial-gradient(120% 140% at 0% 115%, rgba(255, 176, 32, 0.55) 0%, rgba(240, 138, 0, 0.18) 28%, rgba(30, 26, 77, 0) 55%), linear-gradient(135deg, var(--twilight-soft), var(--twilight-deep)); }
.cal { flex: none; width: 112px; border-radius: 18px; overflow: hidden; background: #FFFFFF; color: var(--ink); text-align: center; box-shadow: 0 10px 30px rgba(10, 8, 40, 0.45); transform: rotate(-3deg); }
.cal-top { padding: 6px 0; background: var(--dawn); font-family: var(--display); font-weight: 700; font-size: 15px; }
.cal-day { font-family: var(--display); font-weight: 800; font-size: 54px; line-height: 1; padding-top: 8px; letter-spacing: -0.03em; }
.cal-month { padding: 2px 0 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.hero-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { font-size: 44px; color: #FFFFFF; }
.hero p { color: #E4E1FA; font-size: 17px; max-width: 46ch; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-weight: 600; font-size: 15px; }
.fact-bad { background: #FFFFFF; color: var(--bad-ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--action); color: #FFFFFF; box-shadow: 0 6px 16px rgba(75, 63, 224, 0.28); }
.btn-primary:hover { background: var(--action-deep); color: #FFFFFF; }
.btn-dawn { background: var(--dawn); color: var(--ink); }
.btn-dawn:hover { background: #FFC24D; color: var(--ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--field-line); }
.btn-secondary:hover { color: var(--ink); background: var(--paper); }
.btn-danger { background: var(--surface); color: var(--bad-ink); border-color: var(--bad-ink); }
.btn-danger:hover { background: var(--bad-bg); }
.btn[disabled] { opacity: 0.6; cursor: default; box-shadow: none; }
.btn-block { width: 100%; }

/* Cards and tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.card-pad { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-title { padding: 22px 24px 8px; }
.card-title p { margin-top: 6px; color: var(--muted); }
.card-foot { padding: 18px 24px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 640px; border-collapse: collapse; }
th { padding: 12px 24px; font-size: 14px; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; }
td { padding: 16px 24px; border-top: 1px solid var(--line-soft); font-size: 15px; vertical-align: top; }
tbody tr:hover td { background: #FAFAFE; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.strong { font-weight: 600; }
td a.strong { font-weight: 600; color: var(--ink); text-decoration: none; }
td a.strong:hover { color: var(--action); text-decoration: underline; }
.sub { margin-top: 2px; font-size: 14px; color: var(--muted); }
.empty { padding: 12px 24px 28px; color: var(--muted); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill-info { background: var(--info-bg); color: var(--info-ink); }
.pill-off { background: var(--off-bg); color: var(--off-ink); }
.detail-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.detail-value { margin-top: 2px; overflow-wrap: anywhere; }

/* SMS bubbles */
.bubble { max-width: 520px; padding: 14px 18px; border-radius: 20px 20px 20px 6px; background: var(--off-bg); line-height: 1.5; overflow-wrap: anywhere; }
.bubble-preview { background: var(--twilight); color: #FFFFFF; }
.msg { display: flex; flex-direction: column; gap: 6px; }

/* Forms */
.form { max-width: 860px; padding: 28px; display: flex; flex-direction: column; gap: 28px; }
.form-group { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row > .field { flex: 1 1 220px; }
.field label, .label { font-size: 15px; font-weight: 600; }
.hint { font-size: 14px; color: var(--muted); }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--surface); font: inherit; color: var(--ink);
}
textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
select { padding: 0 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(75, 63, 224, 0.35); outline-offset: 0; border-color: var(--action); }
.btn:focus-visible, a:focus-visible, .link-button:focus-visible, .text-button:focus-visible { outline: 3px solid var(--dawn); outline-offset: 2px; }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--paper); }
.consent input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--action); }
.consent label { font-size: 15px; line-height: 1.5; }
.alert { padding: 12px 16px; border-radius: 12px; background: var(--bad-bg); color: var(--bad-ink); font-weight: 500; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.warn { padding: 12px 16px; border-radius: 12px; background: #FFF1D6; color: #7A4300; font-weight: 500; }
.drop { padding: 20px; border: 2px dashed var(--field-line); border-radius: 16px; background: var(--paper); display: flex; flex-direction: column; gap: 8px; }
.drop input { min-height: 44px; font: inherit; }
.search { max-width: 440px; display: flex; flex-direction: column; gap: 6px; }

/* Sign in */
.auth { min-height: 100vh; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: radial-gradient(90% 60% at 50% 112%, rgba(255, 176, 32, 0.75) 0%, rgba(240, 138, 0, 0.28) 30%, rgba(30, 26, 77, 0) 62%), linear-gradient(180deg, var(--twilight-deep), var(--twilight)); }
.auth .brand { font-size: 34px; padding: 0; gap: 12px; }
.auth .brand-mark { width: 36px; height: 18px; border-radius: 36px 36px 0 0; box-shadow: 0 4px 0 -1px var(--twilight-deep), 0 7px 0 -1px var(--dawn); margin-bottom: 6px; }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 24px 60px rgba(10, 8, 40, 0.5); }
.auth-card h1 { font-size: 30px; }
.auth-foot { max-width: 430px; font-size: 15px; color: #FFFFFF; text-align: center; }
.text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: none; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--action); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.text-button:hover { color: var(--action-deep); }
.setup { max-width: 640px; margin: 48px auto; padding: 28px; }

@media (max-width: 720px) {
  .main { padding: 20px 16px 40px; }
  h1 { font-size: 30px; }
  .nav { gap: 14px; padding: 18px 16px; }
  .nav-foot { margin-top: 0; }
  .hero { padding: 24px 20px; gap: 20px; }
  .hero h1 { font-size: 32px; }
  .cal { width: 92px; }
  .cal-day { font-size: 44px; }
  th, td { padding-left: 16px; padding-right: 16px; }
  .card-title { padding: 18px 16px 6px; }
  .empty { padding: 10px 16px 24px; }
}
