/* Napoleon Billing — Dashboard Styles */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e1e4ed;
  --text-muted: #8b8fa3;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --pending: #74b9ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.4rem;
  color: var(--accent-light);
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.refresh-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#refresh-btn {
  background: var(--border);
  color: var(--text);
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
}

#refresh-btn:hover { background: var(--accent); }

main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.card h2 {
  font-size: 1rem;
  color: var(--accent-light);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.period-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  flex: 1;
  min-width: 140px;
}

.stat-box .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-box .value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text);
  margin-top: 0.25rem;
}

.stat-box .value.accent { color: var(--accent-light); }
.stat-box .value.success { color: var(--success); }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
}

td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

.align-right { text-align: right; }

/* Tool breakdown */
.breakdown-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: var(--bg);
}

.breakdown-segment {
  height: 100%;
  transition: width 0.3s ease;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pending { background: rgba(116,185,255,0.15); color: var(--pending); }
.badge-approved { background: rgba(0,184,148,0.15); color: var(--success); }
.badge-confirmed { background: rgba(0,184,148,0.25); color: var(--success); }
.badge-broadcasting { background: rgba(253,203,110,0.15); color: var(--warning); }
.badge-rejected { background: rgba(225,112,85,0.15); color: var(--danger); }
.badge-failed { background: rgba(225,112,85,0.15); color: var(--danger); }
.badge-expired { background: rgba(139,143,163,0.15); color: var(--text-muted); }

/* Button */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--accent-light); color: var(--bg); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

#bill-result {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.result-success { color: var(--success); }
.result-error { color: var(--danger); }

/* Responsive */
@media (max-width: 600px) {
  header { flex-direction: column; gap: 0.5rem; }
  .summary-row { flex-direction: column; }
}
