/* Proof of Dream — C-Seed-inspired luxury dark theme with fuchsia accent.
   Primary accent fuchsia: #E0218A  (tweak here to restyle everything) */
:root {
  --fuchsia: #E0218A;
  --fuchsia-deep: #D6006E;
  --fuchsia-glow: rgba(224, 33, 138, 0.35);
  --sunset: linear-gradient(135deg, #E0218A 0%, #FF5E8A 55%, #FF9A5A 100%);

  --bg: #080809;
  --bg-2: #0e0e12;
  --panel: #14141a;
  --panel-2: #1b1b22;
  --line: #26262f;
  --ink: #f4f4f6;
  --muted: #9a9aa6;
  --muted-2: #6c6c78;

  --radius: 14px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(224, 33, 138, 0.14), transparent 60%),
    radial-gradient(900px 600px at 8% 108%, rgba(255, 110, 90, 0.07), transparent 55%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-weight: 300;
  letter-spacing: 0.2px;
}
a { color: var(--fuchsia); text-decoration: none; }
h1, h2, h3 { font-weight: 300; letter-spacing: 0.5px; margin: 0; }
.thin { font-weight: 200; }

/* ---------- Top nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  background: rgba(8, 8, 9, 0.72); backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand .mark { font-size: 20px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; }
.brand .mark b { color: var(--fuchsia); font-weight: 600; }
.brand .sub { color: var(--muted-2); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  color: var(--muted); padding: 8px 16px; border-radius: 999px; font-size: 14px;
  letter-spacing: 0.5px; transition: all 0.2s;
}
.nav-links a:hover { color: var(--ink); background: var(--panel); }
.nav-links a.active { color: var(--ink); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 48px 40px 80px; }
.page-head { margin-bottom: 36px; }
.page-head .eyebrow { color: var(--fuchsia); letter-spacing: 4px; text-transform: uppercase; font-size: 11px; font-weight: 500; }
.page-head h1 { font-size: 40px; margin-top: 10px; }
.page-head p { color: var(--muted); margin-top: 10px; font-size: 15px; max-width: 640px; }

/* ---------- Dashboard tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.tile {
  position: relative; display: block; padding: 30px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); overflow: hidden; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tile::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(420px 180px at 100% 0%, var(--fuchsia-glow), transparent 70%);
}
.tile:hover { transform: translateY(-4px); border-color: var(--fuchsia); box-shadow: var(--shadow); }
.tile:hover::before { opacity: 1; }
.tile .label { color: var(--muted-2); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.tile .name { font-size: 24px; margin: 14px 0 8px; font-weight: 300; }
.tile .url { color: var(--muted); font-size: 13px; word-break: break-all; }
.tile .go {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--fuchsia); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; font-weight: 500;
}
.tile .go::after { content: "→"; transition: transform 0.2s; }
.tile:hover .go::after { transform: translateX(5px); }

/* internal tool tiles */
.tile.tool { background: var(--panel); }
.tile.tool .name { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: none; border-radius: 10px; padding: 11px 22px; font-size: 14px; font-weight: 500;
  font-family: var(--font); letter-spacing: 0.4px; transition: all 0.2s;
}
.btn-primary { background: var(--fuchsia); color: #fff; }
.btn-primary:hover { background: var(--fuchsia-deep); box-shadow: 0 8px 28px var(--fuchsia-glow); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--fuchsia); color: var(--fuchsia); }
.btn-danger { background: transparent; color: #ff7a7a; box-shadow: inset 0 0 0 1px rgba(255,122,122,0.4); }
.btn-danger:hover { background: rgba(255,122,122,0.1); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
}
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
label.field { display: block; margin-bottom: 16px; }
label.field span { display: block; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
input, select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); padding: 12px 14px; font-size: 15px; font-family: var(--font); font-weight: 300;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fuchsia); box-shadow: 0 0 0 3px var(--fuchsia-glow); }
textarea { resize: vertical; min-height: 84px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 300; }
table.data th { text-align: left; color: var(--muted); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 500; }
table.data td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: var(--bg-2); }
.num { text-align: right; white-space: nowrap; }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.badge.draft { background: #2a2a33; color: var(--muted); }
.badge.sent { background: rgba(224,33,138,0.16); color: var(--fuchsia); }
.badge.paid { background: rgba(80,200,120,0.14); color: #6bd48a; }

.empty { text-align: center; color: var(--muted-2); padding: 48px 20px; }

/* ---------- Line-item editor ---------- */
.items-head, .item-row { display: grid; grid-template-columns: 1fr 90px 130px 130px 40px; gap: 10px; align-items: center; }
.items-head { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 0 2px 10px; }
.item-row { margin-bottom: 10px; }
.item-row .line-total { text-align: right; color: var(--muted); font-size: 14px; }
.item-row .rm { background: none; border: none; color: var(--muted-2); cursor: pointer; font-size: 18px; }
.item-row .rm:hover { color: #ff7a7a; }
.totals-box { margin-left: auto; width: 300px; margin-top: 18px; font-size: 15px; }
.totals-box .row { display: flex; justify-content: space-between; padding: 7px 2px; }
.totals-box .grand { border-top: 2px solid var(--fuchsia); margin-top: 6px; font-size: 20px; font-weight: 500; padding-top: 12px; }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 410px; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 20px; padding: 44px 40px; box-shadow: var(--shadow);
}
.login-card .mark { text-align: center; font-size: 22px; letter-spacing: 5px; text-transform: uppercase; font-weight: 500; }
.login-card .mark b { color: var(--fuchsia); }
.login-card .tag { text-align: center; color: var(--muted-2); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; margin: 10px 0 34px; }
.login-card .accent-line { height: 3px; width: 56px; margin: 0 auto 30px; border-radius: 3px; background: var(--sunset); }

/* ---------- Toast / dialog ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); padding: 14px 22px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; font-size: 14px; max-width: 90vw; }
.toast.err { border-color: #ff7a7a; }
.toast.ok { border-color: var(--fuchsia); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; width: 100%; max-width: 520px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal h3 { font-size: 22px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err-text { color: #ff7a7a; font-size: 13px; margin-top: 4px; }
