:root {
  --blue: #2E75B6;
  --blue-dark: #1f4e79;
  --ink: #1a1a2e;
  --muted: #667085;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e4e7ec;
  --ok: #12b76a;
  --err: #f04438;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; justify-content: space-between; align-items: center;
}
.brand { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; }
.brand span { color: var(--blue); }
nav { display: flex; align-items: center; }
nav a { margin-left: 18px; color: var(--muted); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--ink); }
nav a.logout { color: var(--err); }
nav .nav-user { margin-left: 18px; font-size: 13px; color: var(--muted); }
main { flex: 1; max-width: 960px; width: 100%; margin: 0 auto; padding: 32px 20px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }

h1 { font-size: 26px; margin-bottom: 6px; }
h2 { font-size: 18px; margin-bottom: 10px; }
.section-title { margin-top: 32px; }
.muted { color: var(--muted); }
.hidden { display: none; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(26,26,46,.06);
}
.login-card { max-width: 420px; margin: 48px auto; }
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; }
.alert-ok { background: #e7f6ef; color: #067647; }
.alert-info { background: #eaf1fb; color: var(--blue-dark); }
.alert-error { background: #fef3f2; color: var(--err); }

.badge {
  display: inline-block; background: #e7f6ef; color: #067647;
  border-radius: 20px; padding: 4px 12px; font-size: 13px; font-weight: 600;
}
.badge-price { background: #eaf1fb; color: var(--blue-dark); }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=email], input[type=number] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 16px;
}
.btn {
  display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 12px 22px; text-decoration: none;
  white-space: nowrap; overflow: visible;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled {
  background: #eef2f7; color: var(--muted); border: 1px solid var(--border);
  cursor: not-allowed;
}
.btn-secondary { background: #eef2f7; color: var(--ink); }
.btn-block { width: 100%; margin-top: 18px; }
.btn-small { padding: 6px 12px; font-size: 13px; background: #eef2f7; color: var(--ink); }

.dash-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; }
.balance-chip {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 20px; text-align: right; text-decoration: none; color: var(--ink);
  flex-shrink: 0;
}
.balance-num { display: block; font-size: 24px; font-weight: 800; color: var(--blue); }
.balance-label { font-size: 12px; color: var(--muted); }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.service-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s ease; display: flex; flex-direction: column;
}
.service-card:hover { box-shadow: 0 6px 20px rgba(26,26,46,.08); }
.service-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.service-icon { font-size: 30px; margin-bottom: 10px; }
.service-card p {
  color: var(--muted); font-size: 14px; margin: 8px 0 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.service-card .btn { margin-top: auto; text-align: center; }

.table { width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.table th, .table td { padding: 10px 14px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--border); }
.table th { background: #f0f3f8; font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--err); font-weight: 600; }

.status { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-ok, .status-completed, .status-active { background: #e7f6ef; color: #067647; }
.status-partial, .status-pending { background: #fff6e5; color: #b54708; }
.status-failed, .status-cancelled { background: #fef3f2; color: var(--err); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.plan-row { padding: 14px 0; border-top: 1px solid var(--border); }
.plan-row p { margin: 4px 0; }
.plan-row form { margin-top: 10px; }
.plan-row .btn { width: 100%; text-align: center; }
.balance-big { font-size: 40px; font-weight: 800; color: var(--blue); }
.balance-big small { font-size: 16px; color: var(--muted); font-weight: 500; }
.wallet-summary { text-align: center; }

.dropzone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 30px;
  text-align: center; color: var(--muted); cursor: pointer; position: relative;
}
.dropzone.over { border-color: var(--blue); background: #f0f6fc; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-list { list-style: none; margin-top: 12px; text-align: left; }
.file-list li { padding: 6px 10px; background: #f0f3f8; border-radius: 8px;
  margin-top: 6px; font-size: 14px; color: var(--ink); }

.cost-banner {
  background: #eaf1fb; border-radius: 10px; padding: 14px 18px;
  margin-bottom: 18px; color: var(--blue-dark); font-size: 15px;
}
.cost-banner strong { font-size: 17px; }

.progress-bar { background: #e9edf3; border-radius: 10px; height: 12px; overflow: hidden; }
#progress-fill { background: var(--blue); height: 100%; width: 0; transition: width .3s ease; }
.error-text { color: var(--err); }
