:root {
  --admin-blue: #071d49;
  --admin-blue-2: #0a4ca8;
  --admin-orange: #ff8a00;
  --admin-ink: #172033;
  --admin-muted: #65728a;
  --admin-line: #d9e5f2;
  --admin-page: #f5f8fc;
  --admin-surface: #ffffff;
  --admin-soft: #eef6ff;
  --admin-shadow: 0 10px 28px rgba(7, 29, 73, .08);
}

html { overflow-x: hidden; }
body {
  margin: 0;
  min-width: 0;
  background: linear-gradient(180deg, #f3f8ff 0, var(--admin-page) 320px, #fff 100%);
  color: var(--admin-ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.navbar, .topbar, .billing-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(7, 29, 73, .97) !important;
  color: #fff !important;
  border-bottom: 3px solid var(--admin-orange) !important;
  box-shadow: 0 8px 24px rgba(7, 29, 73, .16) !important;
  backdrop-filter: blur(12px);
}

.navbar a, .topbar a, .billing-top a {
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.09) !important;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease;
}

.navbar h1, .navbar h2, .topbar h1, .topbar h2, .billing-top h1, .billing-top h2,
.navbar .brand h1, .topbar .brand h1 {
  color: #fff !important;
}
.topbar-inner, .brand, .admin-meta { display: flex !important; }

.navbar a:hover, .topbar a:hover, .billing-top a:hover {
  background: rgba(255,255,255,.18) !important;
  border-color: rgba(255,255,255,.4) !important;
}

.container, main.container, .billing-admin {
  width: min(calc(100% - 32px), 1480px) !important;
  max-width: 1480px !important;
  margin: 0 auto !important;
  padding: 24px 0 48px !important;
}

.hero, .hero-main, .hero-side, .section, .panel, .page-head, .admin-page-head,
.stat-card, .grid article, .invoice-card, .settlement-card, .card {
  min-width: 0;
  border: 1px solid var(--admin-line) !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: var(--admin-shadow) !important;
}

.hero-main, .hero-side, .section, .panel, .page-head, .admin-page-head,
.stat-card, .grid article { padding: 18px !important; }

h1, h2, h3, h4 { color: var(--admin-blue); letter-spacing: 0; }
h1 { font-size: clamp(22px, 3vw, 32px); }
h2 { font-size: clamp(20px, 2.5vw, 28px); }

button, input, select, textarea { font: inherit; }
button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--admin-blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, opacity .16s ease;
}
button:hover:not(:disabled) { background: var(--admin-blue-2); }
button:disabled { cursor: wait; opacity: .58; }
input, select, textarea {
  min-width: 0;
  border: 1px solid #cbd9ea !important;
  border-radius: 10px !important;
  background: #fbfdff !important;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(255,138,0,.24);
  outline-offset: 2px;
  border-color: var(--admin-orange) !important;
}

table { width: 100%; border-collapse: collapse; }
th { background: #eef6ff !important; color: var(--admin-blue) !important; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e7eef7 !important; vertical-align: top; }
.table-wrap, .panel { overflow-x: auto; }
.table-actions, .actions-inline, .hero-actions, .detail-heading { gap: 8px !important; }
.table-actions a, .actions-inline a, .hero-actions a {
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px !important;
  text-decoration: none;
  font-weight: 900;
}
.status-badge { border-radius: 999px !important; }
.empty, .muted-note { border: 1px dashed #cbd9ea !important; border-radius: 12px !important; background: #fbfdff !important; color: var(--admin-muted); }

.billing-nav { display: grid !important; gap: 10px; }
.billing-nav-primary { display: flex; flex-wrap: wrap; gap: 8px; }
.billing-nav-more { position: relative; }
.billing-nav-more summary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 10px;
  background: rgba(255,255,255,.11);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}
.billing-nav-more summary::-webkit-details-marker { display: none; }
.billing-nav-more-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}
.billing-nav-more-list a { min-height: 38px; display: inline-grid; place-items: center; }

@media (max-width: 760px) {
  .container, main.container, .billing-admin { width: min(calc(100% - 20px), 1480px) !important; padding-top: 14px !important; }
  .topbar-inner, .admin-page-head, .page-head, .detail-heading { align-items: stretch !important; flex-direction: column !important; }
  .stats, .sections, .hero { grid-template-columns: 1fr !important; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .table-wrap { margin-inline: -8px; padding-inline: 8px; }
  .table-actions a, .table-actions button, .actions-inline a, .actions-inline button { flex: 1 1 140px; }
}

@media (max-width: 560px) {
  .topbar-inner { flex-direction: column !important; align-items: stretch !important; }
  .brand { align-items: center !important; }
  .admin-meta { justify-content: space-between !important; align-items: center !important; }
  .brand h1 { font-size: 21px !important; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr !important; }
  .navbar nav { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .navbar a { text-align: center; }
  .billing-nav-primary, .billing-nav-more-list { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-nav-primary a, .billing-nav-more-list a, .billing-nav-more summary { justify-content: center; text-align: center; }
}
