/* app.css — Funda Broker Audit (production styling) */
:root{
  --bg:#0f1115; --card:#171a21; --card2:#1d212b; --border:#2a2f3a;
  --accent:#ff6b35; --accent-d:#e2561f; --text:#e8eaed; --muted:#9aa0a6;
  --ok:#2ecc71; --warn:#f1c40f; --bad:#e74c3c; --info:#5aa9ff; --pend:#ffe08a;
  --radius:14px;
}
*{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(--bg); color:var(--text); line-height:1.55; font-size:15px;
}
a{color:var(--accent); text-decoration:none;}
a:hover{text-decoration:underline;}
code{background:#0c0e12; padding:1px 5px; border-radius:5px; font-size:.9em; color:#ffd9c7;}

/* header / nav */
.app-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 24px; background:var(--card); border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:10;
}
.brand{font-weight:800; font-size:19px; letter-spacing:-.01em;}
.brand span{color:var(--accent);}
.app-nav{display:flex; gap:18px; align-items:center; font-size:14px;}
.app-nav a{color:var(--text);}
.app-nav a:hover{color:var(--accent); text-decoration:none;}

/* layout */
.wrap{max-width:1040px; margin:0 auto; padding:26px 20px 60px;}
.app-main.wrap{padding-top:26px;}
.page-head{margin-bottom:18px;}
.page-head h1{margin:0 0 4px; font-size:26px;}
.back{display:inline-block; color:var(--muted); font-size:14px; margin-bottom:14px;}
.back:hover{color:var(--accent);}

/* cards */
.card{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:20px; margin-bottom:18px;
}
.card-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
.card-head h3{margin:0; font-size:17px;}
.card h1,.card h2,.card h3{margin-top:0;}

/* forms */
label{display:block; font-size:13px; color:var(--muted); margin-bottom:6px;}
input[type=text],input[type=password],input[type=url],textarea,select{
  width:100%; padding:11px 13px; border-radius:10px; border:1px solid var(--border);
  background:#0c0e12; color:var(--text); font-size:15px; font-family:inherit;
}
input:focus,textarea:focus{outline:2px solid var(--accent); outline-offset:0;}
button{
  background:var(--accent); color:#fff; border:0; padding:11px 18px; border-radius:10px;
  font-size:15px; font-weight:700; cursor:pointer; font-family:inherit;
}
button:hover{filter:brightness(1.08);}
.btn-sm{padding:7px 13px; font-size:13px; border-radius:9px;}
.btn-ghost{background:transparent; color:var(--text); border:1px solid var(--border);}
.btn-ghost:hover{border-color:var(--accent); color:var(--accent);}
.btn-del{background:transparent; color:var(--bad); border:1px solid var(--bad);}
.btn-del:hover{background:rgba(231,76,60,.12);}

/* flashes */
.flash{padding:11px 14px; border-radius:10px; margin-bottom:14px; font-size:14px;}
.flash.info{background:#15263a; color:#9ecbff;}
.flash.danger{background:#3a1b1b; color:#ff9e9e;}
.flash.success{background:#14331f; color:#9affc0;}

/* pills / grades */
.pill{display:inline-block; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:700;}
.p-ass{background:#13351f; color:#9affc0;}
.p-warn{background:#3a3413; color:#ffd95e;}
.p-fail{background:#3a1b1b; color:#ff9e9e;}
.p-pend{background:#3a3413; color:#ffe08a;}
.p-info{background:#15263a; color:#9ecbff;}
.grade{display:inline-flex; align-items:center; justify-content:center; font-weight:900; border-radius:10px;}
.grade-A{color:var(--ok);} .grade-B{color:#7ed9a0;} .grade-C{color:var(--warn);} .grade-D{color:var(--bad);}
.score-bar{height:9px; border-radius:6px; background:#2a2f3a; overflow:hidden;}
.score-bar > i{display:block; height:100%; background:linear-gradient(90deg,var(--accent),#ffa173);}
.score-bar.big{height:14px; width:200px;}
.score-pct{font-size:13px; color:var(--muted); margin-left:8px;}

/* stat grid */
.stat-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px;}
.stat-card{background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:16px;}
.stat-card .label{font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em;}
.stat-card .num{font-size:30px; font-weight:800; margin:6px 0 2px;}
.stat-card .num-sm{font-size:18px; color:var(--muted);}
.stat-card .sub{font-size:12px; color:var(--muted);}
@media(max-width:760px){.stat-grid{grid-template-columns:repeat(2,1fr);}}

/* explainer */
.explainer ul{margin:10px 0 0; padding-left:18px;}
.explainer li{margin:6px 0; color:var(--text);}
.explainer-avg{margin-top:10px; font-size:14px;}
.explainer-avg .grade{font-size:16px;}

/* add form */
.add-form{margin-top:6px;}
.add-field{margin-bottom:12px;}
.tip{margin-top:8px; font-size:13px;}

/* listing list */
.listing-list{display:flex; flex-direction:column; gap:10px;}
.listing-row{display:flex; align-items:center; gap:14px; border:1px solid var(--border); border-radius:12px; background:var(--card2);}
.listing-card{display:flex; flex:1; align-items:center; gap:14px; padding:14px 16px; color:var(--text);}
.listing-card:hover{text-decoration:none; background:#20242f;}
.listing-info{flex:1; min-width:0;}
.listing-title{font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:420px;}
.meta{font-size:12px; color:var(--muted); display:flex; gap:10px; margin-top:3px;}
.tag{background:#26304a; color:#bcd2ff; padding:1px 8px; border-radius:6px; font-size:11px; font-weight:700;}
.listing-score{min-width:160px;}
.score-row{display:flex; align-items:center; gap:8px;}
.listing-score .grade{font-size:20px;}
.listing-status{min-width:120px; text-align:right;}
.listing-go{color:var(--accent); font-size:14px; font-weight:600; padding-right:8px;}
.listing-del{padding:0 14px; align-self:stretch; display:flex; align-items:center;}
.empty-state{text-align:center; padding:34px 10px; color:var(--muted);}
.empty-state .icon{font-size:34px;}

/* report */
.report-head{display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:18px;}
.eyebrow{font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted);}
.report-head h1{margin:2px 0; font-size:24px;}
.score-hero{text-align:center;}
.score-hero .grade{font-size:46px;}
.notfound-card{border-left:4px solid var(--bad);}
.table{width:100%; border-collapse:collapse; font-size:14px;}
.table th,.table td{padding:9px 10px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top;}
.table th{color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.03em;}
.advice-card{border-left:4px solid var(--accent);}

/* checks */
.check{border-left:4px solid #444; padding:13px 15px; background:#14171d; border-radius:0 10px 10px 0; margin-bottom:10px;}
.check.pass{border-color:var(--ok);}
.check.warn{border-color:var(--warn);}
.check.fail{border-color:var(--bad);}
.check.pending{border-color:var(--pend);}
.check.info{border-color:var(--muted);}
.check-top{display:flex; justify-content:space-between; gap:10px; align-items:center;}
.check-title{font-weight:700;}
.check-detail{margin:8px 0 0; font-size:14px; color:var(--text);}
.check-advice{margin:8px 0 0; font-size:13px; color:var(--muted);}
.check-meta{margin:6px 0 0; font-size:11px;}
.report-actions{display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:18px 0;}

/* footer */
.app-footer{margin-top:30px; padding:20px 24px; border-top:1px solid var(--border); color:var(--muted); font-size:12px; background:var(--card);}
.footer-brand{font-weight:700; margin-bottom:6px; color:var(--text);}
.footer-legal{max-width:820px; line-height:1.5;}

/* login */
.loginwrap{max-width:400px; margin:90px auto;}
.loginwrap .card h2{margin-top:0;}
.llm-status{font-size:13px; color:var(--muted); margin-top:6px;}
.llm-status .on{color:var(--ok); font-weight:700;}
.llm-status .off{color:var(--warn); font-weight:700;}

/* print / PDF */
@media print{
  body{background:#fff; color:#000;}
  .app-header,.app-nav,.report-actions,.footer-legal,.btn-sm,.btn-ghost,.btn-del,
  .listing-del,.back,.llm-status,.flash{display:none !important;}
  .card{border:1px solid #ccc; background:#fff; break-inside:avoid; box-shadow:none;}
  .grade{color:#000 !important;}
  .app-footer{border-top:1px solid #ccc; background:#fff; color:#333;}
  a{color:#000; text-decoration:underline;}
}
