* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f5f7fa;
  color: #172033;
}

.hidden {
  display: none !important;
}


/* =====================================================
   LOGIN PAGE
===================================================== */

.login {
  min-height: 100vh;
  width: 100%;

  display: grid;
  place-items: center;

  position: relative;
  overflow: hidden;

  padding: 25px;

  background: #f5f7fa;
}


/* Background image */

.login::before {
  content: "";

  position: absolute;
  inset: -3%;

  background-image: url("images/login-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  transform: scale(1.08);

  animation: backgroundZoomOut 3s ease-out 1 forwards;

  z-index: 0;
}


/* Very light overlay */

.login::after {
  content: "";

  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.06);

  pointer-events: none;

  z-index: 1;
}


/* =====================================================
   LOGIN CARD
===================================================== */

.login-card {
  position: relative;
  z-index: 2;

  width: min(400px, 92vw);

  background: rgba(255, 255, 255, 0.96);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border: 1px solid rgba(255, 255, 255, 0.8);

  border-radius: 20px;

  padding: 40px;

  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.25),
    0 5px 20px rgba(0, 0, 0, 0.08);

  animation: cardEnter 0.7s ease-out both;

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}


/* Card hover */

.login-card:hover {
  transform: translateY(-3px);

  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.28),
    0 8px 25px rgba(0, 0, 0, 0.1);
}


/* =====================================================
   LOGIN LOGO
===================================================== */

.login-card .mark {
  width: 170px;
  height: 105px;

  margin: 0 auto 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;

  border-radius: 12px;

  overflow: hidden;

  animation: logoEnter 0.8s ease-out 0.15s both;
}


.login-card .mark img {
  display: block;

  width: auto;
  height: auto;

  max-width: 170px;
  max-height: 105px;

  object-fit: contain;

  transition: transform 0.35s ease;
}


/* Logo hover */

.login-card .mark:hover img {
  transform: scale(1.06);
}


/* =====================================================
   LOGIN TEXT
===================================================== */

.eyebrow {
  font-size: 11px;

  letter-spacing: 1.6px;

  color: #64748b;

  font-weight: 700;

  margin: 0 0 6px;

  animation: contentEnter 0.6s ease-out 0.25s both;
}


.login-card h1 {
  margin: 0 0 22px;

  font-size: 30px;

  line-height: 1.2;

  color: #111827;

  animation: contentEnter 0.6s ease-out 0.3s both;
}


.muted {
  color: #64748b;

  font-size: 13px;
}


/* =====================================================
   FORM
===================================================== */

label {
  display: block;

  font-size: 12px;

  font-weight: 700;

  color: #475569;

  margin: 14px 0;

  animation: contentEnter 0.6s ease-out 0.35s both;
}


input,
select,
textarea {
  display: block;

  width: 100%;

  margin-top: 7px;

  padding: 12px 13px;

  border: 1px solid #d8dee8;

  border-radius: 9px;

  font: inherit;

  background: #fff;

  color: #172033;

  outline: none;

  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}


/* Input hover */

input:hover,
select:hover,
textarea:hover {
  border-color: #b8c1cf;
}


/* Input focus */

input:focus,
select:focus,
textarea:focus {
  border-color: #64748b;

  box-shadow:
    0 0 0 3px rgba(100, 116, 139, 0.12);

  transform: translateY(-1px);
}


/* =====================================================
   BUTTONS
===================================================== */

.primary,
.secondary,
.logout {
  border: 0;

  border-radius: 9px;

  padding: 11px 16px;

  font-weight: 700;

  cursor: pointer;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}


.primary {
  background: #111827;

  color: #fff;

  animation: contentEnter 0.6s ease-out 0.45s both;
}


.primary:hover {
  background: #1f2937;

  transform: translateY(-2px);

  box-shadow:
    0 9px 20px rgba(17, 24, 39, 0.25);
}


.primary:active {
  transform: translateY(0);
}


.secondary {
  background: #eef2f7;

  color: #172033;
}


.secondary:hover {
  background: #e2e8f0;

  transform: translateY(-1px);
}


.full {
  width: 100%;

  margin-top: 10px;
}


.error {
  color: #b91c1c;

  font-size: 12px;
}



/* =====================================================
   LOGIN INPUT ICONS
===================================================== */

.input-wrap {
  position: relative;
  width: 100%;
}

.input-wrap input {
  padding-left: 42px;
  padding-right: 42px;
}

.field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
}

.field-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.password-toggle {
  position: absolute;
  right: 9px;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  z-index: 3;
  transition: color .2s ease, background .2s ease;
}

.password-toggle:hover {
  color: #172033;
  background: #f1f5f9;
}

.password-toggle.is-visible {
  color: #111827;
}

.eye-icon {
  width: 18px;
  height: 18px;
}


/* =====================================================
   LOGIN ERROR / SHAKE
===================================================== */

.login-card.shake {
  animation: loginShake .5s ease;
}

@keyframes loginShake {
  0%, 100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(7px);
  }

  60% {
    transform: translateX(-5px);
  }

  80% {
    transform: translateX(4px);
  }
}


/* =====================================================
   LOGIN BUTTON LOADING
===================================================== */

.primary {
  position: relative;
  overflow: hidden;
}

.button-label {
  transition: opacity .2s ease;
}

.button-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.primary.loading {
  cursor: wait;
  transform: none !important;
}

.primary.loading .button-label {
  opacity: 0;
}

.primary.loading .button-spinner {
  opacity: 1;
  animation: spinner .7s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}


/* =====================================================
   RIPPLE EFFECT
===================================================== */

.ripple {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  transform: scale(0);
  animation: rippleEffect .6s ease-out;
  pointer-events: none;
}

.secondary .ripple,
.logout .ripple {
  background: rgba(17,24,39,.12);
}

@keyframes rippleEffect {
  to {
    transform: scale(2.4);
    opacity: 0;
  }
}


/* =====================================================
   TOAST NOTIFICATION
===================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;

  min-width: 280px;
  max-width: min(420px, 90vw);

  padding: 12px 16px;

  border-radius: 10px;

  background: #111827;
  color: #fff;

  font-size: 13px;
  font-weight: 600;
  text-align: center;

  box-shadow: 0 12px 30px rgba(0,0,0,.22);

  opacity: 0;
  visibility: hidden;

  transform: translate(-50%, 14px);

  transition:
    opacity .25s ease,
    transform .25s ease,
    visibility .25s ease;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast.success {
  background: #166534;
}

.toast.error {
  background: #991b1b;
}


/* =====================================================
   MOBILE LOGIN ADDITIONS
===================================================== */

@media (max-width: 650px) {

  .toast {
    bottom: 18px;
  }

}

/* =====================================================
   MAIN APPLICATION
===================================================== */

.app {
  display: flex;

  min-height: 100vh;
}


/* =====================================================
   SIDEBAR
===================================================== */


/* =====================================================
   PROFESSIONAL SIDEBAR V12
===================================================== */

.sidebar {
  width: 268px;
  min-width: 268px;
  background:
    linear-gradient(180deg, #0f172a 0%, #111827 55%, #0b1220 100%);
  color: #fff;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
  box-shadow: 8px 0 30px rgba(15, 23, 42, 0.08);
}

/* Brand */
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 2px 10px 22px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand b {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.brand span {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.mark.small {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-shadow: 0 5px 18px rgba(0,0,0,0.18);
}

.mark.small img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Navigation */
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
}

.nav {
  position: relative;
  width: 100%;
  min-height: 46px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #aeb9c9;
  padding: 9px 11px;
  border-radius: 12px;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.nav::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  width: 3px;
  height: 28px;
  border-radius: 0 5px 5px 0;
  background: transparent;
  transition: background 0.2s ease, height 0.2s ease;
}

.nav-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.08);
  border-radius: 10px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav.active,
.nav:hover {
  background: rgba(255,255,255,0.075);
  border-color: rgba(255,255,255,0.07);
  color: #fff;
  transform: translateX(2px);
  box-shadow: 0 5px 16px rgba(0,0,0,0.10);
}

.nav.active::before {
  height: 32px;
  background: #f5c542;
}

.nav.active .nav-icon,
.nav:hover .nav-icon {
  color: #f5c542;
  background: rgba(245,197,66,0.12);
  border-color: rgba(245,197,66,0.18);
}

/* Notification badge */
.notification-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5c542;
  color: #111827;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(245,197,66,0.25);
}

/* User / Sign out area */
.sidefoot {
  margin-top: auto;
  padding: 12px 8px 2px;
  color: #94a3b8;
  font-size: 11px;
}

#userEmail {
  display: block;
  max-width: 100%;
  padding: 11px 12px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout {
  width: 100%;
  margin-top: 9px;
  padding: 10px 12px;
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.logout:hover {
  background: rgba(239,68,68,0.10);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.18);
  transform: none;
}

/* =====================================================
   MAIN CONTENT
===================================================== */

.main {
  flex: 1;

  padding: 30px 38px;

  max-width: 1500px;

  margin: auto;

  width: 100%;
}


.top {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 28px;
}


.top h1 {
  margin: 0;

  font-size: 28px;
}


/* =====================================================
   DASHBOARD CARDS
===================================================== */

.cards {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 16px;

  margin-bottom: 20px;
}


.card,
.panel {
  background: #fff;

  border: 1px solid #e5e7eb;

  border-radius: 14px;

  box-shadow:
    0 2px 8px rgba(15, 23, 42, 0.03);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}


.card:hover {
  transform: translateY(-3px);

  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.08);
}


.card {
  padding: 22px;
}


.card span {
  font-size: 13px;

  color: #64748b;
}


.card strong {
  display: block;

  font-size: 28px;

  margin-top: 10px;
}


.panel {
  padding: 22px;

  margin-bottom: 20px;
}


.panelhead {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 18px;
}


.panel h2 {
  font-size: 18px;

  margin: 0;
}


.step {
  font-size: 12px;

  color: #64748b;

  background: #f1f5f9;

  padding: 6px 9px;

  border-radius: 999px;
}


/* =====================================================
   GRID
===================================================== */

.grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 4px 18px;
}


.station {
  display: grid;

  grid-template-columns: 1fr 180px 90px;

  gap: 14px;

  align-items: center;

  padding: 14px 0;

  border-bottom: 1px solid #edf0f4;
}


.station input {
  margin: 0;
}


.station .result {
  font-weight: 700;

  text-align: right;
}


/* =====================================================
   SCORE
===================================================== */

.scorebox {
  display: flex;

  justify-content: space-between;

  align-items: center;

  background: #f8fafc;

  padding: 18px;

  border-radius: 10px;

  margin: 20px 0;
}


.scorebox strong {
  font-size: 25px;
}


textarea {
  min-height: 100px;

  resize: vertical;
}


.actions {
  display: flex;

  justify-content: flex-end;

  gap: 10px;

  margin-top: 18px;
}


/* =====================================================
   TABLE
===================================================== */

.tablewrap {
  overflow: auto;
}


table {
  width: 100%;

  border-collapse: collapse;

  font-size: 13px;
}


th,
td {
  text-align: left;

  padding: 13px 12px;

  border-bottom: 1px solid #edf0f4;

  white-space: nowrap;
}


th {
  color: #64748b;

  font-size: 11px;

  text-transform: uppercase;

  letter-spacing: 0.6px;
}


.status {
  font-weight: 700;
}


.good {
  color: #15803d;
}


.needs {
  color: #b45309;
}


.empty {
  text-align: center;

  color: #94a3b8;

  padding: 30px;
}


/* =====================================================
   ANIMATIONS
===================================================== */


/* Background starts large -> becomes normal -> stops */

@keyframes backgroundZoomOut {
  from {
    transform: scale(1.08);
  }

  to {
    transform: scale(1);
  }
}


/* Login card */

@keyframes cardEnter {
  from {
    opacity: 0;

    transform:
      translateY(25px)
      scale(0.97);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }
}


/* Logo */

@keyframes logoEnter {
  from {
    opacity: 0;

    transform: scale(0.88);
  }

  to {
    opacity: 1;

    transform: scale(1);
  }
}


/* Text */

@keyframes contentEnter {
  from {
    opacity: 0;

    transform: translateY(8px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 900px) {

  .sidebar {
    width: 218px;
    min-width: 218px;
  }

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

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

}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 650px) {

  .login {
    padding: 15px;
  }


  .login-card {
    width: 100%;

    padding: 28px 22px;

    border-radius: 16px;
  }


  .login-card .mark {
    width: 145px;

    height: 85px;

    margin-bottom: 15px;
  }


  .login-card .mark img {
    max-width: 145px;

    max-height: 85px;
  }


  .login-card h1 {
    font-size: 25px;
  }


  .sidebar {
    display: none;
  }


  .main {
    padding: 20px;
  }


  .cards,
  .grid {
    grid-template-columns: 1fr;
  }


  .top {
    gap: 12px;
  }


  .top h1 {
    font-size: 22px;
  }


  .station {
    grid-template-columns: 1fr 100px;
  }


  .station .result {
    display: none;
  }

}
/* =====================================================
   STATION IMAGES - SAFE ADDITION
===================================================== */

.stationInfo {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.stationImage {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 58px;
  display: block;
  border-radius: 8px;
}

.stationName {
  min-width: 0;
  font-weight: 700;
  color: #111827;
}

.stationScore {
  display: contents;
}

@media (max-width: 650px) {
  .stationInfo {
    gap: 10px;
  }

  .stationImage {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
}


/* =====================================================
   STATION SCORE BOX - SIZE ADJUSTMENT
===================================================== */

.station {
  grid-template-columns: minmax(0, 1fr) 280px 90px;
}

.stationScore {
  display: contents;
}

.station .scoreInput {
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  font-size: 16px;
  border-radius: 10px;
}

@media (max-width: 650px) {
  .station {
    grid-template-columns: 1fr 180px 70px;
  }

  .station .scoreInput {
    height: 52px;
    min-height: 52px;
  }
}

/* ===== FINAL SCORE - ENHANCED ===== */
.scorebox {
  margin-top: 24px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #f8fafc, #eef4ff);
  border: 2px solid #2563eb;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  transition: all 0.25s ease;
}

.scorebox span {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #475569;
}

#liveScore {
  min-width: 150px;
  padding: 14px 26px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  color: #1d4ed8;
  background: #ffffff;
  border: 2px solid #2563eb;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.scorebox.score-excellent {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #16a34a;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.15);
}
.scorebox.score-excellent #liveScore {
  color: #15803d;
  border-color: #16a34a;
}

.scorebox.score-good {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}
.scorebox.score-good #liveScore {
  color: #1d4ed8;
  border-color: #2563eb;
}

.scorebox.score-warning {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #d97706;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.14);
}
.scorebox.score-warning #liveScore {
  color: #b45309;
  border-color: #d97706;
}

.scorebox.score-danger {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border-color: #dc2626;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.14);
}
.scorebox.score-danger #liveScore {
  color: #b91c1c;
  border-color: #dc2626;
}

@media (max-width: 700px) {
  .scorebox {
    padding: 18px;
    gap: 14px;
  }
  #liveScore {
    min-width: 125px;
    font-size: 34px;
    padding: 12px 18px;
  }
}

/* =====================================================
   GOOGLE RATING CARD
===================================================== */
.google-rating-section {
  margin: 0 0 22px;
}

.google-rating-card {
  display: flex;
  gap: 20px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
}

.google-rating-icon {
  width: 68px;
  min-width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #f59e0b;
  font-size: 32px;
}

.google-rating-content { flex: 1; min-width: 0; }
.google-rating-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.google-rating-top h2 { margin: 3px 0 0; font-size: 20px; }
.google-maps-link { color: #2563eb; text-decoration: none; font-weight: 700; font-size: 13px; white-space: nowrap; }
.google-maps-link:hover { text-decoration: underline; }
.google-rating-values { display: flex; gap: 28px; align-items: center; margin-top: 16px; }
.google-rating-score, .google-rating-count { display: flex; align-items: baseline; gap: 7px; }
.google-rating-score strong { font-size: 36px; line-height: 1; }
.google-rating-score span { color: #f59e0b; font-size: 23px; }
.google-rating-count strong { font-size: 22px; }
.google-rating-count span { color: #64748b; font-size: 14px; font-weight: 700; }
.google-rating-sync { margin: 12px 0 0; color: #94a3b8; font-size: 12px; }

@media (max-width: 650px) {
  .google-rating-card { padding: 16px; gap: 14px; }
  .google-rating-icon { width: 54px; min-width: 54px; height: 54px; border-radius: 14px; font-size: 25px; }
  .google-rating-top { flex-direction: column; gap: 8px; }
  .google-rating-values { gap: 20px; }
  .google-rating-score strong { font-size: 30px; }
}

/* ======================================================
   GOOGLE REVIEWS KPI — PREMIUM DASHBOARD CARD
   Matches the existing dashboard card style while giving
   the Google rating a clearer visual hierarchy.
   ====================================================== */
.google-review-dashboard-card {
  position: relative;
  overflow: hidden;
  padding-bottom: 18px;
}

.google-review-dashboard-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #4285f4 0%, #34a853 35%, #fbbc05 68%, #ea4335 100%);
  opacity: .85;
}

.google-review-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.google-review-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.google-review-eyebrow {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.google-review-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.google-review-actions{display:flex;align-items:center;gap:8px}
}
.google-review-last-updated{display:block;margin-top:5px;font-size:11px;color:#94a3b8}
.google-review-mini-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff8ed;
  border: 1px solid #f8ead4;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  overflow: hidden;
}

.google-maps-pin-icon {
  width: 19px;
  height: 19px;
  display: block;
}

.google-review-dashboard-values {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.google-review-score-block,
.google-review-count-block {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.google-review-score-block strong {
  color: #0f172a;
  font-size: 46px;
  line-height: .9;
  letter-spacing: -1.8px;
}

.google-review-score-star {
  color: #f4b400;
  font-size: 16px;
  margin-left: 1px;
}

.google-review-divider {
  width: 1px;
  height: 30px;
  background: #e2e8f0;
}

.google-review-count-block strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -.2px;
}

.google-review-count-block span {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.google-review-stars-row {
  display: flex;
  gap: 2px;
  margin-top: 9px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 1px;
}

.google-review-stars-row span {
  color: #f4b400;
}

.google-review-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}

.google-review-dashboard-branch {
  display: block;
  min-width: 0;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.google-review-dashboard-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, transform .15s ease;
}

.google-review-dashboard-link:hover {
  color: #1d4ed8;
  text-decoration: none;
  transform: translateX(1px);
}

.google-review-dashboard-link span {
  font-size: 12px;
}

@media (max-width: 700px) {
  .google-review-dashboard-values {
    gap: 12px;
  }

  .google-review-score-block strong {
    font-size: 38px;
  }

  .google-review-count-block strong {
    font-size: 17px;
  }

  .google-review-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

/* Employee photo upload */
.employee-photo-upload{display:flex;align-items:center;gap:14px;margin-top:8px}
.employee-photo-preview{width:86px;height:86px;border-radius:14px;border:1px dashed #cbd5e1;background:#f8fafc;display:grid;place-items:center;overflow:hidden;font-size:28px;color:#94a3b8}
.employee-photo-preview img{width:100%;height:100%;object-fit:cover}
.employee-photo-actions{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.employee-photo-actions small{font-size:10px;color:#94a3b8}
.hidden{display:none!important}

/* Saved assessment viewer */
.modal{position:fixed;inset:0;background:rgba(15,23,42,.55);display:grid;place-items:center;padding:24px;z-index:1000}
.modal.hidden{display:none}
.modal-card{width:min(900px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:18px;padding:24px;box-shadow:0 20px 60px rgba(0,0,0,.2)}
.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.assessment-summary{display:grid;grid-template-columns:100px 1fr 150px;gap:18px;align-items:center;padding:18px;border:1px solid #e5e7eb;border-radius:14px;margin-bottom:20px}
.assessment-photo{width:90px;height:90px;border-radius:14px;object-fit:cover;border:1px solid #e5e7eb}
.assessment-photo.placeholder{display:grid;place-items:center;background:#f8fafc;font-size:32px}
.assessment-overall{text-align:center}
.assessment-overall span,.assessment-overall small{display:block;color:#64748b}
.assessment-overall strong{display:block;font-size:32px;margin:4px 0}
.assessment-notes{background:#f8fafc;border-radius:10px;padding:14px}
@media(max-width:700px){.assessment-summary{grid-template-columns:80px 1fr}.assessment-overall{grid-column:1/-1;text-align:left}}


/* =====================================================
   NOTIFICATIONS
===================================================== */
.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.notification-list {
  display: grid;
  gap: 12px;
}

.notification-item {
  border: 1px solid #e5e7eb;
  border-left: 4px solid #64748b;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.notification-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(15, 23, 42, .08);
}

.notification-item.unread {
  background: #f8fbff;
  border-color: #cbd5e1;
}

.notification-item.priority-important {
  border-left-color: #f59e0b;
}

.notification-item.priority-urgent {
  border-left-color: #dc2626;
}

.notification-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-item-title {
  font-weight: 700;
  font-size: 16px;
}

.notification-item-message {
  margin-top: 8px;
  color: #475569;
  line-height: 1.55;
  white-space: pre-wrap;
}

.notification-item-meta {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 12px;
}

.notification-priority {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.notification-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .notification-header-actions {
    width: 100%;
  }

  .notification-header-actions button {
    flex: 1 1 auto;
  }
}

.notification-modal-card {
  width: min(720px, calc(100vw - 32px));
}

.notification-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

#notificationBranches {
  min-height: 150px;
}

@media (max-width: 700px) {
  .notification-item-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .notification-modal-card .grid {
    grid-template-columns: 1fr !important;
  }
}

/* =====================================================
   TRAINING SCORE INFOGRAPHIC
===================================================== */

.training-score-infographic {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  padding: 24px;
  margin-bottom: 20px;
}

.score-analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.analytics-eyebrow {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  margin-bottom: 5px;
}

.score-analytics-head h2 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.score-analytics-head p {
  margin: 5px 0 0;
}

.score-analytics-main {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
}

.score-gauge-card,
.score-trend-card {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 20px;
  background: #fbfcfe;
}

.analytics-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.analytics-card-title span {
  color: #94a3b8;
  font-weight: 500;
}

.score-gauge {
  position: relative;
  max-width: 260px;
  margin: 10px auto 0;
}

.score-gauge svg {
  display: block;
  width: 100%;
}

.gauge-track,
.gauge-progress {
  fill: none;
  stroke-width: 16;
  stroke-linecap: round;
}

.gauge-track {
  stroke: #e8edf3;
}

.gauge-progress {
  stroke: #f5b400;
  transform-origin: 110px 110px;
  transform: rotate(0deg);
  stroke-dasharray: 251.33;
  stroke-dashoffset: 251.33;
  transition: stroke-dashoffset .7s ease, stroke .25s ease;
}

.score-gauge-value {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
}

.score-gauge-value strong {
  display: block;
  font-size: 36px;
  line-height: 1;
  color: #0f172a;
}

.score-gauge-value span {
  color: #64748b;
  font-size: 12px;
}

.score-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.score-legend > span {
  color: #475569;
  font-size: 11px;
}

.score-legend small {
  display: block;
  color: #94a3b8;
  margin-left: 15px;
  margin-top: 2px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 5px;
}

.legend-dot.danger { background: #ef4444; }
.legend-dot.warning { background: #f59e0b; }
.legend-dot.success { background: #22c55e; }

.score-trend-wrap {
  width: 100%;
  overflow: hidden;
  margin-top: 8px;
}

#scoreTrendChart {
  width: 100%;
  min-height: 240px;
}

.trend-grid {
  stroke: #e8edf3;
  stroke-width: 1;
}

.trend-axis,
.trend-label {
  fill: #94a3b8;
  font-size: 11px;
}

.trend-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-point {
  fill: #fff;
  stroke: #2563eb;
  stroke-width: 3;
}

.trend-value {
  fill: #334155;
  font-size: 11px;
  font-weight: 700;
}

.trend-empty {
  fill: #94a3b8;
  font-size: 13px;
}

.score-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 20px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  overflow: hidden;
}

.score-stat {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px;
  min-width: 0;
}

.score-stat + .score-stat {
  border-left: 1px solid #eef2f7;
}

.score-stat-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 21px;
  font-weight: 800;
}

.score-stat-icon.positive { background: #ecfdf3; color: #16a34a; }
.score-stat-icon.negative { background: #fff1f2; color: #ef4444; }
.score-stat-icon.neutral { background: #eff6ff; color: #2563eb; }
.score-stat-icon.pending { background: #f5f3ff; color: #7c3aed; }

.score-stat small {
  display: block;
  color: #64748b;
  font-size: 11px;
}

.score-stat strong {
  display: block;
  color: #0f172a;
  font-size: 22px;
  margin-top: 3px;
}

.score-stat em {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  font-style: normal;
  margin-top: 2px;
}

@media (max-width: 1000px) {
  .score-analytics-main {
    grid-template-columns: 1fr;
  }

  .score-gauge-card {
    max-width: none;
  }

  .score-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .score-stat:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #eef2f7;
  }

  .score-stat:nth-child(4) {
    border-top: 1px solid #eef2f7;
  }
}

@media (max-width: 600px) {
  .training-score-infographic {
    padding: 16px;
  }

  .score-overview-grid {
    grid-template-columns: 1fr;
  }

  .score-stat,
  .score-stat + .score-stat {
    border-left: 0;
    border-top: 1px solid #eef2f7;
  }

  .score-stat:first-child {
    border-top: 0;
  }

  #scoreTrendChart {
    min-width: 560px;
  }

  .score-trend-wrap {
    overflow-x: auto;
  }
}

/* =====================================================
   DASHBOARD CARDS
===================================================== */

.cards {
  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 16px;

  margin-bottom: 20px;
}


.card,
.panel {
  background: #fff;

  border: 1px solid #e5e7eb;

  border-radius: 14px;

  box-shadow:
    0 2px 8px rgba(15, 23, 42, 0.03);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}


.card:hover {
  transform: translateY(-3px);

  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.08);
}


.card {
  padding: 22px;
}


.card span {
  font-size: 13px;

  color: #64748b;
}


.card strong {
  display: block;

  font-size: 28px;

  margin-top: 10px;
}


.panel {
  padding: 22px;

  margin-bottom: 20px;
}


.panelhead {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 18px;
}


.panel h2 {
  font-size: 18px;

  margin: 0;
}


.step {
  font-size: 12px;

  color: #64748b;

  background: #f1f5f9;

  padding: 6px 9px;

  border-radius: 999px;
}


/* =====================================================
   GRID
===================================================== */

.grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 4px 18px;
}


.station {
  display: grid;

  grid-template-columns: 1fr 180px 90px;

  gap: 14px;

  align-items: center;

  padding: 14px 0;

  border-bottom: 1px solid #edf0f4;
}


.station input {
  margin: 0;
}


.station .result {
  font-weight: 700;

  text-align: right;
}


/* =====================================================
   SCORE
===================================================== */

.scorebox {
  display: flex;

  justify-content: space-between;

  align-items: center;

  background: #f8fafc;

  padding: 18px;

  border-radius: 10px;

  margin: 20px 0;
}


.scorebox strong {
  font-size: 25px;
}


textarea {
  min-height: 100px;

  resize: vertical;
}


.actions {
  display: flex;

  justify-content: flex-end;

  gap: 10px;

  margin-top: 18px;
}


/* =====================================================
   TABLE
===================================================== */

.tablewrap {
  overflow: auto;
}


table {
  width: 100%;

  border-collapse: collapse;

  font-size: 13px;
}


th,
td {
  text-align: left;

  padding: 13px 12px;

  border-bottom: 1px solid #edf0f4;

  white-space: nowrap;
}


th {
  color: #64748b;

  font-size: 11px;

  text-transform: uppercase;

  letter-spacing: 0.6px;
}


.status {
  font-weight: 700;
}


.good {
  color: #15803d;
}


.needs {
  color: #b45309;
}


.empty {
  text-align: center;

  color: #94a3b8;

  padding: 30px;
}


/* =====================================================
   ANIMATIONS
===================================================== */


/* Background starts large -> becomes normal -> stops */

@keyframes backgroundZoomOut {
  from {
    transform: scale(1.08);
  }

  to {
    transform: scale(1);
  }
}


/* Login card */

@keyframes cardEnter {
  from {
    opacity: 0;

    transform:
      translateY(25px)
      scale(0.97);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }
}


/* Logo */

@keyframes logoEnter {
  from {
    opacity: 0;

    transform: scale(0.88);
  }

  to {
    opacity: 1;

    transform: scale(1);
  }
}


/* Text */

@keyframes contentEnter {
  from {
    opacity: 0;

    transform: translateY(8px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 900px) {

  .sidebar {
    width: 218px;
    min-width: 218px;
  }

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

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

}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 650px) {

  .login {
    padding: 15px;
  }


  .login-card {
    width: 100%;

    padding: 28px 22px;

    border-radius: 16px;
  }


  .login-card .mark {
    width: 145px;

    height: 85px;

    margin-bottom: 15px;
  }


  .login-card .mark img {
    max-width: 145px;

    max-height: 85px;
  }


  .login-card h1 {
    font-size: 25px;
  }


  .sidebar {
    display: none;
  }


  .main {
    padding: 20px;
  }


  .cards,
  .grid {
    grid-template-columns: 1fr;
  }


  .top {
    gap: 12px;
  }


  .top h1 {
    font-size: 22px;
  }


  .station {
    grid-template-columns: 1fr 100px;
  }


  .station .result {
    display: none;
  }

}
/* =====================================================
   STATION IMAGES - SAFE ADDITION
===================================================== */

.stationInfo {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.stationImage {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 58px;
  display: block;
  border-radius: 8px;
}

.stationName {
  min-width: 0;
  font-weight: 700;
  color: #111827;
}

.stationScore {
  display: contents;
}

@media (max-width: 650px) {
  .stationInfo {
    gap: 10px;
  }

  .stationImage {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
}


/* =====================================================
   STATION SCORE BOX - SIZE ADJUSTMENT
===================================================== */

.station {
  grid-template-columns: minmax(0, 1fr) 280px 90px;
}

.stationScore {
  display: contents;
}

.station .scoreInput {
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  font-size: 16px;
  border-radius: 10px;
}

@media (max-width: 650px) {
  .station {
    grid-template-columns: 1fr 180px 70px;
  }

  .station .scoreInput {
    height: 52px;
    min-height: 52px;
  }
}

/* ===== FINAL SCORE - ENHANCED ===== */
.scorebox {
  margin-top: 24px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #f8fafc, #eef4ff);
  border: 2px solid #2563eb;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  transition: all 0.25s ease;
}

.scorebox span {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #475569;
}

#liveScore {
  min-width: 150px;
  padding: 14px 26px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  color: #1d4ed8;
  background: #ffffff;
  border: 2px solid #2563eb;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.scorebox.score-excellent {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #16a34a;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.15);
}
.scorebox.score-excellent #liveScore {
  color: #15803d;
  border-color: #16a34a;
}

.scorebox.score-good {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}
.scorebox.score-good #liveScore {
  color: #1d4ed8;
  border-color: #2563eb;
}

.scorebox.score-warning {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #d97706;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.14);
}
.scorebox.score-warning #liveScore {
  color: #b45309;
  border-color: #d97706;
}

.scorebox.score-danger {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border-color: #dc2626;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.14);
}
.scorebox.score-danger #liveScore {
  color: #b91c1c;
  border-color: #dc2626;
}

@media (max-width: 700px) {
  .scorebox {
    padding: 18px;
    gap: 14px;
  }
  #liveScore {
    min-width: 125px;
    font-size: 34px;
    padding: 12px 18px;
  }
}

/* =====================================================
   GOOGLE RATING CARD
===================================================== */
.google-rating-section {
  margin: 0 0 22px;
}

.google-rating-card {
  display: flex;
  gap: 20px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
}

.google-rating-icon {
  width: 68px;
  min-width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #f59e0b;
  font-size: 32px;
}

.google-rating-content { flex: 1; min-width: 0; }
.google-rating-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.google-rating-top h2 { margin: 3px 0 0; font-size: 20px; }
.google-maps-link { color: #2563eb; text-decoration: none; font-weight: 700; font-size: 13px; white-space: nowrap; }
.google-maps-link:hover { text-decoration: underline; }
.google-rating-values { display: flex; gap: 28px; align-items: center; margin-top: 16px; }
.google-rating-score, .google-rating-count { display: flex; align-items: baseline; gap: 7px; }
.google-rating-score strong { font-size: 36px; line-height: 1; }
.google-rating-score span { color: #f59e0b; font-size: 23px; }
.google-rating-count strong { font-size: 22px; }
.google-rating-count span { color: #64748b; font-size: 14px; font-weight: 700; }
.google-rating-sync { margin: 12px 0 0; color: #94a3b8; font-size: 12px; }

@media (max-width: 650px) {
  .google-rating-card { padding: 16px; gap: 14px; }
  .google-rating-icon { width: 54px; min-width: 54px; height: 54px; border-radius: 14px; font-size: 25px; }
  .google-rating-top { flex-direction: column; gap: 8px; }
  .google-rating-values { gap: 20px; }
  .google-rating-score strong { font-size: 30px; }
}

/* ======================================================
   GOOGLE REVIEWS KPI — PREMIUM DASHBOARD CARD
   Matches the existing dashboard card style while giving
   the Google rating a clearer visual hierarchy.
   ====================================================== */
.google-review-dashboard-card {
  position: relative;
  overflow: hidden;
  padding-bottom: 18px;
}

.google-review-dashboard-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #4285f4 0%, #34a853 35%, #fbbc05 68%, #ea4335 100%);
  opacity: .85;
}

.google-review-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.google-review-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.google-review-eyebrow {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.google-review-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.google-review-actions{display:flex;align-items:center;gap:8px}
.google-review-refresh{width:36px;height:36px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;color:#64748b;font-size:20px;line-height:1;cursor:pointer;transition:.18s ease;display:grid;place-items:center}
.google-review-refresh:hover{background:#f8fafc;color:#0f172a;transform:rotate(20deg)}
.google-review-refresh:disabled{opacity:.55;cursor:wait}
.google-review-refresh.is-loading{animation:googleSpin .8s linear infinite}
@keyframes googleSpin{to{transform:rotate(360deg)}}
.google-review-last-updated{display:block;margin-top:5px;font-size:11px;color:#94a3b8}
.google-review-mini-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff8ed;
  border: 1px solid #f8ead4;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  overflow: hidden;
}

.google-maps-pin-icon {
  width: 19px;
  height: 19px;
  display: block;
}

.google-review-dashboard-values {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.google-review-score-block,
.google-review-count-block {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.google-review-score-block strong {
  color: #0f172a;
  font-size: 46px;
  line-height: .9;
  letter-spacing: -1.8px;
}

.google-review-score-star {
  color: #f4b400;
  font-size: 16px;
  margin-left: 1px;
}

.google-review-divider {
  width: 1px;
  height: 30px;
  background: #e2e8f0;
}

.google-review-count-block strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -.2px;
}

.google-review-count-block span {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.google-review-stars-row {
  display: flex;
  gap: 2px;
  margin-top: 9px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 1px;
}

.google-review-stars-row span {
  color: #f4b400;
}

.google-review-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}

.google-review-dashboard-branch {
  display: block;
  min-width: 0;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.google-review-dashboard-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, transform .15s ease;
}

.google-review-dashboard-link:hover {
  color: #1d4ed8;
  text-decoration: none;
  transform: translateX(1px);
}

.google-review-dashboard-link span {
  font-size: 12px;
}

@media (max-width: 700px) {
  .google-review-dashboard-values {
    gap: 12px;
  }

  .google-review-score-block strong {
    font-size: 38px;
  }

  .google-review-count-block strong {
    font-size: 17px;
  }

  .google-review-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

/* Employee photo upload */
.employee-photo-upload{display:flex;align-items:center;gap:14px;margin-top:8px}
.employee-photo-preview{width:86px;height:86px;border-radius:14px;border:1px dashed #cbd5e1;background:#f8fafc;display:grid;place-items:center;overflow:hidden;font-size:28px;color:#94a3b8}
.employee-photo-preview img{width:100%;height:100%;object-fit:cover}
.employee-photo-actions{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.employee-photo-actions small{font-size:10px;color:#94a3b8}
.hidden{display:none!important}

/* Saved assessment viewer */
.modal{position:fixed;inset:0;background:rgba(15,23,42,.55);display:grid;place-items:center;padding:24px;z-index:1000}
.modal.hidden{display:none}
.modal-card{width:min(900px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:18px;padding:24px;box-shadow:0 20px 60px rgba(0,0,0,.2)}
.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.assessment-summary{display:grid;grid-template-columns:100px 1fr 150px;gap:18px;align-items:center;padding:18px;border:1px solid #e5e7eb;border-radius:14px;margin-bottom:20px}
.assessment-photo{width:90px;height:90px;border-radius:14px;object-fit:cover;border:1px solid #e5e7eb}
.assessment-photo.placeholder{display:grid;place-items:center;background:#f8fafc;font-size:32px}
.assessment-overall{text-align:center}
.assessment-overall span,.assessment-overall small{display:block;color:#64748b}
.assessment-overall strong{display:block;font-size:32px;margin:4px 0}
.assessment-notes{background:#f8fafc;border-radius:10px;padding:14px}
@media(max-width:700px){.assessment-summary{grid-template-columns:80px 1fr}.assessment-overall{grid-column:1/-1;text-align:left}}


/* =====================================================
   DASHBOARD METRIC INFOGRAPHICS
===================================================== */
.metric-card {
  min-height: 108px;
  height: 108px;
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.metric-card-content {
  min-width: 0;
}

.metric-card-content > span {
  display: block;
}

.metric-card-content > strong {
  margin-top: 8px;
}

.metric-visual {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  position: relative;
}

.metric-visual svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.metric-visual-bg {
  fill: #f8fafc;
  stroke: #e2e8f0;
  stroke-width: 1;
}

.metric-ring-light {
  fill: none;
  stroke: #dbeafe;
  stroke-width: 2;
}

.people-head {
  fill: #2563eb;
}

.people-body {
  fill: none;
  stroke: #2563eb;
  stroke-width: 4;
  stroke-linecap: round;
}

.people-head.secondary {
  fill: #60a5fa;
}

.people-body.secondary {
  stroke: #60a5fa;
  stroke-width: 3.5;
}

.completion-track,
.completion-progress {
  fill: none;
  stroke-width: 7;
  transform: rotate(-90deg);
  transform-origin: 38px 38px;
}

.completion-track {
  stroke: #e2e8f0;
}

.completion-progress {
  stroke: #16a34a;
  stroke-linecap: round;
  stroke-dasharray: 182.21;
  stroke-dashoffset: 182.21;
  transition: stroke-dashoffset .45s ease;
}

.completion-check {
  display: none;
}

.completion-visual small {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  color: #15803d;
  pointer-events: none;
}

.score-visual {
  width: 86px;
  height: 64px;
  margin-right: -3px;
}

.score-mini-track,
.score-mini-progress {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}

.score-mini-track {
  stroke: #e2e8f0;
}

.score-mini-progress {
  stroke: #f59e0b;
  stroke-dasharray: 94.25;
  stroke-dashoffset: 94.25;
  transition: stroke-dashoffset .45s ease, stroke .3s ease;
}

.score-mini-needle {
  stroke: #0f172a;
  stroke-width: 2.4;
  stroke-linecap: round;
  transition: x2 .45s ease, y2 .45s ease;
}

.score-mini-center {
  fill: #0f172a;
}

.metric-employees .metric-visual,
.metric-completed .metric-visual {
  margin-right: 2px;
}

.metric-score .metric-visual {
  margin-right: 0;
}

.metric-card-content > span {
  font-size: 14px;
  color: #64748b;
  white-space: nowrap;
}

.metric-card-content > strong {
  display: block;
  font-size: 30px;
  line-height: 1.05;
  color: #0f172a;
  margin-top: 9px;
}

@media (max-width: 700px) {
  .metric-card {
    min-height: 96px;
    height: 96px;
  }
  .metric-visual {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }
  .score-visual {
    width: 76px;
    height: 58px;
  }
}

/* =====================================================
   DASHBOARD CARDS — UNIFIED COMPACT SIZE V6
   Keep the original metric-card proportions and compact
   Google Reviews to the same height instead of stretching
   all KPI cards to the tallest content.
===================================================== */
#dashboard .cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

#dashboard .cards > .card {
  height: 118px !important;
  min-height: 118px !important;
  max-height: 118px !important;
  box-sizing: border-box;
  align-self: stretch !important;
}

#dashboard .metric-card {
  height: 118px !important;
  min-height: 118px !important;
  padding: 18px 20px !important;
}

#dashboard .google-review-dashboard-card {
  height: 118px !important;
  min-height: 118px !important;
  padding: 10px 16px 10px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

#dashboard .google-review-card-head {
  flex: 0 0 auto;
  min-height: 30px;
}

#dashboard .google-review-actions {
  gap: 5px;
}

#dashboard .google-review-refresh,
#dashboard .google-review-mini-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

#dashboard .google-review-refresh {
  font-size: 17px;
}

#dashboard .google-review-dashboard-values {
  margin-top: 2px;
  gap: 12px;
  min-height: 35px;
}

#dashboard .google-review-score-block strong {
  font-size: 37px;
  letter-spacing: -1.3px;
}

#dashboard .google-review-score-star {
  font-size: 12px;
}

#dashboard .google-review-divider {
  height: 25px;
}

#dashboard .google-review-count-block strong {
  font-size: 16px;
}

#dashboard .google-review-count-block span {
  font-size: 9px;
}

#dashboard .google-review-stars-row {
  margin-top: 1px;
  font-size: 10px;
  line-height: 1;
}

#dashboard .google-review-card-footer {
  margin-top: 3px;
  padding-top: 4px;
  gap: 6px;
  min-height: 22px;
}

#dashboard .google-review-dashboard-branch,
#dashboard .google-review-dashboard-link {
  font-size: 9px;
}

#dashboard .google-review-last-updated {
  font-size: 8px;
  margin-top: 1px;
}

#dashboard .google-review-dashboard-link span {
  font-size: 10px;
}

@media (max-width: 1100px) {
  #dashboard .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #dashboard .cards {
    grid-template-columns: 1fr;
  }

  #dashboard .cards > .card {
    height: 104px !important;
    min-height: 104px !important;
    max-height: 104px !important;
  }

  #dashboard .metric-card {
    height: 104px !important;
    min-height: 104px !important;
    padding: 14px 16px !important;
  }

  #dashboard .google-review-dashboard-card {
    padding: 12px 14px 10px !important;
  }
}

/* =====================================================
   DASHBOARD CARDS — MATCH GOOGLE REVIEWS CARD SIZE
   All four dashboard KPI cards use the same dimensions.
===================================================== */
#dashboard .cards > .card {
  height: 196px !important;
  min-height: 196px !important;
  max-height: 196px !important;
  box-sizing: border-box;
  align-self: stretch !important;
}

#dashboard .metric-card {
  height: 296px !important;
  min-height: 296px !important;
  max-height: 296px !important;
  padding: 28px !important;
  align-items: center;
}

#dashboard .metric-card-content {
  flex: 1 1 auto;
}

#dashboard .metric-visual {
  flex-shrink: 0;
}

#dashboard .google-review-dashboard-card {
  height: 296px !important;
  min-height: 296px !important;
  max-height: 296px !important;
  padding: 22px !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Keep the Google review content at its original comfortable scale. */
#dashboard .google-review-dashboard-values {
  margin-top: 16px;
  gap: 16px;
}

#dashboard .google-review-score-block strong {
  font-size: 46px;
}

#dashboard .google-review-stars-row {
  margin-top: 9px;
  font-size: 13px;
}

#dashboard .google-review-card-footer {
  margin-top: 12px;
  padding-top: 10px;
}

#dashboard .google-review-dashboard-branch,
#dashboard .google-review-dashboard-link {
  font-size: 10px;
}

@media (max-width: 1100px) {
  #dashboard .cards > .card,
  #dashboard .metric-card,
  #dashboard .google-review-dashboard-card {
    height: 296px !important;
    min-height: 296px !important;
    max-height: 296px !important;
  }
}

@media (max-width: 700px) {
  #dashboard .cards > .card,
  #dashboard .metric-card,
  #dashboard .google-review-dashboard-card {
    height: auto !important;
    min-height: 260px !important;
    max-height: none !important;
  }

  #dashboard .metric-card {
    padding: 22px !important;
  }

  #dashboard .google-review-dashboard-card {
    padding: 18px !important;
  }
}


/* =====================================================
   DASHBOARD METRIC TITLES — MATCH GOOGLE REVIEWS TYPOGRAPHY
===================================================== */
#dashboard .metric-card-content > span {
  font-family: "Segoe UI", Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  color: #64748b !important;
}

/* V14 - Dashboard dynamic greeting */
#dashboardWelcomeGreeting {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0;
  margin-bottom: 2px;
}
@media (max-width: 700px) {
  #dashboardWelcomeGreeting {
    font-size: 14px;
  }
}

/* =====================================================
   V17 - TRAINING DATA & TRAINING VISIT
===================================================== */

.training-admin-form {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 13px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.resource-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 5px 18px rgba(15,23,42,.06);
  transform: translateY(-1px);
}

.resource-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.resource-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 19px;
}

.resource-main > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.resource-main strong {
  color: #0f172a;
  font-size: 14px;
}

.resource-main span,
.resource-main small {
  color: #64748b;
  font-size: 11px;
}

.resource-main p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  max-width: 800px;
}

.resource-download {
  flex: 0 0 auto;
  white-space: nowrap;
}

.visit-score {
  display: inline-flex !important;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e !important;
  font-weight: 700;
}

@media (max-width: 700px) {
  .resource-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-download {
    width: 100%;
  }

  .training-admin-form {
    padding: 12px;
  }
}

.sidebar-branch-brand{display:flex;align-items:center;gap:10px;min-width:0;padding:8px 10px 14px}.sidebar-branch-icon{width:36px;height:36px;flex:0 0 36px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.1)}.sidebar-branch-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}#sidebarBranchName{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:inherit;font-size:15px;font-weight:700}#dashboardWelcomeGreeting{font-size:15px;font-weight:600}

/* =====================================================
   V19 - PREMIUM CURRENT BRANCH IDENTITY
===================================================== */

.sidebar-branch-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  margin: 2px 8px 18px;
  padding: 11px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.105), rgba(255,255,255,.035));
  border: 1px solid rgba(255,255,255,.11);
  box-shadow:
    0 8px 24px rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.07);
  overflow: hidden;
}

.sidebar-branch-brand::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  right: -28px;
  top: -38px;
  border-radius: 50%;
  background: rgba(255,193,7,.10);
  pointer-events: none;
}

.branch-brand-icon {
  position: relative;
  z-index: 1;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #f7b928;
  background: linear-gradient(145deg, rgba(247,185,40,.18), rgba(247,185,40,.06));
  border: 1px solid rgba(247,185,40,.28);
  box-shadow:
    0 5px 14px rgba(247,185,40,.10),
    inset 0 1px 0 rgba(255,255,255,.08);
}

.branch-brand-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.branch-brand-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.branch-brand-label {
  color: rgba(255,255,255,.48);
  font-size: 8px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 1.25px;
}

#sidebarBranchName {
  display: block;
  min-width: 0;
  max-width: 155px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.1px;
}

@media (max-width: 700px) {
  .sidebar-branch-brand {
    margin-left: 5px;
    margin-right: 5px;
  }
}

/* V20 - Current Employees action icons */
.employee-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-left: 8px;
}

.icon-action {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: all .18s ease;
}

.icon-action:hover {
  transform: translateY(-1px);
}

.icon-edit {
  color: #d97706;
  background: #fff7ed;
  border-color: #fed7aa;
}

.icon-edit:hover {
  color: #b45309;
  background: #ffedd5;
  border-color: #fdba74;
  box-shadow: 0 4px 12px rgba(217,119,6,.14);
}

.icon-delete {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.icon-delete:hover {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
  box-shadow: 0 4px 12px rgba(220,38,38,.14);
}

/* V21 - Current Employees action buttons */
.employee-actions { display:inline-flex; align-items:center; gap:7px; }
.employee-actions .secondary { height:32px; min-width:58px; }
.icon-action { width:32px; height:32px; padding:0; border-radius:9px; border:1px solid transparent; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-size:15px; line-height:1; transition:transform .16s ease,box-shadow .16s ease,background .16s ease; }
.icon-edit { color:#d97706; background:#fff7ed; border-color:#fed7aa; }
.icon-edit:hover { color:#b45309; background:#ffedd5; box-shadow:0 4px 12px rgba(217,119,6,.15); transform:translateY(-1px); }
.icon-delete { color:#dc2626; background:#fef2f2; border-color:#fecaca; }
.icon-delete:hover { color:#b91c1c; background:#fee2e2; box-shadow:0 4px 12px rgba(220,38,38,.15); transform:translateY(-1px); }

/* V24 - actions are protected by RLS; delete means assessments only */
.employee-actions .icon-action {
  flex: 0 0 32px;
}

/* =====================================================
   V26 - INITIAL DATA LOADING STATES
===================================================== */
.app-loading-state {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
}

.app-spinner,
.inline-spinner {
  display: inline-block;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,.10);
  border-top-color: #f59e0b;
  animation: appSpinner .75s linear infinite;
}

.app-spinner {
  width: 22px;
  height: 22px;
}

.inline-spinner {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

@keyframes appSpinner {
  to { transform: rotate(360deg); }
}

/* =====================================================
   V28 - CURRENT EMPLOYEES PROFILE CARDS
===================================================== */

.employee-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 4px 0 8px;
}

.employee-profile-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, .06);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  outline: none;
}

.employee-profile-card:hover,
.employee-profile-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, .35);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
}

.employee-card-top {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.employee-card-photo {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  object-fit: cover;
  border-radius: 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.employee-card-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  color: #9ca3af;
}

.employee-card-photo-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  overflow: hidden;
}

.employee-photo-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #dbe3ed;
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: employeePhotoSpin .75s linear infinite;
}

.employee-card-photo-has-image {
  position: relative;
}

.employee-card-photo-has-image .employee-card-photo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 1;
  transition: opacity .22s ease;
}

.employee-card-photo-loaded {
  background: transparent;
}

@keyframes employeePhotoSpin {
  to { transform: rotate(360deg); }
}

.employee-card-identity {
  min-width: 0;
  flex: 1;
}

.employee-card-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #9ca3af;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.employee-card-identity h3 {
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-card-position {
  margin-top: 3px;
  overflow: hidden;
  color: #6b7280;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-card-score {
  flex: 0 0 70px;
  text-align: center;
  padding: 9px 6px;
  border-radius: 13px;
}

.employee-card-score strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.employee-card-score span {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.score-excellent { color:#15803d; background:#f0fdf4; }
.score-good { color:#2563eb; background:#eff6ff; }
.score-warning { color:#b45309; background:#fffbeb; }
.score-critical { color:#dc2626; background:#fef2f2; }

.employee-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.employee-card-info div {
  min-width: 0;
}

.employee-card-info span {
  display: block;
  margin-bottom: 3px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 600;
}

.employee-card-info strong {
  display: block;
  overflow: hidden;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}

.employee-card-hint {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 600;
}

.employee-card-footer .employee-actions {
  margin-left: auto;
}

.employee-cards-loading,
.employee-cards-empty {
  grid-column: 1 / -1;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.employee-cards-empty-icon {
  font-size: 30px;
  opacity: .55;
}

@media (max-width: 850px) {
  .employee-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .employee-profile-card {
    padding: 14px;
  }

  .employee-card-top {
    align-items: flex-start;
  }

  .employee-card-score {
    flex-basis: 62px;
  }

  .employee-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .employee-card-footer .employee-actions {
    width: 100%;
    justify-content: flex-end;
  }
}


/* =====================================================
   V31 POLISH - ADMIN / NOTIFICATIONS / TRAINING LIBRARY
===================================================== */
.google-review-branch-picker {
  min-width: 145px;
  max-width: 180px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}
.google-review-branch-picker:focus { border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(59,130,246,.08); }

.notification-group { display: grid; gap: 10px; margin-bottom: 22px; }
.notification-group.empty-group { opacity: .9; }
.notification-group-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 2px; }
.notification-group-head h3 { margin:0; font-size:14px; color:#0f172a; }
.notification-group-head span { min-width:24px; height:24px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; background:#f1f5f9; color:#475569; font-size:11px; font-weight:800; }
.notification-group:first-child .notification-group-head span { background:#fee2e2; color:#b91c1c; }
.notification-group-list { display:grid; gap:10px; }
.notification-group-empty { padding:14px 16px; border:1px dashed #cbd5e1; border-radius:12px; color:#94a3b8; font-size:13px; background:#f8fafc; }
.notification-unread-dot { display:inline-block; width:8px; height:8px; margin-right:8px; border-radius:50%; background:#dc2626; vertical-align:middle; box-shadow:0 0 0 4px #fee2e2; }
.notification-item.read { background:#fff; border-color:#e5e7eb; }
.notification-item.read .notification-item-message { color:#64748b; }
.notification-item:focus-visible { outline:3px solid rgba(37,99,235,.15); outline-offset:2px; }
.notification-status { font-weight:800; }
.notification-status.status-unread { color:#b91c1c; }
.notification-status.status-read { color:#64748b; }
.notification-open-hint { margin-top:8px; color:#94a3b8; font-size:11px; }
.notification-item.unread .notification-open-hint { color:#2563eb; font-weight:700; }

/* Training materials as a visual library */
#trainingMaterialList.resource-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.training-material-card { display:flex; flex-direction:column; min-width:0; overflow:hidden; border:1px solid #e2e8f0; border-radius:16px; background:#fff; box-shadow:0 6px 22px rgba(15,23,42,.05); transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.training-material-card:hover { transform:translateY(-2px); border-color:#cbd5e1; box-shadow:0 12px 28px rgba(15,23,42,.09); }
.training-material-preview { position:relative; height:150px; overflow:hidden; background:linear-gradient(135deg,#eff6ff,#f8fafc); border-bottom:1px solid #e5e7eb; }
.training-material-preview img { width:100%; height:100%; object-fit:cover; display:block; }
.training-material-preview iframe { width:100%; height:230px; border:0; transform:translateY(-2px) scale(1.02); transform-origin:top center; pointer-events:none; background:#fff; }
.training-file-cover { width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; color:#1e3a8a; }
.training-file-cover strong { font-size:30px; letter-spacing:.06em; }
.training-file-cover span { font-size:11px; font-weight:800; text-transform:uppercase; color:#64748b; }
.training-material-body { display:flex; flex-direction:column; gap:7px; padding:15px 16px 16px; min-width:0; }
.training-material-title { margin:0; color:#0f172a; font-size:15px; font-weight:800; line-height:1.35; }
.training-material-meta { display:flex; flex-wrap:wrap; gap:6px; color:#64748b; font-size:11px; }
.training-material-description { margin:2px 0 0; color:#64748b; font-size:12px; line-height:1.5; }
.training-material-actions { display:flex; justify-content:flex-end; margin-top:5px; }
@media (max-width:900px) { #trainingMaterialList.resource-list { grid-template-columns:1fr; } }
@media (max-width:650px) { .google-review-branch-picker { min-width:120px; max-width:140px; } }

.notification-detail-body { padding: 6px 2px 2px; }
.notification-detail-message { white-space: pre-wrap; line-height: 1.75; color:#334155; font-size:14px; padding:18px; border:1px solid #e2e8f0; border-radius:14px; background:#f8fafc; }

/* =====================================================
   V33 - PROFESSIONAL TRAINING VISITS
===================================================== */
.training-visits-grid {
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:4px 0 8px;
}
.training-visit-card {
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  box-shadow:0 3px 12px rgba(15,23,42,.045);
  padding:10px 12px;
  cursor:pointer;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
  outline:none;
}
.training-visit-card:hover,.training-visit-card:focus-visible {
  transform:translateY(-1px);
  border-color:rgba(245,158,11,.32);
  box-shadow:0 7px 18px rgba(15,23,42,.08);
}
.visit-card-main {
  display:grid;
  grid-template-columns:42px minmax(150px,1.45fr) minmax(160px,1.25fr) minmax(100px,.8fr) minmax(110px,.9fr) minmax(92px,.7fr) 98px auto;
  align-items:center;
  gap:12px;
  min-width:0;
}
.visit-card-icon {
  width:40px;height:40px;display:flex;align-items:center;justify-content:center;
  border-radius:12px;background:#fff7ed;font-size:18px;flex:0 0 40px;
}
.visit-card-field {min-width:0}
.visit-card-field span {
  display:block;color:#9ca3af;font-size:8px;font-weight:800;letter-spacing:.65px;margin-bottom:3px;
}
.visit-card-field strong {
  display:block;color:#243044;font-size:12px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.visit-branch-field strong {font-size:13px;color:#111827}
.visit-type-field strong {color:#52627a}
.visit-score {
  min-width:94px;
  min-height:48px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  border-radius:12px;
  padding:6px 8px;
  box-sizing:border-box;
  line-height:1;
}
.visit-score strong {display:block;font-size:17px;line-height:1.05;letter-spacing:-.2px}
.visit-score small {display:block;font-size:8px;line-height:1.15;text-transform:none;font-weight:800;margin-top:5px;white-space:normal;max-width:84px}
.visit-score-excellent{background:#ecfdf3;color:#15803d;border-color:#bbf7d0}
.visit-score-good{background:#fff7ed;color:#c2410c;border-color:#fed7aa}
.visit-score-warning{background:#fff7ed;color:#c2410c;border-color:#fed7aa}
.visit-score-critical{background:#fef2f2;color:#dc2626;border-color:#fecaca}
.visit-score-neutral{background:#f3f4f6;color:#4b5563}
.visit-card-actions {
  display:flex;align-items:center;justify-content:flex-end;gap:6px;white-space:nowrap;
}
.visit-card-actions button {
  height:34px;min-width:34px;padding:0 10px;border-radius:9px;border:1px solid #e2e8f0;background:#f8fafc;
  color:#334155;font:inherit;font-size:11px;font-weight:750;display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .15s ease,box-shadow .15s ease;
}
.visit-card-actions button:hover {transform:translateY(-1px);box-shadow:0 4px 10px rgba(15,23,42,.08)}
.visit-card-actions button svg {width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.visit-action-view {background:#eff6ff!important;border-color:#bfdbfe!important;color:#1d4ed8!important}
.visit-action-download {background:#f0fdf4!important;border-color:#bbf7d0!important;color:#15803d!important}
.visit-action-edit {background:#fff7ed!important;border-color:#fed7aa!important;color:#c2410c!important}
.visit-action-delete {background:#fef2f2!important;border-color:#fecaca!important;color:#dc2626!important}
.visit-card-actions button.is-loading {opacity:.7;pointer-events:none}
.visit-card-actions button.is-loading svg {animation:visitSpin .8s linear infinite}
@keyframes visitSpin {to{transform:rotate(360deg)}}
.visit-empty,.visit-loading {
  min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;
}
.visit-empty-icon{font-size:32px;opacity:.55}

.visit-details-modal {
  position:fixed;inset:0;z-index:9999;display:none;
}
.visit-details-modal.open {display:block}
.visit-details-backdrop {position:absolute;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(3px)}
.visit-details-dialog {
  position:relative;z-index:1;width:min(760px,calc(100% - 28px));max-height:calc(100vh - 40px);
  overflow:auto;margin:20px auto;background:#fff;border-radius:22px;padding:24px;
  box-shadow:0 25px 70px rgba(15,23,42,.25);
}
.visit-details-close {
  position:absolute;right:16px;top:12px;border:0;background:transparent;font-size:30px;color:#6b7280;cursor:pointer;
}
.visit-details-header {display:flex;align-items:center;gap:13px;padding-right:35px}
.visit-details-header>div:nth-child(2){flex:1}
.visit-details-header h2{margin:4px 0 2px;font-size:22px;color:#111827}
.visit-details-header p{margin:0;color:#6b7280;font-size:13px}
.visit-details-score{
  margin-left:auto;
  width:124px;
  min-width:124px;
  min-height:76px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:10px 8px;
  box-sizing:border-box;
  border-radius:16px;
  background:#f8fafc;
  border:1px solid #eef2f7;
}
.visit-details-score strong{display:block;font-size:25px;line-height:1;color:#111827;letter-spacing:-.4px}
.visit-details-score small{display:block;font-size:10px;line-height:1.2;color:#64748b;text-transform:none;font-weight:800;margin-top:6px;max-width:108px}
.visit-details-score.visit-score-excellent{background:#ecfdf3;color:#15803d;border-color:#bbf7d0}
.visit-details-score.visit-score-good{background:#fff7ed;color:#c2410c;border-color:#fed7aa}
.visit-details-score.visit-score-warning{background:#fff7ed;color:#c2410c;border-color:#fed7aa}
.visit-details-score.visit-score-critical{background:#fef2f2;color:#dc2626;border-color:#fecaca}
.visit-details-score.visit-score-neutral{background:#f3f4f6;color:#4b5563;border-color:#e5e7eb}
.visit-details-score.visit-score-excellent strong,.visit-details-score.visit-score-good strong,.visit-details-score.visit-score-warning strong,.visit-details-score.visit-score-critical strong,.visit-details-score.visit-score-neutral strong{color:inherit}
.visit-details-score.visit-score-excellent small,.visit-details-score.visit-score-good small,.visit-details-score.visit-score-warning small,.visit-details-score.visit-score-critical small,.visit-details-score.visit-score-neutral small{color:inherit;opacity:.9}
.visit-details-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:22px;padding:18px 0;border-top:1px solid #eef0f2;border-bottom:1px solid #eef0f2}
.visit-details-notes{margin-top:18px}
.visit-details-notes p{margin:7px 0 0;padding:14px;background:#f8fafc;border-radius:12px;color:#374151;font-size:13px;line-height:1.6;white-space:pre-wrap}
.visit-details-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.visit-details-actions button.is-loading{opacity:.75;cursor:wait;pointer-events:none}
.visit-report-spinner{width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;display:inline-block;animation:visitSpin .7s linear infinite}
@media(max-width:1100px){
  .visit-card-main{grid-template-columns:40px minmax(130px,1.2fr) minmax(140px,1fr) minmax(90px,.75fr) minmax(100px,.8fr) 86px auto;}
  .visit-card-field:nth-of-type(5){display:none}
}
@media(max-width:850px){
  .training-visits-grid{gap:10px}
  .visit-card-main{grid-template-columns:40px minmax(130px,1.2fr) minmax(120px,1fr) minmax(90px,.7fr) 88px auto;}
  .visit-card-field:nth-of-type(4),.visit-card-field:nth-of-type(5){display:none}
}
@media(max-width:600px){
  .visit-card-main{grid-template-columns:36px minmax(0,1fr) 82px auto;gap:8px}
  .visit-card-icon{width:36px;height:36px;font-size:16px}
  .visit-type-field,.visit-date-field{display:none}
  .visit-card-actions{gap:4px}
  .visit-card-actions button{width:34px;min-width:34px;padding:0}
  .visit-card-actions button span{display:none}
  .visit-score{min-width:78px}
  .visit-score strong{font-size:14px}
  .visit-details-grid{grid-template-columns:1fr}
  .visit-details-header{align-items:flex-start}
  .visit-details-score{width:92px;min-width:92px;min-height:66px;padding:8px 6px}.visit-details-score strong{font-size:21px}.visit-details-score small{font-size:9px}
  .visit-details-actions{flex-direction:column}
}

/* =====================================================
   TRAINING MATERIAL EDIT + THUMBNAIL
===================================================== */
.resource-form-heading {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
}
.resource-form-help {
  margin: 8px 0 0;
  font-size: 11px;
}
.training-material-actions {
  gap: 8px;
}
.resource-edit-material {
  color: #c2410c;
  border-color: #fed7aa;
  background: #fff7ed;
}
.resource-edit-material:hover {
  border-color: #fdba74;
  background: #ffedd5;
}

/* =====================================================
   SIDEBAR V21 - PREMIUM CORPORATE REFRESH
   Visual-only refinement: navigation functionality unchanged.
===================================================== */
.sidebar {
  width: 276px;
  min-width: 276px;
  padding: 20px 12px 14px;
  background:
    radial-gradient(circle at 15% 0%, rgba(245,197,66,.055), transparent 28%),
    linear-gradient(180deg, #0b1220 0%, #101827 48%, #0a111d 100%);
  border-right: 1px solid rgba(255,255,255,.055);
  box-shadow: 12px 0 34px rgba(2,8,23,.12);
}

.sidebar nav {
  gap: 4px;
  padding: 2px 4px 0;
}

.nav {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 13px;
  color: #9aa8ba;
  font-size: 13px;
  font-weight: 600;
}

.nav::before {
  left: -8px;
  top: 10px;
  width: 3px;
  height: 28px;
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  width: 35px;
  height: 35px;
  flex-basis: 35px;
  border-radius: 10px;
  color: #8e9caf;
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.055);
}

.nav:hover {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.065);
  color: #f3f6fa;
  transform: translateX(1px);
  box-shadow: none;
}

.nav.active {
  background: linear-gradient(90deg, rgba(245,197,66,.105), rgba(255,255,255,.045));
  border-color: rgba(245,197,66,.13);
  color: #fff;
  transform: translateX(1px);
  box-shadow: 0 7px 20px rgba(0,0,0,.12);
}

.nav.active::before {
  height: 30px;
  background: #f5c542;
  box-shadow: 0 0 10px rgba(245,197,66,.25);
}

.nav.active .nav-icon,
.nav:hover .nav-icon {
  color: #f5c542;
  background: rgba(245,197,66,.10);
  border-color: rgba(245,197,66,.16);
}

.notification-badge {
  background: #f5c542;
  box-shadow: 0 3px 10px rgba(245,197,66,.18);
}

.sidefoot {
  padding: 12px 4px 2px;
}

#userEmail {
  padding: 11px 12px;
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.065);
  border-radius: 12px;
  color: #9aa8ba;
}

.logout {
  margin-top: 8px;
  min-height: 40px;
  border-color: rgba(255,255,255,.07);
  border-radius: 11px;
  color: #aeb9c9;
  transition: all .2s ease;
}

.logout:hover {
  color: #fff;
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.11);
}

@media (max-width: 700px) {
  .sidebar {
    width: 276px;
    min-width: 276px;
  }
}


/* ======================================================
   V40 - PASSWORD RESET + INITIAL DATA LOADING
====================================================== */
.text-link-button{
  width:auto;
  margin:10px auto 0;
  padding:4px 6px;
  border:0;
  background:transparent;
  color:#64748b;
  font:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.text-link-button:hover{color:#b7791f;text-decoration:underline}
.password-reset-panel{
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid #e5e7eb;
}
.password-reset-head{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:14px;
}
.password-reset-head strong{font-size:15px;color:#0f172a}
.password-reset-head span{font-size:11px;color:#64748b;line-height:1.5}
.password-reset-panel .full{margin-top:4px}
.password-reset-panel label{margin-top:12px}
.password-reset-panel .text-link-button{display:block}
.reset-resend-button{margin-top:8px !important;font-size:11px !important}
.reset-resend-button:disabled{opacity:.5;cursor:not-allowed;text-decoration:none}

/* =====================================================
   V42 - DASHBOARD INLINE DATA LOADING
===================================================== */
.dashboard-value-loading {
  min-width: 28px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-value-loading .inline-spinner {
  width: 18px;
  height: 18px;
  margin: 0;
}

.dashboard-chart-loading {
  opacity: .45;
  transition: opacity .2s ease;
}

.dashboard-meta-loading {
  opacity: .55;
}

@media (max-width:520px) {
  .dashboard-value-loading {
    min-width: 24px;
  }
}


/* ======================================================
   V41 - MOBILE NAVIGATION / RESPONSIVE POLISH
====================================================== */
.mobile-menu-btn,
.mobile-sidebar-backdrop{display:none}

@media (max-width:700px){
  .app{min-height:100dvh;overflow-x:hidden}
  .sidebar{
    position:fixed;
    z-index:1200;
    top:0;
    left:0;
    bottom:0;
    width:min(286px,86vw) !important;
    min-width:0 !important;
    max-width:86vw;
    overflow-y:auto;
    transform:translateX(-105%);
    transition:transform .22s ease;
    box-shadow:18px 0 45px rgba(2,8,23,.25);
  }
  .sidebar.mobile-open{transform:translateX(0)}
  .mobile-sidebar-backdrop{
    position:fixed;
    inset:0;
    z-index:1190;
    display:block;
    background:rgba(15,23,42,.42);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
  }
  .mobile-sidebar-backdrop.show{
    opacity:1;
    pointer-events:auto;
  }
  .main{
    width:100%;
    max-width:none;
    min-width:0;
    padding:18px 14px 28px;
    margin:0;
    box-sizing:border-box;
  }
  .top{
    gap:10px;
    margin-bottom:20px;
    align-items:flex-start;
  }
  .top > div{min-width:0;flex:1}
  .top h1{
    font-size:22px;
    line-height:1.2;
    word-break:break-word;
  }
  .mobile-menu-btn{
    display:inline-flex;
    flex:0 0 40px;
    width:40px;
    height:40px;
    align-items:center;
    justify-content:center;
    padding:0;
    border:1px solid #e2e8f0;
    border-radius:11px;
    background:#fff;
    color:#334155;
    box-shadow:0 4px 14px rgba(15,23,42,.06);
    cursor:pointer;
  }
  .mobile-menu-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
  #newBtn{white-space:nowrap;font-size:11px;padding:9px 10px}
  .panel{padding:16px}
  .grid{grid-template-columns:1fr !important}
  .cards{grid-template-columns:1fr !important}
  .table-wrap,
  .table-responsive,
  .records-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  input,select,textarea,button{max-width:100%}
}


/* ======================================================
   TRAINING MATRIX
   ====================================================== */
.matrix-toolbar{display:flex;gap:12px;align-items:center;margin:4px 0 18px;flex-wrap:wrap}.matrix-toolbar input,.matrix-toolbar select{min-height:44px;border:1px solid var(--border,#e5e7eb);border-radius:12px;padding:0 14px;background:#fff;color:inherit}.matrix-toolbar input{flex:1;min-width:220px}.matrix-summary{display:flex;gap:8px;flex-wrap:wrap}.matrix-pill{padding:7px 11px;border-radius:999px;font-size:12px;font-weight:700}.matrix-pill-danger{background:#fef2f2;color:#b91c1c}.matrix-pill-success{background:#f0fdf4;color:#15803d}.training-matrix-wrap{width:100%;overflow:hidden}.training-matrix-table{min-width:850px}.training-matrix-table th,.training-matrix-table td{vertical-align:middle}.training-matrix-table td:first-child{min-width:170px}.training-matrix-table td:first-child small{display:block;color:#6b7280;margin-top:3px}.matrix-score{display:inline-flex;min-width:54px;justify-content:center;padding:5px 8px;border-radius:9px;font-size:12px;font-weight:800}.matrix-score-good{background:#ecfdf5;color:#047857}.matrix-score-bad{background:#fef2f2;color:#b91c1c}.matrix-score-empty{background:#f3f4f6;color:#9ca3af}.matrix-overall{font-size:16px}.matrix-status{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}.matrix-status-needs{background:#fff7ed;color:#c2410c}.matrix-status-ready{background:#ecfdf5;color:#047857}.matrix-loading,.matrix-empty{min-height:220px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;text-align:center;color:#374151}.matrix-empty>div{font-size:32px}@media(max-width:760px){.matrix-toolbar{align-items:stretch}.matrix-toolbar input,.matrix-toolbar select{width:100%;min-width:0}.training-matrix-wrap{overflow-x:auto}.training-matrix-table{font-size:12px}.matrix-summary{margin-top:8px}}

/* ======================================================
   CURRENT EMPLOYEES + TRAINING INTEGRATION
   ====================================================== */
.current-employees-training-toolbar{display:flex;justify-content:flex-end;margin:0 0 14px}.training-filter-group{display:flex;gap:8px;flex-wrap:wrap}.training-filter-btn{border:1px solid var(--border,#e5e7eb);background:var(--surface,#fff);color:inherit;border-radius:10px;padding:8px 12px;cursor:pointer;font:inherit}.training-filter-btn.active{background:rgba(0,0,0,.07);font-weight:700}.employee-training-inline{margin:14px 0 0;padding:12px 0 0;border-top:1px solid var(--border,#e5e7eb)}.employee-training-inline-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.training-loading-mini{display:inline-flex;align-items:center;gap:6px;font-size:12px;opacity:.65}.training-progress-row{display:flex;align-items:center;gap:9px;margin-top:8px}.training-progress-value{min-width:40px;font-weight:800}.training-progress-track{flex:1;height:7px;border-radius:999px;background:rgba(0,0,0,.08);overflow:hidden}.training-progress-fill{height:100%;border-radius:inherit;background:currentColor}.employee-training-stations{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}.training-station-chip{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:4px 7px;font-size:11px;font-weight:700}.training-status-badge{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800}.training-status-ready{background:#ecfdf5;color:#047857}.training-status-needs{background:#fff7ed;color:#c2410c}.training-status-overdue{background:#fef2f2;color:#b91c1c}.employee-training-view-btn{width:100%;margin-top:10px;border:1px solid var(--border,#e5e7eb);background:transparent;border-radius:9px;padding:8px 10px;cursor:pointer;font:inherit}.employee-training-profile-modal{position:fixed;inset:0;z-index:10000}.employee-training-profile-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55);backdrop-filter:blur(4px)}.employee-training-profile-dialog{position:relative;width:min(860px,calc(100% - 28px));max-height:calc(100vh - 40px);overflow:auto;margin:20px auto;padding:22px;border-radius:18px;background:var(--surface,#fff);box-shadow:0 25px 70px rgba(0,0,0,.28)}.employee-training-profile-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.employee-training-profile-header h2{margin:4px 0}.employee-training-profile-header p{margin:0;opacity:.65}.employee-training-profile-body{margin-top:18px}.employee-training-profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.employee-training-profile-section{border:1px solid var(--border,#e5e7eb);border-radius:14px;padding:14px}.profile-label{font-size:11px;letter-spacing:.06em;opacity:.6}.profile-score{font-size:34px;font-weight:900;margin:6px 0}.profile-score-small{font-size:22px;font-weight:800;margin:8px 0}.profile-history-row{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;padding:9px 0;border-bottom:1px solid var(--border,#e5e7eb)}.profile-history-row:last-child{border-bottom:0}.training-gap-alert{padding:10px 12px;border-radius:10px;background:#fff7ed;color:#9a3412}.training-gap-success{padding:10px 12px;border-radius:10px;background:#ecfdf5;color:#047857}@media(max-width:700px){.current-employees-training-toolbar{justify-content:flex-start}.training-filter-group{overflow-x:auto;flex-wrap:nowrap;width:100%}.training-filter-btn{white-space:nowrap}.employee-training-profile-dialog{margin:10px auto;max-height:calc(100vh - 20px);padding:16px}.employee-training-profile-grid{grid-template-columns:1fr}.profile-history-row{grid-template-columns:1fr auto}.profile-history-row .training-status-badge{grid-column:1/-1;justify-self:start}}

/* ADMIN BRANCH CONTROL */
.admin-branch-scope{margin:18px 0 22px;padding:22px 24px;border:1px solid rgba(17,24,39,.09);border-radius:20px;background:linear-gradient(135deg,#fff 0%,#f8fafc 100%);box-shadow:0 12px 30px rgba(15,23,42,.06);display:flex;align-items:center;justify-content:space-between;gap:24px}
.admin-scope-copy h2{margin:4px 0;font-size:22px}.admin-scope-copy p{margin:0;max-width:720px}.admin-scope-control{position:relative;min-width:260px}
.admin-scope-trigger{width:100%;min-height:48px;padding:0 14px;border:1px solid #dbe3ed;border-radius:12px;background:#fff;color:#172033;font-weight:700;display:flex;align-items:center;gap:10px;justify-content:space-between;cursor:pointer;box-shadow:0 4px 12px rgba(15,23,42,.04)}
.admin-scope-trigger-icon{color:#f59e0b}.admin-scope-chevron{color:#7b8798}.admin-scope-menu{position:absolute;z-index:80;top:56px;right:0;width:330px;max-height:430px;overflow:auto;padding:10px;border:1px solid #dbe3ed;border-radius:16px;background:#fff;box-shadow:0 20px 45px rgba(15,23,42,.16);display:none}
.admin-branch-scope.open .admin-scope-menu{display:block}.admin-scope-all,.admin-scope-option{width:100%;min-height:42px;padding:8px 10px;border-radius:10px;display:flex;align-items:center;gap:10px;color:#253044;background:transparent;border:0;text-align:left;font-size:14px;cursor:pointer}
.admin-scope-option input{position:absolute;opacity:0;pointer-events:none}.admin-scope-all:hover,.admin-scope-option:hover,.admin-scope-option.selected,.admin-scope-all.selected{background:#f7f9fc}
.admin-scope-check{width:22px;height:22px;border-radius:7px;border:1px solid #d4dce7;display:grid;place-items:center;font-size:13px;color:#fff;background:#fff;flex:0 0 22px}
.admin-scope-option.selected .admin-scope-check,.admin-scope-all.selected .admin-scope-check{background:#111827;border-color:#111827}.admin-scope-divider{height:1px;background:#eef1f5;margin:8px 2px}
.admin-scope-footer{position:sticky;bottom:0;background:#fff;padding:10px 2px 2px;display:flex;justify-content:flex-end;gap:8px;border-top:1px solid #eef1f5;margin-top:8px}
.admin-scope-clear,.admin-scope-apply{min-height:38px;padding:0 14px}
.reports-lines,.reports-fold{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.reports-fold{stroke-opacity:.65}

/* COMBINED EMPLOYEE VIEW */
.combined-view-loading{min-height:280px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.combined-employee-header{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:4px 0 20px}.combined-employee-main{display:flex;align-items:center;gap:16px;min-width:0}.combined-employee-main h2{margin:4px 0 3px;font-size:25px}.combined-employee-main p{margin:0;color:#7a8799}.combined-employee-main p span{margin:0 5px}
.combined-employee-photo{width:82px;height:82px;border-radius:20px;object-fit:cover;border:1px solid #e2e8f0;background:#f5f7fa}.combined-employee-photo.placeholder{display:grid;place-items:center;font-size:34px}.combined-score-card{min-width:145px;padding:16px 18px;border-radius:18px;text-align:center;background:#f8fafc;border:1px solid #e7ebf1}.combined-score-card strong{display:block;font-size:30px;line-height:1}.combined-score-card span{display:block;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;margin-top:6px}.combined-score-card small{display:block;margin-top:6px}
.combined-score-card.score-excellent,.combined-score-card.score-good{background:#f0fdf4;border-color:#bbf7d0;color:#15803d}.combined-score-card.score-warning{background:#fffbeb;border-color:#fde68a;color:#b45309}.combined-score-card.score-critical{background:#fef2f2;border-color:#fecaca;color:#dc2626}
.combined-info-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:14px 0;border-top:1px solid #edf0f4;border-bottom:1px solid #edf0f4}.combined-info-grid div{padding:9px 10px}.combined-info-grid span{display:block;font-size:11px;color:#8a96a8;text-transform:uppercase;font-weight:800;letter-spacing:.06em}.combined-info-grid strong{display:block;margin-top:4px;color:#1c2738}
.combined-section{margin-top:20px;padding:18px;border:1px solid #e9edf2;border-radius:16px;background:#fff}.combined-section-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:15px}.combined-section-head h3{margin:3px 0 0}.combined-history-count{font-size:12px;color:#7c8798;font-weight:700}
.combined-progress>div{display:flex;align-items:center;gap:14px}.combined-progress>div>strong{font-size:26px;min-width:58px}.combined-progress>span{display:block;margin-top:8px;color:#7c8798;font-size:12px}.combined-stations{margin-top:16px;display:grid;gap:10px}
.combined-station-row{display:grid;grid-template-columns:180px 1fr 55px;align-items:center;gap:12px}.combined-station-row>span{font-size:13px;font-weight:700;color:#344054}.combined-station-bar{height:8px;background:#edf0f4;border-radius:99px;overflow:hidden}.combined-station-bar span{display:block;height:100%;border-radius:99px;background:#f59e0b}.combined-score-good{color:#16a34a}.combined-score-needs{color:#dc2626}
.combined-history-list{display:grid;gap:8px}.combined-history-row{display:grid;grid-template-columns:1fr auto auto;gap:15px;align-items:center;padding:11px 12px;border-radius:11px;background:#f8fafc}.combined-history-row.latest{background:#f4f8ff;border:1px solid #dbeafe}.combined-history-row div{display:flex;gap:15px;align-items:center}.combined-history-row div span{font-size:12px;color:#7c8798}.employee-training-inline-note{font-size:12px;color:#8792a4;margin-top:8px}

/* SUCCESS CONFIRMATION */
.success-modal{position:fixed;inset:0;z-index:2000;display:grid;place-items:center}.success-modal.hidden{display:none}.success-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.34);backdrop-filter:blur(5px)}.success-modal-dialog{position:relative;width:min(360px,calc(100vw - 32px));padding:32px 28px 30px;background:#fff;border-radius:24px;text-align:center;box-shadow:0 25px 80px rgba(15,23,42,.25);animation:successPop .28s ease-out}.success-check-wrap{width:78px;height:78px;margin:0 auto 16px}.success-check-wrap svg{width:100%;height:100%}.success-check-circle{fill:#ecfdf3;stroke:#22c55e;stroke-width:2.5;stroke-dasharray:176;stroke-dashoffset:176;animation:successCircle .45s .05s ease-out forwards}.success-check-path{fill:none;stroke:#16a34a;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:45;stroke-dashoffset:45;animation:successPath .35s .35s ease-out forwards}.success-modal-dialog h2{margin:0;font-size:25px;color:#142033}.success-modal-dialog p{margin:8px 0 0;color:#7b8798}
@keyframes successPop{from{opacity:0;transform:scale(.92) translateY(8px)}to{opacity:1;transform:none}}@keyframes successCircle{to{stroke-dashoffset:0}}@keyframes successPath{to{stroke-dashoffset:0}}
@media(max-width:760px){.admin-branch-scope{align-items:stretch;flex-direction:column;padding:18px}.admin-scope-control{min-width:0}.admin-scope-menu{width:100%;right:0}.combined-employee-header{align-items:flex-start;flex-direction:column}.combined-score-card{width:100%;min-width:0}.combined-info-grid{grid-template-columns:repeat(2,1fr)}.combined-station-row{grid-template-columns:1fr 60px}.combined-station-bar{grid-column:1/-1;grid-row:2}.combined-station-row>strong{grid-column:2;grid-row:1;text-align:right}.combined-history-row{grid-template-columns:1fr auto}.combined-history-row>span{grid-column:2}.combined-history-row div{grid-column:1/-1}}

/* V11 - Fixed sidebar while main page scrolls */
@media (min-width: 651px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    align-self: flex-start;
  }
  .app {
    align-items: flex-start;
  }
}
/* Non-scored Training Visits */
#visitScore:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

/* ======================================================
   V13 ADMIN CONTROL CENTER
   ====================================================== */
.admin-control-center-top{
  order:-100;
  width:100%;
  margin:0 0 18px;
  padding:18px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
}
.admin-control-center-top .admin-control-center-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
}
.admin-control-center-top .admin-branch-selector{
  min-width:280px;
}
.admin-control-center-top .admin-branch-selector select{
  width:100%;
  min-height:44px;
}
.admin-control-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.admin-stat{
  padding:13px 14px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.07);
}
.admin-stat span{display:block;font-size:12px;opacity:.65}
.admin-stat strong{display:block;font-size:24px;margin-top:3px}
.admin-control-center-top.hidden{display:none!important}
.admin-scope-hint{font-size:12px;opacity:.65;margin-top:6px}
@media(max-width:760px){
  .admin-control-center-top .admin-control-center-head{flex-direction:column;align-items:stretch}
  .admin-control-center-top .admin-branch-selector{min-width:0}
  .admin-control-stats{grid-template-columns:1fr}
}

/* V14: fixed Admin Control Center */


/* V15: polished Admin Training Visit actions */
.visit-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.visit-card-actions button{font-family:inherit;transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease,opacity .16s ease}
.visit-card-actions .visit-action-view{min-height:40px;padding:0 18px;border-radius:11px;font-weight:750}
.visit-card-actions .visit-action-edit,.visit-card-actions .visit-action-delete{min-height:40px;padding:0 13px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:750;border:1px solid transparent;cursor:pointer;background:#fff}
.visit-card-actions .visit-action-edit{color:#b45309;border-color:#fed7aa;background:#fffaf3}
.visit-card-actions .visit-action-delete{color:#dc2626;border-color:#fecaca;background:#fff7f7}
.visit-card-actions .visit-action-edit:hover,.visit-card-actions .visit-action-delete:hover,.visit-card-actions .visit-action-view:hover{transform:translateY(-1px);box-shadow:0 7px 16px rgba(15,23,42,.09)}
.visit-card-actions .visit-action-edit:active,.visit-card-actions .visit-action-delete:active,.visit-card-actions .visit-action-view:active{transform:translateY(0)}
.visit-card-actions svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.visit-card-actions button:disabled{opacity:.6;cursor:wait;transform:none;box-shadow:none}
.visit-card-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}

/* Keep the Admin Control Center at the top of the page content. */
.admin-branch-scope{margin:0 0 20px!important}
@media(max-width:760px){.visit-card-footer{align-items:stretch}.visit-card-actions{width:100%;justify-content:flex-start}.visit-card-actions .visit-action-view{flex:1}}

/* V19 settings, faster material thumbnails, compact cards and mobile hardening */
.settings-panel{max-width:980px}.settings-section{display:flex;justify-content:space-between;gap:28px;align-items:center;padding:24px;border:1px solid #e2e8f0;border-radius:18px;background:linear-gradient(135deg,#fff,#f8fafc)}.settings-section-copy{display:flex;align-items:flex-start;gap:14px;min-width:0}.settings-section-copy h3{margin:0 0 5px;color:#0f172a;font-size:18px}.settings-section-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;background:#eef4ff;border:1px solid #dbe7ff;color:#2563eb;font-weight:800}.language-options{display:flex;gap:10px;min-width:360px}.language-option{display:flex;align-items:center;gap:10px;flex:1;text-align:left;border:1px solid #dbe2ea;background:#fff;border-radius:14px;padding:12px 14px;cursor:pointer;color:#172033}.language-option.selected{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.1);background:#f8fbff}.language-option strong,.language-option small{display:block}.language-option small{margin-top:2px;color:#64748b;font-size:11px}.language-flag{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#f1f5f9;font-weight:800}.language-check{margin-left:auto;opacity:0;color:#16a34a;font-weight:900}.language-option.selected .language-check{opacity:1}
.training-material-preview{height:128px;aspect-ratio:1.45/1}.training-preview-image{background:#eef2f7;opacity:.35;transition:opacity .18s}.training-preview-image.is-loaded{opacity:1}#trainingMaterialList.resource-list{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}.training-material-card{min-height:0}
@media(max-width:1100px){#trainingMaterialList.resource-list{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){#trainingMaterialList.resource-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.training-material-preview{height:110px}.training-material-body{padding:11px}.training-material-description{display:none}.settings-section{flex-direction:column;align-items:stretch}.language-options{min-width:0;width:100%}}@media(max-width:430px){#trainingMaterialList.resource-list{grid-template-columns:1fr}.language-options{flex-direction:column}}
@media(max-width:700px){html,body{width:100%;max-width:100%;overflow-x:hidden}.main{width:100%;min-width:0}.panel,.card,.metric-card,.admin-branch-scope{max-width:100%;min-width:0}input,select,textarea,button{max-width:100%}.grid{grid-template-columns:1fr!important}.visit-details-dialog{width:min(94vw,720px);max-height:92dvh;overflow:auto}.visit-details-grid{grid-template-columns:1fr!important}.visit-details-actions{flex-wrap:wrap}.visit-details-actions button{flex:1 1 140px}.admin-scope-menu{max-height:70dvh;overflow:auto}.tablewrap{max-width:100%;overflow-x:auto}}.rtl-ui .sidebar{left:auto;right:0}.rtl-ui .main{direction:rtl}.rtl-ui .sidebar{direction:rtl}.rtl-ui .language-option{text-align:right}.rtl-ui .language-check{margin-left:0;margin-right:auto}

@media(max-width:700px){
  .rtl-ui .sidebar{left:auto;right:0;transform:translateX(105%);box-shadow:-18px 0 45px rgba(2,8,23,.25)}
  .rtl-ui .sidebar.mobile-open{transform:translateX(0)}
}

/* V20 settings icon + report view button */
.settings-icon{
  width:20px;
  height:20px;
  display:block;
  fill:currentColor;
  flex:0 0 auto;
}
.view-report-btn,.btn-view-report,[data-view-report],[data-report-view]{
  cursor:pointer;
}
.view-report-btn:disabled,.btn-view-report:disabled,[data-view-report]:disabled,[data-report-view]:disabled{
  opacity:.65;
  cursor:wait;
}

.settings-icon{width:20px;height:20px;display:block;fill:currentColor;flex:0 0 auto}
.nav[data-page="settings"] .settings-icon{stroke:none}

/* V22: Settings icon - matches the existing sidebar icon family */
.settings-nav-icon{
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 20px;
  fill: currentColor;
  color: inherit;
}
.nav-item .settings-nav-icon,
.sidebar .settings-nav-icon{
  opacity: .92;
}
.nav-item:hover .settings-nav-icon,
.nav-item.active .settings-nav-icon{
  opacity: 1;
}


/* =====================================================
   DASHBOARD — REFERENCE CARD DESIGN
   Visual treatment only. Existing card dimensions,
   typography scale, values and data behavior stay intact.
===================================================== */
#dashboard .metric-card {
  position: relative !important;
  overflow: hidden !important;
  display: block !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  isolation: isolate;
}

#dashboard .metric-card::before {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 0;
  height: 118px;
  z-index: -1;
  border-radius: 18px 18px 48% 48%;
  background: linear-gradient(180deg, #eef5ff 0%, #e6f0ff 76%, rgba(230,240,255,0.08) 100%);
}
#dashboard .metric-completed::before {
  background: linear-gradient(180deg, #effbf5 0%, #e3f7ec 76%, rgba(227,247,236,0.08) 100%);
}
#dashboard .metric-score::before {
  background: linear-gradient(180deg, #fffaf0 0%, #fff0cc 76%, rgba(255,240,204,0.08) 100%);
}

#dashboard .metric-top-decor {
  position: absolute;
  inset: 0 0 auto 0;
  height: 126px;
  pointer-events: none;
}
#dashboard .metric-dots {
  position: absolute;
  left: 42px;
  top: 50px;
  width: 42px;
  height: 34px;
  opacity: .72;
  background-image: radial-gradient(circle, #5ea0ff 1.7px, transparent 1.9px);
  background-size: 12px 10px;
}
#dashboard .metric-completed .metric-dots,
#dashboard .metric-score .metric-dots {
  background-image: radial-gradient(circle, #5ed79c 1.7px, transparent 1.9px);
}

#dashboard .metric-top-icon {
  position: absolute;
  right: 36px;
  top: 40px;
  width: 82px;
  height: 62px;
  overflow: visible;
}
#dashboard .emp-icon-primary { fill: #438ff4; }
#dashboard .emp-icon-secondary { fill: #a7c9ff; }
#dashboard .emp-icon-primary-fill { fill: #438ff4; }
#dashboard .emp-icon-secondary-fill { fill: #a7c9ff; }
#dashboard .cap-main { fill: #45c87e; }
#dashboard .cap-line { stroke: #45c87e; stroke-width: 3; stroke-linecap: round; }
#dashboard .chart-axis { stroke: #4bc983; stroke-width: 3; stroke-linecap: round; }
#dashboard .chart-bar { fill: #4bc983; }
#dashboard .chart-trend { fill: none; stroke: #4bc983; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }

#dashboard .metric-card-content {
  position: absolute !important;
  left: 30px;
  right: 30px;
  bottom: 30px;
  min-width: 0;
  z-index: 2;
}
#dashboard .metric-card-content > span {
  white-space: nowrap !important;
}

#dashboard .metric-card-content > strong {
  margin-top: 14px !important;
}

#dashboard .metric-completed .metric-visual,
#dashboard .metric-score .metric-visual {
  position: absolute !important;
  right: 34px;
  bottom: 30px;
  z-index: 2;
}

#dashboard .metric-completed .metric-visual {
  width: 78px !important;
  height: 78px !important;
}
#dashboard .metric-completed .completion-visual small {
  font-size: 13px !important;
}
#dashboard .metric-score .score-visual {
  width: 96px !important;
  height: 72px !important;
  margin: 0 !important;
}

@media (max-width: 700px) {
  #dashboard .metric-top-decor { height: 112px; }
  #dashboard .metric-dots { left: 28px; top: 44px; }
  #dashboard .metric-top-icon { right: 24px; top: 34px; width: 72px; height: 56px; }
  #dashboard .metric-card-content { left: 22px; right: 22px; bottom: 22px; }
  #dashboard .metric-completed .metric-visual,
  #dashboard .metric-score .metric-visual { right: 22px; bottom: 22px; }
}


/* ===== Stabilization v31: notification management ===== */
.notification-history-message{margin-top:4px;font-size:.82rem;color:var(--muted,#64748b);max-width:360px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.notification-history-expiry{margin-top:3px;font-size:.78rem;color:var(--muted,#64748b)}.notification-history-priority{display:inline-flex}.notification-delete-btn{min-width:72px}.notification-expiry{font-size:.78rem;color:var(--muted,#64748b)}

/* ===== Stabilization v31: action plans ===== */
.visit-action-actionplan,.visit-details-actionplan{display:inline-flex;align-items:center;justify-content:center;gap:7px}.visit-action-actionplan svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.action-plan-modal-card{width:min(860px,calc(100vw - 28px));max-height:90vh;overflow:auto}.action-plan-create-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:4px 0 8px}.action-plan-create-grid label{display:flex;flex-direction:column;gap:7px;font-weight:600}.action-plan-create-grid label.full{grid-column:1/-1}.action-plan-create-grid input,.action-plan-create-grid select,.action-plan-create-grid textarea{width:100%;box-sizing:border-box}.action-plan-actions{display:flex;justify-content:flex-end;padding:8px 0 18px}.action-plan-history{border-top:1px solid rgba(100,116,139,.18);padding-top:18px}.action-plan-history-list{display:grid;gap:10px}.action-plan-history-item{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:14px 16px;border:1px solid rgba(100,116,139,.16);border-radius:14px;background:rgba(248,250,252,.72)}.action-plan-history-item p{margin:5px 0;color:var(--muted,#64748b)}.action-plan-history-item small{text-transform:capitalize;color:var(--muted,#64748b)}

/* ===== Stabilization v31: Google Reviews admin selector ===== */
.google-review-branch-picker{min-width:190px;border-radius:10px;border:1px solid rgba(100,116,139,.22);padding:8px 30px 8px 10px;font-weight:600;background:#fff}.google-review-dashboard-card .google-review-actions{gap:10px;align-items:center}.google-review-dashboard-card:has(.google-review-branch-picker:not(.hidden)) .google-review-title-wrap:after{content:"ADMIN CONTROL CENTER";display:block;font-size:10px;letter-spacing:.12em;font-weight:800;margin-top:4px;opacity:.62}

@media(max-width:700px){.action-plan-create-grid{grid-template-columns:1fr}.action-plan-create-grid label.full{grid-column:auto}.action-plan-history-item{align-items:flex-start;flex-direction:column}.google-review-branch-picker{min-width:150px;max-width:180px}}
