:root {
  --bg: #e8edf6;
  --panel: #ffffff;
  --ink: #17233b;
  --muted: #5f728f;
  --line: #d1d9e6;
  --accent: #1d3e9e;
  --accent-soft: #e8eeff;
  --header-gradient: linear-gradient(180deg, #18113a 0%, #1a1141 46%, #160f37 100%);
  --shadow-soft: 0 8px 26px rgba(20, 34, 70, 0.12);
  --button-font-size: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.logged-out .sidebar,
body.logged-out #appRoot,
body.logged-out #pageHead {
  display: none !important;
}
body.logged-in #loginCard {
  display: none !important;
}
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f3f6fc 0%, #ebf0f8 100%);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 252px 1fr;
}

body.logged-in {
  overflow: hidden;
}

body.logged-in .shell {
  height: 100dvh;
  overflow: hidden;
}

body.logged-out .shell {
  grid-template-columns: 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(129, 142, 175, 0.28);
  background: var(--header-gradient);
  color: #fff;
  padding: 18px 14px;
  box-shadow: 4px 0 20px rgba(9, 5, 32, 0.28);
}

body.logged-in .sidebar {
  height: 100dvh;
  overflow: hidden;
}

.sidebar-head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.sidebar-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
  color: #f2f6ff;
}

.menu {
  display: grid;
  gap: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-separator {
  flex: 0 0 100%;
  height: 1px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.24);
}

:is(.btn, .menu-item, .icon-btn, .mobile-menu-btn, .sidebar-close-btn) {
  font-family: inherit;
  font-size: var(--button-font-size);
  line-height: 1;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}

.menu-item {
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  text-align: left;
  padding: 0 16px;
  cursor: pointer;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.26);
}

.menu-item.active {
  background: #f9fbff;
  border-color: #f9fbff;
  color: #0f244e;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(120, 140, 190, 0.18);
}

.main-wrap {
  min-width: 0;
  position: relative;
  padding: 20px 22px;
}

body.logged-in .main-wrap {
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (min-width: 901px) {
  body.logged-in .shell {
    display: block;
    height: 100dvh;
    overflow: hidden;
  }

  body.logged-in .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 252px;
    height: 100dvh;
    overflow: hidden;
  }

  body.logged-in .main-wrap {
    margin-left: 252px;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

.page-head { margin-bottom: 14px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.page-head-copy {
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.2px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.topbar-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
}

.admin-name {
  color: #d7e2ff;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  max-width: 182px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  min-width: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

#backupsContainer > .card + .card {
  margin-top: 16px;
}

.login-card {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(340px, 45%) 1fr;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

body.logged-out .content {
  min-height: 100dvh;
  padding: 0;
}

body.logged-out .main-wrap {
  padding: 0;
  background: #eceef4;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.login-hero-panel {
  position: relative;
  background-image:
    linear-gradient(155deg, rgba(16, 12, 52, 0.66) 0%, rgba(16, 16, 59, 0.4) 42%, rgba(20, 22, 62, 0.42) 100%),
    url("./images/hero.jpg");
  background-size: cover;
  background-position: center;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: 44px 22px;
  background: #eceef4;
}

.login-form-card {
  width: min(460px, 100%);
  background: #f8f9fc;
  border-radius: 24px;
  border: 1px solid #e2e6f0;
  padding: 36px 30px 24px;
  box-shadow: 0 20px 40px rgba(34, 56, 105, 0.1);
}

.login-form-head {
  text-align: center;
  margin-bottom: 26px;
}

.login-form-head h2 {
  margin: 0;
  font-size: clamp(22px, 1.8vw, 30px);
  letter-spacing: -0.02em;
  color: #111b2f;
}

.login-form-head p {
  margin: 10px 0 0;
  color: #6b778d;
  font-size: 15px;
}

.login-form-head--banner {
  margin: -36px -30px 20px;
  padding: 14px 12px;
  background: var(--header-gradient);
  border-radius: 24px 24px 0 0;
}

.login-form-head--banner h2 {
  color: #f2f6ff;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.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;
}

#loginForm {
  padding: 0;
  gap: 16px;
}

.input-shell {
  height: 50px;
  border: 1px solid #cfd6e2;
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}

.input-icon {
  color: #7c889c;
  font-size: 16px;
  line-height: 1;
}

.input-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  height: 100%;
  padding: 0;
  font-size: 14px;
  color: #111b2f;
  background: transparent;
}

.input-shell select {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  height: 100%;
  padding: 0;
  font-size: 14px;
  color: #111b2f;
  background: transparent;
}

.input-shell input::placeholder {
  color: #626d81;
}

.input-shell input:focus {
  box-shadow: none;
}

.input-shell select:focus {
  box-shadow: none;
  outline: none;
}

.input-shell:focus-within {
  border-color: #9eb0d6;
  box-shadow: 0 0 0 3px rgba(95, 127, 198, 0.14);
}

.login-submit-btn {
  height: 46px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(180deg, #1a4f9f 0%, #164a95 100%);
  box-shadow: 0 10px 20px rgba(29, 62, 158, 0.2);
}

#loginMsg {
  margin-top: 8px;
  min-height: 16px;
  text-align: center;
}

.stack {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: #516581;
  font-size: 13px;
  font-weight: 500;
}

body.logged-out .login-card label {
  color: #516581;
}

input {
  height: 38px;
  border: 1px solid #c7d2e1;
  border-radius: 9px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  border: 1px solid #c7d2e1;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  resize: vertical;
  min-height: 88px;
  font-family: inherit;
}

textarea:focus {
  border-color: #8ea7dd;
  box-shadow: 0 0 0 3px rgba(94, 133, 232, 0.18);
  outline: none;
}

input:focus {
  border-color: #8ea7dd;
  box-shadow: 0 0 0 3px rgba(94, 133, 232, 0.18);
  outline: none;
}

.btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: #17358a;
}

:is(.btn, .menu-item, .icon-btn, .mobile-menu-btn, .sidebar-close-btn):active {
  transform: translateY(1px);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.workspace-open-btn {
  background: #e9f0ff !important;
  border: 1px solid #b7c9eb !important;
  color: #1a3b7e !important;
}

.workspace-open-btn:hover {
  background: #dbe7ff !important;
}

.workspace-back-btn {
  background: #e9f0ff !important;
  border: 1px solid #b7c9eb !important;
  color: #1a3b7e !important;
}

.workspace-back-btn:hover {
  background: #dbe7ff !important;
}

.boundary-map {
  width: 100%;
  min-height: 270px;
  border: 1px solid #dce5f2;
  border-radius: 10px;
  overflow: hidden;
}

.workspace-settings-grid {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 12px;
}

.workspace-settings-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.workspace-top-msg {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c7d5eb;
  background: #f4f8ff;
  color: #1a3e73;
  font-size: 13px;
  font-weight: 600;
}

.workspace-top-msg.is-error {
  border-color: #e6bcc6;
  background: #fff4f6;
  color: #8a2238;
}

.workspace-top-msg.is-success {
  border-color: #bfe0c7;
  background: #f4fff6;
  color: #1f6b2d;
}

.workspace-settings-head-copy h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #193153;
}

.workspace-settings-head-copy .subtitle {
  margin: 4px 0 0;
}

.workspace-settings-head-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workspace-soft-btn {
  background: #e8edf6;
  border: 1px solid #bdcbdf;
  color: #35537d;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-soft-btn:hover {
  background: #dde6f3;
}

.workspace-boundary-status-chip {
  height: 38px;
  border-radius: 9px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #4a5568;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.workspace-boundary-status-chip.configured {
  color: #1f6b2d;
  border-color: #9bc7a5;
  background: #f1fbf2;
}

.workspace-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
}

.workspace-settings-main {
  border-radius: 0;
  border-right: 0;
}

.workspace-settings-side {
  border-radius: 0;
}

.workspace-settings-side h3 {
  margin: 0 0 10px;
}

.workspace-settings-side p {
  margin: 0 0 8px;
  color: #314767;
  font-size: 12px;
  line-height: 1.45;
}

.workspace-settings-section-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1;
}

.workspace-settings-form {
  display: grid;
  gap: 12px;
}

.workspace-field {
  display: grid;
  gap: 6px;
}

.workspace-owner-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#backupProfileForm {
  display: grid;
  gap: 12px;
}

.backup-profile-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24px;
  text-transform: uppercase;
  white-space: nowrap;
}

.backup-profile-mode-pill.is-new {
  background: #eaf8ef;
  border-color: #b8dfc1;
  color: #20663a;
}

.backup-profile-mode-pill.is-edit {
  background: #fff3d8;
  border-color: #efcf82;
  color: #8b5a05;
}

.backup-enabled-toggle {
  min-width: 92px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  justify-content: center;
}

.backup-enabled-toggle.is-enabled {
  background: #eaf8ef !important;
  border: 1px solid #b8dfc1 !important;
  color: #20663a !important;
}

.backup-enabled-toggle.is-enabled:hover {
  background: #dff2e6 !important;
}

.backup-enabled-toggle.is-disabled {
  background: #eef2f8 !important;
  border: 1px solid #cdd7e5 !important;
  color: #52657f !important;
}

.backup-enabled-toggle.is-disabled:hover {
  background: #e2e9f2 !important;
}

#backupProfileForm .backup-grid {
  display: grid;
  gap: 12px;
  align-items: end;
}

#backupProfileForm .backup-grid-main {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#backupProfileForm .backup-grid-cron {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#backupProfileForm .backup-grid-s3 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#backupProfileForm .backup-grid-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#backupProfileForm label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

#backupProfileForm input[type="text"],
#backupProfileForm input[type="number"],
#backupProfileForm input[type="time"],
#backupProfileForm select {
  width: 100%;
  height: 38px;
  border: 1px solid #c7d2e1;
  border-radius: 9px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  box-sizing: border-box;
}

#backupProfileForm .backup-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  align-self: end;
}

#backupProfileForm .backup-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #1f52a9;
}

#backupProfileForm .backup-form-actions {
  gap: 10px;
  margin-bottom: 10px;
  justify-content:end;
}

.workspace-field label {
  color: #1b355a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1;
}

.workspace-field input,
.workspace-field textarea,
.workspace-field select {
  border-radius: 11px;
  border: 1px solid #bfd0e6;
  background: #f8fafc;
  font-size: 13px;
  color: #122e53;
}

.workspace-field input,
.workspace-field select {
  height: 38px;
  padding: 0 12px;
}

.workspace-field input[readonly] {
  background: #f2f4f8;
  color: #344f76;
}

.workspace-field textarea {
  min-height: 290px;
  resize: vertical;
  padding: 10px 12px;
}

.workspace-password-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.workspace-password-input input {
  width: 100%;
}

.workspace-password-toggle {
  min-width: 44px;
  padding: 0;
  background: #edf3ff !important;
  border: 1px solid #bfd0ef !important;
  color: #1d478e !important;
}

.workspace-password-toggle:hover {
  background: #dfeaff !important;
}

.workspace-password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.workspace-credential-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 24, 48, 0.58);
  backdrop-filter: blur(4px);
}

.workspace-credential-dialog {
  width: min(680px, 100%);
  padding: 24px;
  border-radius: 18px;
  display: grid;
  gap: 18px;
  box-shadow: 0 24px 54px rgba(14, 28, 58, 0.24);
}

.workspace-credential-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workspace-credential-head h2 {
  margin: 0;
  font-size: 28px;
  color: #172d52;
}

.workspace-credential-status {
  margin: 8px 0 0;
  color: #47607f;
  font-size: 14px;
  line-height: 1.5;
}

.workspace-credential-status.is-warning {
  color: #8a2238;
}

.workspace-credential-grid {
  display: grid;
  gap: 14px;
}

.workspace-credential-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.workspace-credential-inline .btn.ghost {
  min-width: 74px;
  background: #edf3ff;
  border: 1px solid #bfd0ef;
  color: #1d478e;
}

.workspace-credential-inline .btn.ghost:hover {
  background: #dfeaff;
}

.workspace-credential-note {
  margin: -4px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f9fc;
  border: 1px solid #d8e0ec;
  color: #38506f;
  font-size: 13px;
  line-height: 1.5;
}

.workspace-credential-copy-msg {
  margin: -4px 0 0;
  color: #216433;
  font-size: 13px;
  font-weight: 600;
}

.workspace-credential-copy-msg.is-error {
  color: #8a2238;
}

.workspace-credential-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-credential-actions .btn.ghost {
  background: #edf3ff;
  border: 1px solid #bfd0ef;
  color: #1d478e;
}

.workspace-credential-actions .btn.ghost:hover {
  background: #dfeaff;
}

.workspace-preview-btn {
  margin: 4px 0 10px;
}

.workspace-metadata {
  margin-top: 14px;
}

.workspace-metadata h4 {
  margin: 0 0 8px;
  color: #223d66;
}
.icon-btn {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  color: #fff;
  padding: 0 10px;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn.ghost {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row.between { justify-content: space-between; }
.row.compact { gap: 8px; }
.row.wrap { flex-wrap: wrap; }

.badge {
  border: 1px solid #d5deea;
  border-radius: 999px;
  background: #f5f8ff;
  padding: 5px 12px;
  color: #3e5578;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.kpi {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  border: 1px solid #d9e5fb;
  border-radius: 10px;
  padding: 12px;
}

.kpi .k {
  color: #566c8e;
  font-size: 11px;
}

.kpi .v {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  color: #172849;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #dce5f2;
  border-radius: 10px;
  margin-top: 10px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  font-size: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

th {
  background: #f5f8ff;
  color: #324766;
  font-weight: 700;
}

.pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pager > span {
  font-size: 13px;
  font-weight: 700;
  color: #223657;
}

.msg {
  margin-top: 10px;
  color: #37527b;
  font-size: 11px;
  min-height: 18px;
}

.company-signature {
  display: inline-flex;
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 16px;
  background: rgba(16, 18, 56, 0.8);
  border: 1px solid rgba(168, 183, 235, 0.24);
  color: #e6eeff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(8, 11, 35, 0.35);
}

.company-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid #ccd7e6;
  border-radius: 10px;
  background: #ffffff;
  color: #1a2f5d;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-close-btn {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5ff;
  font-weight: 700;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
}

.hamburger {
  position: relative;
  width: 18px;
  height: 2px;
  background: #1a2f5d;
  border-radius: 2px;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #1a2f5d;
  border-radius: 2px;
}

.hamburger::before {
  top: -6px;
}

.hamburger::after {
  top: 6px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1001;
    width: min(86vw, 300px);
    min-height: 100dvh;
    border-right: 1px solid #2d447b;
    border-bottom: none;
    padding: 14px 12px;
    transform: translateX(-108%);
    transition: transform 180ms ease;
    overflow-y: auto;
  }

  body.logged-in.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(12, 17, 34, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.logged-in.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .menu {
    grid-template-columns: 1fr;
  }

  .sidebar-footer {
    margin-top: 10px;
    padding-top: 0;
  }

  .menu-item {
    text-align: center;
    padding: 0 6px;
  }

  .main-wrap {
    padding: 12px;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.logged-out .mobile-menu-btn {
    display: none;
  }

  .page-head {
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .page-head-copy h1 {
    color: #1a2f5d;
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
  }

  .page-head-copy .subtitle {
    margin-top: 2px;
    color: #5f728f;
    font-size: 11px;
  }

  .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .row.between.wrap {
    gap: 8px;
    align-items: flex-start;
  }

  .row.compact {
    width: 100%;
    flex-wrap: wrap;
  }

  .row.compact label {
    width: 100%;
  }

  .row.compact .btn {
    width: 100%;
  }

  .pager {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .pager .btn {
    min-width: 92px;
  }

  .table-wrap {
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .table-wrap tr {
    border: 1px solid #dce5f2;
    border-radius: 10px;
    padding: 6px 10px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(25, 40, 78, 0.08);
  }

  .table-wrap td {
    padding: 8px 0;
    border-bottom: 1px solid #ecf1f8;
    display: grid;
    grid-template-columns: minmax(110px, 42%) 1fr;
    gap: 10px;
    align-items: start;
    overflow-wrap: anywhere;
  }

  .table-wrap td:last-child {
    border-bottom: none;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: #5c6f8c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-hero-panel {
    min-height: 38dvh;
  }

  .login-form-panel {
    padding: 18px 12px 26px;
  }

  .login-form-card {
    border-radius: 16px;
    padding: 18px 14px;
  }

  .login-form-head h2 {
    font-size: 18px;
  }

  .login-form-head p {
    font-size: 15px;
  }

  .login-form-head--banner {
    margin: -18px -14px 14px;
    padding: 10px 10px;
    border-radius: 16px 16px 0 0;
  }

  .login-form-head--banner h2 {
    font-size: 16px;
  }

  .input-shell {
    height: 42px;
    border-radius: 12px;
    padding: 0 12px;
  }

  .input-icon {
    font-size: 14px;
  }

  .input-shell input {
    font-size: 13px;
  }

  .login-submit-btn {
    height: 42px;
    border-radius: 14px;
    font-size: 14px;
  }

  .company-signature {
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 16px;
  }

  .company-logo {
    height: 28px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-settings-grid {
    grid-template-columns: 1fr;
  }

  .workspace-settings-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .workspace-settings-main {
    border-right: 1px solid var(--line);
    border-radius: 14px;
  }

  .workspace-settings-side {
    border-radius: 14px;
  }

  .workspace-settings-head {
    flex-direction: column;
  }

  .workspace-settings-head-copy h1 {
    font-size: 24px;
  }

  .workspace-settings-section-title {
    font-size: 20px;
  }

  .workspace-field label {
    font-size: 15px;
  }

  .workspace-field input,
  .workspace-field textarea {
    font-size: 14px;
  }

  .workspace-field input {
    height: 40px;
  }

  .workspace-field textarea {
    min-height: 220px;
  }

  .workspace-owner-details {
    grid-template-columns: 1fr;
  }

  .workspace-credential-dialog {
    padding: 20px;
  }

  .workspace-credential-head h2 {
    font-size: 24px;
  }

  .workspace-credential-inline {
    grid-template-columns: 1fr;
  }

  .workspace-credential-inline .btn.ghost,
  .workspace-credential-actions .btn {
    width: 100%;
  }

  .workspace-credential-actions {
    flex-direction: column;
  }

  #backupProfileForm .backup-grid-main,
  #backupProfileForm .backup-grid-cron,
  #backupProfileForm .backup-grid-s3,
  #backupProfileForm .backup-grid-options {
    grid-template-columns: 1fr;
  }
}

/* Workspace content tabs + actions (issues / reports / members) */
.workspace-content-card {
  margin-top: 16px;
}
.workspace-content-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.workspace-content-tabs .wc-tab {
  padding: 6px 14px;
}

/* Tabs are visible in both states (base .btn.ghost is white-on-white). */
.wc-tab.btn.ghost {
  background: #eef2f9;
  border: 1px solid #c7d3e8;
  color: #1a3b7e;
}
.wc-tab.btn.ghost:hover {
  background: #e2e9f5;
}
.wc-tab.active {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Row action buttons (Open / Delete) need readable colors. */
.wc-open-btn.btn.ghost {
  background: #e9f0ff;
  border: 1px solid #b7c9eb;
  color: #1a3b7e;
}
.wc-open-btn.btn.ghost:hover {
  background: #dbe7ff;
}
.wc-delete-btn.btn.ghost {
  background: #fdecee;
  border: 1px solid #f0b8c0;
  color: #7b2537;
}
.wc-delete-btn.btn.ghost:hover {
  background: #f9dbe0;
}

/* Back-to-list button. */
#wcBackBtn.btn.ghost {
  background: #eef2f9;
  border: 1px solid #c7d3e8;
  color: #1a3b7e;
}
#wcBackBtn.btn.ghost:hover {
  background: #e2e9f5;
}

.workspace-content-card .table-wrap {
  margin-top: 12px;
}

/* Workspace Content controls (workspace dropdown + issue search) */
.wc-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 6px 0 14px;
}
.wc-control-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #37527b;
}
.wc-control-field select,
.wc-control-field input {
  height: 38px;
  min-width: 260px;
  padding: 0 10px;
  border: 1px solid #c7d3e8;
  border-radius: 9px;
  background: #fff;
  color: #1f2a44;
}

/* Workspace Content issue pagination */
.wc-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.wc-page-info {
  font-size: 13px;
  color: #37527b;
}
.wc-page-btn.btn.ghost {
  background: #eef2f9;
  border: 1px solid #c7d3e8;
  color: #1a3b7e;
  padding: 0 14px;
}
.wc-page-btn.btn.ghost:hover {
  background: #e2e9f5;
}
.wc-page-btn.btn.ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Richer Backups: page-head section tabs + Database Config cards (ported from civik variant) */
.backup-section-panel + .backup-section-panel {
  margin-top: 16px;
}
.backup-page-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.backup-page-actions .btn {
  min-width: 0;
}
.backup-page-actions .btn.is-active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.backup-page-actions .btn:not(.is-active) {
  background: #e9f0ff;
  border: 1px solid #b7c9eb;
  color: #1a3b7e;
}
.backup-page-actions .btn:not(.is-active):hover {
  background: #dbe7ff;
}
.backup-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.backup-config-card {
  border: 1px solid #dce5f2;
  border-radius: 12px;
  padding: 16px;
  background: #f9fbff;
}
.backup-config-card h3 {
  margin: 0;
  font-size: 16px;
}
.backup-config-card-head {
  margin-bottom: 12px;
}
.backup-config-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #cdd7e5;
  background: #eef2f8;
  color: #52657f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.backup-config-status-pill.is-configured {
  background: #eaf8ef;
  border-color: #b8dfc1;
  color: #20663a;
}
.backup-config-status-pill.is-missing {
  background: #fff3d8;
  border-color: #efcf82;
  color: #8b5a05;
}
.backup-config-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.backup-config-meta-item {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.backup-config-meta-item span {
  color: #61738f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.backup-config-meta-item strong {
  min-width: 0;
  color: #18294b;
  font-size: 13px;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .backup-page-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .backup-config-grid,
  .backup-config-meta {
    grid-template-columns: 1fr;
  }
}
