/* ==========================================================================
   AcuGIS Platform — Central portal
   --------------------------------------------------------------------------
   Visual language is intentionally aligned with GeoVault (dark slate +
   teal accent, light content area, Material cards). The portal layers a
   gradient navbar and softer card surfaces on top so it reads as the
   "front door" rather than a single-purpose admin tool.
   ========================================================================== */

:root {
  --acu-bg: #f4f6fa;
  --acu-bg-alt: #eef1f6;
  --acu-surface: #ffffff;
  --acu-text: #1f2a37;
  --acu-text-muted: #5b6b7c;
  --acu-text-subtle: #8a99a8;
  --acu-border: #e3e8ef;

  --acu-navbar-from: #1f3b4d;
  --acu-navbar-to: #2c5364;
  --acu-navbar-text: #ffffff;
  --acu-navbar-text-muted: rgba(255, 255, 255, 0.78);

  --acu-accent: #26a69a;
  --acu-accent-strong: #00897b;
  --acu-accent-soft: rgba(38, 166, 154, 0.12);

  --acu-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --acu-shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --acu-shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);

  --acu-radius: 10px;
  --acu-radius-sm: 6px;

  --topnav-height: 64px;
}

html,
body {
  background: var(--acu-bg);
  color: var(--acu-text);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: var(--acu-accent-strong);
}

/* ==========================================================================
   Top navigation
   ========================================================================== */

.topnav {
  background: linear-gradient(135deg, var(--acu-navbar-from) 0%, var(--acu-navbar-to) 100%);
  height: var(--topnav-height);
  line-height: var(--topnav-height);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topnav .nav-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.topnav .brand-logo {
  position: static;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--acu-navbar-text);
}

.topnav .brand-mark {
  font-size: 28px;
  color: #80cbc4;
}

.topnav .brand-name {
  white-space: nowrap;
}

.topnav .admin-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: 8px;
  border-radius: 6px;
  color: var(--acu-navbar-text);
  transition: background-color 0.15s ease;
}

.topnav .admin-trigger:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.topnav .admin-trigger i.material-icons {
  line-height: 44px;
  height: 44px;
}

.topnav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav-actions li {
  display: flex;
  align-items: center;
  height: var(--topnav-height);
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px !important;
  border-radius: 6px;
  color: var(--acu-navbar-text-muted) !important;
  font-weight: 500;
  font-size: 0.92rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topnav-link i.material-icons {
  line-height: 40px;
  height: 40px;
}

.topnav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--acu-navbar-text) !important;
}

.user-menu-placeholder {
  width: 40px;
  justify-content: center;
  padding: 0 !important;
}

.user-menu-placeholder i.material-icons {
  font-size: 26px;
}

/* ==========================================================================
   Admin drawer (Materialize sidenav, opened on demand)
   ========================================================================== */

.admin-drawer.sidenav {
  width: 300px;
  background: #1f2a37;
  color: #cfd8dc;
  padding-top: 0;
}

.admin-drawer .drawer-brand {
  background: #16202b;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}

.admin-drawer .drawer-brand .brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-drawer .drawer-brand .brand-icon {
  color: var(--acu-accent);
  font-size: 28px;
}

.admin-drawer .drawer-brand .brand-title {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.admin-drawer .nav-section-label {
  padding: 14px 24px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #78909c;
}

.admin-drawer li > a {
  color: #cfd8dc;
  font-weight: 500;
  font-size: 0.95rem;
  height: 48px;
  line-height: 48px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-drawer li > a > i.material-icons {
  color: #78909c;
  margin-right: 14px;
  font-size: 22px;
  height: auto;
  line-height: 1;
}

.admin-drawer li > a:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.admin-drawer li > a:hover > i.material-icons {
  color: #ffffff;
}

.admin-drawer li > a.disabled-link {
  opacity: 0.5;
  pointer-events: none;
}

.admin-drawer .divider {
  background-color: rgba(255, 255, 255, 0.06);
  margin: 8px 16px;
}

/* ==========================================================================
   Main layout
   ========================================================================== */

.portal-main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 32px 48px;
  box-sizing: border-box;
}

/* Hero */

.portal-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 40px;
}

@media only screen and (min-width: 993px) {
  .portal-hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
  }
}

.hero-text .hero-title {
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 10px 0;
  color: var(--acu-text);
  letter-spacing: -0.2px;
}

.hero-text .hero-subtitle {
  margin: 0;
  color: var(--acu-text-muted);
  font-size: 1rem;
  max-width: 56ch;
  line-height: 1.5;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media only screen and (min-width: 600px) {
  .hero-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media only screen and (min-width: 993px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-tile {
  background: var(--acu-surface);
  border: 1px solid var(--acu-border);
  border-radius: var(--acu-radius);
  box-shadow: var(--acu-shadow-sm);
  padding: 18px 18px;
  text-align: left;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.stat-tile:hover {
  box-shadow: var(--acu-shadow-md);
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--acu-text);
}

.stat-label {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--acu-text-subtle);
}

/* ==========================================================================
   Sections & cards
   ========================================================================== */

.portal-section {
  margin-bottom: 40px;
}

.section-head {
  margin-bottom: 18px;
}

.section-title {
  margin: 0 0 4px 0;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--acu-text);
}

.section-subtitle {
  margin: 0;
  color: var(--acu-text-muted);
  font-size: 0.92rem;
}

.app-grid {
  margin-bottom: 0;
}

.app-card.card {
  border-radius: var(--acu-radius);
  box-shadow: var(--acu-shadow-sm);
  border: 1px solid var(--acu-border);
  margin: 0 0 0 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  background: var(--acu-surface);
}

.app-card.card:hover {
  box-shadow: var(--acu-shadow-md);
  transform: translateY(-2px);
  border-color: #d3dbe5;
}

.app-card .card-content {
  padding: 22px 24px 18px;
  flex: 1;
}

.app-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--acu-accent-soft);
  color: var(--acu-accent-strong);
}

.app-icon i.material-icons {
  font-size: 24px;
}

.app-icon-maps      { background: rgba(38, 166, 154, 0.12); color: #00897b; }
.app-icon-map       { background: rgba(38, 166, 154, 0.12); color: #00897b; }
.app-icon-dashboard { background: rgba(67, 160, 71, 0.12); color: #2e7d32; }
.app-icon-report    { background: rgba(94, 53, 177, 0.12); color: #5e35b1; }
.app-icon-dataset   { background: rgba(2, 136, 209, 0.12); color: #0277bd; }
.app-icon-external  { background: rgba(84, 110, 122, 0.12); color: #455a64; }
.app-icon-admin     { background: rgba(216, 27, 96, 0.12); color: #c2185b; }
.app-icon-reports   { background: rgba(94, 53, 177, 0.12); color: #5e35b1; }
.app-icon-data      { background: rgba(2, 136, 209, 0.12); color: #0277bd; }
.app-icon-forms     { background: rgba(245, 124, 0, 0.12); color: #ef6c00; }
.app-icon-analysis  { background: rgba(216, 27, 96, 0.12); color: #c2185b; }

.app-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--acu-text-subtle);
  background: var(--acu-bg-alt);
  border-radius: 999px;
}

.app-card .card-title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--acu-text);
  display: block;
  margin-bottom: 6px;
}

.app-card .card-text {
  margin: 0;
  color: var(--acu-text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.app-card .card-action {
  border-top: 1px solid var(--acu-border);
  padding: 12px 24px;
}

.app-card .card-action a.app-cta {
  color: var(--acu-accent-strong);
  text-transform: none;
  font-weight: 500;
  font-size: 0.92rem;
  margin-right: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.app-card .card-action a.app-cta i.material-icons {
  font-size: 18px;
  margin-left: 4px;
  transition: transform 0.15s ease;
}

.app-card .card-action a.app-cta:hover i.material-icons {
  transform: translateX(2px);
}

.app-card .card-action a.app-cta.disabled {
  color: var(--acu-text-subtle);
  pointer-events: none;
}

.portal-toolbar.card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  margin: 0 0 22px;
  border: 1px solid var(--acu-border);
  border-radius: var(--acu-radius);
  box-shadow: var(--acu-shadow-sm);
}

.portal-search.input-field {
  flex: 1 1 360px;
  margin: 0;
}

.portal-search.input-field input[type="search"] {
  margin-bottom: 0;
  border-bottom-color: var(--acu-border);
}

.portal-search.input-field .prefix {
  color: var(--acu-text-subtle);
}

.portal-category-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-chip.chip {
  border: 1px solid var(--acu-border);
  background: var(--acu-surface);
  color: var(--acu-text-muted);
  cursor: pointer;
  height: 32px;
  line-height: 30px;
  margin: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.portal-chip.chip.active,
.portal-chip.chip:hover {
  background: var(--acu-accent-soft);
  border-color: rgba(38, 166, 154, 0.35);
  color: var(--acu-accent-strong);
}

.portal-card-image {
  height: 150px;
  background: var(--acu-bg-alt);
  overflow: hidden;
}

.portal-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-card-action.card-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-card-action .app-cta {
  margin-left: auto;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 60%;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--acu-text-muted);
  background: var(--acu-bg-alt);
  font-size: 0.72rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-state-card.card {
  margin: 0;
  border: 1px dashed #cfd8dc;
  border-radius: var(--acu-radius);
  box-shadow: none;
  text-align: center;
}

.portal-state-card .card-content {
  padding: 34px 24px;
}

.portal-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: var(--acu-accent-strong);
  background: var(--acu-accent-soft);
}

.portal-state-icon i.material-icons {
  font-size: 30px;
}

/* ==========================================================================
   Portal administration
   ========================================================================== */

.admin-main {
  max-width: 1440px;
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.admin-hero .hero-title {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 500;
}

.admin-hero .hero-subtitle {
  margin: 0;
  color: var(--acu-text-muted);
  max-width: 68ch;
}

.admin-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-grid.row {
  margin-bottom: 0;
}

.admin-card.card {
  margin: 0 0 24px;
  border: 1px solid var(--acu-border);
  border-radius: var(--acu-radius);
  box-shadow: var(--acu-shadow-sm);
}

.tight-row.row {
  margin-bottom: 0;
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-subtitle {
  margin: 0;
  color: var(--acu-text-muted);
  font-size: 0.9rem;
}

.admin-message {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--acu-accent-strong);
  font-size: 0.9rem;
}

.admin-message.is-error {
  color: #c62828;
}

.admin-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  border: 1px dashed #cfd8dc;
  border-radius: var(--acu-radius);
  color: var(--acu-text-muted);
}

.admin-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--acu-border);
  border-radius: var(--acu-radius-sm);
  background: var(--acu-surface);
}

.admin-card-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-card-row-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.admin-card-row-text strong {
  color: var(--acu-text);
  font-weight: 500;
}

.admin-card-row-text span,
.admin-card-row-text code {
  color: var(--acu-text-muted);
  font-size: 0.82rem;
}

.admin-card-row-text code {
  display: block;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.admin-card-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sort-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--acu-text-muted);
  font-size: 0.75rem;
}

.sort-order-input {
  width: 72px !important;
  height: 32px !important;
  margin: 0 !important;
  text-align: right;
}

.import-panel {
  display: none;
}

.import-panel.is-open {
  display: block;
}

.import-actions {
  display: flex;
  align-items: center;
  min-height: 72px;
}

.import-resource-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.import-resource-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--acu-border);
  border-radius: var(--acu-radius-sm);
  background: var(--acu-surface);
}

.import-resource-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.import-resource-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.import-resource-text strong {
  color: var(--acu-text);
  font-weight: 500;
}

.import-resource-text span,
.import-resource-text p,
.import-resource-text code {
  color: var(--acu-text-muted);
  font-size: 0.84rem;
}

.import-resource-text p {
  margin: 3px 0;
  line-height: 1.4;
}

.import-resource-text code {
  display: block;
  max-width: 56vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.import-resource-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   Identity administration
   ========================================================================== */

.auth-section {
  display: none;
}

.auth-section.is-active {
  display: block;
}

.auth-admin-main .admin-actions a {
  color: var(--acu-accent-strong);
}

.compact-search.input-field {
  min-width: 260px;
  margin: 0;
}

.compact-search.input-field input[type="search"] {
  margin-bottom: 0;
}

.responsive-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-actions {
  white-space: nowrap;
}

.muted-cell {
  color: var(--acu-text-muted);
  font-size: 0.84rem;
}

.mini-chip.chip {
  height: 26px;
  line-height: 24px;
  margin: 2px;
  border: 1px solid var(--acu-border);
  background: var(--acu-bg-alt);
  color: var(--acu-text-muted);
}

.chip-list {
  margin-top: 4px;
}

.chip-action {
  border: 0;
  background: transparent;
  color: var(--acu-text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  margin-left: 6px;
  padding: 0;
}

.auth-filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-width: min(100%, 520px);
}

.auth-filter-row .input-field {
  flex: 1 1 220px;
  margin: 0;
}

.perm-overview-head {
  margin-bottom: 8px;
}

.perm-overview-toolbar.card-sticky-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 18px;
  padding: 12px 0 16px;
  margin-bottom: 8px;
  background: var(--acu-surface, #fff);
  border-bottom: 1px solid var(--acu-border);
}

.perm-overview-toolbar .input-field {
  flex: 1 1 180px;
  margin-top: 0;
  margin-bottom: 0;
}

.perm-overview-toolbar .compact-search {
  flex: 2 1 280px;
  min-width: 200px;
}

.perm-chip-cell {
  max-width: 420px;
}

.perm-visibility-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--acu-border);
}

.perm-vis-public {
  color: #1b5e20;
  background: rgba(46, 125, 50, 0.12);
  border-color: rgba(46, 125, 50, 0.35);
}

.perm-vis-restricted {
  color: var(--acu-text-muted);
  background: var(--acu-bg-alt);
}

.compact-table td,
.compact-table th {
  padding: 8px 12px;
  vertical-align: middle;
}

.resource-acl-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.resource-acl-title {
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 4px;
}

.resource-acl-meta {
  margin: 0 0 16px;
}

.resource-acl-controls {
  margin-bottom: 8px;
}

.resource-acl-controls .input-field {
  flex: 0 1 360px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Recent activity
   ========================================================================== */

.activity-card.card {
  border-radius: var(--acu-radius);
  box-shadow: var(--acu-shadow-sm);
  border: 1px solid var(--acu-border);
  margin: 0;
  background: var(--acu-surface);
}

.activity-list.collection {
  border: none;
  margin: 0;
  border-radius: var(--acu-radius);
  overflow: hidden;
}

.activity-list .collection-item {
  border-bottom: 1px solid var(--acu-border);
  padding: 18px 22px;
}

.activity-list .collection-item:last-child {
  border-bottom: none;
}

.activity-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--acu-text-muted);
}

.activity-empty i.material-icons {
  font-size: 30px;
  color: var(--acu-text-subtle);
}

.activity-empty-title {
  font-weight: 500;
  color: var(--acu-text);
  margin-bottom: 2px;
}

.activity-empty-sub {
  font-size: 0.88rem;
  color: var(--acu-text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.portal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  font-size: 0.82rem;
  color: var(--acu-text-subtle);
  border-top: 1px solid var(--acu-border);
  background: var(--acu-surface);
}

.footer-spacer {
  flex: 1;
}

.footer-version {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* ==========================================================================
   Login
   ========================================================================== */

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--acu-navbar-from) 0%, var(--acu-navbar-to) 100%);
}

.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

.login-card {
  width: min(420px, 100%);
  border-radius: var(--acu-radius);
  box-shadow: var(--acu-shadow-lg);
}

.login-card .card-title {
  color: var(--acu-text);
  font-weight: 500;
}

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */

@media only screen and (max-width: 992px) {
  .portal-main {
    padding: 24px 20px 36px;
  }

  .portal-toolbar.card {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-search.input-field {
    flex-basis: auto;
  }

  .admin-hero,
  .admin-card-head,
  .admin-card-row,
  .import-resource-card {
    flex-direction: column;
  }

  .admin-card-row,
  .import-resource-card {
    align-items: stretch;
  }

  .admin-card-row-actions,
  .import-resource-actions {
    justify-content: flex-end;
  }

  .admin-card-row-text code,
  .import-resource-text code {
    max-width: 100%;
  }

  .hero-text .hero-title {
    font-size: 1.75rem;
  }

  .topnav .nav-wrapper {
    padding: 0 14px;
  }

  .topnav .brand-name {
    font-size: 1.1rem;
  }
}

@media only screen and (max-width: 600px) {
  .portal-main {
    padding: 20px 14px 32px;
  }

  .hero-text .hero-title {
    font-size: 1.55rem;
  }

  .stat-value {
    font-size: 1.45rem;
  }

  .app-card .card-content {
    padding: 18px 18px 14px;
  }

  .app-card .card-action {
    padding: 10px 18px;
  }
}

/* Materialize override: ensure the sidenav overlay matches our dark theme. */
.sidenav-overlay {
  background-color: rgba(15, 23, 42, 0.45);
}

/* Identity admin — resource registry service badges */
.service-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.service-badge-dashboard {
  background: #e3f2fd;
  color: #1565c0;
}

.service-badge-qgis {
  background: #fff3e0;
  color: #e65100;
}

.service-badge-tileserver {
  background: #f3e5f5;
  color: #6a1b9a;
}

.service-badge-geovault {
  background: #e8f5e9;
  color: #2e7d32;
}

.service-badge-jasper {
  background: #e0f2f1;
  color: #00695c;
}

.service-badge-platform {
  background: #eceff1;
  color: #455a64;
}

.service-badge-default {
  background: #eceff1;
  color: #37474f;
}

.resource-manage-link {
  color: #00897b;
}

.resource-manage-link .material-icons.tiny {
  font-size: 1.1rem;
  vertical-align: middle;
}

tr.resource-row-highlight {
  outline: 2px solid #26a69a;
  outline-offset: 1px;
}
