:root {
  --ink: #0f1f38;
  --ink-soft: #385274;
  --bg: #eef3fb;
  --paper: #ffffff;
  --accent: #0a4f9d;
  --accent-2: #0f66c7;
  --ok: #177245;
  --line: #cfd9e8;
  --shadow: 0 18px 34px rgba(12, 29, 56, 0.14);
  --digesett-blue: #0047ab;
  --digesett-blue-dark: #003580;
  --digesett-orange: #ff8c00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Barlow", sans-serif;
  font-size: 11px;
  color: var(--ink);
  background: var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(110deg, rgba(15, 31, 56, 0.96), rgba(33, 64, 107, 0.9)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.09) 0,
      rgba(255, 255, 255, 0.09) 1px,
      transparent 1px,
      transparent 50px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.1) 0,
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px,
      transparent 50px
    );
}

.tag {
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 102, 199, 0.22);
  color: #d9ebff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.login-shell {
  width: min(1080px, 92vw);
  margin: 6vh auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  animation: riseIn 500ms ease-out;
}

.brand-panel,
.login-card {
  border-radius: 24px;
  padding: clamp(1.4rem, 1.8vw, 2rem);
  box-shadow: var(--shadow);
}

.brand-panel {
  color: #fff;
  background: linear-gradient(145deg, rgba(9, 29, 56, 0.96), rgba(18, 52, 94, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.emblem-block {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 0.8rem;
}

.brand-panel h1 {
  margin: 0.6rem 0;
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.05em;
}

.lead {
  margin: 0;
  max-width: 44ch;
  color: #d9e6ff;
}

.highlights {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 0.7rem;
}

.highlights li {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.8rem;
  border-radius: 12px;
}

.login-card {
  background: var(--paper);
}

.login-card h2 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.login-card p {
  margin: 0.2rem 0 1.4rem;
  color: var(--ink-soft);
}

.form-grid {
  display: grid;
  gap: 0.4rem;
}

#demoUser {
  background: #edf4ff;
}

label {
  font-weight: 600;
  font-size: 0.95em;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcff;
  font-size: 1em;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(255, 122, 24, 0.25);
  border-color: var(--accent);
}

.btn-primary,
.btn-secondary {
  border: 0;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 1em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #f7fbff;
}

.btn-secondary {
  background: #e6ecf7;
  color: var(--ink);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

.foot-note {
  margin-top: 0.6rem;
  font-size: 0.9em;
}

.login-footer {
  margin-top: 0.6rem;
  font-size: 0.85em;
  color: #5f789d;
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
}

.flash-message {
  background: #edf6ff;
  color: #0a4f9d;
  border: 1px solid #b8d4f3;
  border-radius: 14px;
  padding: 0.8rem 1rem;
}

.flash-error {
  background: #fff1f1;
  color: #8c1f1f;
  border-color: #efc1c1;
  margin-bottom: 1rem;
}

.dashboard-body {
  background:
    radial-gradient(circle at 15% 15%, rgba(10, 79, 157, 0.16), transparent 38%),
    radial-gradient(circle at 90% 5%, rgba(15, 102, 199, 0.14), transparent 34%),
    linear-gradient(180deg, #f4f8ff 0%, #edf3fc 100%);
  position: relative;
}

.dashboard-body::before,
.dashboard-body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.dashboard-body::before {
  width: 380px;
  height: 380px;
  top: -130px;
  left: -120px;
  background: radial-gradient(circle, rgba(11, 79, 157, 0.18) 0%, rgba(11, 79, 157, 0) 72%);
}

.dashboard-body::after {
  width: 460px;
  height: 460px;
  right: -170px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(255, 140, 0, 0.11) 0%, rgba(255, 140, 0, 0) 72%);
}

body:has(.digesett-login-page) {
  background-color: #001840 !important;
}

.digesett-login-page {
  position: relative;
  min-height: 100dvh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #001840;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.digesett-login-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 35, 96, 0.84) 0%,
    rgba(0, 71, 171, 0.7) 55%,
    rgba(27, 111, 224, 0.52) 100%
  );
  pointer-events: none;
}

.digesett-login-center {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.digesett-login-card {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 24, 64, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.digesett-login-card-body {
  padding: 1.2rem 1.2rem 1.1rem;
}

.digesett-login-brand-block {
  text-align: center;
  margin-bottom: 0.7rem;
}

.digesett-login-logo {
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 71, 171, 0.16));
}

.digesett-login-title {
  color: var(--digesett-blue-dark);
  font-size: 1em;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0.4rem 0 0.2rem;
}

.digesett-login-subtitle {
  margin: 0;
  font-size: 0.85em;
  color: #5a6e8d;
}

.digesett-login-page label {
  font-weight: 600;
  font-size: 0.9em;
  color: #374152;
  margin-bottom: 0.15rem;
}

.digesett-login-page input,
.digesett-login-page select {
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid rgba(0, 71, 171, 0.15);
  background: #f8faff;
  font-size: 0.95em;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.digesett-login-page input:focus,
.digesett-login-page select:focus {
  border-color: var(--digesett-blue);
  box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
  background: #fff;
}

.digesett-password-wrap {
  position: relative;
}

.digesett-password-wrap input {
  padding-right: 4.4rem;
}

.digesett-password-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: #eff4ff;
  color: #3b5f98;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7em;
  font-weight: 700;
  cursor: pointer;
}

.digesett-password-toggle:hover {
  background: #dfe9ff;
}

.digesett-login-btn {
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--digesett-blue), var(--digesett-blue-dark));
}

.digesett-login-footer {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75em;
  font-weight: 500;
  text-align: center;
  margin-top: 0.7rem;
  margin-bottom: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.digesett-topbar-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 0.65rem;
  align-items: center;
}

.digesett-topbar-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 71, 171, 0.28));
}

.scip-meaning {
  margin: 0.12rem 0 0;
  font-size: 0.78rem;
  color: #406793;
  font-weight: 600;
}

.digesett-welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(135deg, #0047ab 0%, #1b6fe0 100%);
  color: #fff;
  border-radius: 16px;
  padding: 1.15rem 1.35rem;
}

.digesett-welcome-banner h5 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
}

.digesett-welcome-banner p {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86rem;
}

.digesett-welcome-badge {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.module-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0.65rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.8rem;
  backdrop-filter: blur(4px);
}

.module-breadcrumb-home {
  font-weight: 700;
  color: var(--accent);
}

.module-breadcrumb-sep {
  color: #8fa4c4;
}

.module-breadcrumb-current {
  font-weight: 600;
  color: var(--ink);
}

.command-layout {
  width: min(1380px, 95vw);
  margin: 1rem auto 1.4rem;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.05rem;
}

.command-sidebar {
  background: linear-gradient(180deg, #0e2444 0%, #0c1c35 100%);
  color: #e2edff;
  border-radius: 20px;
  padding: 1rem 0.95rem;
  position: sticky;
  top: 1rem;
  height: fit-content;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.command-sidebar h2 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  font-size: 1.65rem;
}

.sidebar-head p {
  margin: 0.22rem 0 0;
  color: #b9cdee;
  font-size: 0.79rem;
  line-height: 1.45;
}

.side-section-title {
  margin: 0.9rem 0 0.45rem;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #aac5ea;
  font-weight: 700;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.side-nav a {
  color: #e5efff;
  text-decoration: none;
  padding: 0.52rem 0.58rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.87rem;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.3);
}

.side-nav a.active {
  background: linear-gradient(130deg, rgba(27, 111, 224, 0.35), rgba(0, 71, 171, 0.32));
  border-color: rgba(162, 205, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(192, 222, 255, 0.35);
}

.side-filter {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  gap: 0.45rem;
}

.side-filter h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.side-filter label {
  color: #d5e4ff;
}

.side-filter input,
.side-filter select {
  background: rgba(255, 255, 255, 0.98);
}

.side-filter-actions {
  margin-top: 0.3rem;
  display: grid;
  gap: 0.45rem;
}

.side-reset-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.topbar {
  width: min(1380px, 95vw);
  margin: 1.1rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(16, 56, 108, 0.13);
  border-radius: 14px;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.97), rgba(245, 250, 255, 0.96));
  box-shadow: 0 8px 20px rgba(12, 29, 56, 0.09);
  padding: 0.55rem 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.topbar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.topbar-brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar .tag {
  background: var(--digesett-blue);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
}

.topbar h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
  white-space: nowrap;
}

.topbar-brand-sub {
  margin: 0;
  font-size: 0.72rem;
  color: #5d7fa8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.topbar-user-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.83rem;
}

.topbar-user-icon {
  font-size: 0.55rem;
  color: #2e7d32;
  line-height: 1;
}

.topbar-username {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.topbar-chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #eef3fb;
  border: 1px solid #cdd9ef;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2b4f80;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topbar-chip-area {
  background: #edfaf2;
  border-color: #b6e3c8;
  color: #1a5c36;
}

.topbar-btns {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid #cdd9ef;
  border-radius: 9px;
  background: #f4f8ff;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.38rem 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s;
}

.topbar-btn:hover {
  background: #e6eeff;
  border-color: #a8bde0;
}

.topbar-btn-logout {
  background: #fff3f4;
  border-color: #f0c8cb;
  color: #8c1f2a;
}

.topbar-btn-logout:hover {
  background: #ffe6e8;
  border-color: #e0a0a5;
}

.session-card {
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  border: 1px solid #d5e3f6;
  border-radius: 18px;
  padding: 0.9rem;
  display: grid;
  gap: 0.46rem;
  min-width: 260px;
  box-shadow: 0 14px 28px rgba(12, 29, 56, 0.08);
}

.session-card h2 {
  margin: 0;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #406793;
}

.session-card p {
  margin: 0;
  font-size: 0.86rem;
}

.notification-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.notification-counter {
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #0a4f9d;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0 0.32rem;
}

.notification-counter-pulse {
  animation: counterPulse 680ms ease;
}

@keyframes counterPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(10, 79, 157, 0.45);
  }
  55% {
    transform: scale(1.16);
    box-shadow: 0 0 0 9px rgba(10, 79, 157, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(10, 79, 157, 0);
  }
}

.new-case-toast {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 75;
  max-width: min(420px, calc(100vw - 2rem));
  border-radius: 13px;
  border: 1px solid #b9d9ca;
  background: linear-gradient(140deg, #f0fbf5, #e4f6ec);
  box-shadow: 0 18px 36px rgba(8, 34, 24, 0.2);
  padding: 0.72rem 0.82rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.new-case-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.new-case-toast strong {
  color: #0c6f41;
  font-size: 0.86rem;
}

.new-case-toast p {
  margin: 0.18rem 0 0;
  color: #335f4a;
  font-size: 0.79rem;
}

body.modal-open {
  overflow: hidden;
}

.logout-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  padding: 1rem;
}

.logout-modal.is-open {
  display: grid;
}

.logout-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 23, 44, 0.6);
}

.logout-modal-card {
  position: relative;
  width: min(460px, calc(100vw - 2rem));
  border-radius: 16px;
  border: 1px solid #d7e2f4;
  background: #ffffff;
  padding: 1rem;
  box-shadow: 0 24px 54px rgba(4, 16, 33, 0.34);
}

.logout-modal-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #163b72;
}

.logout-modal-card p {
  margin: 0.45rem 0 0;
}

.logout-modal-actions {
  margin-top: 0.95rem;
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.logout-modal-actions form {
  margin: 0;
}

.notification-modal {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: none;
  place-items: center;
  padding: 1rem;
}

.notification-modal.is-open {
  display: grid;
}

.notification-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 23, 44, 0.6);
}

.notification-modal-card {
  position: relative;
  width: min(760px, calc(100vw - 2rem));
  max-height: min(80vh, 680px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid #d7e2f4;
  background: #ffffff;
  padding: 1rem;
  box-shadow: 0 24px 54px rgba(4, 16, 33, 0.34);
}

.notification-modal-card h3 {
  margin: 0;
  color: #163b72;
}

.notification-modal-actions {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-end;
}

.admin-user-modal {
  position: fixed;
  inset: 0;
  z-index: 73;
  display: none;
  place-items: center;
  padding: 1rem;
}

.admin-user-modal.is-open {
  display: grid;
}

.admin-user-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 23, 44, 0.6);
}

.admin-user-modal-card {
  position: relative;
  width: min(720px, calc(100vw - 2rem));
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid #d7e2f4;
  background: #ffffff;
  padding: 1rem;
  box-shadow: 0 24px 54px rgba(4, 16, 33, 0.34);
}

.admin-user-modal-card h3 {
  margin: 0 0 0.75rem;
  color: #163b72;
}

.notification-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.notification-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid #dbe7f8;
  border-radius: 12px;
  padding: 0.6rem 0.65rem;
  background: #f9fbff;
}

.notification-copy strong {
  color: #173b6f;
}

.notification-copy p {
  margin: 0.2rem 0 0;
  color: #5f789d;
  font-size: 0.8rem;
}

.notification-kind {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0.15rem 0.48rem;
  background: #e7eef8;
  color: #1f4a85;
  font-weight: 700;
}

.notification-pill {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #0a4f9d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0 0.3rem;
}

.notification-link {
  text-decoration: none;
  white-space: nowrap;
}

.notification-warning {
  border-color: #f3dfb6;
  background: #fffaf0;
}

.notification-danger {
  border-color: #f0c8cf;
  background: #fff3f5;
}

.notification-info {
  border-color: #c8dcf5;
  background: #f3f8ff;
}

.notification-success {
  border-color: #c8e9d8;
  background: #f0fbf5;
}

.notifications-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  border: 1px solid #d7e2f2;
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.notifications-shell {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.notifications-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 0.75rem;
}

.notifications-kpi {
  border: 1px solid #dbe6f6;
  border-radius: 14px;
  padding: 0.82rem;
  background: #f9fbff;
}

.notifications-kpi h3 {
  margin: 0;
  font-size: 0.9rem;
  color: #46688f;
}

.notifications-kpi strong {
  display: block;
  margin-top: 0.36rem;
  font-size: 1.8rem;
  line-height: 1;
  color: #173b6f;
}

.notifications-kpi p {
  margin: 0.32rem 0 0;
  color: #5f789d;
  font-size: 0.78rem;
}

.notifications-kpi-pending {
  border-top: 4px solid #d8992f;
}

.notifications-kpi-process {
  border-top: 4px solid #1b6fe0;
}

.notifications-kpi-total {
  border-top: 4px solid #0c6f41;
}

.notifications-feed {
  display: grid;
  gap: 0.55rem;
}

.notification-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.7rem;
  align-items: center;
  border: 1px solid #dbe7f8;
  border-radius: 12px;
  padding: 0.65rem;
  background: #f9fbff;
}

.notification-row h4 {
  margin: 0;
  color: #173b6f;
}

.notification-row p {
  margin: 0.18rem 0 0;
  color: #5f789d;
  font-size: 0.8rem;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
}

.dashboard-layout {
  display: grid;
  gap: 1rem;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.85rem;
}

.kpi-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
}

.kpi-card-link:hover > .kpi-card {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(15, 37, 67, 0.14);
}

.kpi-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #d8e5f7;
  border-radius: 16px;
  border-top: 4px solid var(--accent);
  padding: 0.9rem;
  box-shadow: 0 12px 24px rgba(15, 37, 67, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.status-strip h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.status-strip strong {
  display: block;
  font-size: 1.85rem;
  margin-top: 0.42rem;
  line-height: 1;
}

.status-strip p {
  margin: 0.32rem 0 0;
  color: #5f789d;
  font-size: 0.78rem;
}

.kpi-card-sla {
  border-top-color: #dc5f3f;
}

.kpi-card-ready {
  border-top-color: #18744b;
}

.kpi-card-closed {
  border-top-color: #7a52b5;
}

.kpi-card-alert {
  border-top-color: #c62828;
  background: linear-gradient(180deg, #fff8f8 0%, #fff3f3 100%);
}

.kpi-card-ok {
  border-top-color: #2e7d32;
  background: linear-gradient(180deg, #f8fff9 0%, #f3fff5 100%);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}

.kpi-badge {
  display: inline-block;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.kpi-badge-neutral {
  background: #e8edf8;
  color: #3a5582;
}

.kpi-badge-alert {
  background: #fde8e8;
  color: #b71c1c;
}

.kpi-badge-ok {
  background: #e6f4ea;
  color: #1b5e20;
}

.form-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  border: 1px solid #d7e2f2;
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.growth-hub {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.8rem;
}

.growth-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.growth-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #102b52;
}

.growth-card-head p {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.health-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.75rem;
}

.health-item {
  padding: 0.7rem;
  border: 1px solid #dbe7fb;
  border-radius: 12px;
  background: #f8fbff;
}

.health-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.health-item-head strong {
  color: #173b6f;
  font-size: 0.92rem;
}

.health-item p {
  margin: 0.3rem 0 0.55rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.health-pill {
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.health-pill.health-success {
  background: #e6f8ef;
  color: #0c6f41;
  border-color: #b9e8cf;
}

.health-pill.health-warning {
  background: #fff4de;
  color: #8c5a00;
  border-color: #ffe1a8;
}

.health-pill.health-danger {
  background: #ffe8ea;
  color: #9f1f2c;
  border-color: #ffc8cf;
}

.health-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e7eef8;
  overflow: hidden;
}

.health-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.health-fill.health-success {
  background: linear-gradient(90deg, #14b86a, #56d393);
}

.health-fill.health-warning {
  background: linear-gradient(90deg, #f2aa2b, #ffd270);
}

.health-fill.health-danger {
  background: linear-gradient(90deg, #e04961, #ff7a8f);
}

.quick-actions-grid {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.quick-action-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d8e4f8;
  border-radius: 12px;
  padding: 0.62rem 0.7rem;
  background: #f9fbff;
}

.quick-action-link:hover {
  border-color: #9ec0ef;
  background: #eef5ff;
}

.quick-action-badge {
  align-self: start;
  background: #104180;
  color: #fff;
  border-radius: 999px;
  padding: 0.14rem 0.42rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.quick-action-content {
  display: grid;
  gap: 0.16rem;
}

.quick-action-content strong {
  color: #173b6f;
  font-size: 0.9rem;
}

.quick-action-content small {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.form-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  background: linear-gradient(120deg, rgba(19, 35, 63, 0.98), rgba(53, 80, 122, 0.95));
  color: #fff;
  padding: 1.05rem 1.25rem;
}

.panel-head h2 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  font-size: clamp(1.5rem, 2.1vw, 2.1rem);
}

.panel-head p {
  margin: 0.3rem 0 0;
  color: #d3def2;
}

.case-form {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.8rem;
}

fieldset.inbox-fieldset {
  grid-template-columns: 1fr;
}

legend {
  padding: 0 0.45rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.inline-check input {
  width: auto;
}

.actions-row {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}

.actions-left {
  justify-content: flex-start;
}

.support-text {
  margin: 0;
  color: var(--ink-soft);
}

.role-only {
  display: none;
}

.role-visible {
  display: block;
}

.digesett-area-only {
  display: none;
}

.area-visible {
  display: grid;
}

.tracker-shell {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 0.8rem;
}

.tracker-card {
  background: #f7faff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
}

.tracker-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.tracker-card strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.7rem;
}

.tracker-card p {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.compact-scroll {
  max-height: 420px;
  overflow: auto;
}

.compact-shell {
  max-height: 640px;
  overflow: auto;
}

.dashboard-collapsible {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  overflow: hidden;
}

.dashboard-collapsible + .dashboard-collapsible {
  margin-top: 0.55rem;
}

.dashboard-collapsible > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  font-weight: 700;
  color: #173b6f;
  background: #f4f8ff;
  border-bottom: 1px solid #dbe6f6;
}

.dashboard-collapsible > summary::-webkit-details-marker {
  display: none;
}

.dashboard-collapsible > summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #b8cce8;
  color: #305889;
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
}

.dashboard-collapsible[open] > summary::after {
  content: "−";
}

.dashboard-collapsible > .map-shell,
.dashboard-collapsible > .table-wrap,
.dashboard-collapsible > .calendar-shell,
.dashboard-collapsible > .form-subgrid,
.dashboard-collapsible > .support-text {
  margin: 0.75rem;
}

.form-subgrid {
  display: grid;
  gap: 1rem;
}

.map-provider-wrap {
  display: grid;
  gap: 0.7rem;
}

.map-provider-wrap.navega-main {
  display: block;
}

.provider-frame {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef4ff;
}

.provider-frame-full {
  min-height: 500px;
  border-radius: 10px;
}

.map-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.map-section-head h3 {
  margin: 0;
}

.map-head-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.traffic-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.traffic-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.navega-map-container {
  width: 100%;
  height: 500px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #dce8f5;
}

.scip-map-wrapper {
  position: relative;
  width: 100%;
}
.scip-leaflet-map {
  width: 100%;
  height: 460px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #dce8f5;
}
.scip-map-fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 7px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(9,23,44,0.15);
  transition: box-shadow 0.15s, background 0.15s;
  color: #334;
  width: 32px;
  height: 32px;
}
.scip-map-fullscreen-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}
.scip-map-fullscreen-btn:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(9,23,44,0.22);
}
.scip-map-wrapper.is-fullscreen {
  position: fixed !important;
  inset: 0;
  z-index: 9999;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}
.scip-map-wrapper.is-fullscreen .scip-leaflet-map {
  height: 100% !important;
  border-radius: 0 !important;
}

.scip-leaflet-popup .maplibregl-popup-content {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(9, 23, 44, 0.22);
  border: 1px solid #d1ddf0;
  min-width: 280px;
  max-width: 320px;
}

.scip-leaflet-popup .maplibregl-popup-close-button {
  color: #fff;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0,0,0,0.15);
  border-radius: 0 12px 0 6px;
  line-height: 1;
  right: 0;
  top: 0;
}

.scip-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  color: #fff;
}

.scip-popup-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.scip-popup-inst-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.scip-popup-body {
  padding: 0.7rem 0.85rem 0.75rem;
  background: #fff;
}

.scip-popup-event {
  margin: 0 0 0.55rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.3;
}

.scip-popup-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
}

.scip-popup-table td {
  padding: 0.18rem 0;
  vertical-align: top;
  border: none;
  color: var(--ink-soft);
}

.scip-popup-table td:first-child {
  font-weight: 700;
  color: #3a5580;
  width: 6.5rem;
  padding-right: 0.5rem;
  white-space: nowrap;
}

.scip-popup-table td:last-child {
  color: var(--ink);
}

.scip-popup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.scip-popup-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.scip-popup-badge-sla {
  background: #fff8ec;
  color: #8c5200;
  border-color: #e5b96a;
}

.scip-popup-badge-approx {
  background: #f5f7fb;
  color: #6a7fa3;
  border-color: #c5d1e8;
}

/* Popup tabs */
.scip-popup-tabs {
  display: flex;
  border-bottom: 1.5px solid #e2e8f4;
  margin-bottom: 8px;
}
.scip-popup-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6a7fa3;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1.5px;
}
.scip-popup-tab-btn:hover {
  color: #0047ab;
}
.scip-popup-tab-btn.active {
  color: #0047ab;
  border-bottom-color: #0047ab;
}
.scip-popup-tab-pane[hidden] {
  display: none;
}

.navega-pin {
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(19,35,63,0.4);
  transform: rotate(-45deg);
  cursor: pointer;
  transition: transform 0.15s;
}

.navega-pin:hover {
  transform: rotate(-45deg) scale(1.25);
}

.provider-link {
  text-align: center;
  text-decoration: none;
}

.dashboard-footer {
  width: min(1380px, 95vw);
  margin: 0 auto 1.3rem;
  border-radius: 18px;
  border: 1px solid #d4e0f1;
  background: linear-gradient(130deg, #f8fbff, #edf3fc);
  box-shadow: 0 14px 30px rgba(12, 29, 56, 0.08);
}

.dashboard-footer-inner {
  padding: 0.85rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.dashboard-footer strong {
  color: #163b72;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.dashboard-footer p {
  margin: 0.18rem 0 0;
  font-size: 0.8rem;
  color: #59789f;
}

.dashboard-footer-meta {
  display: grid;
  gap: 0.12rem;
  text-align: right;
  font-size: 0.76rem;
  color: #5f789d;
}

.map-fallback {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  align-content: start;
}

.map-fallback-card {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
}

.map-fallback-card p,
.map-fallback-card span {
  margin: 0.3rem 0 0;
  display: block;
  color: var(--ink-soft);
}

.empty-area-card {
  display: none;
  background: #f5f8ff;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
}

.empty-area-card.show {
  display: block;
}

.inbox-list {
  margin-top: 0.5rem;
  width: 100%;
  overflow-x: auto;
}

.inbox-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  font-size: 0.86rem;
}

.inbox-table thead th {
  background: #edf3ff;
  color: var(--ink-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 0.55rem 0.8rem;
  border-bottom: 2px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.inbox-table tbody tr {
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  transition: background 0.12s;
}

.inbox-table tbody tr:hover {
  background: #f0f6ff;
}

.inbox-table tbody tr.inbox-row-selected {
  background: #ddeeff;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.inbox-table tbody tr.sender-intrant {
  border-left-color: #0a7b4f;
}

.inbox-table tbody tr.sender-ayuntamiento {
  border-left-color: #b06000;
}

.inbox-table td {
  padding: 0.65rem 0.8rem;
  vertical-align: middle;
}

.inbox-case-num {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.inbox-date {
  font-size: 0.76rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.inbox-event-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.inbox-location {
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.inbox-streets {
  font-size: 0.76rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.inbox-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
}

.inbox-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.inbox-note-input {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.5rem;
  font-size: 0.74rem;
}

.inbox-action-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  background: #f8fbff;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.inbox-action-btn:hover {
  background: #edf4ff;
}

.inbox-return-btn {
  border-color: rgba(194, 46, 46, 0.3);
  color: #8f1f1f;
  background: rgba(194, 46, 46, 0.08);
}

.inbox-return-btn:hover {
  background: rgba(194, 46, 46, 0.14);
}

.inline-post-form {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.inbox-return-form {
  flex-wrap: wrap;
}

.case-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.case-table th,
.case-table td {
  padding: 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.case-table thead th {
  background: #edf3ff;
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-ok {
  background: rgba(23, 114, 69, 0.12);
  color: #0f5f39;
  border-color: rgba(23, 114, 69, 0.22);
}

.badge-done {
  background: rgba(100, 116, 139, 0.10);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.22);
}

.badge-pending {
  background: rgba(255, 122, 24, 0.12);
  color: #8f4700;
  border-color: rgba(255, 122, 24, 0.25);
}

.badge-alert {
  background: rgba(194, 46, 46, 0.12);
  color: #8f1f1f;
  border-color: rgba(194, 46, 46, 0.25);
}

.badge-warning {
  background: rgba(200, 130, 0, 0.12);
  color: #7a4f00;
  border-color: rgba(200, 130, 0, 0.28);
}

.badge-info {
  background: rgba(10, 79, 157, 0.1);
  color: #0a4f9d;
  border-color: rgba(10, 79, 157, 0.22);
}

.badge-success {
  background: rgba(22, 130, 62, 0.12);
  color: #145c2d;
  border-color: rgba(22, 130, 62, 0.28);
}

.badge-secondary {
  background: rgba(100, 116, 139, 0.08);
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.18);
}

/* Cross-approval UI */
.approval-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.approval-badge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.approval-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.approval-block-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(200, 130, 0, 0.08);
  border: 1px solid rgba(200, 130, 0, 0.25);
  border-radius: 8px;
  color: #7a4f00;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ---- Pipeline Table ------------------------------------------------- */
.pipeline-table {
  table-layout: fixed;
  min-width: 848px;
}
.pipeline-table th,
.pipeline-table td {
  text-align: center;
  vertical-align: middle;
  font-size: 0.75rem;
  padding: 0.4rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
}
.pipeline-table th:nth-child(1),
.pipeline-table td:nth-child(1) { text-align: left; }
.pipeline-table th:nth-child(2),
.pipeline-table td:nth-child(2) { text-align: left; }
.pipeline-table th:last-child,
.pipeline-table td:last-child   { text-align: left; }

.pipeline-event-name { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pipeline-event-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pipeline-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  border: 2px solid transparent;
}
.pipeline-done  { background: rgba(22,130,62,0.12); color: #145c2d; border-color: rgba(22,130,62,0.30); }
.pipeline-active { background: rgba(10,79,157,0.12); color: #0a4f9d; border-color: #0a4f9d; font-weight: 800; font-size: 0.65rem; }
.pipeline-blocked { background: rgba(200,130,0,0.10); color: #7a4f00; border-color: rgba(200,130,0,0.30); }
.pipeline-pending { color: #bbb; border-color: transparent; }

.pipeline-owner-digesett.pipeline-active  { background: rgba(0,71,171,0.14); color: #003a8c; border-color: #003a8c; }
.pipeline-owner-intrant.pipeline-active   { background: rgba(10,123,79,0.14); color: #0a7b4f; border-color: #0a7b4f; }
.pipeline-owner-ayuntamiento.pipeline-active { background: rgba(196,122,0,0.14); color: #7a4d00; border-color: #c47a00; }

/* ---- Map ------------------------------------------------------------ */
.map-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  background: #fbfdff;
}

.map-shell h3 {
  margin-top: 0;
}

.case-map {
  position: relative;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 122, 24, 0.12), transparent 28%),
    radial-gradient(circle at 90% 70%, rgba(19, 35, 63, 0.12), transparent 30%),
    linear-gradient(120deg, #f2f7ff, #e8f1ff);
  overflow: hidden;
}

.case-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(19, 35, 63, 0.2);
}

.case-pin:hover {
  transform: scale(1.15);
}

.map-legend {
  margin-top: 0.8rem;
  overflow-x: auto;
}

.map-legend-item {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.map-legend-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}


/* ── Stress Map ─────────────────────────────────────────────── */
.stress-map-shell {
  border: 1px solid var(--line);
}

.stress-map-wrap {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 0.8rem;
}

.stress-geo {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.stress-zone {
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stress-zone:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(19, 35, 63, 0.15);
  border-color: var(--accent);
}

.stress-zone.sz-selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(15, 102, 199, 0.25);
}

.stress-zone-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f1f38;
  line-height: 1.2;
}

.stress-zone-meta {
  font-size: 0.72rem;
  color: #3a4f6a;
  margin-top: 0.3rem;
}

.stress-zone-score {
  font-size: 1.3rem;
  font-weight: 900;
  font-family: "Bebas Neue", sans-serif;
  color: #0f1f38;
  line-height: 1;
}

/* stress level backgrounds */
.sz-verde   { background: rgba(23, 114, 69, 0.14); }
.sz-amarillo { background: rgba(209, 170, 0, 0.2); }
.sz-naranja { background: rgba(230, 120, 20, 0.28); }
.sz-rojo    { background: rgba(220, 60, 40, 0.28); }
.sz-critico { background: rgba(180, 20, 20, 0.38); border-color: #c22e2e !important; }

/* legend key */
.stress-sidebar-key {
  width: 130px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem;
  background: #f4f7fb;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.stress-key-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.stress-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.stress-dot.sk-verde    { background: rgba(23, 114, 69, 0.5); }
.stress-dot.sk-amarillo { background: rgba(209, 170, 0, 0.6); }
.stress-dot.sk-naranja  { background: rgba(230, 120, 20, 0.7); }
.stress-dot.sk-rojo     { background: rgba(220, 60, 40, 0.7); }
.stress-dot.sk-critico  { background: rgba(180, 20, 20, 0.8); }

/* detail bar below geo */
.stress-detail-bar {
  margin-top: 0.8rem;
  min-height: 2.5rem;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  background: #f0f5fc;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.stress-detail-bar strong {
  color: var(--accent);
}

.calendar-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: #fbfdff;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.calendar-month-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  min-width: 220px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.calendar-institution-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.38rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8fd;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.calendar-institution-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.calendar-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 84px;
  padding: 0.45rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  /* reset button element appearance */
  font: inherit;
  text-align: left;
  width: 100%;
}

.calendar-cell.is-outside {
  background: #f7f9fc;
  color: #9aabc1;
}

.calendar-cell.is-clickable {
  cursor: pointer;
}

.calendar-cell.is-clickable:hover {
  border-color: rgba(10, 79, 157, 0.45);
  box-shadow: 0 2px 10px rgba(19, 35, 63, 0.08);
}

.calendar-cell.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(10, 79, 157, 0.2);
}

.calendar-cell.inst-ayuntamiento {
  background: linear-gradient(180deg, rgba(176, 96, 0, 0.08), #fff 38%);
}

.calendar-cell.inst-intrant {
  background: linear-gradient(180deg, rgba(10, 123, 79, 0.08), #fff 38%);
}

.calendar-cell.inst-digesett {
  background: linear-gradient(180deg, rgba(10, 79, 157, 0.08), #fff 38%);
}

.calendar-day-number {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink);
}

.calendar-cell.is-outside .calendar-day-number {
  color: #9aabc1;
}

.calendar-event-count {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.72rem;
  padding: 0.16rem 0.4rem;
  border-radius: 999px;
  background: rgba(10, 79, 157, 0.12);
  color: #0a4f9d;
  font-weight: 700;
}

.calendar-inst-dots {
  display: flex;
  gap: 0.2rem;
  margin-top: 0.05rem;
}

.calendar-inst-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.calendar-inst-dot.inst-ayuntamiento,
.calendar-inst-badge.inst-ayuntamiento {
  background: #b06000;
}

.calendar-inst-dot.inst-intrant,
.calendar-inst-badge.inst-intrant {
  background: #0a7b4f;
}

.calendar-inst-dot.inst-digesett,
.calendar-inst-badge.inst-digesett {
  background: #0a4f9d;
}

.calendar-day-agenda {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f9ff;
  padding: 0.65rem 0.75rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

/* ── Calendar day popup ─────────────────────────────── */
.scip-cal-popup {
  position: fixed;
  inset: 0;
  background: rgba(9, 23, 44, 0.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: scopFadeIn 0.14s ease;
}

.scip-cal-popup[hidden] { display: none; }

@keyframes scopFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.scip-cal-popup-inner {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 56px rgba(9, 23, 44, 0.28);
  animation: scopSlideUp 0.16s ease;
}

@keyframes scopSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.scip-cal-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid #e5edfa;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.scip-cal-popup-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  text-transform: capitalize;
}

.scip-cal-popup-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #6a7fa3;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}
.scip-cal-popup-close:hover { background: #f0f4fc; color: var(--ink); }

.scip-cal-popup-list {
  list-style: none;
  margin: 0;
  padding: 0.65rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scip-cal-popup-item {
  border: 1px solid #e2ecfa;
  border-radius: 10px;
  overflow: hidden;
  background: #fafcff;
}

.scip-cal-popup-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: #f3f7ff;
  gap: 0.5rem;
}

.scip-cal-popup-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.scip-cal-popup-inst {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scip-cal-popup-event {
  margin: 0.4rem 0.75rem 0;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.3;
}

.scip-cal-popup-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  padding: 0 0.75rem;
}

.scip-cal-popup-table td {
  padding: 0.18rem 0.75rem 0.18rem 0.75rem;
  vertical-align: top;
  border: none;
}

.scip-cal-popup-table td:first-child {
  font-weight: 700;
  color: #3a5580;
  width: 7rem;
  white-space: nowrap;
}

.scip-cal-popup-table td:last-child { color: var(--ink); }

.scip-cal-popup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem 0.6rem;
}

.scip-cal-popup-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.scip-cal-badge-sla {
  background: #fff8ec;
  color: #8c5200;
  border-color: #e5b96a;
}

.calendar-day-agenda strong {
  color: var(--ink);
}

.calendar-agenda-list {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
}

.calendar-agenda-list li {
  margin: 0.26rem 0;
}

.calendar-inst-badge {
  display: inline-block;
  color: #fff;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.12rem 0.38rem;
  margin-right: 0.24rem;
  letter-spacing: 0.02em;
}

.repo-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.repo-filter-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fbff;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.repo-filter-switch input {
  accent-color: var(--accent);
}

.doc-list {
  margin: 0;
  padding-left: 1rem;
}

.doc-list li {
  margin: 0.2rem 0;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #123f2b;
  color: #fff;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow);
  animation: riseIn 350ms ease-out;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 960px) {
  .command-layout {
    grid-template-columns: 1fr;
  }

  .command-sidebar {
    position: static;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.5rem 0.75rem;
  }

  .topbar-brand-sub {
    display: none;
  }

  .topbar-right {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .notifications-kpis {
    grid-template-columns: 1fr;
  }

  .notification-item,
  .notification-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .notification-link {
    width: 100%;
    justify-content: center;
  }

  .growth-hub {
    grid-template-columns: 1fr;
  }

  .tracker-grid {
    grid-template-columns: 1fr;
  }

  .inbox-table {
    font-size: 0.8rem;
  }

  .provider-frame {
    min-height: 280px;
  }

  .calendar-head {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-institution-legend {
    gap: 0.55rem;
  }

  .calendar-institution-item {
    font-size: 0.72rem;
  }

  .calendar-month-label {
    min-width: auto;
  }

  .calendar-cell {
    min-height: 74px;
  }

  fieldset {
    grid-template-columns: 1fr;
  }

  .actions-row {
    justify-content: stretch;
  }

  .actions-row button {
    flex: 1;
  }

  .dashboard-footer-inner {
    align-items: flex-start;
  }

  .dashboard-footer-meta {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .topbar {
    width: min(100%, calc(100vw - 1rem));
    margin-top: 0.7rem;
    border-radius: 10px;
    padding: 0.46rem 0.65rem;
    gap: 0.5rem;
  }

  .topbar h1 {
    font-size: 1rem;
  }

  .topbar-user-info {
    font-size: 0.76rem;
    gap: 0.32rem;
  }

  .topbar-chip {
    font-size: 0.65rem;
    padding: 0.13rem 0.4rem;
  }

  .command-layout {
    width: min(100%, calc(100vw - 1rem));
    margin-top: 0.75rem;
    gap: 0.72rem;
  }

  .command-sidebar,
  .form-panel,
  .notifications-panel,
  .dashboard-footer {
    border-radius: 14px;
  }

  .panel-head,
  .tracker-shell,
  .notifications-shell,
  .case-form {
    padding: 0.72rem;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .tracker-grid {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    gap: 0.28rem;
  }

  .calendar-cell {
    min-height: 66px;
    padding: 0.34rem;
  }

  .calendar-day-number {
    font-size: 0.76rem;
  }

  .notification-modal-card,
  .logout-modal-card {
    width: min(100%, calc(100vw - 1rem));
    border-radius: 12px;
    padding: 0.72rem;
  }

  .notification-item,
  .notification-row {
    padding: 0.55rem;
    gap: 0.45rem;
  }

  .notification-copy p,
  .notification-row p {
    font-size: 0.76rem;
  }

  .new-case-toast {
    right: 0.5rem;
    left: 0.5rem;
    top: 0.5rem;
    max-width: none;
  }

  .compact-scroll,
  .compact-shell {
    max-height: 340px;
  }

  .dashboard-collapsible > summary {
    padding: 0.58rem 0.65rem;
    font-size: 0.84rem;
  }
}

@media (max-width: 420px) {
  .topbar-main .support-text,
  .session-card p {
    font-size: 0.78rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 0.24rem 0.5rem;
  }

  .side-nav a,
  .btn-primary,
  .btn-secondary {
    font-size: 0.82rem;
  }

  .kpi-card strong,
  .notifications-kpi strong {
    font-size: 1.45rem;
  }

  .notification-counter {
    min-width: 1.35rem;
    height: 1.35rem;
    font-size: 0.68rem;
  }

  .calendar-weekdays span,
  .calendar-event-count {
    font-size: 0.64rem;
  }
}
