.admin-body { min-height: 100vh; background: #080b12; }
.gate-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 70% 20%, rgba(246, 132, 31, .12), transparent 30%), #080b12; }
.gate-shell[hidden], .admin-app[hidden], .admin-view[hidden] { display: none !important; }
.auth-card { width: min(460px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: rgba(17, 22, 33, .96); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-card .brand { margin-bottom: 34px; }
.auth-card h1 { margin: 5px 0 8px; font-size: clamp(26px, 5vw, 36px); }
.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 7px; color: #c9dadd; font-size: 13px; font-weight: 700; }
.stack-form input, .stack-form select, .stack-form textarea, .search-input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  color: var(--text); background: #09151d; outline: none;
}
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus, .search-input:focus {
  border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(15, 118, 110, .18);
}
.button { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: #fff; background: #181e2b; font: inherit; font-weight: 800; cursor: pointer; }
.button.primary { border-color: transparent; color: #04110e; background: linear-gradient(145deg, #43e2a7, #22b88e); }
.button.ghost { background: transparent; }
.button.small { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.admin-app { min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; width: 250px; display: flex; flex-direction: column; padding: 24px 16px; border-right: 1px solid var(--line); background: #0d111a; }
.admin-sidebar .brand { padding: 0 8px; }
.admin-nav { display: grid; gap: 6px; margin-top: 40px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.nav-item span { width: 22px; font-size: 20px; text-align: center; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(246, 132, 31, .13); }
.nav-item.active { box-shadow: inset 3px 0 var(--accent); }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--line); }
.identity { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12px; word-break: break-word; }
.admin-main { min-height: 100vh; margin-left: 250px; padding: 28px clamp(20px, 4vw, 52px) 50px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.admin-topbar h1 { margin: 2px 0 0; font-size: 31px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.status-dot { color: #90dfb2; font-size: 13px; }
.status-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #44d486; box-shadow: 0 0 12px rgba(68, 212, 134, .7); }
.status-dot.error { color: #ff9a9a; }
.status-dot.error::before { background: #ff6262; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: #fff; background: var(--panel); font-size: 22px; cursor: pointer; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(28, 34, 48, .95), rgba(15, 20, 30, .95)); }
.metric-card .metric-label { display: block; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin: 15px 0 5px; font-size: 32px; }
.metric-card small { color: #727d91; }
.content-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); }
.release-grid { grid-template-columns: minmax(360px, .72fr) minmax(0, 1.28fr); }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0 0 5px; font-size: 18px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.text-button { border: 0; color: var(--accent); background: none; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.compact-form { padding: 20px 22px 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-row { display: flex !important; flex-direction: row !important; align-items: center; gap: 9px; }
.check-row input { width: auto; }
.toolbar-heading { flex-wrap: wrap; }
.search-input { width: min(330px, 100%); }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: left; vertical-align: middle; }
.data-table th { color: #8490a5; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.cell-primary { display: block; color: #fff; font-weight: 700; }
.cell-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.badge.perpetual, .badge.active, .badge.approved { color: #88eab2; background: rgba(49, 187, 109, .13); }
.badge.trial, .badge.pending, .badge.submitted { color: #ffd394; background: rgba(246, 132, 31, .14); }
.badge.expired, .badge.suspended, .badge.revoked, .badge.rejected { color: #ff9c9c; background: rgba(255, 74, 74, .12); }
.actions { display: flex; align-items: center; gap: 7px; }
.table-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: #fff; background: #181e2b; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.table-button:hover { border-color: var(--accent); }
.table-button.danger { color: #ff9c9c; }
.empty-state { padding: 44px 22px; color: var(--muted); text-align: center; }
.toast { position: fixed; right: 26px; bottom: 24px; z-index: 30; max-width: 420px; padding: 13px 17px; border: 1px solid rgba(68, 212, 134, .35); border-radius: 12px; color: #bdf6d3; background: #10251a; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
.toast.error { border-color: rgba(255, 98, 98, .35); color: #ffd1d1; background: #291414; }
textarea { resize: vertical; }

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .two-columns, .release-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-sidebar { position: static; width: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-sidebar .brand small, .sidebar-footer { display: none; }
  .admin-nav { grid-template-columns: repeat(5, 1fr); margin-top: 15px; }
  .nav-item { justify-content: center; padding: 10px 6px; font-size: 11px; }
  .nav-item span { display: none; }
  .admin-main { margin-left: 0; padding: 22px 14px 40px; }
  .admin-topbar { align-items: flex-start; }
  .status-dot { display: none; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
