/* ================= TISP Admin Theme ================= */
:root {
  --tisp-primary: #2563eb;
  --tisp-primary-dark: #1d4ed8;
  --tisp-sidebar-bg: #0f172a;
  --tisp-sidebar-width: 250px;
  --tisp-topbar-height: 60px;
}

body { background: #f1f5f9; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; }

/* ---------- Layout ---------- */
.tisp-wrapper { display: flex; min-height: 100vh; }

.tisp-sidebar {
  width: var(--tisp-sidebar-width);
  background: var(--tisp-sidebar-bg);
  color: #cbd5e1;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
  display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; background: var(--tisp-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex-shrink: 0; }
.brand-text { font-weight: 700; font-size: 15px; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 11px;
  color: #94a3b8; padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; text-decoration: none; margin-bottom: 2px;
}
.sidebar-nav .nav-link i { font-size: 16px; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #f1f5f9; }
.sidebar-nav .nav-link.active { background: var(--tisp-primary); color: #fff; }
.nav-item.has-children .nav-children { display: none; padding-left: 28px; }
.nav-item.has-children.open .nav-children { display: block; }
.nav-item.has-children.open > .nav-link .bi-chevron-down { transform: rotate(180deg); }

.tisp-main { flex: 1; margin-left: var(--tisp-sidebar-width); display: flex; flex-direction: column; min-width: 0; }

.tisp-topbar {
  height: var(--tisp-topbar-height); background: #fff;
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
  border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 1030;
}
.topbar-title { font-weight: 700; font-size: 16px; color: #0f172a; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--tisp-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

.tisp-content { padding: 22px; flex: 1; }

@media (max-width: 991px) {
  .tisp-sidebar { transform: translateX(-100%); }
  .tisp-sidebar.show { transform: translateX(0); }
  .tisp-main { margin-left: 0; }
}

/* ---------- Cards & stats ---------- */
.card { border: 0; border-radius: 12px; box-shadow: 0 1px 3px rgba(2,6,23,.06); }
.card-header { background: #fff; border-bottom: 1px solid #f1f5f9; font-weight: 600; border-radius: 12px 12px 0 0 !important; }

.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-value { font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1.1; }
.stat-label { color: #64748b; font-size: 12.5px; }

/* ---------- Tables ---------- */
.table { font-size: 13.5px; }
.table thead th { background: #f8fafc; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: 13px; color: #334155; }
.form-control, .form-select { font-size: 14px; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--tisp-primary); box-shadow: 0 0 0 .2rem rgba(37,99,235,.12); }
.btn { border-radius: 8px; font-size: 14px; }
.btn-primary { background: var(--tisp-primary); border-color: var(--tisp-primary); }
.btn-primary:hover { background: var(--tisp-primary-dark); border-color: var(--tisp-primary-dark); }

.badge { font-weight: 600; font-size: 11.5px; }

/* ---------- Auth pages ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); padding: 20px; }
.auth-card { background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(2,6,23,.35); }
.auth-logo { width: 52px; height: 52px; border-radius: 13px; background: var(--tisp-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; margin: 0 auto 14px; }

/* ---------- Portal (end-user) ---------- */
.portal-body { background: #f1f5f9; min-height: 100vh; }
.portal-header { background: linear-gradient(135deg, var(--tisp-primary) 0%, #1e40af 100%); color: #fff; padding: 20px 0 60px; }
.portal-container { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.portal-card-float { margin-top: -44px; }
.pay-now-btn { font-size: 18px; font-weight: 700; padding: 14px; border-radius: 12px; }

/* ---------- Misc ---------- */
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.search-box { max-width: 320px; }
.text-mono { font-family: Consolas, monospace; }
.cursor-pointer { cursor: pointer; }
.online-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.online-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.online-dot.off { background: #cbd5e1; }
