/* ============================================================
   KINITRA OWNER — Dashboard Billing CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-base: #f5f6fa;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f8f9fc;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --green: #16a34a;
  --green-dim: #f0fdf4;
  --red: #dc2626;
  --red-dim: #fef2f2;
  --yellow: #d97706;
  --yellow-dim: #fffbeb;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ── LOGIN ─────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: #fff; border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .mark { width: 48px; height: 48px; background: var(--accent); color: #fff; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.login-logo .title { font-size: 15px; font-weight: 700; margin-top: 10px; color: var(--text-primary); }
.login-logo .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── APP SHELL ─────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 900; }
.sidebar-overlay.show { display: block; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: #fff;
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 950;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid var(--border); }
.logo-mark { width: 34px; height: 34px; background: var(--accent); color: #fff; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.logo-text { font-size: 14px; font-weight: 700; color: var(--text-primary); }

.sidebar-nav { padding: 14px 10px; flex: 1; }
.nav-section-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 2px; }
button.nav-item { width: 100%; border: none; background: none; font-family: inherit; cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.nav-icon { display: inline-flex; width: 15px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }

.topbar {
  position: sticky; top: 0; z-index: 90; background: #fff; border-bottom: 1px solid var(--border);
  height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; gap: 12px;
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer; }
.icon-btn:hover { background: var(--bg-hover); }

.main-content { flex: 1; min-width: 0; padding: 24px; }

/* ── PAGE HEADER ───────────────────────── */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-header p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── CARD ──────────────────────────────── */
.card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; margin-bottom: 16px; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.no-pad { padding: 0; overflow-x: auto; }

/* ── STAT CARDS ────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-card .lbl { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card .val { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-top: 6px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stat-grid { grid-template-columns: 1fr; } }

/* ── BADGE ─────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-green  { background: var(--green-dim); color: var(--green); }
.badge-red    { background: var(--red-dim); color: var(--red); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-blue   { background: var(--accent-light); color: var(--accent); }
.badge-gray   { background: #f1f5f9; color: var(--text-muted); }

/* ── BUTTON ────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: none; font-family: 'Montserrat', Arial, sans-serif; transition: opacity 0.15s; text-decoration: none; }
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary, .btn-ghost { background: #f1f5f9; color: var(--text-secondary); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── FORM ──────────────────────────────── */
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  width: 100%; background: var(--bg-base); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13px; color: var(--text-primary); outline: none; font-family: 'Montserrat', Arial, sans-serif;
}
.form-control:focus { border-color: var(--accent); background: #fff; }
.form-group { margin-bottom: 14px; }

/* ── TABLE ─────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--border); background: var(--bg-base); white-space: nowrap; }
.tbl td { padding: 12px 14px; font-size: 13px; color: var(--text-primary); border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg-hover); }

/* ── ALERT ─────────────────────────────── */
.alert-bar { padding: 11px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.alert-bar.success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(22,163,74,.2); }
.alert-bar.error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(220,38,38,.2); }

@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; transition: left 0.2s; }
  .sidebar.open { left: 0; }
  .main-content { padding: 16px; }
  .card-header { flex-direction: column; align-items: flex-start; }
}
