* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #0a0a0a;
  color: #f3f3f3;
}
.update-banner {
  background: #0b2a35;
  color: #d9f8ff;
  border-bottom: 1px solid #00d4ff66;
  padding: 8px 12px;
  font-size: 13px;
}
.update-banner a {
  color: #00d4ff;
  font-weight: 700;
}
.topbar {
  padding: 16px 20px;
  border-bottom: 1px solid #232323;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
h1 { margin: 0; color: #00d4ff; }
h2 { margin-top: 0; }
p { margin-top: 6px; color: #9a9a9a; }
.actions { display: flex; gap: 10px; }
.grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.card {
  background: #111;
  border: 1px solid #232323;
  border-radius: 12px;
  padding: 18px;
}
label {
  display: block;
  font-size: 12px;
  margin-top: 10px;
  margin-bottom: 4px;
  color: #9a9a9a;
}
input, select, button {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #2b2b2b;
  background: #1a1a1a;
  color: #f3f3f3;
  padding: 12px;
}
button {
  margin-top: 12px;
  cursor: pointer;
  font-weight: 700;
}
button:hover { border-color: #00d4ff; }
.ghost {
  background: #1a1a1a;
  width: auto;
}
.danger {
  background: #2a1111;
  border-color: #5a2626;
  width: auto;
}
.hidden { display: none !important; }
.onboarding {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.onboarding-card {
  width: min(460px, 100%);
  background: #101010;
  border: 1px solid #2b2b2b;
  border-radius: 12px;
  padding: 16px;
}
.setup-card {
  width: min(560px, 100%);
}
.onboarding-card ol {
  margin-top: 8px;
  margin-bottom: 8px;
  color: #c8c8c8;
  padding-left: 18px;
}
#invoice-list .row {
  padding: 10px 0;
  border-bottom: 1px solid #232323;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#invoice-list .ref { color: #00d4ff; font-weight: 700; }
.line-head {
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}
.line-columns {
  display: grid;
  grid-template-columns: 2.4fr 0.8fr 1fr auto;
  gap: 10px;
  margin-bottom: 6px;
}
.line-columns span {
  font-size: 11px;
  color: #9a9a9a;
  font-weight: 700;
}
.line-row {
  display: grid;
  grid-template-columns: 2.4fr 0.8fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
}
#invoice-lines input {
  min-height: 44px;
}
#kpis .row {
  padding: 8px 0;
  border-bottom: 1px solid #232323;
}
#kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
#clients-list {
  margin-top: 12px;
}
#clients-list .row {
  padding: 8px 0;
  border-bottom: 1px solid #232323;
}

#admin-stats .row {
  padding: 8px 0;
  border-bottom: 1px solid #232323;
}
#status-stats .row {
  padding: 10px 0;
  border-bottom: 1px solid #232323;
}
#invoice-card {
  grid-column: span 2;
}

@media (max-width: 820px) {
  .topbar {
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .actions {
    width: 100%;
  }
  .actions button {
    width: 100%;
  }
  .grid {
    padding: 12px;
    grid-template-columns: 1fr;
  }
  .line-row {
    grid-template-columns: 1fr;
  }
  .line-columns {
    display: none;
  }
  #kpis {
    grid-template-columns: 1fr;
  }
  #invoice-card {
    grid-column: span 1;
  }
  #invoice-list .row {
    flex-direction: column;
    align-items: flex-start;
  }
  #invoice-list .row span:last-child {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
