:root{
  --bg:#07110b;
  --panel:#0b1a11;
  --card:#0f2418;
  --line:#1c3a27;
  --text:#e9fff2;
  --muted:#a9c9b6;
  --green:#2ee36b;
  --green2:#0fa34a;
  --danger:#ff3b3b;
  --warn:#ffb020;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% 0%, #0f2a1b 0%, var(--bg) 55%) fixed;
  color:var(--text);
}

a{color:inherit}
.small{font-size:.9rem}
.muted{color:var(--muted)}
.hp{position:absolute; left:-9999px; width:1px; height:1px; opacity:0}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background: rgba(7,17,11,.78);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
}

.brand{display:flex; gap:12px; align-items:center}
.logo-dot{
  width:14px; height:14px; border-radius:999px;
  background: linear-gradient(135deg, var(--green), var(--green2));
  box-shadow: 0 0 0 6px rgba(46,227,107,.08);
}
.brand-title{font-weight:800; letter-spacing:.3px}
.brand-sub{font-size:.88rem; color:var(--muted)}

.top-actions{display:flex; gap:10px; align-items:center}

.container{
  max-width:1100px;
  margin:0 auto;
  padding:18px;
}

.card{
  background: linear-gradient(180deg, rgba(15,36,24,.95), rgba(11,26,17,.92));
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

.login-card{max-width:520px; margin:26px auto}

h1,h2{margin:0 0 10px 0}
h1{font-size:1.6rem}
h2{font-size:1.15rem}

label{display:block; margin:10px 0;color: #fff;}
input, select{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
}
input:focus, select:focus{
  border-color: rgba(46,227,107,.65);
  box-shadow: 0 0 0 4px rgba(46,227,107,.12);
}

.btn{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{border-color: rgba(46,227,107,.45)}
.btn-primary{
  background: linear-gradient(135deg, rgba(46,227,107,.95), rgba(15,163,74,.92));
  border-color: rgba(46,227,107,.65);
  color:#04110a;
}
.btn-danger{
  background: rgba(255,59,59,.12);
  border-color: rgba(255,59,59,.38);
}
.btn-ghost{
  background: transparent;
}

.msg{margin-top:10px; min-height:20px}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  margin-bottom:14px;
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
  .top-actions{gap:8px}
}

.card-title-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}

.row{display:flex; gap:8px; align-items:center}
.pill{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color:var(--muted);
  font-weight:600;
}

.kpis{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
  margin: 10px 0 6px 0;
}
@media (max-width: 700px){
  .kpis{grid-template-columns:1fr}
}
.kpi{
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:12px;
  background: rgba(0,0,0,.16);
}
.kpi-label{color:var(--muted); font-size:.86rem}
.kpi-value{font-size:1.3rem; font-weight:800; margin-top:6px}

.advice{
  display:none;
  margin-top:10px;
  border:1px dashed rgba(46,227,107,.35);
  border-radius:14px;
  padding:12px;
  color:var(--text);
  background: rgba(46,227,107,.07);
}

.list{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.item{
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:12px;
  background: rgba(0,0,0,.14);
}
.item-top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.item-title{font-weight:800}
.item-sub{color:var(--muted); font-size:.9rem; margin-top:4px}
.item-actions{display:flex; gap:8px}

.table{margin-top:10px}
.thead, .trow{
  display:grid;
  grid-template-columns: 1.35fr .9fr .9fr 1fr 1.4fr;
  gap:10px;
  padding:10px;
}
.thead{
  color:var(--muted);
  font-weight:700;
}
.trow{
  border-top:1px solid rgba(255,255,255,.07);
  align-items:center;
}
.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  font-weight:700;
  color:var(--muted);
}
.badge.paid{border-color: rgba(46,227,107,.5); color: var(--green)}
.badge.late{border-color: rgba(255,176,32,.55); color: var(--warn)}
.badge.unknown{border-color: rgba(255,255,255,.18); color: var(--muted)}
.badge.cancelled{border-color: rgba(255,59,59,.55); color: var(--danger)}

.cashflow{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.cfrow{
  display:flex;
  justify-content:space-between;
  gap:10px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:14px;
  padding:10px;
  background: rgba(0,0,0,.14);
}
.cfdate{color:var(--muted); font-weight:700}
.cfbalance{font-weight:800}

.modal::backdrop{background: rgba(0,0,0,.55)}
.modal{
  border:none;
  padding:0;
  width:min(720px, 94vw);
  background: transparent;
}
.modal-card{
  background: linear-gradient(180deg, rgba(15,36,24,.98), rgba(11,26,17,.96));
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow: var(--shadow);
  padding:12px;
}
.modal-head{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:10px; padding:6px 6px 10px 6px;
}
.modal-title{font-weight:900; font-size:1.05rem;color: #fff;}
.modal-body{padding:0 6px 10px 6px}
.modal-actions{
  display:flex; justify-content:flex-end; gap:8px;
  padding:0 6px 6px 6px;
}

#currencySelect{width:auto; min-width:92px; padding:10px 10px}
