/* Albook Account & Admin Portal Styles — unified with Albook DS (#141518 + #f59e0b) */
.portal-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 24px 64px;
}
.portal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde68a;
  font-size: 13px;
}
.portal-banner code {
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
}
.portal-banner .p-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.portal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.portal-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #f3f4f6;
  margin: 0 0 4px;
}
.portal-header p {
  margin: 0;
  color: #9ca3af;
  font-size: 13px;
}
.portal-user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.portal-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #22242c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  font-weight: 600;
  font-size: 13px;
}
.portal-grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
.portal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.portal-card {
  background: #1a1c22;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 20px;
}
.portal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.portal-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #f3f4f6;
  margin: 0;
}
.portal-kpi-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 6px;
}
.portal-kpi-val {
  font-size: 24px;
  font-weight: 600;
  color: #f9fafb;
  font-variant-numeric: tabular-nums;
}
.portal-kpi-sub {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}
.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
}
.portal-badge.ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}
.portal-badge.warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fde68a;
}
.portal-badge.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
  color: #fca5a5;
}
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #22242c;
  color: #f3f4f6;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease;
}
.p-btn:hover:not(:disabled) {
  background: #2a2d37;
  border-color: rgba(255, 255, 255, 0.24);
}
.p-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.p-btn-primary {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #141518;
  font-weight: 400;
}
.p-btn-primary:hover:not(:disabled) {
  background: #fbbf24;
  border-color: #fbbf24;
}
.p-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.p-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
}
.p-btn-sm {
  height: 26px;
  padding: 0 9px;
  font-size: 11px;
}
.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.plan-card {
  background: #1a1c22;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.plan-card.featured {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.07), #1a1c22 45%);
}
.plan-price {
  font-size: 22px;
  font-weight: 600;
  color: #f9fafb;
  font-variant-numeric: tabular-nums;
}
.plan-price span {
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
}
.portal-table-wrap {
  overflow-x: auto;
}
.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.portal-table th {
  text-align: left;
  padding: 9px 10px;
  color: #9ca3af;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}
.portal-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.portal-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}
.portal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.portal-input,
.portal-select {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #111215;
  color: #f3f4f6;
  font-size: 12px;
}
.portal-input {
  min-width: 240px;
}
.portal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}
.portal-modal-backdrop.open {
  display: flex;
}
.portal-modal {
  width: 100%;
  max-width: 460px;
  background: #141518;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.portal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.portal-modal-body {
  padding: 18px;
}
.portal-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.qr-box {
  background: #ffffff;
  border-radius: 10px;
  padding: 12px;
  width: 220px;
  height: 220px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.portal-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #22242c;
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f9fafb;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 1200;
  display: none;
}
.portal-toast.show {
  display: block;
}
.login-gate {
  max-width: 440px;
  margin: 40px auto;
  text-align: center;
}
.actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.portal-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #111215;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #d1d5db;
  margin-bottom: 8px;
  text-align: left;
}
.portal-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #fde68a;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.portal-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
}
.portal-footer a {
  color: #9ca3af;
  text-decoration: none;
}
.portal-footer a:hover {
  color: #f3f4f6;
}
.portal-mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 18px;
  background: #141518;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.portal-mobile-drawer.open {
  display: flex;
}
.portal-mobile-drawer a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
}
.legal-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 104px 24px 64px;
  color: #d1d5db;
  line-height: 1.7;
  font-size: 14px;
}
.legal-wrap h1 {
  font-size: 28px;
  color: #f9fafb;
  margin: 0 0 8px;
}
.legal-wrap h2 {
  font-size: 17px;
  color: #f3f4f6;
  margin: 26px 0 8px;
}
.legal-wrap ul {
  padding-left: 20px;
}
@media (max-width: 960px) {
  .portal-grid-2,
  .portal-kpi-grid,
  .plans-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .portal-grid-2,
  .portal-kpi-grid,
  .plans-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   ADMIN 360° USER INSPECTOR DRAWER, FILTER CHIPS, BULK BAR & DEVICE CARDS
   ============================================================================ */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
}
.filter-chip:hover {
  border-color: rgba(245, 158, 11, 0.45);
  color: #f8fafc;
}
.filter-chip.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
  color: #fde68a;
}
.filter-chip .chip-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 12.5px;
  color: #fef3c7;
}
.bulk-bar.show {
  display: flex;
}

/* 4-level real-time device status dots */
.st-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.st-dot.live {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}
.st-dot.idle {
  background: #f59e0b;
}
.st-dot.offline {
  background: #64748b;
}
.st-dot.revoked {
  background: #ef4444;
}

.crm-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.32);
  color: #c7d2fe;
}
.crm-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.crm-tag-btn {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  cursor: pointer;
}
.crm-tag-btn.on {
  background: rgba(99, 102, 241, 0.24);
  border-color: #818cf8;
  color: #e0e7ff;
}

.user-row-clickable {
  cursor: pointer;
}
.user-avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #141518;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Slide-Over 360° Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1050;
  display: none;
  justify-content: flex-end;
}
.drawer-backdrop.open {
  display: flex;
}
.drawer-panel {
  width: 100%;
  max-width: 620px;
  height: 100%;
  background: #14151a;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  animation: drawerSlideIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes drawerSlideIn {
  from { transform: translateX(36px); opacity: 0.4; }
  to { transform: translateX(0); opacity: 1; }
}
.drawer-head {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #181a21;
}
.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #181a21;
  overflow-x: auto;
}
.drawer-tab {
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.drawer-tab:hover {
  color: #f1f5f9;
}
.drawer-tab.active {
  color: #f59e0b;
  border-bottom-color: #f59e0b;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 28px;
}
.drawer-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.drawer-stat {
  background: #1c1e26;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  padding: 10px 12px;
}
.drawer-stat-lbl {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.drawer-stat-val {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}
.drawer-section {
  background: #1a1c23;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.drawer-section h4 {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
}
.dev-card {
  background: #1a1c23;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 13px 14px;
  margin-bottom: 10px;
}
.dev-card.is-revoked {
  opacity: 0.72;
  border-style: dashed;
}
.dev-card.is-banned {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.05);
}
.dev-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 11.5px;
  color: #94a3b8;
  margin: 8px 0 10px;
}
.dev-meta-grid strong {
  color: #e2e8f0;
  font-weight: 500;
}
.portal-textarea {
  width: 100%;
  min-height: 68px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #111215;
  color: #f3f4f6;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.mode-switch {
  display: flex;
  gap: 6px;
  background: #111215;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mode-switch button {
  flex: 1;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.mode-switch button.active {
  background: #f59e0b;
  color: #141518;
  font-weight: 600;
}
.table-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: #94a3b8;
}
