/* InkReady — mobile-first, no framework. */
:root {
  --ink: #14121a;
  --ink-2: #211d2b;
  --paper: #f7f5f2;
  --card: #ffffff;
  --line: #e4e0da;
  --accent: #6b3fa0;       /* tattoo-purple */
  --accent-2: #8b5cf6;
  --good: #2e8b57;
  --warn: #c2410c;
  --bad: #b91c1c;
  --muted: #6b6675;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20,18,26,.08), 0 8px 24px rgba(20,18,26,.06);
  --maxw: 1080px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
.boot { padding: 4rem 1rem; text-align: center; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px;
  padding: .7rem 1.1rem; background: var(--accent); color: #fff;
  text-decoration: none; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--accent); padding-inline: .4rem; }
.btn.danger { background: var(--bad); }
.btn.small { padding: .4rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .3rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: .65rem .7rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent-2); }
.field-hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; margin: .35rem 0; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; font-weight: 500; }

/* Layout: marketing */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 1rem;
}
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.brand .dot { color: var(--accent); }
.hero { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1rem 3rem; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.03em; margin: .5rem 0; }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 42ch; }
.hero .cta-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.pill { display: inline-block; background: #efe9f7; color: var(--accent); font-weight: 600;
  font-size: .8rem; padding: .3rem .7rem; border-radius: 999px; }
.grid-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem;
  max-width: var(--maxw); margin: 0 auto; padding: 1rem; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.feature .ico { font-size: 1.6rem; }
.feature h3 { margin: .5rem 0 .25rem; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: .9rem; }
.pricing { max-width: 760px; margin: 2rem auto; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.price-card.featured { border-color: var(--accent); }
.price-card .amount { font-size: 2rem; font-weight: 800; }
.price-card ul { padding-left: 1.1rem; color: var(--muted); }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }
.footer a { color: var(--muted); }

/* Auth card */
.auth-wrap { max-width: 420px; margin: 2rem auto; padding: 0 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card h2 { margin-top: 0; }
.switch-auth { text-align: center; margin-top: 1rem; font-size: .9rem; color: var(--muted); }

/* App shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #cfc9d8; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #fff; padding: .25rem .5rem 1rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: .6rem; color: #cfc9d8; text-decoration: none;
  padding: .6rem .65rem; border-radius: 8px; font-size: .92rem; margin-bottom: .15rem;
}
.sidebar nav a:hover { background: var(--ink-2); color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar .sb-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #8a8499; padding: .8rem .65rem .3rem; }
.sidebar .upgrade-box { background: var(--ink-2); border-radius: 10px; padding: .8rem; margin-top: 1rem; font-size: .85rem; }

.main { padding: 1.25rem clamp(1rem, 3vw, 2rem); max-width: 1000px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.muted { color: var(--muted); }

/* Top bar (mobile) */
.topbar { display: none; align-items: center; justify-content: space-between;
  background: var(--ink); color: #fff; padding: .75rem 1rem; position: sticky; top: 0; z-index: 30; }
.topbar .brand { color: #fff; font-size: 1.1rem; }
.hamburger { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }

/* Cards / stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stat .n { font-size: 1.6rem; font-weight: 800; }
.stat .l { color: var(--muted); font-size: .85rem; }

.banner { border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; font-size: .92rem; }
.banner.good { background: #eaf6ef; color: var(--good); border: 1px solid #bfe3cd; }
.banner.warn { background: #fdf0e7; color: var(--warn); border: 1px solid #f6cfb4; }
.banner.bad { background: #fdeaea; color: var(--bad); border: 1px solid #f3c2c2; }
.banner.info { background: #efe9f7; color: var(--accent); border: 1px solid #d8c9ee; }

.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.section-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
  text-decoration: none; color: var(--ink); display: block; box-shadow: var(--shadow); transition: transform .12s; }
.section-tile:hover { transform: translateY(-2px); }
.section-tile .ico { font-size: 1.5rem; }
.section-tile h3 { margin: .4rem 0 .2rem; font-size: 1rem; }
.section-tile p { margin: 0; color: var(--muted); font-size: .82rem; }
.section-tile .count { font-weight: 700; color: var(--accent); font-size: .85rem; margin-top: .4rem; }

/* Record list */
.rec-list { display: flex; flex-direction: column; gap: .5rem; }
.rec {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.rec .rec-main { min-width: 0; }
.rec .rec-title { font-weight: 600; }
.rec .rec-sub { color: var(--muted); font-size: .85rem; }
.rec .rec-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.tag { display: inline-block; font-size: .72rem; padding: .15rem .5rem; border-radius: 999px; background: #eee; color: #555; }
.tag.pass { background: #eaf6ef; color: var(--good); }
.tag.fail { background: #fdeaea; color: var(--bad); }
.tag.overdue { background: #fdf0e7; color: var(--warn); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,18,26,.5); display: flex; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; z-index: 50; }
.modal { background: var(--card); border-radius: var(--radius); padding: 1.5rem; max-width: 560px; width: 100%; margin: 2rem auto; box-shadow: var(--shadow); }
.modal h2 { margin-top: 0; }
.modal .modal-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.25rem; }

/* Signature pad */
.sig-pad { border: 1px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 150px; }
.sig-controls { display: flex; gap: .5rem; margin-top: .4rem; }

/* Toast */
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; z-index: 100; font-size: .9rem; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); }
.toast.good { background: var(--good); }

/* Report (print) */
.report { background: #fff; }
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .shell { display: block; }
  .main { max-width: none; padding: 0; }
  body { background: #fff; }
  .report-section { break-inside: avoid; }
}
.report-section { margin-bottom: 1.5rem; }
.report table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.report th, .report td { border: 1px solid var(--line); padding: .4rem .5rem; text-align: left; vertical-align: top; }
.report th { background: var(--paper); }

/* Responsive */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .pricing { grid-template-columns: 1fr; }
}
.scrim { display: none; }
.scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
