/* ============================================================
   Mobile-only stylesheet for /m/* routes — Personal Assistant.
   Tokens kept in lockstep with frontend/styles.css. Accent is
   GREEN (#4ade80) so the iPhone home-screen icon is visually
   distinct from Claudinho (cyan) and Finance.
============================================================ */

:root {
  --bg: #0b0d12;
  --bg-2: #0f1219;
  --panel: #161a22;
  --panel-2: #1d2230;
  --panel-3: #252b3b;
  --border: #2a2f3e;
  --border-strong: #3a4156;
  --text: #eef1f8;
  --muted: #8a93a6;
  --muted-2: #6b7384;
  --accent: #4ade80;
  --accent-strong: #22c55e;
  --good: #4ade80;
  --warn: #facc15;
  --bad: #f87171;
  --radius: 10px;
  --radius-sm: 6px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* Layout shell — every /m/* page follows:
     <div class="app">
       <header class="nav-top"> ... </header>
       <main class="body"> ... </main>
       <nav class="tab-bar"> ... </nav>
     </div>
*/
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

.nav-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 12px;
}
.nav-top .title { font-size: 17px; font-weight: 600; line-height: 1.2; }
.nav-top .sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.nav-top .icon-btn {
  background: transparent; border: none; color: var(--muted);
  font-size: 18px; padding: 8px 10px; cursor: pointer;
  text-decoration: none;
}

.body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px calc(80px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

/* Section heading inside a tab body. */
.section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted);
  margin: 14px 0 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.section-label .more { color: var(--muted-2); font-size: 12px; }

/* Cards — primary content container. */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

/* Buttons — ≥44 px tap targets. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent-strong);
  color: #07241a;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn.success { background: var(--good); color: #07241a; }
.btn.danger  { background: var(--bad);  color: #0a0c11; }
.btn.small   { padding: 8px 12px; font-size: 13px; width: auto; margin-top: 0; min-height: 36px; }
.btn:active  { transform: translateY(1px); }
.btn:disabled { opacity: .4; pointer-events: none; }

/* Bottom tab bar — fixed to viewport. */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding-top: 8px;
  padding-bottom: max(22px, var(--safe-bottom));
}
.tab-bar .tab {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0;
}
.tab-bar .tab .icon { font-size: 22px; line-height: 1; margin-bottom: 2px; }
.tab-bar .tab.active { color: var(--accent-strong); }

/* Floating action button (FAB) — sits above tab bar, used on Hoje for
   "+ Nova tarefa". One-handed reach distance. */
.fab {
  position: fixed;
  right: 18px; bottom: calc(90px + var(--safe-bottom));
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #07241a;
  border: none;
  font-size: 28px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 60;
}
.fab:active { transform: scale(0.96); }

/* Banners — alerts at the top of a screen. */
.banner {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  margin: 12px 0;
}
.banner.info { background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.35); color: var(--accent); }
.banner.warn { background: rgba(250,204,21,.12); border: 1px solid rgba(250,204,21,.35); color: var(--warn); }
.banner.bad  { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.35); color: var(--bad); }

/* Bottom sheet — for quick-capture, task edit, etc. */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none; z-index: 100;
}
.sheet-overlay.open { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  padding: 18px 18px max(28px, var(--safe-bottom));
  border-top: 1px solid var(--border-strong);
  max-height: 88dvh; overflow-y: auto;
}
.sheet h3 { margin: 0 0 14px; font-size: 15px; }

/* Chip rows — one-tap pickers (data, duração). */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}
.chip.active {
  background: var(--accent);
  color: #07241a;
  border-color: var(--accent-strong);
  font-weight: 600;
}
.chip:active { transform: translateY(1px); }

/* Form inputs. */
.field {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted);
}
.field input[type=text],
.field input[type=password],
.field input[type=email],
.field input[type=number],
.field input[type=date] {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;          /* ≥16 px stops iOS auto-zooming on focus */
  color: var(--text);
  width: 100%;
}
.field input:focus {
  outline: none;
  border-color: var(--accent-strong);
}
.field .err { color: var(--bad); font-size: 12px; }

/* Toast — bottom-centered ephemeral feedback. */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--panel-3); color: var(--text);
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; opacity: 0;
  pointer-events: none; transition: opacity .25s;
  z-index: 300;
}
.toast.show { opacity: 1; }

/* Skeleton shimmer for loading. */
.skel {
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }

/* Task rows — shared between Hoje, Semana, Delegadas. */
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.task-row:last-child { border-bottom: none; }
.task-row:active { background: var(--panel-2); }
.task-row .check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.task-row.done .check { background: var(--good); color: #07241a; border-color: var(--good); }
.task-row .grow { flex: 1; min-width: 0; }
.task-row .title-line {
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-row.done .title-line { color: var(--muted); text-decoration: line-through; }
.task-row .meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.task-row.overdue .meta { color: var(--bad); }
.task-row .chev { color: var(--muted-2); font-size: 16px; flex-shrink: 0; }

/* Day header in Semana view. */
.day-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase; letter-spacing: .6px;
}
.day-head .label  { color: var(--muted); font-weight: 600; }
.day-head .load   { color: var(--muted-2); font-size: 11px; }
.day-head.today   .label { color: var(--accent); }
.day-head.overload .load { color: var(--bad); font-weight: 600; }

/* Empty state inside cards. */
.empty {
  padding: 28px 12px; text-align: center;
  color: var(--muted); font-size: 13px;
}

/* Utility. */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny  { font-size: 11px; }
.spacer-lg { height: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.center { text-align: center; }
