/* BioEnergetica Client Portal */
:root {
  --teal-900: #10292b;
  --teal-800: #1C4245;   /* logo text */
  --teal-600: #2f5f62;
  --green:    #4A7C59;   /* site accent */
  --green-dk: #3c6649;
  --mint:     #D9F3E4;
  --mint-50:  #eef5f1;
  --sky:      #4890C8;   /* logo starburst */
  --ink:      #0D141A;
  --text:     #33484a;
  --muted:    #6b7f80;
  --line:     #dfe9e4;
  --white:    #ffffff;
  --danger:   #b3412f;
  --danger-bg:#fbeae6;
  --warn-bg:  #fdf4dc;
  --radius:   14px;
  --shadow:   0 1px 2px rgba(16,41,43,.06), 0 8px 28px rgba(16,41,43,.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--mint-50);
}
a { color: var(--green-dk); }
a:hover { color: var(--teal-800); }
h1, h2, h3, .date-badge .d, .stat .n { font-variant-numeric: lining-nums; }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; color: var(--teal-800); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 2.3rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 600; color: var(--green); margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* logo sits on an off-white background; multiply blends it into light surfaces */
.logo { display: block; width: 220px; max-width: 100%; height: auto; mix-blend-mode: multiply; }
.logo-sm { width: 170px; }
.logo-link { display: inline-block; }

/* ---------- forms ---------- */
label { display: block; font-weight: 500; font-size: .9rem; color: var(--teal-800); margin: 0 0 .35rem; }
.field { margin-bottom: 1.1rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search] {
  width: 100%; padding: .78rem .9rem; font: inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(74,124,89,.15); }
input[type=file] { font: inherit; font-size: .9rem; max-width: 100%; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; color: var(--text); }
.check input { margin-top: .3rem; accent-color: var(--green); }
.hint { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4.2rem; }
.pw-toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--green-dk); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; padding: .4rem .5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .78rem 1.3rem; font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
  color: var(--white); background: var(--green); border: 1.5px solid var(--green);
  border-radius: 10px; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--green-dk); border-color: var(--green-dk); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--teal-800); border-color: var(--line); }
.btn-ghost:hover { background: var(--mint); border-color: var(--mint); color: var(--teal-800); }
.btn-danger { background: var(--white); color: var(--danger); border-color: #ecc5bd; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: var(--white); }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }

.alert { padding: .85rem 1rem; border-radius: 10px; margin: 0 0 1.2rem; font-size: .93rem; border: 1px solid transparent; }
.alert-success { background: var(--mint); color: var(--teal-800); border-color: #bfe6cf; }
.alert-info    { background: #e6f1fa; color: #1d4a6b; border-color: #c9e0f2; }
.alert-error   { background: var(--danger-bg); color: var(--danger); border-color: #f1cdc5; }
.alert-warning { background: var(--warn-bg); color: #7a5a12; border-color: #f0dfaa; }

/* ---------- auth (login) ---------- */
body.auth { background: var(--white); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand {
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
  padding: 56px; color: #e8f3ee;
  background: radial-gradient(120% 90% at 20% 10%, #2a5b55 0%, var(--teal-800) 45%, var(--teal-900) 100%);
}
.aura { position: absolute; inset: 0; pointer-events: none; }
.aura span { position: absolute; border-radius: 50%; filter: blur(2px); }
.aura span:nth-child(1) { width: 520px; height: 520px; left: 50%; top: 34%; transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(72,144,200,.55) 0%, rgba(72,144,200,.18) 38%, transparent 68%); animation: breathe 9s ease-in-out infinite; }
.aura span:nth-child(2) { width: 340px; height: 340px; left: 50%; top: 34%; transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(217,243,228,.55) 0%, rgba(74,124,89,.25) 45%, transparent 70%); animation: breathe 9s ease-in-out -3s infinite; }
.aura span:nth-child(3) { width: 150px; height: 150px; left: 50%; top: 34%; transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(255,255,255,.85) 0%, rgba(217,243,228,.4) 40%, transparent 72%); }
@keyframes breathe { 0%,100% { transform: translate(-50%,-50%) scale(1); opacity: .9; } 50% { transform: translate(-50%,-50%) scale(1.08); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .aura span { animation: none !important; } }
.auth-brand-text { position: relative; max-width: 440px; }
.auth-brand .eyebrow { color: var(--mint); opacity: .85; }
.auth-brand h2 { color: var(--white); font-size: 2.6rem; }
.auth-brand h2 em { font-style: italic; color: var(--mint); }
.auth-brand p { color: #cfe3da; margin: 0; }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo-link { margin-bottom: 2.2rem; }
.auth-card h1 { font-size: 2.2rem; }
.auth-card .lead { color: var(--muted); margin: 0 0 1.8rem; }
.auth-row { display: flex; justify-content: flex-end; margin: -.4rem 0 1.3rem; font-size: .88rem; }
.auth-foot { margin-top: 2.5rem; font-size: .85rem; }
.auth-foot a { color: var(--muted); text-decoration: none; }
.auth-foot a:hover { color: var(--teal-800); }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  body.auth { background: linear-gradient(180deg, var(--mint-50), var(--white) 40%); }
  .auth-main { justify-content: flex-start; padding-top: 56px; }
}

/* ---------- app shell ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topnav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: .92rem; }
.topnav a:not(.btn) { color: var(--teal-800); text-decoration: none; font-weight: 500; }
.topnav a:not(.btn):hover { color: var(--green); }
.who { color: var(--muted); }
.container { max-width: 1040px; margin: 0 auto; padding: 32px 16px 48px; }
.site-foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 0 16px 32px; }
.site-foot a { color: var(--muted); }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; margin-bottom: 24px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head p { margin: .3rem 0 0; }

/* ---------- client reports ---------- */
.hero {
  border-radius: var(--radius); padding: 32px; margin-bottom: 28px; color: #e8f3ee; position: relative; overflow: hidden;
  background: radial-gradient(90% 140% at 90% 0%, rgba(72,144,200,.45), transparent 60%), linear-gradient(135deg, var(--teal-800), var(--teal-900));
}
.hero h1 { color: var(--white); margin: 0 0 .3rem; }
.hero p { margin: 0; color: #cfe3da; max-width: 560px; }
.hero .eyebrow { color: var(--mint); }

.report-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.report {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  border-left: 4px solid var(--green);
}
.report.latest { border-left-color: var(--sky); }
.date-badge { width: 64px; text-align: center; border-radius: 12px; background: var(--mint); color: var(--teal-800); padding: 8px 4px; line-height: 1.1; }
.date-badge .d { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.75rem; font-weight: 600; }
.date-badge .m { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.report h3 { font-family: Inter, sans-serif; font-size: 1.02rem; font-weight: 600; margin: 0 0 .15rem; color: var(--teal-800); }
.report .meta { font-size: .85rem; color: var(--muted); }
.report .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tag { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: #e6f1fa; color: #1d4a6b; margin-left: 6px; vertical-align: 2px; }
.empty { text-align: center; padding: 48px 24px; }
.empty .glow { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, var(--mint) 45%, rgba(72,144,200,.35) 100%); }

@media (max-width: 640px) {
  .report { grid-template-columns: auto 1fr; }
  .report .actions { grid-column: 1 / -1; justify-content: stretch; }
  .report .actions .btn { flex: 1; }
  .hero { padding: 24px; }
  h1 { font-size: 1.9rem; }
}

/* ---------- admin ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; margin: 0 -26px; padding: 0 26px; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data a.name { font-weight: 600; text-decoration: none; color: var(--teal-800); }
table.data a.name:hover { color: var(--green); }
.status { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status-on  { background: var(--mint); color: var(--green-dk); }
.status-off { background: #eceeee; color: #6b7577; }
.inline-form { display: inline; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 300px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat .n { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2.2rem; font-weight: 600; color: var(--teal-800); line-height: 1; }
.stat .l { font-size: .82rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr; } }
.dropzone { border: 2px dashed #bcd8c7; border-radius: 12px; padding: 22px; background: var(--mint-50); margin-bottom: 1rem; }
.dropzone.over { border-color: var(--green); background: var(--mint); }
.file-list { list-style: none; padding: 0; margin: .8rem 0 0; font-size: .88rem; }
.file-list li { padding: 4px 0; }
details.edit summary { cursor: pointer; color: var(--green-dk); font-size: .85rem; font-weight: 600; list-style: none; display: inline; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] { display: block; margin-top: 10px; }
.edit-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.edit-row input[type=text] { flex: 1 1 220px; padding: .5rem .7rem; }
.edit-row input[type=date] { width: auto; padding: .5rem .7rem; }
.danger-zone { border: 1px solid #f1cdc5; }
.back { display: inline-block; margin-bottom: 14px; font-size: .9rem; text-decoration: none; }
