:root {
  --bg-gradient-start: #0a0f1d;
  --bg-gradient-end: #161d2f;
  --card-bg: #111827;
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: #1f293d;
  --input-border: #374151;
  --btn-orange: #d97706;
  --btn-orange-hover: #b45309;
  --link-orange: #f59e0b;
  --btn-danger: #ef4444;
  --text-primary: #ffffff;
  --text-muted: #9ca3af;
  --dash-card-bg: #1a1e2b;
  --dash-card-border: #232938;
  --dash-header-btn: #242a38;
  --dash-header-btn-hover: #2f374a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-gradient-start);
  padding: 20px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: -24px;
  z-index: -2;
  background: url("IMAGES/images.jpg") center / cover no-repeat;
  filter: blur(10px);
  transform: scale(1.04);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(10, 15, 29, 0.68);
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card.glass-card {
  max-width: 600px;
  padding: 44px 48px;
}

.glass-card .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.glass-card .brand-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.form-grid .input-wrap {
  margin-top: 10px;
}

.input-wrap .icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 560px) {
  .card.glass-card {
    padding: 36px 24px;
  }

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

.panel-hero {
  display: none !important;
}

h1, h2, 
.form-panel h1, 
.form-panel h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

p, 
.subtitle, 
.form-panel .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

label:not(.field-label):not(.relationship-option):not(.checkbox):not(.payment-method-item):not(.message-attachment-button) {
  display: none;
}

label.relationship-option,
.relationship-option {
  display: block !important;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label,
.form-panel label {
  margin-top: 6px;
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
  width: 100%;
  margin-top: 10px;
}

.input-wrap .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap .icon + input {
  padding-left: 44px;
}

.input-wrap:has(.toggle-password) input {
  padding-right: 58px;
}

input::placeholder {
  color: #6b7280;
}

input:focus {
  border-color: var(--link-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.input-incomplete {
  border-color: #ef4444 !important;
}

.toggle-password {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px !important;
  height: 44px;
  margin: 0 !important;
  padding: 10px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: var(--text-muted, #9ca3af);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.toggle-password.is-visible {
  display: flex !important;
}

.toggle-password:hover {
  color: var(--text-primary, #ffffff);
  background: transparent !important;
}

.toggle-password:focus-visible {
  outline: 2px solid var(--link-orange);
  outline-offset: -2px;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--btn-orange);
  cursor: pointer;
}

button, 
button[type="submit"],
.button-link {
  display: block;
  width: 100%;
  padding: 13px;
  margin-top: 8px;
  border-radius: 10px;
  border: none;
  background-color: var(--btn-orange);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px rgba(217, 119, 6, 0.4);
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover,
.button-link:hover {
  background-color: var(--btn-orange-hover);
  color: #ffffff;
}

button:active,
.button-link:active {
  transform: scale(0.99);
}

a {
  color: var(--link-orange);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.footer-link,
.form-panel .footer-link {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-link + .footer-link {
  margin-top: 2px;
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.4;
}

.alert strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* Tinanggal ang bullets/circles para sa mga error messages */
.alert ul,
.alert.error ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.alert li,
.alert.error li {
  list-style: none;
}

.alert.error li span {
  display: block;
  margin-top: 4px;
  font-size: 0.9em;
  opacity: 0.85;
}

.password-requirements,
.password-rules {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-top: 10px;
  margin-bottom: 16px;
}

.password-requirements ul,
.password-rules ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
}

.password-requirements li,
.password-rules li {
  font-size: 12px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.password-requirements li:last-child,
.password-rules li:last-child {
  margin-bottom: 0;
}

.password-requirements li .icon,
.password-rules li .icon {
  font-size: 13px;
  font-weight: bold;
}

.password-requirements li span,
.password-rules li span {
  font-size: 11px;
  font-weight: bold;
}

.password-requirements li.invalid,
.password-rules li:not(.valid) {
  color: #fca5a5;
}

.password-requirements li.valid,
.password-rules li.valid {
  color: #86efac;
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

body.is-transitioning .page-transition {
  opacity: 1;
}

body.page-entering .page-transition {
  opacity: 0;
}

body.page-entering {
  animation: pageEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.is-transitioning .login-screen {
  animation: screenExit 0.24s ease both;
}

.login-screen {
  animation: screenEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: -6px 0 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.login-back-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-back-button:hover,
.login-back-button:focus-visible {
  color: var(--link-orange);
  transform: translateX(-2px);
}

.login-back-button:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--link-orange);
  outline-offset: 4px;
}

@keyframes screenEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes screenExit {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
}

.card.split-card {
  max-width: 1100px;
  width: min(92%, 1100px);
  min-height: min(620px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.split-card .form-panel {
  flex: 1 1 0;
  min-width: 0;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
}

.split-card .panel-image {
  flex: 1.1 1 0;
  min-width: 0;
}

.split-card .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.split-card .brand-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.split-card .brand-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.split-card .form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 24px;
  font-size: 13px;
}

.split-card .form-options .checkbox {
  margin: 0;
}

.split-card .panel-image {
  flex: 1.1;
  position: relative;
  background-color: transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
}

.split-card .panel-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 100%);
  pointer-events: none;
  z-index: 5;
}

.split-card .image-caption {
  position: relative;
  z-index: 10;
}

.split-card .image-caption h2 {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.split-card .image-caption p {
  font-size: 13px;
  color: var(--link-orange);
  margin-bottom: 0;
  font-weight: 500;
}

.split-card .panel-image .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  z-index: 1;
  filter: blur(12px);
  transform: scale(1.08);
  animation: crossfade 24s infinite ease-in-out;
}

@keyframes crossfade {
  0% { 
    opacity: 0; 
    filter: blur(12px);
    transform: scale(1.08);
  }
  4% { 
    opacity: 0.7; 
    filter: blur(0px);
    transform: scale(1);
  }
  12.5% { 
    opacity: 0.7; 
    filter: blur(0px);
    transform: scale(1);
  }
  16.5% { 
    opacity: 0; 
    filter: blur(12px);
    transform: scale(1.08);
  }
  100% { 
    opacity: 0; 
    filter: blur(12px);
    transform: scale(1.08);
  }
}

/* Pulse animation for notification badges */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.split-card .panel-image .slide:nth-of-type(1) { animation-delay: 0s; }
.split-card .panel-image .slide:nth-of-type(2) { animation-delay: 3s; }
.split-card .panel-image .slide:nth-of-type(3) { animation-delay: 6s; }
.split-card .panel-image .slide:nth-of-type(4) { animation-delay: 9s; }
.split-card .panel-image .slide:nth-of-type(5) { animation-delay: 12s; }
.split-card .panel-image .slide:nth-of-type(6) { animation-delay: 15s; }
.split-card .panel-image .slide:nth-of-type(7) { animation-delay: 18s; }
.split-card .panel-image .slide:nth-of-type(8) { animation-delay: 21s; }

body.dashboard-page {
  display: block;
  align-items: initial;
  justify-content: initial;
  padding: 0;
}

.dash-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background-color: rgba(17, 24, 39, 0.9);
  border-right: 1px solid var(--dash-card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  text-decoration: none;
  cursor: pointer;
  border-radius: 8px;
  transition: opacity 0.15s ease;
}

.sidebar-brand:hover {
  opacity: 0.8;
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.sidebar-brand .brand-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.3;
  color: var(--text-primary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover {
  background-color: var(--dash-header-btn);
  color: var(--text-primary);
  text-decoration: none;
  opacity: 1;
}

.sidebar-icon {
  display: inline-flex;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.sidebar-icon-svg {
  display: block;
  width: 18px;
  height: 18px;
  overflow: visible;
}

.system-icon-svg {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -0.18em;
  overflow: visible;
  color: currentColor;
}

.notification-bell-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  line-height: 0;
  visibility: visible;
}

.notification-bell-icon .system-icon-svg {
  display: block;
  width: 18px;
  height: 18px;
  vertical-align: initial;
}

#notificationToggle .notification-bell-icon > svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: #f8fafc;
  stroke: currentColor;
  stroke-width: 2;
  visibility: visible;
}

.sidebar-overlay {
  display: none;
}

.dashboard-main {
  flex: 1;
  min-width: 0;          /* pigilan ang overflow sa flex child */
  width: 100%;
  max-width: none;       /* dating 1200px */
  padding: 28px 40px 48px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-icon-menu {
  width: 42px;
  height: 42px;
  margin-top: 0;
  padding: 0;
  background-color: var(--dash-header-btn);
  border: 1px solid var(--dash-card-border);
  color: #e2e8f0;
  border-radius: 10px;
  font-size: 18px;
  box-shadow: none;
  display: none;
  align-items: center;
  justify-content: center;
}

.btn-icon-menu:hover {
  background-color: var(--dash-header-btn-hover);
}

.dash-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--link-orange);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.dash-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon-nav {
  width: 42px;
  height: 42px;
  margin-top: 0;
  padding: 0;
  background-color: var(--dash-header-btn);
  border: 1px solid var(--dash-card-border);
  color: #cbd5e1;
  border-radius: 10px;
  font-size: 16px;
  box-shadow: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-nav:hover {
  background-color: var(--dash-header-btn-hover);
}

.notification-count-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  display: flex;
  min-width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--dash-card-bg);
  border-radius: 999px;
  background: #e53945;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.notification-menu {
  position: relative;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: min(360px, calc(100vw - 40px));
  padding: 8px;
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.notification-menu.open .notification-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--dash-card-border);
}

.notification-header strong {
  color: var(--text-primary);
  font-size: 14px;
}

.notification-mark-read {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--link-orange);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.notification-mark-read:hover {
  color: #ffbd63;
  text-decoration: underline;
}

.notification-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.notification-item:hover,
.notification-item.unread {
  background-color: var(--dash-header-btn);
  opacity: 1;
  text-decoration: none;
}

.notification-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color: rgba(217, 119, 6, 0.14);
  font-size: 14px;
}

.notification-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notification-copy strong {
  color: #e5e7eb;
  font-size: 12px;
}

.notification-copy span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.notification-copy small {
  color: #64748b;
  font-size: 10px;
}

.notification-empty {
  padding: 18px 12px 12px;
  margin: 0;
  text-align: center;
  font-size: 12px;
}

/* ---------- Admin dashboard ---------- */

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.admin-stat-card,
.admin-actions a,
.admin-panel {
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
}

.admin-stat-card {
  position: relative;
  min-height: 128px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-stat-card strong {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 20px;
}

.admin-stat-card > span:not(.admin-stat-icon) {
  color: var(--text-muted);
  font-size: 11px;
}

.admin-stat-card em {
  position: absolute;
  top: 17px;
  right: 14px;
  padding: 3px 6px;
  border-radius: 5px;
  background-color: rgba(34, 197, 94, 0.12);
  color: #86efac;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.admin-stat-card em.admin-warning {
  background-color: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.admin-stat-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
}

.admin-icon-blue { background-color: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.admin-icon-green { background-color: rgba(34, 197, 94, 0.15); color: #86efac; }
.admin-icon-yellow { background-color: rgba(234, 179, 8, 0.15); color: #fbbf24; }
.admin-icon-pink { background-color: rgba(236, 72, 153, 0.15); color: #f9a8d4; }

.admin-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.admin-actions a {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.admin-actions a:hover {
  background-color: var(--dash-header-btn-hover);
  color: var(--text-primary);
  opacity: 1;
  text-decoration: none;
}

.admin-actions a span {
  color: var(--link-orange);
  font-size: 18px;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: calc(100vh - 520px);
}

.admin-panel {
  height: 100%;
  padding: 18px;
}

.admin-panel h2 {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 14px;
}

.admin-analytics h3 {
  color: #ffffff !important;
}

/* =========================================================
   Admin: Announcements page — modal, form grid, priority
   badges, and announcement list (moved from an inline
   <style> block in announcements.php for consistency)
   ========================================================= */

.admin-page .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .admin-page .form-grid {
    grid-template-columns: 1fr;
  }
}

.admin-page .form-full {
  grid-column: 1 / -1;
}

.admin-page .modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.admin-page .modal-overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-page .modal-content {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
}

.admin-page #announcementModal .modal-content {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-page #announcementModal .modal-content > form {
  min-height: 0;
  overflow-y: auto;
  margin-top: 0 !important;
  padding-right: 4px;
}

.admin-page #announcementModal .modal-content > form > div:last-child {
  position: sticky;
  bottom: 0;
  padding: 12px 0 2px;
  margin-bottom: 0 !important;
  background: #111827;
}

@media (max-width: 600px) {
  .admin-page #announcementModal.modal-overlay.open {
    align-items: flex-start;
    padding: 12px 0;
    overflow-y: auto;
  }

  .admin-page #announcementModal .modal-content {
    width: calc(100% - 24px);
    padding: 20px;
  }
}

.admin-page .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary) !important;
}

.admin-page .modal-header .modal-close {
  float: none;
  flex: 0 0 auto;
  margin-left: auto;
  width: 32px !important;
  height: 32px !important;
  min-width: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 6px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.admin-page .modal-header .modal-close:hover {
  background: #1f293d !important;
  color: #fff;
}

.admin-page .announcement-item {
  background: #1a1e2b;
  border: 1px solid #232938;
  border-radius: 8px;
  padding: 15px 18px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-page .announcement-info {
  flex: 1;
  min-width: 0;
}

.admin-page .announcement-title,
.admin-page .announcement-meta,
.admin-page .announcement-meta strong,
.admin-page .modal-header {
  color: var(--text-primary) !important;
}

.admin-page .announcement-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.admin-page .announcement-meta {
  font-size: 12px;
  margin-bottom: 10px;
}

.admin-page .announcement-content {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

.admin-page .announcement-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.admin-page .btn-edit {
  background: #d97706;
  color: white;
}

.admin-page .btn-delete {
  background: #ef4444;
  color: white;
}

.admin-page .priority-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.admin-page .priority-high {
  background: #ef4444;
  color: white;
}

.admin-page .priority-medium {
  background: #f59e0b;
  color: white;
}

.admin-page .priority-low {
  background: #10b981;
  color: white;
}

.admin-page .action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-page .action-row button {
  width: 100%;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: white;
}

.admin-page .template-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 768px) {
  .admin-page .template-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.admin-page .template-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px 8px;
  background: #1f293d;
  border: 1px solid #374151;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.admin-page .template-btn:hover {
  background: #374151;
  border-color: #4b5563;
}

.admin-page .template-btn.active {
  background: #d97706;
  border-color: #d97706;
  color: white;
}

.admin-page .template-icon {
  font-size: 22px;
  margin-bottom: 0;
}

.admin-page .template-name {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.admin-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--dash-card-border);
}

.admin-list-row > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-list-row strong {
  overflow: hidden;
  color: #e5e7eb;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-row small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-pill {
  flex-shrink: 0;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}

.admin-pill-success { background-color: rgba(34, 197, 94, 0.12); color: #86efac; }
.admin-pill-warning { background-color: rgba(234, 179, 8, 0.14); color: #fbbf24; }
.admin-pill-info { background-color: rgba(59, 130, 246, 0.14); color: #93c5fd; }
.admin-pill-info:hover { opacity: 0.8; text-decoration: none; }

.admin-empty {
  margin: 0;
  font-size: 12px;
}

.unit-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px 20px;
  background-color: rgba(26, 30, 43, 0.94);
  border: 1px solid #30394d;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.unit-page-head h2 {
  margin: 0 0 5px;
  color: var(--text-primary);
  font-size: 18px;
}

.unit-page-head p {
  margin: 0;
  font-size: 12px;
}

.payment-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.payment-overview-card {
  padding: 16px;
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
}

.payment-overview-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.payment-overview-card strong {
  color: var(--text-primary);
  font-size: 20px;
}

.payment-overview-card.paid { border-color: rgba(34, 197, 94, 0.35); }
.payment-overview-card.pending { border-color: rgba(234, 179, 8, 0.35); }
.payment-overview-card.overdue { border-color: rgba(239, 68, 68, 0.35); }

.unit-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.unit-summary span {
  padding: 6px 9px;
  border-radius: 6px;
  background-color: var(--dash-header-btn);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.unit-summary .registered-vehicles-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: linear-gradient(110deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(249, 115, 22, 0.24);
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.unit-summary .registered-vehicles-link:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(249, 115, 22, 0.32);
}

.unit-management-panel {
  min-height: calc(100vh - 150px);
  margin-bottom: 28px;
  background-color: var(--dash-card-bg);
  border: 1px solid #30394d;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.unit-management-panel:has(.unit-table-wrap) {
  height: calc(100vh - 150px);
}

.unit-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--dash-card-border);
}

.unit-filters label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.unit-filters input,
.unit-filters select {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.unit-filters input {
  flex: 1;
}

.unit-filters select {
  width: 130px;
}

.unit-filters input:focus,
.unit-filters select:focus {
  border-color: var(--link-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.unit-filters button {
  width: auto;
  margin: 0;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
}

.unit-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  border-radius: 12px;
  border: 1px solid var(--dash-card-border);
}

.parking-inventory-panel {
  height: calc(100vh - 150px);
  min-height: 520px;
  overflow: hidden;
}

.parking-inventory-panel .unit-table-wrap {
  max-height: calc(100vh - 270px);
}

.unit-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.unit-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
}

.unit-table th {
  padding: 14px 16px;
  background-color: #0f1419;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--dash-card-border);
}

.unit-table td {
  padding: 14px 16px;
  border-top: 1px solid var(--dash-card-border);
  color: var(--text-primary);
  font-size: 12px;
  vertical-align: middle;
}

.unit-table td strong {
  display: block;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.unit-table td small {
  display: block;
  color: #64748b;
  font-size: 10px;
  margin-top: 2px;
}

.unit-table tbody tr:hover {
  background-color: rgba(217, 119, 6, 0.05);
}

.unit-status {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
}

.unit-status.occupied {
  background-color: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.unit-status.vacant {
  background-color: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.unit-status.paid {
  background-color: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.unit-status.pending {
  background-color: rgba(234, 179, 8, 0.14);
  color: #fbbf24;
}

.unit-status.online,
.staff-status.online {
  background-color: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.9);
}

.unit-status.offline,
.staff-status.offline {
  background-color: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.9);
}

.unit-status.in_progress {
  background-color: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
}

.unit-status.confirmed {
  background-color: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.unit-status.cancelled {
  background-color: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.unit-status.overdue,
.unit-status.rejected {
  background-color: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.unit-empty {
  padding: 32px 14px !important;
  text-align: center;
}

.request-description {
  max-width: 300px;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.maintenance-admin-panel {
  height: auto;
  min-height: 0;
}

.maintenance-admin-panel .unit-table-wrap {
  max-height: min(62vh, 720px);
}

.maintenance-status-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.maintenance-status-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--dash-card-border);
  border-radius: 8px;
  background: var(--dash-card-bg);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.maintenance-status-summary:hover {
  border-color: var(--link-orange);
  background: #202536;
  text-decoration: none;
}

.maintenance-status-summary strong {
  color: var(--text-primary);
  font-size: 18px;
}

.maintenance-admin-filters {
  flex-wrap: wrap;
}

.maintenance-admin-filters > label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.maintenance-admin-filters input[type="search"] {
  flex: 1 1 260px;
  min-width: 180px;
  padding: 10px 11px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}

.maintenance-admin-filters .maintenance-search-label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  color: var(--text-muted);
}

.maintenance-admin-table {
  min-width: 1120px;
}

.maintenance-admin-table th,
.maintenance-admin-table td {
  vertical-align: middle;
}

.maintenance-admin-table th {
  padding: 15px 14px;
  font-size: 11px;
}

.maintenance-admin-table td {
  padding: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.maintenance-admin-table td strong {
  font-size: 13px;
}

.maintenance-admin-table td small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.maintenance-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.maintenance-status-badge.status-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.maintenance-status-badge.status-approved,
.maintenance-status-badge.status-in_progress { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
.maintenance-status-badge.status-completed { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.maintenance-status-badge.status-closed { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.maintenance-status-badge.status-rejected,
.maintenance-status-badge.status-cancelled { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.maintenance-status-badge.status-reopened { background: rgba(217, 119, 6, 0.18); color: #fdba74; }

.maintenance-urgency {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.maintenance-urgency.urgency-urgent { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.maintenance-urgency.urgency-normal { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.maintenance-urgency.urgency-low { background: rgba(34, 197, 94, 0.12); color: #86efac; }

.maintenance-view-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--link-orange);
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.maintenance-admin-detail {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
  background: var(--dash-card-bg);
}

.maintenance-admin-detail-head,
.maintenance-admin-actions,
.maintenance-admin-actions form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.maintenance-admin-detail-head {
  justify-content: space-between;
}

.maintenance-admin-actions {
  justify-content: flex-start;
}

.maintenance-admin-actions form {
  flex: 0 0 auto;
  justify-content: flex-start;
  width: auto;
  margin: 0;
}

.maintenance-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #b45309;
  border-radius: 8px;
  background: #b45309;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.maintenance-back-button:hover {
  border-color: #d97706;
  background: #d97706;
  color: #fff;
  text-decoration: none;
}

.maintenance-back-button:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.35);
  outline-offset: 2px;
}

.maintenance-admin-detail-head {
  margin-bottom: 20px;
}

.maintenance-admin-detail-head h2 {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 20px;
}

.maintenance-admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
  margin: 0;
}

.maintenance-admin-detail-grid dt,
.maintenance-complete-form label,
.maintenance-photo-fields label {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.maintenance-admin-detail-grid dd {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.maintenance-admin-wide {
  grid-column: 1 / -1;
}

.maintenance-admin-evidence,
.maintenance-photo-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.maintenance-admin-evidence a {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
}

.maintenance-admin-evidence img {
  width: 150px;
  height: 110px;
  object-fit: cover;
  border: 1px solid var(--dash-card-border);
  border-radius: 8px;
}

.maintenance-admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 38px;
  padding: 8px 13px;
  margin: 0;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.maintenance-admin-button.approve { background: #15803d; }
.maintenance-admin-button.reject { background: #b91c1c; }

.maintenance-complete-form {
  flex: 1 1 100%;
  display: grid;
  gap: 12px;
}

.maintenance-admin-actions form.maintenance-complete-form {
  display: grid;
  flex: 1 1 100%;
  width: 100%;
  justify-content: stretch;
}

.maintenance-complete-form textarea,
.maintenance-photo-fields input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--input-border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
}

.maintenance-photo-fields > label {
  flex: 1 1 220px;
}

.maintenance-complete-form button[type="submit"] {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  pointer-events: auto;
  cursor: pointer;
}

@media (max-width: 760px) {
  .maintenance-status-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .maintenance-admin-panel {
    min-height: 500px;
  }

  .maintenance-admin-filters {
    align-items: stretch;
  }

  .maintenance-admin-filters select,
  .maintenance-admin-filters button,
  .maintenance-admin-filters input[type="search"] {
    flex: 1 1 100%;
    width: 100%;
  }

  .maintenance-admin-filters label {
    margin-bottom: -6px;
  }

  .maintenance-admin-detail {
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .maintenance-admin-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .maintenance-admin-wide {
    grid-column: auto;
  }

  .maintenance-admin-actions,
  .maintenance-admin-actions form {
    align-items: stretch;
    width: 100%;
  }

  .maintenance-admin-actions form button {
    flex: 1 1 auto;
  }
}

.status-form {
  display: inline;
}

.status-form select {
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.status-form select:hover {
  border-color: var(--link-orange);
}

.status-form select:focus {
  outline: none;
  border-color: var(--link-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.admin-chat-shell {
  height: min(720px, calc(100vh - 190px));
  min-height: 500px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background-color: var(--dash-card-bg);
  border: 1px solid #30394d;
  border-radius: 12px;
  overflow: hidden;
}

.admin-chat-residents {
  border-right: 1px solid var(--dash-card-border);
  background-color: #161b28;
}

.admin-chat-residents h2,
.admin-chat-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
}

.admin-chat-residents h2 {
  padding: 18px;
}

.admin-chat-resident {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 18px;
  border-top: 1px solid var(--dash-card-border);
  color: var(--text-primary);
  text-decoration: none;
}

.admin-chat-resident:hover,
.admin-chat-resident.selected {
  background-color: var(--dash-header-btn);
  text-decoration: none;
  opacity: 1;
}

.admin-chat-resident strong { font-size: 12px; }
.admin-chat-resident small { color: var(--text-muted); font-size: 10px; }

.admin-chat-thread {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--dash-card-border);
}

.admin-chat-header span { color: var(--text-muted); font-size: 11px; }

.admin-chat-messages {
  min-height: 0;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

@media (max-width: 700px) {
  .admin-chat-shell { height: calc(100vh - 150px); min-height: 500px; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .admin-chat-residents { border-right: none; border-bottom: 1px solid var(--dash-card-border); }
  .admin-chat-residents { max-height: 220px; overflow-y: auto; }
}

@media (max-width: 900px) {
  .admin-stats-grid,
  .admin-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .admin-stats-grid,
  .admin-actions,
  .admin-overview-grid,
  .payment-overview-grid {
    grid-template-columns: 1fr;
  }

  .admin-overview-grid {
    min-height: 0;
  }

  .unit-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .unit-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .unit-filters select,
  .unit-filters button {
    width: 100%;
  }
}

.btn-logout-nav {
  background-color: var(--dash-header-btn);
  border: 1px solid var(--dash-card-border);
  color: var(--text-primary);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.btn-logout-nav:hover {
  background-color: var(--dash-header-btn-hover);
  text-decoration: none;
  opacity: 1;
}

.profile-menu {
  position: relative;
}

.btn-profile-nav {
  height: 42px;
  margin-top: 0;
  padding: 4px 12px 4px 4px;
  background-color: var(--dash-header-btn);
  border: 1px solid var(--dash-card-border);
  color: var(--text-primary);
  border-radius: 999px;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-profile-nav:hover {
  background-color: var(--dash-header-btn-hover);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--link-orange) 0%, var(--btn-orange-hover) 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.profile-nav-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-caret {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.profile-menu.open .profile-caret {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  padding: 8px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.profile-menu.open .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--dash-card-border);
}

.profile-dropdown-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--link-orange) 0%, var(--btn-orange-hover) 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-dropdown-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-dropdown-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-unit {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.profile-dropdown-item:hover {
  background-color: var(--dash-header-btn);
  text-decoration: none;
  opacity: 1;
}

.profile-dropdown-danger {
  color: #fca5a5;
}

.profile-dropdown-danger:hover {
  background-color: rgba(239, 68, 68, 0.12);
}

@media (max-width: 480px) {
  .profile-nav-name {
    display: none;
  }

  .btn-profile-nav {
    padding: 4px;
    border-radius: 50%;
  }

  .profile-caret {
    display: none;
  }
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}

.badge-danger {
  background-color: rgba(225, 29, 72, 0.2);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.3);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-warning {
  background-color: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.action-btn {
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background-color: #222738;
  border-color: #333d54;
  transform: translateY(-2px);
  text-decoration: none;
  opacity: 1;
}

.action-icon {
  font-size: 22px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* ---------- Messages page ---------- */

.messages-shell {
  height: min(720px, calc(100vh - 190px));
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.55fr);
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 14px;
  overflow: hidden;
}

.conversation-list {
  border-right: 1px solid var(--dash-card-border);
  background-color: #161b28;
}

.messages-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 18px 14px;
}

.messages-list-header .section-title {
  margin: 0;
}

.message-count {
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background-color: rgba(217, 119, 6, 0.18);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.message-search {
  padding: 0 14px 14px;
}

.message-search label,
.reply-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.message-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.message-search input:focus {
  border-color: var(--link-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.message-announcements {
  padding: 16px;
  border-bottom: 1px solid #232938;
  background: #111827;
}

.message-announcements-title {
  margin: 0 0 12px;
  color: #f8fafc;
  font-size: 15px;
}

.message-announcement {
  padding: 12px;
  margin-bottom: 10px;
  border-left: 3px solid #d97706;
  background: #1a1e2b;
  border-radius: 4px;
}

.message-announcement:last-child { margin-bottom: 0; }
.message-announcement.high { border-left-color: #ef4444; }
.message-announcement-title { color: #f8fafc; font-weight: 600; }
.message-announcement-meta { color: #9ca3af; font-size: 11px; margin: 4px 0 7px; }
.message-announcement-content { color: #cbd5e1; font-size: 13px; line-height: 1.5; white-space: pre-line; }
.message-announcement-note { color: #9ca3af; font-size: 11px; margin-top: 8px; }

.violation-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 170px;
  gap: 16px;
  margin-bottom: 18px;
}

.violation-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.violation-field label { color: #9ca3af; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.violation-field input, .violation-field select, .violation-field textarea { width: 100%; box-sizing: border-box; padding: 11px 12px; border-radius: 7px; border: 1px solid #374151; background: #0f1420; color: #fff; font-family: inherit; font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease; }
.violation-field textarea { min-height: 86px; resize: vertical; }
.violation-field input:focus, .violation-field select:focus, .violation-field textarea:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .12); }
.violation-description { margin-bottom: 18px; }
.penalty-toggle { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.penalty-toggle label { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #374151; border-radius: 7px; color: #cbd5e1; cursor: pointer; font-size: 13px; }
.penalty-toggle label:has(input:checked) { border-color: #f59e0b; background: rgba(245, 158, 11, .1); color: #fef3c7; }
.penalty-toggle input { accent-color: #f59e0b; }
.fine-field { max-width: 220px; margin-bottom: 18px; }
.violation-admin-row { background: linear-gradient(135deg, #161b28, #121722); border: 1px solid #2a3345; border-radius: 10px; padding: 16px 18px; margin-bottom: 12px; }
.violation-admin-row:hover { border-color: #44516a; }
.violation-admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.violation-copy { min-width: 0; }
.violation-resident { display: block; color: #f8fafc; font-size: 15px; margin-bottom: 5px; }
.violation-unit { color: #9ca3af; font-size: 12px; font-weight: 400; }
.violation-type { color: #fbbf24; font-size: 13px; font-weight: 700; }
.violation-description-text, .violation-dispute { margin: 8px 0 0; color: #9ca3af; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.violation-dispute { color: #f59e0b; }
.violation-date { display: block; margin-top: 10px; color: #6b7280; font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.status-unpaid, .status-disputed { background: #ef444422; color: #ef4444; }
.status-paid, .status-waived { background: #10b98122; color: #10b981; }
.status-warning_issued { background: #3b82f622; color: #60a5fa; }
.violation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #232938; }
.btn-small { padding: 8px 13px; font-size: 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: 700; transition: transform .15s ease, filter .15s ease; }
.btn-small:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-approve { background: #10b981; color: white; }
.btn-reject { background: #ef4444; color: white; }

@media (max-width: 760px) {
  .violation-form-grid { grid-template-columns: 1fr; gap: 13px; }
  .violation-admin-row { padding: 14px; }
  .violation-admin-head { gap: 10px; }
}

@media (max-width: 480px) {
  .penalty-toggle { flex-direction: column; }
  .penalty-toggle label { width: 100%; box-sizing: border-box; }
  .violation-actions .btn-small { flex: 1; }
}

.conversation-items {
  display: flex;
  flex-direction: column;
}

.conversation-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(35, 41, 56, 0.75);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.conversation-item:hover,
.conversation-item.selected {
  background-color: rgba(20, 184, 166, 0.1);
  text-decoration: none;
  opacity: 1;
}

.conversation-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #243047;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
}

.conversation-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conversation-copy strong {
  overflow: hidden;
  color: #e5e7eb;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
}

.conversation-meta small {
  color: #64748b;
  font-size: 9px;
  white-space: nowrap;
}

.conversation-meta i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--btn-orange);
}

.messages-empty {
  padding: 18px;
  margin: 0;
  font-size: 12px;
}

.message-thread {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--dash-card-border);
}

.thread-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--link-orange);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
}

.thread-status {
  padding: 5px 9px;
  border-radius: 999px;
  background-color: rgba(34, 197, 94, 0.12);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
}

.thread-messages {
  min-height: 0;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.thread-message {
  box-sizing: border-box;
  min-width: 0;
  max-width: min(76%, 420px);
  padding: 12px 14px;
  border: 1px solid var(--dash-card-border);
  border-radius: 10px;
  background-color: #202635;
  overflow-wrap: anywhere;
}

.thread-message.outgoing {
  align-self: flex-end;
  background-color: rgba(217, 119, 6, 0.16);
  border-color: rgba(217, 119, 6, 0.3);
}

.message-author {
  display: block;
  margin-bottom: 5px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
}

.thread-message p {
  margin: 0 0 8px;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.thread-message time {
  color: #64748b;
  font-size: 10px;
}

.reply-form {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--dash-card-border);
}

.reply-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.reply-controls textarea {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  max-height: 120px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.reply-controls textarea:focus {
  border-color: var(--link-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.reply-controls .reply-send {
  width: auto;
  min-width: 72px;
  margin: 0;
  padding: 11px 13px;
  border-radius: 8px;
  background-color: #0f9f91;
  box-shadow: 0 8px 16px -5px rgba(15, 159, 145, 0.35);
  font-size: 12px;
}

.reply-controls .reply-send:hover {
  background-color: #0d857a;
}

.message-attachment-input {
  position: fixed;
  left: -10000px;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}

.reply-form .message-attachment-button {
  position: static;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 40px;
  max-width: 180px;
  padding: 0 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  overflow: hidden;
  clip: auto;
  clip-path: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-form .message-attachment-button:hover {
  border-color: var(--link-orange);
}

.message-attachment-input:focus + .reply-send {
  outline: 2px solid var(--link-orange);
}

.message-attachment-button > span:first-child {
  margin-right: 7px;
  font-size: 15px;
}

.message-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-attachment-help {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
}

.message-attachment-link {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--link-orange);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.message-attachment-image {
  display: block;
  width: fit-content;
  max-width: min(240px, 100%);
  margin: 8px 0;
  cursor: zoom-in;
}

.message-attachment-image img {
  display: block;
  width: auto;
  max-width: 100%;
.message-attachment-button > span:first-child {
  margin-right: 7px;
  font-size: 15px;
}
.message-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
  max-height: 160px;
  border-radius: 6px;
  object-fit: contain;
}

body.image-viewer-open {
  overflow: hidden;
}

.message-image-viewer {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(5, 8, 14, 0.94);
}

.message-image-viewer.open {
  display: flex;
}

.message-image-viewer-panel {
  display: flex;
  box-sizing: border-box;
  width: min(100%, 1400px);
  max-width: 100%;
  height: 100%;
  flex-direction: column;
}

.message-image-viewer-toolbar {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  color: #f8fafc;
}

.message-image-viewer-name {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-image-viewer-actions {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.message-image-viewer-actions button {
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  min-width: 36px;
  height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background: #202635;
  color: #f8fafc;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.message-image-viewer-actions button:hover {
  background: #30394b;
}

.message-image-viewer-zoom {
  min-width: 42px;
  color: #cbd5e1;
  font-size: 11px;
  text-align: center;
}

.message-image-viewer-stage {
  min-height: 0;
  flex: 1;
  overflow: auto;
  text-align: center;
}

.message-image-viewer-stage img {
  display: block;
  max-width: none;
  max-height: none;
  margin: 0 auto;
  object-fit: contain;
}

@media (max-width: 600px) {
  .message-image-viewer {
    padding: 8px;
  }

  .message-image-viewer-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 4px 0 8px;
  }

  .message-image-viewer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .message-image-viewer-actions button {
    min-width: 32px;
    padding: 0 7px;
  }
}

@media (max-width: 700px) {
  .messages-shell {
    height: calc(100vh - 150px);
    min-height: 500px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .conversation-list {
    border-right: none;
    border-bottom: 1px solid var(--dash-card-border);
  }

  .conversation-items {
    max-height: 235px;
    overflow-y: auto;
  }

  .thread-messages {
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .thread-header,
  .thread-messages,
  .reply-form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .thread-message {
    max-width: min(90%, 420px);
  }

  .reply-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .reply-controls .reply-send {
    width: 100%;
  }
}

.page-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0 16px;
}

.sidebar-link.active {
  background-color: var(--dash-header-btn);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .card.split-card {
    flex-direction: column;
    width: min(92%, 440px);
    min-height: 0;
    max-height: none;
  }
  .split-card .form-panel {
    padding: 36px 30px;
  }
  .split-card .panel-image {
    min-height: 250px;
    order: -1;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.45);
  }

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

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .dashboard-main {
    padding: 20px;
  }

  .btn-icon-menu {
    display: flex;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .card.split-card {
    width: 100%;
  }

  .split-card .form-panel {
    padding: 30px 22px;
  }

  .split-card .panel-image {
    min-height: 210px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .dash-header-right {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ===== Parking management (admin / superadmin / security) ===== */
.parking-request-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.parking-request-columns > .parking-panel {
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0 0 20px;
}

.parking-panel {
  min-height: 0;
  padding: 20px;
}

.parking-panel .section-title {
  margin-bottom: 14px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.parking-panel .bookings-empty {
  padding: 8px 0;
}

/* Request cards */
.parking-requests-panel .parking-request-row {
  margin-bottom: 12px;
  padding: 16px;
  background-color: #161b28;
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
}

.parking-requests-panel .parking-request-row:last-child {
  margin-bottom: 0;
}

.parking-request-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.parking-request-head strong {
  color: #e5e7eb;
  font-weight: 600;
}

.parking-request-head small {
  color: var(--text-muted);
  font-size: 12px;
}

.parking-request-head .unit-status {
  flex-shrink: 0;
}

.sticker-requests-panel > .parking-request-row {
  margin: 0 0 14px;
  padding: 16px;
  background-color: #161b28;
  border: 1px solid var(--dash-card-border);
  border-radius: 10px;
}

.sticker-requests-panel > .parking-request-row:last-child {
  margin-bottom: 0;
}

.sticker-requests-panel .parking-request-decide {
  margin-top: 12px;
  padding-top: 12px;
}

.parking-request-decide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--dash-card-border);
}

.parking-request-decide select {
  flex: 0 1 200px;
}

.parking-request-decide input[type="text"] {
  flex: 1 1 220px;
  width: auto;
}

.parking-request-row > small {
  display: block;
  margin-top: 10px;
}

/* Inputs / selects inside the parking panels */
.parking-panel select,
.parking-request-decide input[type="text"] {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.parking-panel select {
  width: 100%;
}

.parking-panel select:focus,
.parking-request-decide input[type="text"]:focus {
  border-color: var(--link-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Buttons (override the global full-width orange button) */
.parking-panel .btn-small {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 8px 13px;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: none;
}

.parking-panel .btn-approve,
.parking-panel .btn-approve:hover { background-color: #10b981; }
.parking-panel .btn-reject,
.parking-panel .btn-reject:hover { background-color: #ef4444; }
.btn-neutral {
  background-color: #374151;
  color: #e5e7eb;
}

.btn-neutral:hover {
  background-color: #4b5563;
  color: #ffffff;
}

.parking-panel .btn-neutral,
.parking-panel .btn-neutral:hover { background-color: #374151; color: #e5e7eb; }

/* Add-slot form */
.add-slot-form {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.65fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.add-slot-form .field {
  min-width: 0;
}

.add-slot-form .field-label {
  margin-bottom: 6px;
  color: #b8c2d2;
  font-size: 12px;
  font-weight: 700;
}

.add-slot-form input[type="text"] {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.add-slot-form select {
  font-size: 14px;
  line-height: 1.4;
}

.add-slot-form button {
  width: auto;
  margin: 0;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.parking-search-form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.parking-search-form .field {
  flex: 1 1 280px;
  min-width: 0;
}

.parking-search-form .field-label {
  margin-bottom: 6px;
  color: #b8c2d2;
  font-size: 12px;
  font-weight: 700;
}

.parking-search-form input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.parking-search-form button {
  width: auto;
  margin: 0;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}

/* Slot table */
.parking-slot-actions,
.parking-status-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.parking-slot-actions {
  white-space: nowrap;
}

.parking-panel .unit-table td .parking-status-form,
.parking-panel .unit-table td .parking-delete-form {
  margin: 0;
}

.parking-status-form select {
  width: auto;
  min-width: 120px;
}

.parking-slot-actions .btn-small {
  flex: 0 0 auto;
}

.parking-panel .unit-table th {
  font-size: 12px;
}

.parking-panel .unit-table td {
  font-size: 14px;
  line-height: 1.45;
}

.parking-panel .unit-table td strong {
  font-size: 14px;
}

.parking-panel .unit-table td small {
  font-size: 11px;
}

.parking-panel .unit-table select {
  font-size: 14px;
}

.parking-panel .btn-small {
  min-height: 34px;
  font-size: 13px;
  font-weight: 700;
}

.parking-panel .unit-status.available,
.parking-panel .unit-status.approved {
  background-color: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.parking-panel .unit-status.occupied {
  background-color: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

.parking-panel .unit-status.maintenance {
  background-color: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

@media (max-width: 768px) {
  .parking-request-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .parking-panel { padding: 14px; }
  .add-slot-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-slot-form button { grid-column: 1 / -1; width: 100%; }
  .parking-search-form { flex-wrap: wrap; }
  .parking-search-form .field { flex-basis: 100%; }
  .parking-search-form button { flex: 1; }
  .parking-request-head { flex-direction: column; }
}

/* ---------- Generate Bills page (admin) ---------- */

.bill-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.bill-form-grid .field { display: flex; flex-direction: column; gap: 4px; }
.bill-form-grid label { font-size: 12px; color: #9ca3af; }
.bill-form-grid input, .bill-form-grid select { padding: 8px 10px; border-radius: 6px; border: 1px solid #374151; background: #0f1420; color: #fff; }

.panel-subtext { color: #9ca3af; margin-top: -8px; }

.charge-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.charge-row span { width: 120px; color: #cbd5e1; }
.charge-row input { flex: 1; padding: 8px 10px; border-radius: 6px; border: 1px solid #374151; background: #0f1420; color: #fff; }

.item-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.item-row input, .item-row select { padding: 8px; border-radius: 6px; border: 1px solid #374151; background: #0f1420; color: #fff; }
.item-row .cat { flex: 1; min-width: 130px; }
.item-row .desc { flex: 1; min-width: 130px; }
.item-row .amt { width: 110px; }

.notify-check { display: flex; align-items: center; gap: 8px; color: #cbd5e1; margin: 12px 0; }
.notify-check input[type="checkbox"] { width: auto; }

#addItemRow { margin-bottom: 12px; }

/* =========================================================
   Generate Bills — compact layout fixes
   Scoped to panels that contain .bill-form-grid
   ========================================================= */

.unit-management-panel:has(.bill-form-grid) {
  min-height: auto;
  height: auto;
  padding: 22px;
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
}

.unit-management-panel:has(.bill-form-grid) .section-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.unit-management-panel:has(.bill-form-grid) .panel-subtext {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: normal;
}

.unit-management-panel:has(.bill-form-grid) form {
  width: 100%;
  min-width: 0;
}

.unit-management-panel:has(.bill-form-grid) .bill-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  width: 100%;
}

.unit-management-panel:has(#customBillForm) .bill-form-grid {
  grid-template-columns: 1.05fr 1fr 1fr 1fr;
}

.unit-management-panel:has(.bill-form-grid) .bill-form-grid .field {
  min-width: 0;
  gap: 6px;
}

.unit-management-panel:has(.bill-form-grid) .bill-form-grid label {
  font-size: 13px;
}

.unit-management-panel:has(.bill-form-grid) .bill-form-grid input,
.unit-management-panel:has(.bill-form-grid) .bill-form-grid select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.unit-management-panel:has(.bill-form-grid) .charge-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}

.unit-management-panel:has(.bill-form-grid) .charge-row span {
  width: auto;
  min-width: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.unit-management-panel:has(.bill-form-grid) .charge-row input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.unit-management-panel:has(#bulkGenerateForm) .bulk-charge-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}

.unit-management-panel:has(#bulkGenerateForm) .bulk-charge-row select,
.unit-management-panel:has(#bulkGenerateForm) .bulk-charge-row input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #0f1420;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.unit-management-panel:has(#bulkGenerateForm) .bulk-charge-row .remove-bulk-row {
  width: auto;
  min-width: 90px;
  margin: 0;
}

.unit-management-panel:has(.bill-form-grid) .item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  min-width: 0;
  align-items: center;
}

.unit-management-panel:has(.bill-form-grid) .item-row input,
.unit-management-panel:has(.bill-form-grid) .item-row select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.unit-management-panel:has(.bill-form-grid) .item-row .cat,
.unit-management-panel:has(.bill-form-grid) .item-row .amt {
  width: 100%;
  min-width: 0;
}

.unit-management-panel:has(.bill-form-grid) .item-row .remove-item-row {
  width: auto;
  min-width: 90px;
  margin: 0;
}

.unit-management-panel:has(.bill-form-grid) .notify-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.unit-management-panel:has(.bill-form-grid) .notify-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 0;
}

.unit-management-panel:has(.bill-form-grid) form > button[type="submit"] {
  width: 100%;
  height: auto;
  margin-top: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.2;
}

.unit-management-panel:has(.bill-form-grid) #addItemRow,
.unit-management-panel:has(.bill-form-grid) #addBulkChargeRow,
.unit-management-panel:has(.bill-form-grid) form > button[type="submit"] {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.1);
}

.confirm-modal,
.system-confirm-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 12, 20, 0.72);
  z-index: 2000;
}

.confirm-modal.open,
.system-confirm-overlay.open {
  display: flex;
}

.confirm-dialog,
.staff-confirm-modal,
.vacancy-confirm-modal,
.system-confirm-dialog {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 40px));
  margin: auto;
  background: #111a2b;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 24px 20px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.system-confirm-dialog {
  max-height: min(90vh, 700px);
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.system-confirm-dialog::backdrop {
  background: rgba(8, 12, 20, 0.72);
}

.confirm-dialog h3,
.staff-confirm-modal h3,
.vacancy-confirm-modal h3,
.system-confirm-dialog h2,
.system-confirm-dialog h3 {
  margin: 0 0 10px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 700;
}

.confirm-dialog p,
.staff-confirm-modal p,
.vacancy-confirm-modal p,
.system-confirm-dialog p {
  margin: 0 0 20px;
  color: #aab4c4;
  font-size: 13px;
  line-height: 1.5;
}

.confirm-actions,
.staff-confirm-actions,
.vacancy-confirm-actions,
.pending-dialog-actions,
.system-confirm-actions {
  display: flex;
  justify-content: stretch;
  gap: 10px;
  margin-top: 20px;
}

.confirm-actions button,
.staff-confirm-actions button,
.vacancy-confirm-actions button,
.pending-dialog-actions button,
.system-confirm-actions button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
  padding: 9px 14px;
  border: 0;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}

.confirm-cancel,
.staff-confirm-cancel,
.vacancy-confirm-cancel,
.dialog-cancel,
.system-confirm-cancel {
  background: #293346;
  color: #f8fafc;
}

.confirm-ok,
.staff-confirm-submit,
.vacancy-confirm-submit,
.dialog-confirm-approve,
.dialog-confirm-reject,
.system-confirm-accept {
  background: linear-gradient(110deg, #f59e0b, #f97316);
  color: #fff;
}

.system-confirm-dialog label {
  display: block;
  margin: 0 0 6px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
}

.system-confirm-dialog select,
.system-confirm-dialog textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #3b465b;
  border-radius: 8px;
  background: #1f293d;
  color: #f8fafc;
}

.system-confirm-dialog textarea {
  min-height: 90px;
  margin-top: 12px;
  resize: vertical;
}

.unit-management-panel:has(#bulkGenerateForm) .charge-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
}

.unit-management-panel:has(#bulkGenerateForm) form > button[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 800px) {
  .unit-management-panel:has(.bill-form-grid) {
    padding: 12px;
  }

  .unit-management-panel:has(.bill-form-grid) .bill-form-grid {
    grid-template-columns: 1fr;
  }

  .unit-management-panel:has(.bill-form-grid) .item-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .unit-management-panel:has(.bill-form-grid) .charge-row {
    grid-template-columns: 110px minmax(0, 1fr);
  }
}



/* =========================================================
   Violations — text / border overflow fixes
   Keeps long resident names, violation types, descriptions,
   and dispute messages inside their containers.
   ========================================================= */

.unit-management-panel:has(.violation-form-grid),
.unit-management-panel:has(.violation-admin-row),
.unit-management-panel:has(.violation-table-wrap) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.unit-management-panel:has(.violation-form-grid) *,
.unit-management-panel:has(.violation-admin-row) *,
.unit-management-panel:has(.violation-table-wrap) * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.unit-management-panel.violation-create-panel {
  display: block;
  min-height: 0;
  height: auto;
  padding: 22px;
}

.violation-create-panel > .section-title {
  margin: 0 0 18px;
  font-size: 19px;
  line-height: 1.3;
}

.violation-create-panel #violationForm {
  display: grid;
  gap: 16px;
}

.violation-create-panel .violation-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.violation-create-panel .violation-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.violation-create-panel .violation-field label {
  display: block !important;
  margin: 0;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: normal;
}

.violation-create-panel .violation-field input,
.violation-create-panel .violation-field select,
.violation-create-panel .violation-field textarea {
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid #3a455a;
  border-radius: 8px;
  background: #101725;
  color: #f8fafc;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.violation-create-panel .violation-field input::placeholder,
.violation-create-panel .violation-field textarea::placeholder {
  color: #8994a6;
  opacity: 1;
}

.violation-create-panel .violation-field input:focus,
.violation-create-panel .violation-field select:focus,
.violation-create-panel .violation-field textarea:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.violation-create-panel .violation-description {
  margin: 0;
}

.violation-create-panel .violation-description textarea {
  min-height: 104px;
  resize: vertical;
}

.violation-create-panel .violation-field input[type="file"] {
  padding: 7px 9px;
  color: #cbd5e1;
  font-size: 12px;
}

.violation-create-panel .violation-field input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: #293346;
  color: #f8fafc;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.violation-create-panel .violation-field small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.violation-create-panel .penalty-toggle {
  gap: 10px;
  margin: 0;
}

.violation-create-panel .penalty-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #354156;
  border-radius: 8px;
  background: #141c2b;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.35;
}

.violation-create-panel .penalty-toggle input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #f59e0b;
}

.violation-create-panel .fine-field {
  max-width: 360px;
}

.violation-create-panel .violation-rate-wrap {
  width: min(100%, 620px);
  max-width: none;
  margin: 0;
}

.violation-create-panel .violation-rate-wrap h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.violation-create-panel .violation-rate-table {
  width: 100%;
  font-size: 12px;
}

.violation-create-panel .violation-rate-table th,
.violation-create-panel .violation-rate-table td {
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.4;
}

.violation-create-panel #violationForm > button[type="submit"] {
  width: min(240px, 100%);
  min-height: 44px;
  margin: 0;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .unit-management-panel.violation-create-panel {
    padding: 16px;
  }

  .violation-create-panel .violation-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .violation-create-panel .fine-field {
    max-width: none;
  }
}

.violation-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.violation-field {
  min-width: 0;
  width: 100%;
}

.violation-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.violation-field input,
.violation-field select,
.violation-field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.violation-description {
  width: 100%;
  min-width: 0;
}

.violation-description textarea {
  display: block;
  resize: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.penalty-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  margin: 10px 0;
  overflow-wrap: anywhere;
}

.penalty-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.3;
}

.fine-field {
  max-width: 100%;
}

.violation-admin-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.violation-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.violation-copy {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.violation-resident,
.violation-type,
.violation-date {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.violation-resident {
  display: block;
  line-height: 1.3;
}

.violation-unit {
  white-space: normal;
  overflow-wrap: anywhere;
}

.violation-type {
  display: block;
  margin-top: 2px;
  line-height: 1.35;
}

.violation-description-text,
.violation-dispute {
  width: 100%;
  max-width: 100%;
  margin: 5px 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.violation-dispute {
  padding: 6px 8px;
  border-radius: 6px;
  overflow: hidden;
}

.status-pill {
  flex: 0 0 auto;
  max-width: 130px;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

.violation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 8px;
}

.violation-actions .btn-small {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

@media (max-width: 800px) {
  .violation-form-grid {
    grid-template-columns: 1fr;
  }

  .violation-admin-head {
    flex-direction: column;
    gap: 8px;
  }

  .status-pill {
    align-self: flex-start;
    max-width: 100%;
  }

  .violation-actions {
    justify-content: flex-start;
  }
}


/* =========================================================
   Violations — panel title must stay inside the border
   ========================================================= */

.unit-management-panel:has(.violation-form-grid),
.unit-management-panel:has(.violation-admin-row) {
  padding: 14px;
  min-height: auto;
  height: auto;
  margin-bottom: 14px;
  overflow: hidden;
}

.unit-management-panel:has(.violation-form-grid) > .section-title,
.unit-management-panel:has(.violation-admin-row) > .section-title,
.unit-management-panel:has(.violation-table-wrap) > .section-title {
  display: block;
  position: static;
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-primary);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}

.unit-management-panel:has(.violation-form-grid) form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.violation-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--dash-card-border);
  border-radius: 8px;
  overscroll-behavior-x: contain;
}

.unit-management-panel:has(.violation-table-wrap) .violation-table {
  width: 2080px;
  min-width: 2080px;
  max-width: none;
  table-layout: fixed;
}

.unit-management-panel:has(.violation-table-wrap) .violation-table th,
.unit-management-panel:has(.violation-table-wrap) .violation-table td {
  box-sizing: border-box;
  min-width: 0;
  max-width: none;
  padding: 10px 12px;
  white-space: normal;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
}

.unit-management-panel:has(.violation-table-wrap) .violation-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.35;
}

.violation-table th:nth-child(1), .violation-table td:nth-child(1) { width: 90px; }
.violation-table th:nth-child(2), .violation-table td:nth-child(2) { width: 160px; }
.violation-table th:nth-child(3), .violation-table td:nth-child(3) { width: 105px; }
.violation-table th:nth-child(4), .violation-table td:nth-child(4) { width: 180px; }
.violation-table th:nth-child(5), .violation-table td:nth-child(5) { width: 280px; }
.violation-table th:nth-child(6), .violation-table td:nth-child(6) { width: 155px; }
.violation-table th:nth-child(7), .violation-table td:nth-child(7) { width: 140px; }
.violation-table th:nth-child(8), .violation-table td:nth-child(8) { width: 120px; }
.violation-table th:nth-child(9), .violation-table td:nth-child(9) { width: 115px; }
.violation-table th:nth-child(10), .violation-table td:nth-child(10) { width: 115px; }
.violation-table th:nth-child(11), .violation-table td:nth-child(11) { width: 105px; }
.violation-table th:nth-child(12), .violation-table td:nth-child(12) { width: 145px; }
.violation-table th:nth-child(13), .violation-table td:nth-child(13) { width: 230px; }
.violation-table th:nth-child(14), .violation-table td:nth-child(14) { width: 140px; }

.unit-management-panel:has(.violation-table-wrap) .violation-table td:nth-child(5),
.unit-management-panel:has(.violation-table-wrap) .violation-table td:nth-child(13) {
  overflow-wrap: anywhere;
}

.violation-table-note { display: block; margin-top: 6px; color: var(--text-muted); }
.violation-table .violation-actions { min-width: 125px; justify-content: flex-start; margin: 0; padding: 0; border: 0; }
.violation-table .violation-actions .btn-small { flex: 0 0 auto; }

.unit-management-panel:has(.violation-table-wrap) .violation-table .violation-actions {
  min-width: 0;
  max-width: none;
  flex-wrap: wrap;
  gap: 5px;
}

.unit-management-panel:has(.violation-table-wrap) .violation-table .violation-actions .btn-small {
  flex: 1 1 55px;
  min-width: 55px;
}

.violation-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px auto auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.violation-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.violation-history-heading .section-title {
  margin: 0;
}

.violation-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.violation-search input,
.violation-search select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}

.violation-search button,
.violation-search-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--btn-orange);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.unit-management-panel .violation-search button {
  width: auto;
  margin: 0;
}

.violation-search-reset {
  background: #293346;
}

.violation-search-count {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .violation-history-heading {
    flex-direction: column;
    gap: 6px;
  }

  .violation-search {
    grid-template-columns: minmax(0, 1fr) 1fr;
  }

  .violation-search input {
    grid-column: 1 / -1;
  }

  .violation-search-count {
    grid-column: 1 / -1;
  }
}

.violation-rate-wrap {
  max-width: 460px;
  margin: 4px 0 18px;
}

.violation-rate-wrap h4 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 13px;
}

.violation-rate-table {
  min-width: 0;
}

.violation-rate-table th,
.violation-rate-table td {
  padding: 8px 10px;
}

.violation-rate-table td:last-child {
  color: #fbbf24;
  font-weight: 700;
  white-space: nowrap;
}

/* Violation management layout and readable history */
.unit-management-panel.violation-create-panel,
.unit-management-panel.violation-history-panel {
  padding: 22px;
  border-radius: 10px;
}

.violation-create-panel > .section-title,
.violation-history-heading .section-title {
  margin: 0;
  color: #f8fafc;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}

.violation-create-panel #violationForm {
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 18px 22px;
}

.violation-create-panel #violationForm > .violation-form-grid,
.violation-create-panel #violationForm > .violation-description,
.violation-create-panel #violationForm > #dueDateField,
.violation-create-panel #violationForm > input[name="penalty_type"],
.violation-create-panel #violationForm > button[type="submit"] {
  grid-column: 1 / -1;
}

.violation-create-panel .violation-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.violation-create-panel .violation-evidence-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.violation-create-panel .violation-field {
  gap: 8px;
}

.violation-create-panel .violation-field label {
  color: #d4dbe6;
  font-size: 13px;
  font-weight: 650;
}

.violation-create-panel .violation-field input,
.violation-create-panel .violation-field select,
.violation-create-panel .violation-field textarea {
  font-size: 14px;
}

.violation-create-panel .violation-field small {
  font-size: 12px;
  line-height: 1.5;
}

.violation-create-panel .fine-field {
  max-width: none;
}

.violation-create-panel .violation-rate-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
}

.violation-create-panel .violation-rate-wrap h4 {
  margin-bottom: 10px;
  color: #e7edf5;
  font-size: 15px;
  line-height: 1.4;
}

.violation-create-panel .violation-rate-table th,
.violation-create-panel .violation-rate-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.violation-evidence-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.violation-create-panel .violation-evidence-control input[type="file"] {
  flex: 1 1 auto;
  min-width: 0;
}

.violation-create-panel .violation-evidence-control button[type="submit"] {
  flex: 0 0 auto;
  width: auto;
  min-width: 190px;
  min-height: 44px;
  margin: 0;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .violation-evidence-control {
    align-items: stretch;
    flex-direction: column;
  }

  .violation-create-panel .violation-evidence-control button[type="submit"] {
    width: 100%;
    min-width: 0;
  }
}

.violation-table .violation-action-form {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.violation-history-heading {
  align-items: center;
  margin-bottom: 16px;
}

.violation-search {
  grid-template-columns: minmax(260px, 1fr) minmax(170px, .35fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.violation-search-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.violation-search-field label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 650;
}

.violation-search input,
.violation-search select {
  height: 42px;
  font-size: 13px;
}

.violation-search button,
.violation-search-reset {
  min-height: 42px;
  font-size: 13px;
}

.violation-search-count {
  font-size: 12px;
}

.violation-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.violation-history-stat {
  display: flex;
  min-width: 0;
  min-height: 72px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(100, 116, 139, .22);
  border-radius: 8px;
  background: #141b29;
}

.violation-history-stat > span {
  color: #aeb9ca;
  font-size: 12px;
  line-height: 1.35;
}

.violation-history-stat > strong {
  color: #f8fafc;
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.violation-history-stat > small {
  color: #f5c66a;
  font-size: 12px;
}

.violation-history-stat-open > strong { color: #ffb454; }
.violation-history-stat-disputed > strong { color: #ff8798; }
.violation-history-stat-paid > strong { color: #6ee7b7; }

.unit-management-panel:has(.violation-table-wrap) .violation-table th {
  padding: 13px 12px;
  color: #d5dfec;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.unit-management-panel:has(.violation-table-wrap) .violation-table td {
  padding: 13px 12px;
  color: #e1e7ef;
  font-size: 13px;
  line-height: 1.5;
}

.unit-management-panel:has(.violation-table-wrap) .violation-table td:nth-child(9) {
  color: #fbbf24;
  font-weight: 700;
  white-space: nowrap;
}

.unit-management-panel:has(.violation-table-wrap) .violation-table td:nth-child(2),
.unit-management-panel:has(.violation-table-wrap) .violation-table td:nth-child(4) {
  font-weight: 600;
}

.violation-table-note {
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .violation-create-panel #violationForm {
    grid-template-columns: minmax(0, 1fr);
  }

  .violation-create-panel #violationForm > .fine-field,
  .violation-create-panel #violationForm > .violation-rate-wrap {
    grid-column: 1;
  }

  .violation-search {
    grid-template-columns: minmax(0, 1fr) minmax(150px, .5fr) auto auto;
  }
}

@media (max-width: 700px) {
  .unit-management-panel.violation-create-panel,
  .unit-management-panel.violation-history-panel {
    padding: 16px;
  }

  .violation-create-panel .violation-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .violation-search {
    grid-template-columns: minmax(0, 1fr) minmax(110px, .55fr);
  }

  .violation-search-field:first-child {
    grid-column: 1 / -1;
  }

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

  .violation-search button,
  .violation-search-reset {
    width: 100%;
  }

}


/* =========================================================
   Violations — compact All Violations panel
   ========================================================= */

.unit-management-panel:has(.violation-admin-row) {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 12px 14px 14px !important;
  margin-bottom: 14px;
  overflow: hidden;
}

.unit-management-panel:has(.violation-admin-row) .section-title {
  margin: 0 0 6px !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

.unit-management-panel:has(.violation-admin-row) .bookings-empty {
  margin: 0;
  padding: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* When there are actual violation rows, keep each item compact. */
.unit-management-panel:has(.violation-admin-row) .violation-admin-row {
  min-height: 0;
  height: auto;
  margin: 0 0 8px;
  padding: 10px;
}

.unit-management-panel:has(.violation-admin-row) .violation-admin-row:last-child {
  margin-bottom: 0;
}


/* =========================================================
   FIX: All Violations panel when it is EMPTY
   :has(.violation-admin-row) cannot match an empty panel,
   so target the second violation panel directly.
   ========================================================= */

.dashboard-main > .unit-management-panel + .unit-management-panel {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 12px 14px 14px !important;
  margin-bottom: 14px !important;
  overflow: hidden;
}

.dashboard-main > .unit-management-panel + .unit-management-panel > .section-title {
  margin: 0 0 6px !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

.dashboard-main > .unit-management-panel + .unit-management-panel .bookings-empty {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dashboard-main > .unit-management-panel + .unit-management-panel .violation-admin-row {
  min-height: 0 !important;
  height: auto !important;
}
/* ===== Visitor Log status badges (superadmin/visitorlog.php) ===== */
.visitor-badge { font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge-in { background: rgba(60, 190, 120, 0.15); color: #3cbe78; }
.badge-out { background: rgba(150, 150, 150, 0.15); color: var(--text-muted); }

.admin-page .unit-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px 20px;
  background-color: rgba(26, 30, 43, 0.94);
  border: 1px solid #30394d;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.admin-page .unit-page-head h2 {
  margin: 0 0 5px;
  color: var(--text-primary);
  font-size: 18px;
}

.admin-page .unit-page-head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-panel {
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
  padding: 18px;
}

.admin-panel table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.admin-panel th {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--dash-card-border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background-color: #0f1419;
}

.admin-panel td {
  padding: 10px;
  border-bottom: 1px solid var(--dash-card-border);
  color: var(--text-primary);
  font-size: 12px;
  vertical-align: middle;
}

.admin-panel tbody tr:hover {
  background-color: rgba(217, 119, 6, 0.05);
}

.admin-panel input[type="text"] {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-panel input[type="text"]:focus {
  border-color: var(--link-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.admin-panel button[type="submit"] {
  background-color: #10b981;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.admin-panel button[type="submit"]:hover {
  background-color: #059669;
}

.admin-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

/* =========================================================
   Pending Accounts page
   Moved from inline styles in pending_accounts.php
   ========================================================= */

.admin-page .pending-flash {
  margin: 0 0 20px;
}

.admin-page .pending-accounts-panel {
  margin: 0 0 20px;
  padding: 0;
  overflow: hidden;
}

.pending-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.pending-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  margin: 0;
  text-align: left;
}

.pending-table th {
  padding: 13px 14px;
  background-color: #0f1419;
  border-bottom: 1px solid var(--dash-card-border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pending-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--dash-card-border);
  color: #cbd5e1;
  font-size: 12px;
  vertical-align: middle;
}

.pending-table tbody tr:last-child td {
  border-bottom: none;
}

.pending-table tbody tr {
  transition: background-color 0.15s ease;
}

.pending-table tbody tr:hover {
  background-color: rgba(217, 119, 6, 0.05);
}

.pending-table .pending-name {
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
}

.pending-actions-cell {
  min-width: 300px;
}

.pending-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.approve-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.assigned-unit-input {
  width: 140px;
  padding: 7px 10px;
  border: 1px solid var(--input-border);
  border-radius: 7px;
  background-color: var(--input-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.assigned-unit-input::placeholder {
  color: #6b7280;
}

.assigned-unit-input:focus {
  border-color: var(--link-orange);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.pending-actions .btn-approve,
.pending-actions .btn-reject {
  width: auto;
  margin: 0;
  padding: 7px 13px;
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.pending-actions .btn-approve {
  background-color: #10b981;
}

.pending-actions .btn-approve:hover {
  background-color: #059669;
}

.pending-actions .btn-reject {
  background-color: var(--btn-danger);
}

.pending-actions .btn-reject:hover {
  background-color: #dc2626;
}

.pending-actions .btn-approve:active,
.pending-actions .btn-reject:active {
  transform: scale(0.98);
}

.manual-payment-confirm {
  display: grid;
  gap: 6px;
  min-width: 112px;
}

.manual-payment-confirm select {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #374151;
  border-radius: 5px;
  background: #0f1420;
  color: #e5e7eb;
  font-size: 11px;
}

.manual-payment-confirm .btn-small {
  width: 100%;
  padding: 7px 8px;
  font-size: 10px;
}

.payment-table .payment-date-cell,
.payment-table .payment-time-cell {
  min-width: 92px;
  white-space: nowrap;
}

.payment-table .payment-time-cell {
  min-width: 78px;
}

@media (max-width: 768px) {
  .admin-page .pending-flash {
    margin-bottom: 16px;
  }

  .pending-table {
    min-width: 820px;
  }
}

/* ===== Maintenance dashboard widgets (overview bars, completion ring, recent requests) ===== */
.maint-widgets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.maint-widget-card {
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
  padding: 16px;
}

.maint-widget-card h3 {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.status-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.status-bar-row:last-child {
  margin-bottom: 0;
}

.status-bar-label {
  flex: 0 0 90px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-bar-track {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.status-bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
}

.status-bar-fill.pending { background-color: #fbbf24; }
.status-bar-fill.in_progress { background-color: #93c5fd; }
.status-bar-fill.completed { background-color: #86efac; }
.status-bar-fill.rejected { background-color: #fca5a5; }

.status-bar-count {
  flex: 0 0 22px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.completion-ring-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.completion-ring {
  --pct: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#86efac calc(var(--pct) * 1%), rgba(255, 255, 255, 0.08) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.completion-ring-inner {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background-color: var(--dash-card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.completion-ring-inner strong {
  font-size: 22px;
  color: var(--text-primary);
}

.completion-ring-inner span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.completion-legend {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.maint-recent-card {
  background-color: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.maint-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.maint-recent-head h3 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.maint-recent-head a {
  font-size: 11px;
  color: var(--link-orange);
  text-decoration: none;
  font-weight: 600;
}

.maint-recent-head a:hover {
  text-decoration: underline;
}

.unit-status.completed {
  background-color: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

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