:root {
  --sa-brand-primary: #2563eb;
  --sa-brand-primary-rgb: 37, 99, 235;
}

.smartadmin-shell,
.smartadmin-auth {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.smartadmin-shell,
.smartadmin-shell body,
.smartadmin-auth,
.smartadmin-auth body {
  color-scheme: light;
}

.smartadmin-shell {
  --background-color: #f5f7fa;
  --default-color: #2d3748;
  --heading-color: #1a202c;
  --accent-color: #5b8def;
  --surface-color: #ffffff;
  --muted-color: #718096;
  --light-color: #a0aec0;
  --border-color: #e2e8f0;
  --border-color-light: #edf2f7;
  --border-color-dark: #cbd5e0;
  --header-bg: #ffffff;
  --header-border: #e2e8f0;
  --sidebar-bg: #ffffff;
  --sidebar-icon-bg: #f8fafc;
  --sidebar-border: #e2e8f0;
  --sidebar-color: #2d3748;
  --sidebar-muted-color: #718096;
  --sidebar-hover-bg: #edf2f7;
  --sidebar-active-bg: color-mix(in srgb, #5b8def, transparent 88%);
  --sidebar-active-color: #5b8def;
  --sidebar-icon-active-bg: color-mix(in srgb, #5b8def, transparent 85%);
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --input-bg: #ffffff;
  --input-border: #e2e8f0;
  --input-focus-border: #5b8def;
  --input-focus-ring: rgb(91 141 239 / 0.25);
}

body {
  min-height: 100vh;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.flash-container {
  display: grid;
  gap: 0.875rem;
}

.flash {
  border-radius: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
}

.flash.error {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(254, 242, 242, 0.96);
  color: #991b1b;
}

.flash.warn {
  border-color: rgba(217, 119, 6, 0.18);
  background: rgba(255, 247, 237, 0.96);
  color: #9a3412;
}

.flash.success {
  border-color: rgba(22, 163, 74, 0.18);
  background: rgba(240, 253, 244, 0.96);
  color: #166534;
}

.flash.info {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(239, 246, 255, 0.96);
  color: #1d4ed8;
}

.platform-header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.platform-header-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--sa-brand-primary-rgb), 0.16), rgba(15, 23, 42, 0.08));
  border: 1px solid rgba(var(--sa-brand-primary-rgb), 0.12);
}

.platform-header-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.platform-header-logo i {
  font-size: 1.1rem;
  color: var(--sa-brand-primary);
}

.platform-header-copy {
  min-width: 0;
}

.platform-header-copy h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.platform-header-copy p {
  margin: 0;
  color: var(--default-color);
  opacity: 0.72;
}

.platform-header-actions {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.platform-header-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.platform-toolbar-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.platform-toolbar-form label {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
  color: var(--default-color);
  opacity: 0.72;
}

.platform-toolbar-form select,
.platform-toolbar-form input[type="search"] {
  min-height: 2.5rem;
}

.platform-tenant-form {
  display: grid;
  gap: 0.4rem;
}

.platform-tenant-controls {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(180px, 260px);
  gap: 0.5rem;
}

.platform-user-menu {
  min-width: 18rem;
}

.platform-user-summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 0.75rem;
}

.platform-user-summary .avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--sa-brand-primary-rgb), 0.12);
  color: var(--sa-brand-primary);
  font-size: 1.2rem;
}

.platform-user-summary strong,
.platform-user-summary span {
  display: block;
}

.platform-user-summary span {
  color: var(--default-color);
  opacity: 0.72;
  font-size: 0.875rem;
}

.platform-inline-form {
  margin: 0;
}

.platform-footer-note {
  color: var(--default-color);
  opacity: 0.7;
}

.panel-link.platform-active {
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.12);
}

.panel-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.panel-link-icon {
  width: 1.7rem;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  font-size: 0.9rem;
}

.panel-link.platform-active .panel-link-icon,
.panel-nav-group.open > .panel-link .panel-link-icon {
  background: rgba(var(--accent-color-rgb), 0.14);
  color: var(--accent-color);
}

.panel-link-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
  flex: 1 1 auto;
}

.panel-link-label {
  min-width: 0;
}

.panel-link-summary {
  color: var(--default-color);
  opacity: 0.62;
  font-size: 0.74rem;
  line-height: 1.25;
}

.panel-link.platform-child {
  padding-left: 1.1rem;
}

.panel-link.platform-child .panel-link-icon {
  width: 1.35rem;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
}

.panel-subnav {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.panel-nav-group.open > .panel-subnav,
.panel-subnav.show {
  max-height: 22rem;
  overflow-y: auto;
}

.panel-subnav::-webkit-scrollbar {
  width: 6px;
}

.panel-subnav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

.sidebar-panel-header small {
  display: block;
  margin-top: 0.2rem;
  color: var(--default-color);
  opacity: 0.68;
  font-size: 0.78rem;
}

.platform-auth-card .flash-container {
  margin-bottom: 1rem;
}

.platform-auth-card .btn-block {
  width: 100%;
}

.platform-auth-methods {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.platform-auth-methods label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.platform-brand-text {
  max-width: 34rem;
}

.platform-auth-footnote {
  margin-top: 1rem;
  text-align: center;
}

.platform-auth-footnote .btn {
  min-width: 10rem;
}

.smartadmin-shell .theme-toggle,
.smartadmin-auth .theme-toggle {
  display: none !important;
}

.smartadmin-shell .header-left {
  flex: 0 0 auto;
}

.smartadmin-shell .header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 1rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: none;
  z-index: 1000;
}

@media (min-width: 768px) {
  .smartadmin-shell .header {
    left: 72px;
  }
}

@media (min-width: 1280px) {
  .smartadmin-shell .header {
    left: 312px;
  }
}

.smartadmin-shell .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  padding: 0;
  gap: 0;
  background: transparent;
  border-right: none;
  z-index: 1001;
}

.smartadmin-shell .sidebar-iconbar {
  width: 72px;
  min-width: 72px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

.smartadmin-shell .sidebar-panel {
  width: 240px;
  min-width: 240px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  opacity: 1;
  overflow: hidden;
  transition: width 0.22s ease, min-width 0.22s ease, opacity 0.18s ease;
}

.smartadmin-shell .sidebar-panel-section {
  display: none;
  padding-bottom: 1rem;
}

.smartadmin-shell .sidebar-panel-section.active {
  display: block;
}

.smartadmin-shell .sidebar-panel-header {
  height: 60px;
  padding: 0 1rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.smartadmin-shell .main {
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  min-width: 0;
}

@media (min-width: 768px) {
  .smartadmin-shell .sidebar {
    width: 72px;
  }

  .smartadmin-shell .main {
    margin-left: 72px;
    width: calc(100% - 72px);
  }
}

@media (min-width: 1280px) {
  .smartadmin-shell .sidebar {
    width: 312px;
  }

  .smartadmin-shell .main {
    margin-left: 312px;
    width: calc(100% - 312px);
  }

  .smartadmin-shell.sidebar-panel-collapsed .header {
    left: 72px;
  }

  .smartadmin-shell.sidebar-panel-collapsed .main {
    margin-left: 72px;
    width: calc(100% - 72px);
  }

  .smartadmin-shell.sidebar-panel-collapsed .sidebar {
    width: 72px;
  }

  .smartadmin-shell.sidebar-panel-collapsed .sidebar-panel {
    width: 0;
    min-width: 0;
    opacity: 0;
    border-right: none;
  }
}

@media (min-width: 768px) and (max-width: 1279.98px) {
  .smartadmin-shell .sidebar {
    width: 72px;
  }

  .smartadmin-shell .sidebar-panel {
    width: 0;
    min-width: 0;
    opacity: 0;
    border-right: none;
  }

  .smartadmin-shell.sidebar-panel-open .sidebar-panel {
    width: 240px;
    min-width: 240px;
    opacity: 1;
    border-right: 1px solid #e2e8f0;
  }

  .smartadmin-shell.sidebar-panel-open .sidebar {
    width: 312px;
  }
}

@media (max-width: 767.98px) {
  .smartadmin-shell .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .smartadmin-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .smartadmin-shell .sidebar-panel {
    width: 240px;
    min-width: 240px;
    opacity: 1;
    border-right: 1px solid #e2e8f0;
  }

  .smartadmin-shell .main {
    margin-left: 0;
  }
}

.smartadmin-shell .sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 1000;
}

.smartadmin-shell.sidebar-open .sidebar-overlay,
.smartadmin-shell.sidebar-panel-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1280px) {
  .smartadmin-shell .sidebar-overlay {
    display: none;
  }
}

.smartadmin-shell .main-content {
  padding: 1.5rem;
  padding-bottom: 3rem;
  background: #f5f7fa;
  width: 100%;
  min-width: 0;
}

.smartadmin-shell .page-content .narrow-card {
  max-width: none;
  width: 100%;
  margin: 0;
}

.smartadmin-shell .page-content .card.narrow-card {
  max-width: none;
  margin: 0;
}

.smartadmin-shell .mobile-header-menu {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.smartadmin-shell .page-content {
  padding: 0;
  gap: 1.5rem;
  width: 100%;
  min-width: 0;
}

.smartadmin-shell .page-content .card {
  background: var(--surface-color, #fff);
  border: 1px solid var(--surface-border-color, rgba(15, 23, 42, 0.08));
  border-radius: 1rem;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.05);
}

.smartadmin-shell .page-content .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.smartadmin-shell .page-content .card-header h3,
.smartadmin-shell .page-content .card-header h4,
.smartadmin-shell .page-content .section-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--heading-color, #0f172a);
}

.smartadmin-shell .page-content .muted,
.smartadmin-shell .page-content .small,
.smartadmin-shell .page-content .status-note {
  font-size: 0.875rem;
  line-height: 1.55;
}

.smartadmin-shell .page-content label {
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(15, 23, 42, 0.66);
}

.smartadmin-shell .page-content input:not([type="checkbox"]):not([type="radio"]),
.smartadmin-shell .page-content select,
.smartadmin-shell .page-content textarea {
  min-height: 2.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: none;
}

.smartadmin-shell .page-content textarea {
  min-height: 6rem;
}

.smartadmin-shell .page-content input:focus,
.smartadmin-shell .page-content select:focus,
.smartadmin-shell .page-content textarea:focus {
  border-color: rgba(var(--sa-brand-primary-rgb), 0.52);
  box-shadow: 0 0 0 0.2rem rgba(var(--sa-brand-primary-rgb), 0.12);
  outline: none;
}

.smartadmin-shell .page-content button:not(.dropdown-toggle):not(.iconbar-item):not(.sidebar-toggle):not(.header-action):not(.search-toggle):not(.mobile-menu-toggle):not(.theme-toggle):not(.sidebar-panel-close):not(.btn-close),
.smartadmin-shell .page-content .btn {
  min-height: 2.5rem;
  padding: 0.65rem 1rem;
  border-radius: 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.smartadmin-shell .page-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.smartadmin-shell .page-content th,
.smartadmin-shell .page-content td {
  padding: 0.85rem 0.75rem;
  vertical-align: top;
}

.smartadmin-shell .page-content th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(15, 23, 42, 0.58);
}

.smartadmin-shell .page-content .grid,
.smartadmin-shell .page-content .row,
.smartadmin-shell .page-content .filter-grid,
.smartadmin-shell .page-content .list-filter-grid,
.smartadmin-shell .page-content .metrics-grid,
.smartadmin-shell .page-content .row-3 {
  gap: 1rem;
}

.smartadmin-shell .page-content .table-responsive {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 1rem;
  overflow: auto;
}

.smartadmin-shell .page-content .dataTables_wrapper .dataTables_filter input,
.smartadmin-shell .page-content .dataTables_wrapper .dataTables_length select {
  min-height: 2.4rem;
  border-radius: 0.75rem;
}

.smartadmin-shell .page-content .code-block {
  max-height: none;
  font-size: 0.83rem;
  line-height: 1.5;
}

.smartadmin-shell .page-content .beacon-kpi-label,
.smartadmin-shell .page-content .beacon-live-label,
.smartadmin-shell .page-content .beacon-automation-step-label,
.smartadmin-shell .page-content .beacon-action-label {
  font-size: 0.76rem;
}

.smartadmin-shell .page-content .beacon-kpi-value,
.smartadmin-shell .page-content .beacon-action-value {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  line-height: 1.1;
}

.smartadmin-shell .page-content svg {
  max-width: 100%;
}

@media (max-width: 1279px) {
  .platform-header-filters {
    display: none;
  }
}

@media (max-width: 991px) {
  .platform-tenant-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .platform-header-actions {
    gap: 0.5rem;
  }

  .main-content {
    gap: 1rem;
  }
}
