/* Shared styles for the BrickIQ app panels (company dashboard + super admin). */
body.panel-body { background: var(--bg-soft); color: var(--ink); }
.panel-top {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.panel-top .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.panel-top .brand { font-weight: 800; font-size: 1.12rem; }
.panel-top .brand b { color: var(--brand); }
.panel-top .who { display: flex; align-items: center; gap: 14px; font-size: .9rem; color: var(--muted); }
.panel-top .role-chip { background: var(--bg-tint); color: var(--brand-ink); font-weight: 700; padding: 5px 12px; border-radius: var(--r-pill); font-size: .78rem; }
.panel-main { padding: 34px 0 80px; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 22px; flex-wrap: wrap; }
.panel-h h1 { font-size: 1.7rem; margin: 0; }
.panel-h p { margin: 4px 0 0; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); }
.kpi b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.kpi small { color: var(--muted); font-weight: 600; }
.kpi.accent b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.pcard h2 { font-size: 1.15rem; margin: 0 0 16px; }
.pcard .sub { color: var(--muted); font-size: .92rem; margin: -8px 0 16px; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
table.tbl th { text-align: left; padding: 10px 12px; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.tbl tr:hover td { background: var(--bg-soft); }
.empty { text-align: center; color: var(--muted); padding: 30px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pill); font-size: .76rem; font-weight: 700; }
.badge.active { background: #ecfdf5; color: #047857; }
.badge.inactive { background: #fef2f2; color: #b91c1c; }
.badge.trial { background: #fffbeb; color: #b45309; }
.badge.res { background: var(--bg-tint); color: var(--brand-ink); }
.badge.comm { background: #ecfeff; color: #0e7490; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 8px 14px; font-size: .84rem; }
.btn-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.btn-ok:hover { background: #d1fae5; }

.sub-status { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sub-status .price { font-size: 1.6rem; font-weight: 800; }
.locked-note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: var(--r); padding: 14px 16px; font-size: .92rem; margin-top: 14px; }

.mini-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mini-form .field { margin: 0; }
.mini-form .full { grid-column: 1 / -1; }

/* ---- Super Admin sidebar layout ---- */
.sa-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sa-side {
  background: #0b1220; color: #cdd7ea; padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.sa-side .sa-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: #fff; padding: 6px 10px 18px; }
.sa-side .sa-brand b { color: var(--sky); }
.sa-side .sa-badge { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #93a4c3; padding: 0 10px 10px; }
.sa-nav-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px;
  color: #aab6ce; font-weight: 600; font-size: .93rem; transition: background .15s, color .15s;
}
.sa-nav-link:hover { background: #131f36; color: #fff; }
.sa-nav-link.active { background: linear-gradient(135deg, #4f46e5, #0ea5e9); color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,.35); }
.sa-nav-link svg { width: 18px; height: 18px; flex: none; }
.sa-side .sa-spacer { flex: 1; }
.sa-side .sa-foot { border-top: 1px solid #1e2b45; padding-top: 12px; margin-top: 8px; font-size: .82rem; color: #6b7a99; }
.sa-side .sa-foot a { color: #aab6ce; display: block; padding: 8px 10px; border-radius: 8px; }
.sa-side .sa-foot a:hover { background: #131f36; color: #fff; }

.sa-body { display: flex; flex-direction: column; min-width: 0; }
.sa-topbar {
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 20;
}
.sa-topbar .who { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); }
.sa-content { padding: 30px 28px 70px; }
.sa-mobile-top { display: none; }

@media (max-width: 860px) {
  .sa-layout { grid-template-columns: 1fr; }
  .sa-side {
    position: fixed; z-index: 60; width: 250px; transform: translateX(-100%); transition: transform .2s ease;
  }
  .sa-side.open { transform: none; }
  .sa-mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #0b1220; color: #fff; position: sticky; top: 0; z-index: 40; }
  .sa-mobile-top .brand { color: #fff; font-weight: 800; } .sa-mobile-top .brand b { color: var(--sky); }
  .sa-burger { background: #131f36; color: #fff; border: 0; border-radius: 8px; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; }
}

@media (max-width: 780px) {
  .kpis, .mini-form { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .kpis, .mini-form { grid-template-columns: 1fr; }
}
