* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  max-width: 1060px;
  margin: 40px auto;
  padding: 0 16px;
  background: #f8fafc;
  color: #0f172a;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
}

h2.section-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
  color: #0f172a;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.tab-btn {
  background: #e2e8f0;
  color: #334155;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.tab-btn.active {
  background: #2563eb;
  color: #fff;
}

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

.role-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-badge.admin {
  background: #dbeafe;
  color: #1e40af;
}

.role-badge.employee {
  background: #dcfce7;
  color: #166534;
}

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pill.priority-low {
  background: #e2e8f0;
  color: #334155;
}

.pill.priority-medium {
  background: #fef3c7;
  color: #92400e;
}

.pill.priority-high {
  background: #fee2e2;
  color: #991b1b;
}

.pill.status-pending {
  background: #f1f5f9;
  color: #475569;
}

.pill.status-in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill.status-completed {
  background: #dcfce7;
  color: #166534;
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

/* Login Card */
.login-wrapper {
  max-width: 400px;
  margin: 70px auto;
}

.login-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 26px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.login-subtitle {
  margin: 0 0 18px;
  color: #64748b;
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.server-alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  font-size: 0.85rem;
  word-break: break-word;
}

.demo-hint {
  margin-top: 16px;
  padding: 10px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
}

.create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.employee-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.task-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
}

.task-desc-input {
  grid-column: 1 / -1;
}

.task-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  width: 100%;
  background: #fff;
  font-family: inherit;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field-hint {
  font-size: 0.78rem;
  color: #64748b;
}

button {
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-add {
  background: #2563eb;
  color: #fff;
}

.btn-edit {
  background: #f59e0b;
  color: #fff;
  margin-right: 6px;
}

.btn-delete {
  background: #ef4444;
  color: #fff;
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
}

.btn-logout {
  background: #334155;
  color: #fff;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.status-select-inline {
  padding: 5px 8px;
  font-size: 0.82rem;
  min-width: 125px;
}

.task-title-cell {
  font-weight: 600;
  color: #0f172a;
}

.task-desc-sub {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: #64748b;
  margin-top: 2px;
  max-width: 280px;
  white-space: normal;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

th {
  background: #f1f5f9;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #475569;
}

.empty-row {
  text-align: center;
  color: #64748b;
}

.actions-col {
  width: 165px;
}

/* Custom Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15);
  overflow: hidden;
  animation: modalFadeIn 0.16s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-close {
  background: transparent;
  color: #64748b;
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 8px;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
/* Partner's Directory */
.partner-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: center;
}

.partner-create-form input,
.partner-create-form select {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #ffffff;
}

.partner-role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.partner-role-badge.principal {
  background: #dbeafe;
  color: #1d4ed8;
}

.partner-role-badge.coordinator {
  background: #dcfce7;
  color: #15803d;
}

@media (max-width: 900px) {
  .partner-create-form {
    grid-template-columns: 1fr 1fr;
  }
  .partner-create-form button[type="submit"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .partner-create-form {
    grid-template-columns: 1fr;
  }
}
.partner-create-form {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}

.partner-kind-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.partner-kind-badge.health {
  background: #fce7f3;
  color: #be185d;
}

.partner-kind-badge.education {
  background: #ede9fe;
  color: #6d28d9;
}

@media (max-width: 1020px) {
  .partner-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .partner-create-form button[type="submit"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .partner-create-form {
    grid-template-columns: 1fr;
  }
}
/* Profile Pictures */
.avatar-img {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #cbd5e1;
  background: #e2e8f0;
  display: inline-block;
  vertical-align: middle;
}

.avatar-img.lg {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-width: 2px;
}

.avatar-placeholder {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #cbd5e1;
  vertical-align: middle;
}

.avatar-placeholder.lg {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 0.85rem;
  border-width: 2px;
}

td .avatar-img,
td .avatar-placeholder {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
}

.file-input-compact {
  padding: 7px 9px;
  font-size: 0.84rem;
}

.btn-upload-sm {
  background: #0f172a;
  color: #fff;
  padding: 7px 11px;
  font-size: 0.8rem;
}

.current-pfp-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
/* Clickable Table Avatars & Profile View Modal */
.clickable-avatar {
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.clickable-avatar:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.profile-view-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 6px 0;
}

.profile-view-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #cbd5e1;
  background: #e2e8f0;
}

.profile-view-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 2rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #cbd5e1;
}

.profile-view-name {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
}

.profile-view-meta {
  width: 100%;
  border-top: 1px solid #e2e8f0;
  margin-top: 6px;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font-size: 0.9rem;
}

.profile-view-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.profile-view-label {
  color: #64748b;
  font-weight: 600;
}

.profile-view-value {
  color: #0f172a;
  font-weight: 500;
  text-align: right;
}
/* Dashboard Tab */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.dash-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.03em;
}

.dash-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
}

.dash-stat-sub {
  font-size: 0.82rem;
  color: #475569;
}

.dash-session-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Enhanced Cross-Device Responsive Layout */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 1140px;
  margin: 28px auto;
  padding: 0 16px;
}

.topbar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.user-bar {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-tabs {
  gap: 8px;
  padding-bottom: 12px;
}

.tab-btn {
  flex: 0 1 auto;
  white-space: nowrap;
}

.card {
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.table-wrap {
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

th,
td {
  padding: 11px 14px;
}

/* Tablet breakpoint (<= 900px) */
@media (max-width: 900px) {
  body {
    margin: 18px auto;
    padding: 0 12px;
  }

  h1 {
    font-size: 1.35rem;
  }

  .create-form,
  .task-create-form,
  .employee-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .create-form button[type="submit"],
  .task-create-form button[type="submit"],
  .employee-create-form button[type="submit"] {
    grid-column: 1 / -1;
  }
}

/* Mobile breakpoint (<= 640px) */
@media (max-width: 640px) {
  body {
    margin: 12px auto;
    padding: 0 10px;
  }

  .login-wrapper {
    margin: 28px auto;
  }

  .login-card {
    padding: 20px 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 10px;
  }

  h1 {
    font-size: 1.25rem;
  }

  .user-bar {
    justify-content: space-between;
    gap: 6px;
  }

  #currentUserLabel {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 170px;
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .tab-btn {
    padding: 9px 10px;
    font-size: 0.84rem;
    text-align: center;
  }

  .card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .create-form,
  .task-create-form,
  .partner-create-form,
  .employee-create-form,
  .task-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dash-stat-card {
    padding: 14px;
  }

  .dash-stat-value {
    font-size: 1.3rem;
  }

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

  .modal-dialog {
    max-width: 100%;
    border-radius: 10px;
  }

  .modal-body {
    padding: 14px;
    max-height: 75vh;
    overflow-y: auto;
  }

  .modal-footer {
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .modal-footer button {
    flex: 1 1 auto;
  }

  th,
  td {
    padding: 9px 10px;
    font-size: 0.85rem;
  }

  .btn-edit,
  .btn-delete,
  .btn-secondary {
    padding: 7px 10px;
    font-size: 0.8rem;
  }
}

/* Very small phones (<= 380px) */
@media (max-width: 380px) {
  .nav-tabs {
    grid-template-columns: 1fr;
  }

  #currentUserLabel {
    max-width: 120px;
  }
}
/* Admin System Customization & Dark Mode */
:root {
  --app-bg-color: #f8fafc;
  --app-bg-image: none;
  --app-accent: #2563eb;
  --surface-bg: #ffffff;
  --surface-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --input-border: #cbd5e1;
}

body.dark-mode {
  --surface-bg: #1e293b;
  --surface-subtle: #0f172a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --input-border: #475569;
}

body {
  background-color: var(--app-bg-color);
  background-image: var(--app-bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-main);
}

.topbar,
.card,
.dash-stat-card,
.login-card,
.modal-dialog {
  background: var(--surface-bg);
  border-color: var(--border-color);
  color: var(--text-main);
}

.table-wrap {
  background: var(--surface-bg);
  border-color: var(--border-color);
}

th {
  background: var(--surface-subtle);
  color: var(--text-muted);
  border-bottom-color: var(--border-color);
}

td {
  border-bottom-color: var(--border-color);
}

.nav-tabs {
  border-bottom-color: var(--border-color);
}

.tab-btn {
  background: var(--surface-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.tab-btn.active {
  background: var(--app-accent);
  color: #ffffff;
  border-color: var(--app-accent);
}

.btn-add {
  background: var(--app-accent);
}

.btn-secondary {
  background: var(--surface-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

input,
select,
textarea {
  background: var(--surface-bg);
  color: var(--text-main);
  border-color: var(--input-border);
}

.demo-hint {
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.login-subtitle,
.field-hint,
.dash-stat-label,
.dash-stat-sub,
.empty-row,
.task-desc-sub,
.profile-view-label {
  color: var(--text-muted);
}

h2.section-title,
.task-title-cell,
.dash-stat-value,
.profile-view-name,
.profile-view-value,
.form-group label {
  color: var(--text-main);
}

.modal-header,
.modal-footer,
.profile-view-meta {
  border-color: var(--border-color);
}

.modal-footer {
  background: var(--surface-subtle);
}

.customize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.customize-toggle-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.customize-toggle-box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input-row input[type="color"] {
  width: 52px;
  height: 40px;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.customize-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.bg-preview-box {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bg-preview-thumb {
  width: 72px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--input-border);
}
/* Sidebar System Information ("What's New?") */
.app-layout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: start;
}

.app-main-column {
  min-width: 0;
}

.info-sidebar {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 20px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.whats-new-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--app-accent);
  color: #ffffff;
}

.sidebar-subtitle {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.whats-new-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.whats-new-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
}

.whats-new-item-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.whats-new-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.sidebar-footer-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

@media (max-width: 960px) {
  .app-layout-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .info-sidebar {
    position: static;
  }
}
/* Right-Side Card Layout for System Information Sidebar */
.app-layout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}

.app-main-column {
  grid-column: 1;
  min-width: 0;
}

.info-sidebar.right-side-card {
  grid-column: 2;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 18px -6px rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 20px;
}

.sidebar-footer-note {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

@media (max-width: 960px) {
  .app-layout-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-main-column,
  .info-sidebar.right-side-card {
    grid-column: 1;
    position: static;
  }
}
/* Compact Left-Side Card Layout for System Information Sidebar */
.app-layout-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.info-sidebar.left-side-card {
  grid-column: 1;
  grid-row: 1;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 4px 14px -6px rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 16px;
}

.app-main-column {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.info-sidebar.left-side-card .sidebar-header {
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.info-sidebar.left-side-card .sidebar-title {
  font-size: 0.88rem;
}

.info-sidebar.left-side-card .whats-new-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
}

.info-sidebar.left-side-card .sidebar-subtitle {
  font-size: 0.74rem;
  margin-bottom: 8px;
  line-height: 1.35;
}

.info-sidebar.left-side-card .whats-new-list {
  gap: 6px;
}

.info-sidebar.left-side-card .whats-new-item {
  padding: 7px 9px;
  border-radius: 7px;
}

.info-sidebar.left-side-card .whats-new-item-title {
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.info-sidebar.left-side-card .whats-new-item-desc {
  font-size: 0.72rem;
  line-height: 1.32;
}

.info-sidebar.left-side-card .sidebar-footer-note {
  margin-top: 8px;
  padding-top: 7px;
  font-size: 0.7rem;
}

@media (max-width: 960px) {
  .app-layout-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-main-column,
  .info-sidebar.left-side-card {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }
}
/* AdminLTE-Inspired Card Layout & Responsive Polish */
:root {
  --lte-card-header-bg: var(--surface-bg);
  --lte-card-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
  --lte-card-shadow-hover: 0 6px 16px -4px rgba(15, 23, 42, 0.14);
}

body.dark-mode {
  --lte-card-header-bg: var(--surface-bg);
  --lte-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-color);
  --lte-card-shadow-hover: 0 8px 18px -6px rgba(0, 0, 0, 0.65);
}

.app-layout-shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.info-sidebar.left-side-card {
  grid-column: 1;
  grid-row: 1;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--app-accent);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--lte-card-shadow);
  position: sticky;
  top: 16px;
}

.app-main-column {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.topbar {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--app-accent);
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: var(--lte-card-shadow);
}

.nav-tabs {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 18px;
  box-shadow: var(--lte-card-shadow);
}

.tab-btn {
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.tab-btn:hover:not(.active) {
  background: var(--border-color);
}

.tab-btn.active {
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.card,
.table-wrap,
.login-card,
.modal-dialog {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--app-accent);
  border-radius: 8px;
  box-shadow: var(--lte-card-shadow);
}

.card {
  padding: 16px 18px;
  margin-bottom: 18px;
}

.card h2.section-title {
  margin: -16px -18px 14px;
  padding: 11px 18px;
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  background: var(--lte-card-header-bg);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-wrap {
  padding: 0;
  overflow-x: auto;
}

.task-filters {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--lte-card-shadow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.dash-stat-card {
  position: relative;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--app-accent);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: var(--lte-card-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lte-card-shadow-hover);
}

.dash-stat-card:nth-child(2) {
  border-left-color: #10b981;
}

.dash-stat-card:nth-child(3) {
  border-left-color: #f59e0b;
}

.dash-stat-card:nth-child(4) {
  border-left-color: #6366f1;
}

.whats-new-item {
  border-left: 3px solid var(--app-accent);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.whats-new-item:hover {
  transform: translateX(2px);
}

@media (max-width: 1024px) {
  .app-layout-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 960px) {
  .app-layout-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-main-column {
    grid-column: 1;
    grid-row: 1;
  }

  .info-sidebar.left-side-card {
    grid-column: 1;
    grid-row: 2;
    position: static;
  }

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

@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    padding: 14px;
  }

  .card h2.section-title {
    margin: -14px -14px 12px;
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .nav-tabs {
    padding: 8px;
  }
}
/* Move Sidebar to Right Side (AdminLTE Card Layout) */
.app-layout-shell {
  grid-template-columns: minmax(0, 1fr) 255px;
}

.app-main-column {
  grid-column: 1;
  grid-row: 1;
}

.info-sidebar.left-side-card,
.info-sidebar.right-side-card {
  grid-column: 2;
  grid-row: 1;
}

@media (max-width: 1024px) {
  .app-layout-shell {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 14px;
  }
}

@media (max-width: 960px) {
  .app-layout-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-main-column {
    grid-column: 1;
    grid-row: 1;
  }

  .info-sidebar.left-side-card,
  .info-sidebar.right-side-card {
    grid-column: 1;
    grid-row: 2;
    position: static;
  }
}
/* Full-Screen Fluid & Responsive Layout */
html,
body {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  min-height: 100vh;
}

body {
  padding: 16px 24px !important;
}

#appSection {
  width: 100%;
  max-width: none;
}

.login-wrapper {
  max-width: 440px;
  width: 100%;
  margin: 6vh auto !important;
}

.topbar,
.app-layout-shell {
  width: 100%;
  max-width: none;
}

.app-layout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
  align-items: start;
}

.app-main-column {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  width: 100%;
}

.info-sidebar.left-side-card,
.info-sidebar.right-side-card {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
}

.table-wrap {
  width: 100%;
}

table {
  width: 100%;
  min-width: 680px;
}

@media (max-width: 1200px) {
  body {
    padding: 14px 18px !important;
  }

  .app-layout-shell {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 16px;
  }
}

@media (max-width: 960px) {
  body {
    padding: 12px 14px !important;
  }

  .app-layout-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-main-column {
    grid-column: 1;
    grid-row: 1;
  }

  .info-sidebar.left-side-card,
  .info-sidebar.right-side-card {
    grid-column: 1;
    grid-row: 2;
    position: static;
  }
}

@media (max-width: 640px) {
  body {
    padding: 10px !important;
  }

  .login-wrapper {
    margin: 20px auto !important;
  }
}
/* Remove Card Callout Borders & Callout Accents While Keeping Clean Surfaces */
.info-sidebar.left-side-card,
.info-sidebar.right-side-card,
.topbar,
.card,
.table-wrap,
.login-card,
.modal-dialog {
  border-top: 1px solid var(--border-color) !important;
  box-shadow: none !important;
}

.dash-stat-card,
.dash-stat-card:nth-child(2),
.dash-stat-card:nth-child(3),
.dash-stat-card:nth-child(4) {
  border-left: 1px solid var(--border-color) !important;
  box-shadow: none !important;
}

.whats-new-item {
  border-left: 1px solid var(--border-color) !important;
}
/* Subtle Noticeable Contrast Between Default Background and Cards */
:root {
  --app-bg-color: #e6ecf5;
  --surface-bg: #ffffff;
  --surface-subtle: #f1f5f9;
  --border-color: #cbd5e1;
}

body.dark-mode {
  --app-bg-color: #090e1a;
  --surface-bg: #1e293b;
  --surface-subtle: #0f172a;
  --border-color: #334155;
}

body {
  background-color: var(--app-bg-color);
}
/* Left-Side Vertical Navigation Bar Layout */
.app-layout-shell {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr) 265px !important;
  gap: 20px !important;
  align-items: start !important;
}

.nav-tabs.left-sidenav {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  margin-bottom: 0 !important;
  padding: 12px !important;
  background: var(--surface-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  position: sticky;
  top: 16px;
}

.sidenav-header {
  justify-content: center;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 2px 8px 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2px;
}

.nav-tabs.left-sidenav .tab-btn {
  width: 100%;
  text-align: left !important;
  padding: 10px 12px !important;
  border-radius: 6px;
  white-space: nowrap;
}

.app-main-column {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0;
  width: 100%;
}

.info-sidebar.left-side-card,
.info-sidebar.right-side-card {
  grid-column: 3 !important;
  grid-row: 1 !important;
  width: 100%;
  top: 16px;
}

@media (max-width: 1240px) {
  .app-layout-shell {
    grid-template-columns: 205px minmax(0, 1fr) 235px !important;
    gap: 16px !important;
  }
}

@media (max-width: 1024px) {
  .app-layout-shell {
    grid-template-columns: 200px minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  .info-sidebar.left-side-card,
  .info-sidebar.right-side-card {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    position: static !important;
  }
}

@media (max-width: 768px) {
  .app-layout-shell {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .nav-tabs.left-sidenav {
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: static !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    padding: 8px !important;
    gap: 6px !important;
  }

  .sidenav-header {
    display: none;
  }

  .nav-tabs.left-sidenav .tab-btn {
    width: auto;
    flex: 1 1 calc(50% - 6px);
    text-align: center !important;
    padding: 8px 10px !important;
  }

  .app-main-column {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .info-sidebar.left-side-card,
  .info-sidebar.right-side-card {
    grid-column: 1 !important;
    grid-row: 3 !important;
    position: static !important;
  }
}

@media (max-width: 420px) {
  .nav-tabs.left-sidenav .tab-btn {
    flex: 1 1 100%;
  }
}
/* Welcome Bulletin Board & Photo/PDF Slides */
.welcome-banner-card {
  transition: padding-right 0.18s ease, margin-top 0.18s ease;
}

.welcome-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

.bulletin-stage-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulletin-stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bulletin-autoplay-btn.is-playing {
  border-color: var(--app-accent);
  color: var(--app-accent);
}

.bulletin-counter {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bulletin-viewport {
  min-height: 320px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bulletin-empty-state {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.bulletin-viewport {
  transition: min-height 0.35s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
}

.bulletin-slide-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translate3d(18px, 0, 0);
  transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.bulletin-slide-card.slide-dir-prev {
  transform: translate3d(-18px, 0, 0);
}

.bulletin-slide-card.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.bulletin-photo-img {
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .bulletin-viewport,
  .bulletin-slide-card,
  .bulletin-photo-img {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

.bulletin-slide-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.bulletin-slide-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-main);
}

.bulletin-slide-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bulletin-media-wrap {
  width: 100%;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.bulletin-photo-img {
  display: block;
  max-width: 100%;
  max-height: 460px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.bulletin-pdf-box {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.bulletin-pdf-frame {
  width: 100%;
  height: 440px;
  border: 0;
  background: #ffffff;
}

.bulletin-pdf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-bg);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.bulletin-open-link {
  text-decoration: none;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.bulletin-slide-caption {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.45;
  white-space: pre-wrap;
}

.bulletin-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bulletin-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bulletin-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: var(--input-border);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.28s ease, width 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.28s ease;
}

.bulletin-dot.active {
  width: 22px;
  border-radius: 999px;
  background: var(--app-accent);
  transform: none;
}

.modal-dialog.modal-dialog-wide {
  width: min(94vw, 1080px);
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.bulletin-modal-body {
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  padding: 20px 24px;
}

.bulletin-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}

.bulletin-upload-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulletin-form-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
}

.bulletin-caption-input {
  width: 100%;
  resize: vertical;
}

.bulletin-form-actions {
  display: flex;
  justify-content: flex-end;
}

.bulletin-manage-list-wrap {
  margin-top: 0;
  padding-top: 0;
  padding-left: 22px;
  border-top: none;
  border-left: 1px solid var(--border-color);
  max-height: 58vh;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .modal-dialog.modal-dialog-wide {
    width: min(96vw, 720px);
    max-width: 720px;
  }

  .bulletin-modal-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .bulletin-manage-list-wrap {
    margin-top: 4px;
    padding-top: 16px;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border-color);
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 600px) {
  .modal-dialog.modal-dialog-wide {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
  }

  .bulletin-modal-body {
    padding: 14px;
  }

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

  .bulletin-form-actions .btn-add {
    width: 100%;
  }

  .bulletin-manage-item {
    flex-direction: column;
    align-items: stretch;
  }

  .bulletin-manage-item .bulletin-delete-btn {
    align-self: flex-end;
  }
}

.bulletin-manage-heading {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--text-main);
}

.bulletin-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bulletin-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.bulletin-manage-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
}

.bulletin-type-tag {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.bulletin-type-tag.photo {
  background: #dbeafe;
  color: #1d4ed8;
}

.bulletin-type-tag.pdf {
  background: #fee2e2;
  color: #991b1b;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
}

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

  .bulletin-pdf-frame {
    height: 320px;
  }
}
/* Partner Barangay Dropdown Manager (Admin) */
.partner-barangay-card {
  margin-bottom: 16px;
}

.partner-barangay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.partner-barangay-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 14px;
}

.partner-barangay-form input {
  flex: 1 1 240px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  background: var(--card-bg);
  color: var(--text);
}

.partner-barangay-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.partner-barangay-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt, rgba(148, 163, 184, 0.12));
  font-size: 0.85rem;
  font-weight: 500;
}

.partner-barangay-chip-del {
  border: none;
  background: transparent;
  color: #ef4444;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.95rem;
  line-height: 1;
}

.partner-barangay-chip-del:hover {
  color: #b91c1c;
}


/* Persistent System Footer */
#appSection {
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

#appSection.hidden {
  display: none !important;
}

.app-layout-shell {
  flex: 1 0 auto;
}

.system-footer {
  margin-top: 22px;
  padding: 12px 18px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.system-footer-clean,
.system-footer-right-align {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-left: auto;
  text-align: right;
}

.footer-copyright {
  font-weight: 500;
  color: var(--text-muted);
}

.footer-sep {
  opacity: 0.55;
}

.footer-version-text {
  font-weight: 700;
  color: var(--text-main);
}

@media (max-width: 900px) {
  .system-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
  }

}

/* Hide System Information Sidebar on non-Welcome tabs and expand main workspace */
.info-sidebar.hidden {
  display: none !important;
}

.app-layout-shell.no-right-sidebar {
  grid-template-columns: 225px minmax(0, 1fr) !important;
}

@media (max-width: 1240px) {
  .app-layout-shell.no-right-sidebar {
    grid-template-columns: 205px minmax(0, 1fr) !important;
  }
}

@media (max-width: 1024px) {
  .app-layout-shell.no-right-sidebar {
    grid-template-columns: 200px minmax(0, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .app-layout-shell.no-right-sidebar {
    grid-template-columns: 1fr !important;
  }
}

/* Analytics Graph Sidebar (Right Side on Non-Welcome Tabs) */
.analytics-graph-sidebar .sidebar-header {
  align-items: flex-start;
  gap: 8px;
}

.graph-mode-switch {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-subtle);
  flex-shrink: 0;
}

.graph-mode-btn {
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.graph-mode-btn.active {
  background: var(--app-accent);
  color: #ffffff;
}

.graph-canvas-wrap {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-subtle);
  display: flex;
  justify-content: center;
  align-items: center;
}

#sidebarGraphCanvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.graph-legend-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.graph-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-main);
  padding: 4px 6px;
  border-radius: 5px;
  background: var(--surface-subtle);
}

.graph-legend-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
}

.graph-legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* Compact Field Font Sizing & Overflow Fit Across Forms, Inputs, Selects, Tables & Cards */
input,
select,
textarea {
  font-size: 0.84rem !important;
  line-height: 1.35 !important;
  padding: 7px 10px !important;
  text-overflow: ellipsis;
}

input[type="file"],
.file-input-compact {
  font-size: 0.78rem !important;
  line-height: 1.3 !important;
  padding: 6px 8px !important;
}

.form-group label {
  font-size: 0.78rem !important;
  line-height: 1.25 !important;
}

.field-hint {
  font-size: 0.72rem !important;
  line-height: 1.3 !important;
}

.select-inline {
  font-size: 0.78rem !important;
  line-height: 1.25 !important;
  padding: 4px 7px !important;
}

th {
  font-size: 0.74rem !important;
  line-height: 1.25 !important;
}

td {
  font-size: 0.8rem !important;
  line-height: 1.32 !important;
}

button,
.btn-add,
.btn-secondary,
.btn-edit,
.btn-delete,
.btn-logout,
.btn-upload-sm,
.tab-btn {
  font-size: 0.8rem !important;
  line-height: 1.25 !important;
}

.btn-sm,
.graph-mode-btn,
.bulletin-type-tag,
.pill,
.role-badge,
.partner-role-badge,
.partner-kind-badge {
  font-size: 0.72rem !important;
  line-height: 1.2 !important;
}

.sidebar-title,
.modal-header h2,
.section-title {
  font-size: 0.98rem !important;
  line-height: 1.3 !important;
}

.sidebar-subtitle,
.whats-new-item-desc,
.graph-legend-item,
.bulletin-manage-info,
.bulletin-slide-caption {
  font-size: 0.78rem !important;
  line-height: 1.35 !important;
}

/* Partner's Directory Category Filter Controls (Barangay & Role) */
.partner-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.partner-filter-bar input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
}

.partner-filter-bar select {
  flex: 0 1 180px;
  min-width: 145px;
}

@media (max-width: 640px) {
  .partner-filter-bar select,
  .partner-filter-bar #resetPartnerFiltersBtn {
    flex: 1 1 100%;
  }
}

/* Partner's Directory Specimen Attachment & Link Badge */
.partner-file-field {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  color: #475569;
}

.partner-file-label {
  font-weight: 600;
  line-height: 1.1;
}

.specimen-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.specimen-link-badge:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* Compact Partner's Directory Table Fit */
.partner-directory-table-wrap {
  overflow-x: auto;
}

.partner-directory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  line-height: 1.3;
  table-layout: auto;
}

.partner-directory-table th,
.partner-directory-table td {
  padding: 6px 8px;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.partner-directory-table th {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.partner-directory-table td .avatar-img,
.partner-directory-table td .avatar-placeholder {
  width: 24px;
  height: 24px;
  min-width: 24px;
  font-size: 0.7rem;
}

.partner-directory-table .field-hint {
  font-size: 0.68rem;
  line-height: 1.2;
}

.partner-directory-table .partner-role-badge,
.partner-directory-table .partner-kind-badge,
.partner-directory-table .specimen-link-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  white-space: nowrap;
}

.partner-directory-table td:last-child {
  white-space: nowrap;
}

.partner-directory-table .btn-edit,
.partner-directory-table .btn-delete {
  padding: 3px 7px;
  font-size: 0.7rem;
}

/* Dynamic System Brand Title in Topbar & Customize Grid */
.topbar-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.system-brand-title {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--app-accent, #2563eb);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-mode .system-brand-title {
  color: #93c5fd;
}

.customize-title-group {
  grid-column: 1 / -1;
}

/* Login Page System Title, Logo & Customization Section */
.login-brand-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.login-brand-logo {
  max-height: 52px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.login-system-title {
  margin: 0;
  font-size: clamp(1.38rem, 2.1vw, 1.72rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--app-accent, #2563eb);
  line-height: 1.22;
  word-break: break-word;
}

.customize-subsection-title {
  margin: 20px 0 4px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
}

body.dark-mode .customize-subsection-title {
  border-top-color: #334155;
  color: #f1f5f9;
}

/* Login Page Full-Width Edge Layout: Fitted Information Card + Right-Edge Login Card */
#loginSection.login-wrapper {
  max-width: none !important;
  width: 100% !important;
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  box-sizing: border-box;
}

#loginSection.login-wrapper.hidden {
  display: none !important;
}

.login-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 420px);
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-height: 100vh;
  max-width: none;
  margin: 0;
}

.login-info-card {
  --login-info-card-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
  grid-column: 1;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: var(--login-info-card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(203, 213, 225, 0.85) !important;
  border-radius: 0;
  padding: clamp(28px, 3.6vw, 48px) clamp(24px, 3.5vw, 44px);
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  box-sizing: border-box;
}

.login-info-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--app-accent, #2563eb), #38bdf8, var(--app-accent, #2563eb));
}

.login-info-card::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.09) 0%, rgba(37, 99, 235, 0) 70%);
  pointer-events: none;
}

.login-info-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.login-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--app-accent, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.login-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--app-accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.login-info-pill {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid #e2e8f0;
  padding: 4px 11px;
  border-radius: 999px;
}

.login-info-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.24;
  word-break: break-word;
}

.login-info-body {
  flex: 1 1 auto;
  font-size: clamp(0.96rem, 1.1vw, 1.06rem);
  line-height: 1.75;
  color: #051c01;
  white-space: pre-line;
  word-break: break-word;
  padding: 18px 20px;
  background: #edf3f0;
  border: 1px solid #243342;
  border-radius: 14px;
}

.login-info-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.login-highlight-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.login-chip-icon {
  color: var(--app-accent, #2563eb);
  font-size: 0.72rem;
}

#loginSection .login-card {
  grid-column: 2;
  justify-self: end;
  width: 100%;
  max-width: 420px;
  height: 100%;
  margin: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(203, 213, 225, 0.9) !important;
  border-left: 1px solid #e2e8f0 !important;
  border-radius: 0;
  padding: clamp(28px, 3.2vw, 40px) clamp(24px, 2.8vw, 36px);
  box-shadow: -12px 0 32px -16px rgba(15, 23, 42, 0.12) !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

#loginSection .login-brand-header {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

#loginSection .login-card h2 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #0f172a;
}

#loginSection .login-subtitle {
  margin-bottom: 20px;
  font-size: 0.92rem;
  color: #64748b;
}

#loginSection .login-form .form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

#loginSection .login-form input[type="text"],
#loginSection .login-form input[type="password"] {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.94rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

#loginSection .login-form input[type="text"]:focus,
#loginSection .login-form input[type="password"]:focus {
  background: #ffffff;
  border-color: var(--app-accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.login-password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.login-password-field input {
  width: 100%;
  padding-right: 58px !important;
}

.login-pwd-toggle {
  position: absolute;
  right: 8px;
  padding: 4px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.login-pwd-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.login-submit-btn {
  margin-top: 4px;
  padding: 11px 16px !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px -6px rgba(37, 99, 235, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

#loginSection .demo-hint {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.81rem;
}

#customizeLoginInfoBodyInput {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
}

body.dark-mode #customizeLoginInfoBodyInput {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

@media (max-width: 960px) {
  #loginSection.login-wrapper {
    min-height: auto;
    justify-content: stretch;
    padding: 0 !important;
  }
  .login-split-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 0;
  }
  .login-info-card,
  #loginSection .login-card {
    grid-column: 1;
    justify-self: stretch;
    max-width: none;
    height: auto;
    box-shadow: none !important;
  }
  .login-info-card {
    padding: 24px 20px;
  }
  #loginSection .login-card {
    padding: 24px 20px;
    border-top: 1px solid #e2e8f0 !important;
  }
}

/* Force Uppercase Display on All Text & Textarea Inputs (Except Login Form) */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
textarea {
  text-transform: uppercase;
}

#loginForm input,
#loginSection input {
  text-transform: none !important;
}

/* Login Information Card Carousel & Responsive Full-Width Fitting */
.login-carousel-controls-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.login-carousel-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.login-carousel-nav-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: var(--app-accent, #2563eb);
  color: var(--app-accent, #2563eb);
  transform: translateY(-1px);
}

.login-carousel-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.login-carousel-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
}

.login-carousel-track {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.login-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  min-height: 0;
}

.login-carousel-slide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.login-carousel-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(37, 99, 235, 0.12);
  color: var(--app-accent, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.login-carousel-media-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 240px;
  max-height: clamp(260px, 44vh, 460px);
  overflow: hidden;
  border-radius: 14px;
  background: #2f4050;
  border: 1px solid #243342;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.login-carousel-photo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: clamp(260px, 44vh, 460px);
  object-fit: contain;
  display: block;
}

.login-carousel-pdf-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: clamp(260px, 46vh, 620px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #243342;
  background: #2f4050;
  box-sizing: border-box;
  container-type: inline-size;
}

.login-carousel-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  padding: 8px 14px;
  background: #243342;
  color: #f8fafc;
  font-size: 0.78rem;
  min-width: 0;
  box-sizing: border-box;
}

.login-carousel-open-link {
  color: #93c5fd;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.login-carousel-open-link:hover {
  text-decoration: underline;
}

.login-carousel-pdf-frame {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: clamp(220px, 40vh, 560px);
  border: 0;
  background: #ffffff;
  box-sizing: border-box;
  transform: none;
}

@container (max-width: 540px) {
  .login-carousel-pdf-wrap {
    min-height: clamp(210px, 36vh, 320px);
  }
  .login-carousel-pdf-frame {
    min-height: clamp(180px, 32vh, 280px);
  }
  .login-carousel-pdf-toolbar {
    padding: 7px 10px;
    font-size: 0.74rem;
  }
}

.login-carousel-slide-caption {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.login-carousel-footer-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.login-carousel-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.login-carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: #cbd5e1;
  cursor: pointer;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.login-carousel-dot.active {
  width: 26px;
  background: var(--app-accent, #2563eb);
}

.login-carousel-admin-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

body.dark-mode .login-carousel-admin-box {
  background: #0f172a;
  border-color: #334155;
}

.login-carousel-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-carousel-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

body.dark-mode .login-carousel-manage-item {
  background: #1e293b;
  border-color: #334155;
}

.login-carousel-manage-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.login-carousel-manage-cap {
  font-size: 0.82rem;
  color: #64748b;
}

.login-carousel-manage-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-accent, #2563eb);
  text-decoration: none;
}

.login-carousel-manage-link:hover {
  text-decoration: underline;
}

/* Responsive Breakpoints for Login Split Carousel & Right Login Card */
@media (max-width: 1180px) {
  .login-split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  }
  .login-info-card {
    padding: clamp(22px, 3vw, 36px);
  }
  #loginSection .login-card {
    max-width: 380px;
    padding: clamp(22px, 2.8vw, 32px) 22px;
  }
}

@media (max-width: 960px) {
  #loginSection.login-wrapper {
    min-height: 100vh;
    padding: 0 !important;
  }
  .login-split-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    gap: 0;
  }
  .login-info-card,
  #loginSection .login-card {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    height: auto;
    box-shadow: none !important;
  }
  .login-info-card {
    padding: 20px 16px;
    gap: 16px;
  }
  .login-carousel-media-wrap,
  .login-carousel-photo {
    max-height: 240px;
    min-height: 170px;
  }
  .login-carousel-pdf-wrap {
    min-height: clamp(220px, 36vh, 320px);
  }
  .login-carousel-pdf-frame {
    width: 100%;
    height: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: clamp(190px, 32vh, 280px);
    transform: none;
  }
  .login-info-highlights {
    gap: 6px;
  }
  .login-highlight-chip {
    font-size: 0.74rem;
    padding: 5px 10px;
  }
  #loginSection .login-card {
    padding: 22px 16px;
    border-top: 1px solid #e2e8f0 !important;
    border-left: none !important;
  }
}

@media (max-width: 520px) {
  .login-info-card {
    padding: 16px 12px;
    gap: 12px;
  }
  .login-carousel-pdf-wrap {
    border-radius: 10px;
  }
  .login-carousel-pdf-wrap {
    min-height: clamp(200px, 34vh, 280px);
  }
  .login-carousel-pdf-frame {
    width: 100%;
    height: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: clamp(175px, 30vh, 240px);
    transform: none;
  }
}


/* Login PDF Iframe col-md Width (1 to 12 columns of 12) */
.login-carousel-pdf-wrap[data-col-md] {
  --login-iframe-col-span: 12;
  width: calc((100% / 12) * var(--login-iframe-col-span));
  max-width: 100%;
  min-width: 0;
}
.login-carousel-pdf-wrap[data-col-md="1"]  { --login-iframe-col-span: 1; }
.login-carousel-pdf-wrap[data-col-md="2"]  { --login-iframe-col-span: 2; }
.login-carousel-pdf-wrap[data-col-md="3"]  { --login-iframe-col-span: 3; }
.login-carousel-pdf-wrap[data-col-md="4"]  { --login-iframe-col-span: 4; }
.login-carousel-pdf-wrap[data-col-md="5"]  { --login-iframe-col-span: 5; }
.login-carousel-pdf-wrap[data-col-md="6"]  { --login-iframe-col-span: 6; }
.login-carousel-pdf-wrap[data-col-md="7"]  { --login-iframe-col-span: 7; }
.login-carousel-pdf-wrap[data-col-md="8"]  { --login-iframe-col-span: 8; }
.login-carousel-pdf-wrap[data-col-md="9"]  { --login-iframe-col-span: 9; }
.login-carousel-pdf-wrap[data-col-md="10"] { --login-iframe-col-span: 10; }
.login-carousel-pdf-wrap[data-col-md="11"] { --login-iframe-col-span: 11; }
.login-carousel-pdf-wrap[data-col-md="12"] { --login-iframe-col-span: 12; }

@media (max-width: 767px) {
  .login-carousel-pdf-wrap[data-col-md] {
    width: 100%;
  }
}


/* Font Awesome Icons in Navigation Tabs */
.nav-tabs .sidenav-header .fa-compass {
  margin-right: 6px;
}
.nav-tabs .tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-tabs .tab-btn .nav-fa-icon {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}


/* Facebook Feed Style Bulletin Post Composer Modal */
.fb-post-modal-dialog {
  max-width: 880px;
}
.fb-post-modal-header h2 {
  width: 100%;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}
.fb-post-modal-body {
  background: var(--surface-subtle);
}
.fb-composer-card {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  gap: 12px;
}
.fb-composer-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fb-composer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--app-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fb-composer-author-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fb-composer-author-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
}
.fb-composer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
}
.fb-composer-textarea {
  border: none !important;
  background: transparent !important;
  padding: 4px 2px !important;
  font-size: 1rem !important;
  line-height: 1.45 !important;
  box-shadow: none !important;
  min-height: 88px;
}
.fb-composer-textarea:focus {
  outline: none !important;
}
.fb-composer-meta-row {
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.fb-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.fb-add-to-post-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-bg);
}
.fb-add-to-post-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}
.fb-add-to-post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  color: #16a34a;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.fb-attach-btn:hover {
  background: var(--surface-bg);
  border-color: var(--app-accent);
}
.fb-media-preview-box {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.fb-media-preview-img {
  max-height: 48px;
  max-width: 10%;
  width: auto;
  height: auto;
  border-radius: 5px;
  object-fit: contain;
}
.fb-media-preview-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}
.fb-media-preview-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 8px 12px;
}
.fb-media-clear-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--surface-bg);
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-post-submit-btn {
  width: 100%;
  justify-content: center;
  font-weight: 700;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Top-Positioned Post & Choose File Buttons in Bulletin Composer */
.fb-composer-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}
.fb-composer-top-bar .fb-composer-author-row {
  min-width: 0;
  flex: 1 1 auto;
}
.fb-below-file-post-wrap {
  width: 100%;
}
.fb-below-file-post-wrap .fb-post-submit-btn {
  width: 100%;
  padding: 10px 18px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.fb-top-choose-file-bar {
  background: var(--surface-subtle);
  border: 1.5px dashed var(--app-accent);
  padding: 10px 14px;
}
.fb-choose-file-btn {
  background: var(--app-accent) !important;
  color: #ffffff !important;
  border-color: var(--app-accent) !important;
  padding: 7px 14px !important;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.12);
}
.fb-choose-file-btn:hover {
  filter: brightness(1.06);
}


/* Welcome Bulletin Carousel Comments Section */
.bulletin-comments-card {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bulletin-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}
.bulletin-comments-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bulletin-comments-heading {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.bulletin-comment-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--app-accent);
}
.bulletin-comments-post-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.bulletin-comment-form {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.bulletin-comment-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
  margin-top: 2px;
}
.bulletin-comment-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bulletin-comment-textarea {
  width: 100%;
  resize: vertical;
  min-height: 62px;
  border-radius: 10px;
  background: var(--surface-subtle);
  font-size: 0.88rem;
}
.bulletin-comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.bulletin-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bulletin-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.bulletin-comment-bubble {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 9px 12px;
}
.bulletin-comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.bulletin-comment-author {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}
.bulletin-comment-role {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.bulletin-comment-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.bulletin-comment-delete-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.bulletin-comment-delete-btn:hover {
  color: #dc2626;
}
.bulletin-comment-text {
  font-size: 0.86rem;
  color: var(--text-main);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}


/* Editable & Draggable Schedule Calendar (Picture-Inspired Grid) */
.schedule-calendar-card.dtc-calendar-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}
.dtc-banner-header {
  background: linear-gradient(135deg, #07224d 0%, #0d3b7c 100%);
  color: #ffffff;
}
.dtc-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px 10px;
  flex-wrap: wrap;
}
.dtc-month-heading-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dtc-month-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #ffffff;
}
.dtc-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease;
}
.dtc-nav-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}
.dtc-banner-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.dtc-today-btn {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.dtc-today-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}
.dtc-year-label {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #ffffff;
}
.dtc-subbar {
  background: #4b4f54;
  color: #ffffff;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.dtc-subbar-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.dtc-subbar-hint {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.88);
}
.schedule-cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.schedule-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.schedule-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.schedule-dot.priority-high { background: #c81e1e; }
.schedule-dot.priority-medium { background: #15803d; }
.schedule-dot.priority-low { background: #1d4ed8; }
.schedule-dot.status-completed { background: #64748b; }
.schedule-unscheduled-badge {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--app-accent);
}
.schedule-unscheduled-bar {
  margin: 0 16px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.schedule-unscheduled-bar.is-drop-over {
  border-color: var(--app-accent);
  background: rgba(37, 99, 235, 0.08);
}
.schedule-unscheduled-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.schedule-unscheduled-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.schedule-cal-grid-wrap.dtc-grid-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 0 16px 16px;
  box-sizing: border-box;
}
.schedule-cal-weekdays.dtc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(122px, 1fr));
  background: var(--surface-subtle);
  border: 1px solid #94a3b8;
  border-bottom: none;
}
.schedule-cal-weekdays.dtc-weekdays > div {
  padding: 7px 6px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  border-right: 1px solid #94a3b8;
}
.schedule-cal-weekdays.dtc-weekdays > div:last-child {
  border-right: none;
}
.schedule-cal-grid.dtc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(122px, 1fr));
  border-top: 1px solid #94a3b8;
  border-left: 1px solid #94a3b8;
  background: var(--surface-bg);
}
.schedule-cal-cell.dtc-cell {
  min-height: 128px;
  padding: 5px 6px 6px;
  background: var(--surface-bg);
  border-right: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}
.schedule-cal-cell.dtc-cell:hover {
  background: var(--surface-subtle);
}
.schedule-cal-cell.dtc-cell.is-other-month {
  opacity: 0.55;
}
.schedule-cal-cell.dtc-cell.is-today {
  background: rgba(29, 78, 216, 0.06);
}
.schedule-cal-cell.dtc-cell.is-today .dtc-day-num {
  background: #0d3b7c;
  color: #ffffff;
  border-radius: 4px;
  padding: 0 5px;
}
.schedule-cal-cell.dtc-cell.is-drop-over {
  background: rgba(37, 99, 235, 0.14);
  box-shadow: inset 0 0 0 2px #1d4ed8;
}
.schedule-cell-top.dtc-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.schedule-day-num.dtc-day-num {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.schedule-cell-add-btn.dtc-add-btn {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.75;
}
.schedule-cal-cell.dtc-cell:hover .schedule-cell-add-btn.dtc-add-btn {
  opacity: 1;
}
.schedule-cell-add-btn.dtc-add-btn:hover {
  background: #0d3b7c;
  border-color: #0d3b7c;
  color: #ffffff;
}
.schedule-cell-events.dtc-cell-events {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: auto 0;
  padding: 2px 0;
}
.schedule-event-chip.dtc-event-item {
  width: 100%;
  box-sizing: border-box;
  padding: 3px 4px;
  border-radius: 4px;
  background: transparent;
  border: none;
  border-left: none;
  text-align: center;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.schedule-event-chip.dtc-event-item:hover {
  background: rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}
.schedule-event-chip.dtc-event-item:active {
  cursor: grabbing;
}
.schedule-event-chip.dtc-event-item.is-dragging {
  opacity: 0.4;
}
.dtc-event-title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}
.schedule-event-chip.dtc-event-item.priority-high .dtc-event-title {
  color: #c81e1e;
}
.schedule-event-chip.dtc-event-item.priority-medium .dtc-event-title {
  color: #15803d;
}
.schedule-event-chip.dtc-event-item.priority-low .dtc-event-title {
  color: #1d4ed8;
}
.schedule-event-chip.dtc-event-item.is-completed .dtc-event-title {
  color: #64748b;
  text-decoration: line-through;
}
.dtc-note-highlight {
  display: inline-block;
  background: #fde047;
  color: #111827;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 2px;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}
.schedule-chip-user {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
}
.schedule-cell-quick-input.dtc-quick-input {
  margin-top: 2px;
  width: 100%;
  box-sizing: border-box;
  padding: 3px 6px;
  font-size: 0.72rem;
  border-radius: 4px;
  border: 1px dashed #cbd5e1;
  background: transparent;
  color: var(--text-main);
}
.schedule-cell-quick-input.dtc-quick-input:hover,
.schedule-cell-quick-input.dtc-quick-input:focus {
  outline: none;
  border-style: solid;
  border-color: #0d3b7c;
  background: var(--surface-bg);
}


/* Schedule Due Date Notification Near Logout */
.schedule-due-notif-wrap {
  position: sticky;
  top: 10px;
  z-index: 1210;
  display: inline-flex;
  align-items: center;
}
.schedule-due-notif-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--app-accent);
  background: var(--surface-bg);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.schedule-due-notif-btn:hover {
  background: var(--surface-subtle);
  transform: translateY(-1px);
}
.schedule-due-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}
.schedule-due-notif-badge.is-zero {
  background: #64748b;
}
.schedule-due-notif-popup {
  position: fixed;
  top: 56px;
  right: 14px;
  width: 280px;
  max-width: 88vw;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--app-accent);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  z-index: 1200;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schedule-due-notif-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-main);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.schedule-due-notif-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.schedule-due-notif-close:hover {
  color: var(--text-main);
}
.schedule-due-notif-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.schedule-due-notif-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-color);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 7px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.14s ease;
}
.schedule-due-notif-item:hover {
  background: var(--surface-bg);
}
.schedule-due-notif-item.is-overdue,
.schedule-due-notif-item.is-today {
  border-left-color: #dc2626;
}
.schedule-due-notif-item.is-soon {
  border-left-color: #d97706;
}
.schedule-due-notif-item-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}
.schedule-due-notif-item-meta {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}


/* Draggable & Arrangeable Navigation Tabs */
.nav-tabs .sidenav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}


.nav-tabs .tab-btn {
  cursor: grab;
  user-select: none;
  position: relative;
}

.nav-tabs .tab-btn:active {
  cursor: grabbing;
}

.nav-tabs .tab-btn .nav-drag-handle {
  opacity: 0.45;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.nav-tabs .tab-btn:hover .nav-drag-handle,
.nav-tabs .tab-btn.nav-dragging .nav-drag-handle {
  opacity: 0.95;
}

.nav-tabs .tab-btn.nav-dragging,
.nav-tabs .tab-btn.nav-touch-dragging {
  opacity: 0.65;
  transform: scale(0.98);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
  z-index: 5;
}

.nav-tabs .tab-btn.nav-drag-over-before {
  border-top: 2.5px solid var(--app-accent, #2563eb) !important;
}

.nav-tabs .tab-btn.nav-drag-over-after {
  border-bottom: 2.5px solid var(--app-accent, #2563eb) !important;
}

@media (max-width: 1240px) {
  .nav-tabs .tab-btn.nav-drag-over-before {
    border-top: none !important;
    border-left: 3px solid var(--app-accent, #2563eb) !important;
  }

  .nav-tabs .tab-btn.nav-drag-over-after {
    border-bottom: none !important;
    border-right: 3px solid var(--app-accent, #2563eb) !important;
  }
}

/* BTR Table: highlight household members rather than grantee */
.btr-member-row td.btr-grantee-plain {
  font-weight: 400;
  color: #475569;
}

.btr-member-row td.btr-member-highlight {
  background-color: rgba(37, 99, 235, 0.08);
  color: #0f172a;
  border-left: 3px solid #2563eb;
}

.btr-member-row td.btr-member-highlight strong {
  color: #1d4ed8;
  font-weight: 700;
}

.btr-member-row.btr-head-row td.btr-member-highlight {
  background-color: rgba(16, 185, 129, 0.11);
  border-left-color: #059669;
}

.btr-member-row.btr-head-row td.btr-member-highlight strong {
  color: #047857;
}

/* BTR clickable household member rows */
.btr-member-row.btr-clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btr-member-row.btr-clickable-row:hover td {
  background-color: rgba(37, 99, 235, 0.06);
}

.btr-member-row.btr-clickable-row:hover td.btr-member-highlight {
  background-color: rgba(37, 99, 235, 0.14);
}

/* BTR Edit Household Member Modal: wide & smoothly scrollable */
.modal-dialog.btr-edit-modal-dialog {
  width: min(92vw, 760px);
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.btr-edit-modal-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-body.btr-edit-modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  overflow-y: auto;
  max-height: calc(88vh - 130px);
  padding: 20px;
  scrollbar-gutter: stable;
}

.modal-body.btr-edit-modal-body > input[type="hidden"] {
  display: none;
}

@media (max-width: 640px) {
  .modal-dialog.btr-edit-modal-dialog {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
  }

  .modal-body.btr-edit-modal-body {
    grid-template-columns: 1fr;
    max-height: calc(90vh - 130px);
  }
}

/* BTR Table: compact font & spacing so entries fit cleanly */
#btrTable.btr-compact-table,
.btr-compact-table {
  font-size: 0.78rem;
  line-height: 1.25;
}

.btr-compact-table th {
  font-size: 0.74rem;
  padding: 7px 8px;
  white-space: nowrap;
}

.btr-compact-table td {
  font-size: 0.77rem;
  padding: 6px 8px;
  white-space: nowrap;
}

.btr-compact-table .btr-member-badge,
.btr-compact-table .role-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
}

.btr-compact-table .btn-edit,
.btr-compact-table .btn-delete {
  font-size: 0.72rem;
  padding: 4px 7px;
}


/* Cleanly Arranged Radio Buttons in SweetAlert2 / Export Dialog */
.swal2-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin: 14px auto 4px;
  text-align: left;
}

.swal2-radio-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.swal2-radio-label:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.swal2-radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

.swal2-radio-label:has(input[type="radio"]:checked) {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}


/* Grantee List QR Code Scanner */
.grantee-qr-scanner-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.grantee-qr-upload-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.grantee-qr-scanner-box {
  margin-bottom: 10px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #334155;
  background: #0f172a;
  max-width: 360px;
}

.grantee-qr-scanner-box video {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.grantee-qr-status {
  padding: 6px 10px;
  font-size: 0.78rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.9);
}

.grantee-qr-payload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.grantee-qr-payload-row input {
  flex: 1 1 220px;
  min-width: 0;
}


/* Generated Household ID QR Code Box */
.grantee-generated-qr-box {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #ffffff);
}

.grantee-generated-qr-box.hidden {
  display: none;
}

.grantee-generated-qr-box canvas {
  display: block;
  width: 140px;
  height: 140px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.grantee-generated-qr-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grantee-generated-qr-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.grantee-generated-qr-value {
  font-size: 0.96rem;
  font-weight: 700;
  word-break: break-all;
}

.grantee-generated-qr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


.grantee-table-qr-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.grantee-table-qr-img {
  display: block;
  width: 56px;
  height: 56px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.grantee-table-qr-canvas {
  display: block;
  width: 56px;
  height: 56px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}


/* Recognized QR Popup Modal */
.recognized-qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.55;
}

.recognized-qr-modal-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
}

.recognized-qr-modal-img {
  display: block;
  width: 112px;
  height: 112px;
  background: #ffffff;
}

.recognized-qr-modal-code {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}

.recognized-qr-modal-details {
  width: 100%;
}


/* Modern Recognized Grantee Details Modal */
.rqm-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  padding: 2px 0;
  color: #0f172a;
}

.rqm-hero-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px 16px;
}

.rqm-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.rqm-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2563eb;
}

.rqm-hh-code {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e3a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.rqm-members-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.rqm-grantee-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
}

.rqm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rqm-info-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rqm-tile-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.rqm-tile-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.rqm-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rqm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.rqm-section-title {
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
}

.rqm-section-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.rqm-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 2px;
}

.rqm-member-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rqm-member-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rqm-member-index {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rqm-member-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  flex: 1 1 auto;
  min-width: 140px;
}

.rqm-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}

.rqm-badge-health {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.rqm-badge-general {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.rqm-member-meta {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 8px;
  background: #f8fafc;
  border-radius: 8px;
  padding: 7px 10px;
}

.rqm-member-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rqm-meta-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.rqm-meta-val {
  font-size: 0.83rem;
  font-weight: 600;
  color: #1e293b;
  word-break: break-word;
}

.rqm-empty-members {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 0.86rem;
  color: #64748b;
}

body.dark-mode .rqm-container {
  color: #e2e8f0;
}

body.dark-mode .rqm-hero-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18) 0%, rgba(15, 23, 42, 0.75) 100%);
  border-color: rgba(96, 165, 250, 0.35);
}

body.dark-mode .rqm-hh-code,
body.dark-mode .rqm-grantee-title,
body.dark-mode .rqm-tile-value,
body.dark-mode .rqm-member-name {
  color: #f8fafc;
}

body.dark-mode .rqm-info-tile,
body.dark-mode .rqm-member-card,
body.dark-mode .rqm-empty-members {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .rqm-member-meta {
  background: #0f172a;
}

body.dark-mode .rqm-meta-val,
body.dark-mode .rqm-section-title {
  color: #e2e8f0;
}

@media (max-width: 560px) {
  .rqm-grid,
  .rqm-member-meta {
    grid-template-columns: 1fr;
  }
}


/* Camera QR Crosshair Overlay */
.grantee-qr-video-stage {
  position: relative;
  width: 100%;
  background: #0f172a;
}

.grantee-qr-crosshair-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, transparent 34%, rgba(15, 23, 42, 0.36) 82%);
}

.grantee-qr-reticle {
  position: relative;
  width: 148px;
  height: 148px;
  border: 2px solid rgba(56, 189, 248, 0.92);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.14), inset 0 0 14px rgba(56, 189, 248, 0.22);
}

.grantee-qr-reticle-h,
.grantee-qr-reticle-v {
  position: absolute;
  background: rgba(56, 189, 248, 0.85);
}

.grantee-qr-reticle-h {
  left: 50%;
  top: 50%;
  width: 24px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.grantee-qr-reticle-v {
  left: 50%;
  top: 50%;
  width: 2px;
  height: 24px;
  transform: translate(-50%, -50%);
}

.grantee-qr-scan-beam {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #a5f3fc, #38bdf8, transparent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.9);
  animation: granteeQrBeamSweep 2s ease-in-out infinite;
}

@keyframes granteeQrBeamSweep {
  0%, 100% {
    top: 12px;
  }
  50% {
    top: calc(100% - 14px);
  }
}


#offlineReadyStatusPill, .offline-ready-pill { display: none !important; }


/* Topbar & Footer Credit Styling (9px Uppercase) */
.topbar-credit-note,
#topbarCreditInfo,
#footerCreditInfo {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.topbar-credit-note {
  display: inline-flex;
  align-items: center;
  line-height: 1.25;
  color: var(--text-muted, #475569);
}

/* Topbar Profile Trigger & Profile Modal Logout Footer */
.topbar-profile-trigger {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.topbar-profile-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.profile-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-modal-footer .btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dc2626;
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  transition: background 0.16s ease;
}

.profile-modal-footer .btn-logout:hover {
  background: #b91c1c;
}

.profile-modal-footer .btn-logout.hidden {
  display: none;
}

/* Unified Modern Dashboard: Server Info + Current Time + Live Connected PCs */
.dashboard-grid-modern {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 780px) {
  .dashboard-grid-modern {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dash-modern-unified-card {
  grid-column: span 2;
  background: linear-gradient(160deg, var(--surface-bg, #ffffff) 0%, var(--surface-subtle, #f8fafc) 100%);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 18px 20px;
  gap: 14px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

@media (max-width: 780px) {
  .dash-modern-unified-card {
    grid-column: span 1;
    padding: 16px;
  }
}

.dash-server-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-card-title-group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.dash-card-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--app-accent, #2563eb) 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
  flex-shrink: 0;
}

.dash-card-caption {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  margin-top: 1px;
}

.dash-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.dash-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.dash-unified-hero-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 680px) {
  .dash-unified-hero-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dash-unified-metric-tile {
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 11px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.dash-unified-metric-tile:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.dash-mini-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.dash-unified-ip-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  word-break: break-all;
  line-height: 1.25;
}

.dash-unified-sub-value {
  font-size: 0.78rem;
  color: var(--text-muted, #475569);
  line-height: 1.35;
}

.dash-connected-clients-box {
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 11px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-connected-clients-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-connected-clients-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.dash-sync-hint {
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  background: var(--surface-subtle, #f1f5f9);
  padding: 2px 7px;
  border-radius: 999px;
}

.dash-connected-clients-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 155px;
  overflow-y: auto;
}

.dash-connected-empty {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.dash-connected-client-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.dash-connected-client-item:hover {
  background: var(--surface-bg, #ffffff);
  border-color: rgba(37, 99, 235, 0.28);
}

.dash-connected-client-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-client-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.dash-client-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.dash-client-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dash-client-tag.is-you {
  background: #dbeafe;
  color: #1d4ed8;
}

.dash-client-tag.is-host {
  background: #e2e8f0;
  color: #334155;
}

.dash-client-tag.is-remote {
  background: #dcfce7;
  color: #15803d;
}

.dash-connected-client-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-muted, #475569);
  padding-left: 13px;
}

.dash-client-seen {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.dash-modern-kpi-card {
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dash-modern-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

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

.dash-kpi-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.dash-kpi-badge.is-blue {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.dash-kpi-badge.is-indigo {
  background: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
}

/* Online / Logged-In Employees List in Dashboard Card */
.dash-online-emp-item {
  padding: 7px 10px;
}

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

.dash-online-emp-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-online-emp-avatar-wrap .user-avatar,
.dash-online-emp-avatar-wrap .user-avatar-placeholder {
  width: 30px;
  height: 30px;
  font-size: 0.78rem;
}

.dash-online-emp-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--surface-bg, #ffffff);
}

.dash-online-emp-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-online-emp-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.dash-online-emp-sub {
  padding-left: 0 !important;
}

/* Dedicated Who's Online Dashboard Card */
.dash-whos-online-card {
  grid-column: span 2;
  background: linear-gradient(160deg, var(--surface-bg, #ffffff) 0%, var(--surface-subtle, #f8fafc) 100%);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 18px 20px;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

@media (max-width: 780px) {
  .dash-whos-online-card {
    grid-column: span 1;
    padding: 16px;
  }
}

.dash-card-icon-badge.is-online-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.dash-online-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dash-online-refresh-btn {
  padding: 4px 9px !important;
  font-size: 0.76rem !important;
  border-radius: 8px !important;
  line-height: 1.2;
}

.dash-whos-online-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

/* Employees Monitoring (Online / Offline) Dashboard Card Enhancements */
.dash-offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.28);
}

.dash-offline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.dash-online-emp-dot.is-online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22);
}

.dash-online-emp-dot.is-offline {
  background: #94a3b8;
}

.dash-client-tag.is-status-online {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.dash-client-tag.is-status-offline {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.34);
}

.dash-online-emp-item.is-emp-offline {
  opacity: 0.86;
}

.dash-client-seen.is-online-text {
  color: #059669;
  font-weight: 600;
}

.dash-client-seen.is-offline-text {
  color: #64748b;
}

.dash-unified-time-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--app-accent, #2563eb);
  line-height: 1.25;
}

/* Single Merged Server IP Address & Current Server Time Card */
.dash-single-merged-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding-top: 4px;
}

.dash-merged-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dash-merged-divider {
  width: 1px;
  height: 100%;
  min-height: 54px;
  background: var(--border-color, #e2e8f0);
}

@media (max-width: 680px) {
  .dash-single-merged-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .dash-merged-divider {
    width: 100%;
    height: 1px;
    min-height: 1px;
  }
}

/* Profile Photo Cropper Modal (Profile Photos Only) */
.pfp-crop-backdrop {
  z-index: 10050 !important;
}

.pfp-crop-modal-card {
  max-width: 620px;
  width: 95%;
}

.pfp-crop-modal-body {
  padding: 18px 20px;
}

.pfp-crop-workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 660px) {
  .pfp-crop-workspace {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
}

.pfp-crop-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pfp-crop-canvas {
  width: 320px;
  height: 320px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: #0f172a;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

.pfp-crop-canvas:active {
  cursor: grabbing;
}

.pfp-crop-stage-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pfp-crop-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.pfp-crop-preview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
}

.pfp-crop-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.pfp-crop-preview-circle {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 3px solid var(--app-accent, #2563eb);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  background: #e2e8f0;
}

.pfp-crop-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pfp-crop-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main, #1e293b);
}

.pfp-crop-zoom-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--app-accent, #2563eb);
  font-weight: 700;
}

.pfp-crop-range {
  width: 100%;
  accent-color: var(--app-accent, #2563eb);
  cursor: pointer;
}

.pfp-crop-btn-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pfp-crop-tool-btn {
  padding: 7px 10px !important;
  font-size: 0.78rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.user-bar #currentRoleBadge { display: none !important; }

/* Admin Live Login Toast Alert */
.swal2-popup.swal2-toast.admin-login-presence-toast {
  border-radius: 12px !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
  padding: 10px 14px !important;
}


/* Wider Welcome Bulletin View (Left Navigation Hidden, System Information Right Sidebar Visible) */
.app-layout-shell.welcome-bulletin-wide,
.app-layout-shell.welcome-bulletin-wide:has(#welcomeTabContent:not(.hidden)) {
  grid-template-columns: minmax(0, 1fr) 265px !important;
  gap: 20px !important;
}

.app-layout-shell.welcome-bulletin-wide .nav-tabs.left-sidenav,
.app-layout-shell.welcome-bulletin-wide #tabWelcomeBtn,
.app-layout-shell.welcome-bulletin-wide #analyticsGraphSidebar {
  display: none !important;
}

.app-layout-shell.welcome-bulletin-wide .app-main-column {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.app-layout-shell.welcome-bulletin-wide #systemInfoSidebar {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
}

.app-layout-shell.welcome-bulletin-wide #welcomeTabContent,
.app-layout-shell.welcome-bulletin-wide #welcomeTabContent .card,
.app-layout-shell.welcome-bulletin-wide #welcomeTabContent .bulletin-viewport {
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 1024px) {
  .app-layout-shell.welcome-bulletin-wide,
  .app-layout-shell.welcome-bulletin-wide:has(#welcomeTabContent:not(.hidden)) {
    grid-template-columns: minmax(0, 1fr) 235px !important;
    gap: 14px !important;
  }
}

@media (max-width: 960px) {
  .app-layout-shell.welcome-bulletin-wide,
  .app-layout-shell.welcome-bulletin-wide:has(#welcomeTabContent:not(.hidden)) {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .app-layout-shell.welcome-bulletin-wide .app-main-column {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .app-layout-shell.welcome-bulletin-wide #systemInfoSidebar {
    grid-column: 1 !important;
    grid-row: 2 !important;
    position: static !important;
  }
}


.dash-client-tag.is-admin-role {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.32);
}

.dash-client-tag.is-emp-role {
  background: rgba(15, 23, 42, 0.07);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

body.dark-mode .dash-client-tag.is-admin-role {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.42);
}

body.dark-mode .dash-client-tag.is-emp-role {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}



/* Messenger-Style Floating Chat Launcher & Pop-Up Window */
.messenger-dock-root {
  position: fixed;
  right: 18px;
  bottom: 52px;
  z-index: 960;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.messenger-dock-root.hidden {
  display: none !important;
}

.messenger-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: var(--accent, #2563eb);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  position: relative;
}

.messenger-fab-btn:hover {
  filter: brightness(0.95);
}

.messenger-unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messenger-popup-window {
  width: 340px;
  max-width: calc(100vw - 24px);
  height: 440px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messenger-popup-window.hidden {
  display: none !important;
}

body.dark-mode .messenger-popup-window {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

.messenger-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--accent, #2563eb);
  color: #ffffff;
}

.messenger-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.messenger-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.messenger-header-meta {
  min-width: 0;
}

.messenger-header-title {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messenger-header-sub {
  font-size: 0.74rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messenger-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.messenger-icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.messenger-icon-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.messenger-contacts-view,
.messenger-thread-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.messenger-search-wrap {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
}

body.dark-mode .messenger-search-wrap {
  border-bottom-color: #334155;
}

.messenger-search-input {
  width: 100%;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.84rem;
}

body.dark-mode .messenger-search-input {
  background: #0f172a;
  color: #f8fafc;
  border-color: #475569;
}

.messenger-contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.messenger-contact-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.messenger-contact-item:hover,
.messenger-contact-item.is-selected {
  background: rgba(37, 99, 235, 0.1);
}

body.dark-mode .messenger-contact-item:hover,
body.dark-mode .messenger-contact-item.is-selected {
  background: rgba(59, 130, 246, 0.18);
}

.messenger-avatar-box {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messenger-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.messenger-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messenger-presence-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #94a3b8;
}

body.dark-mode .messenger-presence-dot {
  border-color: #1e293b;
}

.messenger-presence-dot.is-online {
  background: #16a34a;
}

.messenger-contact-meta {
  flex: 1;
  min-width: 0;
}

.messenger-contact-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.messenger-contact-name {
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messenger-contact-item.has-unread .messenger-contact-name {
  font-weight: 800;
}

.messenger-role-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.messenger-role-pill.is-admin {
  background: #dbeafe;
  color: #1d4ed8;
}

.messenger-role-pill.is-emp {
  background: #e2e8f0;
  color: #334155;
}

.messenger-contact-preview {
  font-size: 0.76rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

body.dark-mode .messenger-contact-preview {
  color: #94a3b8;
}

.messenger-row-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messenger-status-label {
  font-size: 0.7rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.messenger-status-label.is-online {
  color: #16a34a;
  font-weight: 600;
}

.messenger-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
}

body.dark-mode .messenger-messages-list {
  background: #0f172a;
}

.messenger-msg-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.messenger-msg-row.is-mine {
  justify-content: flex-end;
}

.messenger-msg-row.is-theirs {
  justify-content: flex-start;
}

.messenger-msg-bubble {
  max-width: 78%;
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 0.86rem;
  line-height: 1.38;
  word-break: break-word;
}

.messenger-msg-row.is-mine .messenger-msg-bubble {
  background: #6d28d9;
  color: #ffffff;
}

.messenger-msg-row.is-theirs .messenger-msg-bubble {
  background: #ececef;
  color: #111827;
}

body.dark-mode .messenger-msg-row.is-theirs .messenger-msg-bubble {
  background: #334155;
  color: #f8fafc;
}

.messenger-msg-time {
  font-size: 0.68rem;
  opacity: 0.72;
  margin-top: 2px;
  text-align: right;
}

.messenger-bubble-avatar,
.messenger-bubble-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.messenger-bubble-avatar-fallback {
  background: #6d28d9;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messenger-composer-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

body.dark-mode .messenger-composer-form {
  background: #1e293b;
  border-top-color: #334155;
}

.messenger-message-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.84rem;
}

body.dark-mode .messenger-message-input {
  background: #0f172a;
  color: #f8fafc;
  border-color: #475569;
}

.messenger-send-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--accent, #2563eb);
  color: #ffffff;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.messenger-empty-note {
  padding: 20px 14px;
  text-align: center;
  color: #64748b;
  font-size: 0.82rem;
}

body.dark-mode .messenger-empty-note {
  color: #94a3b8;
}

.messenger-icon-btn.is-muted {
  opacity: 0.72;
  background: rgba(15, 23, 42, 0.25);
}


.messenger-back-lobby-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.messenger-back-lobby-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.messenger-back-lobby-btn.hidden {
  display: none !important;
}

.messenger-lobby-chip-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.messenger-lobby-chip-btn:hover {
  background: #e2e8f0;
}

body.dark-mode .messenger-lobby-chip-btn {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #475569;
}

body.dark-mode .messenger-lobby-chip-btn:hover {
  background: #1e293b;
}

.login-carousel-nav-btn,
.dtc-nav-btn,
.schedule-due-notif-close,
.fb-media-clear-btn,
.modal-close-btn,
.schedule-cell-add-btn {
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messenger-back-lobby-btn .fa,
.messenger-back-lobby-btn .fa-solid,
.messenger-lobby-chip-btn .fa,
.messenger-lobby-chip-btn .fa-solid,
.messenger-fab-btn .fa,
.messenger-fab-btn .fa-solid,
.messenger-icon-btn .fa,
.messenger-icon-btn .fa-solid,
.messenger-send-btn .fa,
.messenger-send-btn .fa-solid,
.messenger-header-icon .fa,
.messenger-header-icon .fa-solid {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.messenger-lobby-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.messenger-contact-chevron {
  font-size: 0.55rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.messenger-contact-item.has-unread .messenger-contact-chevron {
  color: #2563eb;
}


/* ==========================================================================
   Modern Tailwind-Inspired Dashboard UI (v163 - 100% Offline)
   ========================================================================== */
.tw-dash-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tw-dash-shell.hidden {
  display: none !important;
}

/* Hero Banner */
.tw-dash-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #1d4ed8 100%);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.tw-dash-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 220px;
  height: 220px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.tw-dash-hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.tw-dash-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.28);
  margin-bottom: 0.5rem;
}

.tw-dash-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.25);
}

.tw-dash-hero-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.tw-dash-hero-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.tw-dash-quick-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tw-dash-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.tw-dash-action-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.tw-dash-action-btn.is-primary {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.tw-dash-action-btn.is-primary:hover {
  background: #1d4ed8;
}

/* 3-Column Bento KPI Grid */
.tw-dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 920px) {
  .tw-dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .tw-dash-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tw-kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  border-radius: 1rem;
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tw-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #2563eb;
}

.tw-kpi-card.is-indigo-accent::before {
  background: #4f46e5;
}

.tw-kpi-card.is-emerald-accent {
  cursor: default;
}

.tw-kpi-card.is-emerald-accent::before {
  background: #10b981;
}

.tw-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
}

.tw-kpi-trend {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.15rem;
}

.dash-kpi-badge.is-emerald {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.tw-kpi-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.tw-kpi-number {
  font-size: 1.95rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  line-height: 1;
}

.tw-kpi-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--app-accent, #2563eb);
}

.tw-kpi-status-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

/* Monitoring Card & Filter Bar */
.tw-monitoring-card {
  border-radius: 1rem !important;
  padding: 1.25rem 1.35rem !important;
  box-shadow: 0 6px 20px -6px rgba(15, 23, 42, 0.07) !important;
}

.tw-monitoring-title {
  font-size: 0.92rem !important;
  text-transform: none !important;
  letter-spacing: -0.01em !important;
  color: var(--text-main, #0f172a) !important;
}

.tw-monitoring-controls {
  flex-wrap: wrap;
}

.tw-filter-pills {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 0.65rem;
  background: var(--surface-subtle, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  gap: 0.2rem;
}

.tw-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.32rem 0.68rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #475569);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tw-filter-btn.is-active {
  background: var(--surface-bg, #ffffff);
  color: var(--text-main, #0f172a);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.tw-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem !important;
  font-weight: 600;
}

.tw-presence-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)) !important;
  gap: 0.75rem !important;
  max-height: 360px !important;
  padding-top: 0.25rem;
}

.tw-presence-grid .dash-online-emp-item {
  border-radius: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tw-presence-grid .dash-online-emp-item:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.1);
}

.tw-presence-grid .dash-online-emp-item.is-emp-online {
  border-left: 3px solid #10b981;
}

/* Dark Mode Overrides */
body.dark-mode .tw-kpi-card,
body.dark-mode .tw-presence-grid .dash-online-emp-item {
  background: #111827;
  border-color: #1f2937;
}

body.dark-mode .tw-filter-pills {
  background: #0f172a;
  border-color: #1e293b;
}

body.dark-mode .tw-filter-btn {
  color: #94a3b8;
}

body.dark-mode .tw-filter-btn.is-active {
  background: #1e293b;
  color: #f8fafc;
}

body.dark-mode .tw-kpi-status-chip {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}


/* ==========================================================================
   Clean & User-Friendly System Settings UI (v164 - 100% Offline)
   ========================================================================== */
.sys-settings-shell {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.sys-settings-shell.hidden {
  display: none !important;
}

.sys-settings-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  border-radius: 1rem;
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
}

.sys-settings-header-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.sys-settings-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--app-accent, #2563eb) 0%, #1d4ed8 100%);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.sys-settings-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main, #0f172a);
}

.sys-settings-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.sys-settings-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.1);
  color: var(--app-accent, #1d4ed8);
  border: 1px solid rgba(37, 99, 235, 0.24);
}

/* Section Filter Tabs */
.sys-settings-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 0.85rem;
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.sys-settings-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.88rem;
  border-radius: 0.6rem;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #475569);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sys-settings-nav-btn:hover {
  background: var(--surface-subtle, #f1f5f9);
  color: var(--text-main, #0f172a);
}

.sys-settings-nav-btn.is-active {
  background: var(--app-accent, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.sys-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Individual Setting Cards */
.sys-settings-card {
  background: var(--surface-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 1rem !important;
  padding: 1.35rem 1.45rem !important;
  margin-top: 0 !important;
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
}

.sys-settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.sys-settings-step-num {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--app-accent, #2563eb);
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
  margin-top: 1px;
}

.sys-settings-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.sys-settings-card-desc {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.sys-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.15rem;
}

@media (max-width: 720px) {
  .sys-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sys-col-span-2 {
  grid-column: span 2;
}

@media (max-width: 720px) {
  .sys-col-span-2 {
    grid-column: span 1;
  }
}

.sys-field-note {
  display: block;
  margin-top: 0.32rem;
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
}

.sys-toggle-card {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.65rem 0.85rem !important;
  border-radius: 0.75rem !important;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sys-toggle-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.sys-toggle-title {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.sys-toggle-sub {
  display: block;
  font-size: 0.73rem;
  color: var(--text-muted, #64748b);
}

.sys-color-box {
  padding: 0.28rem 0.45rem;
  border-radius: 0.65rem;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
}

.sys-remove-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
}

/* Carousel Composer Sub-panel */
.sys-carousel-composer {
  padding: 1rem 1.1rem;
  border-radius: 0.85rem;
  background: var(--surface-subtle, #f8fafc);
  border: 1px dashed var(--border-color, #cbd5e1);
  margin-bottom: 1rem;
}

.sys-carousel-composer-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.sys-carousel-list-header {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.55rem;
}

/* Sticky Save Action Bar */
.sys-settings-sticky-bar {
  position: sticky;
  bottom: 0.75rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-radius: 0.95rem;
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.16);
}

.sys-settings-sticky-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #475569);
}

.sys-settings-sticky-hint i {
  color: #10b981;
}

.sys-settings-actions-row {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

/* Dark Mode Adjustments */
body.dark-mode .sys-settings-header-card,
body.dark-mode .sys-settings-nav,
body.dark-mode .sys-settings-card,
body.dark-mode .sys-settings-sticky-bar {
  background: #111827 !important;
  border-color: #1f2937 !important;
}

body.dark-mode .sys-toggle-card,
body.dark-mode .sys-color-box,
body.dark-mode .sys-carousel-composer {
  background: #0f172a;
  border-color: #1e293b;
}

body.dark-mode .sys-settings-nav-btn:hover {
  background: #1e293b;
  color: #f8fafc;
}


/* ==========================================================================
   Dynamic Analytics Sidebar (v165 - 100% Offline)
   ========================================================================== */
.app-layout-shell:has(#analyticsGraphSidebar:not(.hidden)) {
  grid-template-columns: 225px minmax(0, 1fr) 295px !important;
}

@media (max-width: 1180px) {
  .app-layout-shell:has(#analyticsGraphSidebar:not(.hidden)) {
    grid-template-columns: 205px minmax(0, 1fr) !important;
  }
  .app-layout-shell:has(#analyticsGraphSidebar:not(.hidden)) #analyticsGraphSidebar {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 768px) {
  .app-layout-shell:has(#analyticsGraphSidebar:not(.hidden)) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

.tw-analytics-aside {
  border-radius: 1rem !important;
  padding: 1.1rem 1.15rem !important;
  box-shadow: 0 8px 22px -6px rgba(15, 23, 42, 0.08) !important;
}

.tw-analytics-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #059669;
  margin-bottom: 0.2rem;
}

.tw-analytics-lens-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.22rem;
  border-radius: 0.65rem;
  background: var(--surface-subtle, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 0.65rem;
}

.tw-analytics-lens-btn {
  border: none;
  background: transparent;
  padding: 0.32rem 0.4rem;
  border-radius: 0.48rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #475569);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tw-analytics-lens-btn.is-active {
  background: var(--surface-bg, #ffffff);
  color: var(--app-accent, #2563eb);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.tw-analytics-canvas-box {
  border-radius: 0.75rem !important;
  padding: 0.6rem !important;
}

.tw-legend-card {
  padding: 0.42rem 0.6rem !important;
  border-radius: 0.55rem !important;
  border: 1px solid var(--border-color, #e2e8f0);
}

.tw-legend-metrics {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.tw-legend-metrics small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.tw-analytics-insights {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.7rem;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.tw-insight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted, #475569);
}

.tw-insight-row strong {
  color: var(--text-main, #0f172a);
  font-weight: 800;
}

.tw-analytics-badge {
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.12);
  color: var(--app-accent, #2563eb);
}

body.dark-mode .tw-analytics-lens-bar {
  background: #0f172a;
  border-color: #1e293b;
}

body.dark-mode .tw-analytics-lens-btn.is-active {
  background: #1e293b;
  color: #60a5fa;
}

body.dark-mode .tw-analytics-insights {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}


/* ==========================================================================
   Responsive Right-Side Dynamic Analytics Sidebar Layout (v166)
   ========================================================================== */
.app-layout-shell:not(.welcome-bulletin-wide) {
  display: grid !important;
  grid-template-columns: 225px minmax(0, 1fr) 300px !important;
  gap: 20px !important;
  align-items: start !important;
}

.app-layout-shell:not(.welcome-bulletin-wide) > .nav-tabs.left-sidenav {
  grid-column: 1 !important;
  grid-row: 1 !important;
  position: sticky;
  top: 16px;
}

.app-layout-shell:not(.welcome-bulletin-wide) > .app-main-column {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  width: 100% !important;
}

.app-layout-shell:not(.welcome-bulletin-wide) > #analyticsGraphSidebar.right-side-card {
  grid-column: 3 !important;
  grid-row: 1 !important;
  width: 100% !important;
  position: sticky !important;
  top: 16px !important;
  align-self: start !important;
}

.app-layout-shell:not(.welcome-bulletin-wide) > #analyticsGraphSidebar.hidden {
  display: none !important;
}

/* Medium-large laptops: slightly tighter sidebars while keeping 3-column right-sidebar layout */
@media (max-width: 1320px) {
  .app-layout-shell:not(.welcome-bulletin-wide) {
    grid-template-columns: 205px minmax(0, 1fr) 265px !important;
    gap: 16px !important;
  }
}

/* Tablet breakpoint: keep left nav + main column on row 1, place Dynamic Analytics cleanly below on row 2 */
@media (max-width: 1040px) {
  .app-layout-shell:not(.welcome-bulletin-wide) {
    grid-template-columns: 195px minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  .app-layout-shell:not(.welcome-bulletin-wide) > #analyticsGraphSidebar.right-side-card {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    position: static !important;
  }

  .app-layout-shell:not(.welcome-bulletin-wide) > #analyticsGraphSidebar .graph-legend-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}

/* Mobile breakpoint: single-column stack (Nav -> Main Content -> Dynamic Analytics) */
@media (max-width: 768px) {
  .app-layout-shell:not(.welcome-bulletin-wide) {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .app-layout-shell:not(.welcome-bulletin-wide) > .nav-tabs.left-sidenav {
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: static !important;
  }

  .app-layout-shell:not(.welcome-bulletin-wide) > .app-main-column {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .app-layout-shell:not(.welcome-bulletin-wide) > #analyticsGraphSidebar.right-side-card {
    grid-column: 1 !important;
    grid-row: 3 !important;
    position: static !important;
  }

  .app-layout-shell:not(.welcome-bulletin-wide) > #analyticsGraphSidebar .graph-legend-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}


/* Version pill inside Bulletin System Information What's New items (v171) */
.whats-new-ver-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
  background: rgba(37, 99, 235, 0.12);
  color: var(--app-accent, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.24);
}


/* ==========================================================================
   Employee-Only Topbar Dark Mode ON/OFF Toggle (v172)
   ========================================================================== */
.emp-topbar-dark-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 0.72rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--surface-bg, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}

.emp-topbar-dark-btn:hover {
  transform: translateY(-1px);
  border-color: var(--app-accent, #2563eb);
}

.emp-topbar-dark-btn.hidden {
  display: none !important;
}

.emp-topbar-dark-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: #e2e8f0;
  color: #475569;
}

.emp-topbar-dark-btn.is-on {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

.emp-topbar-dark-btn.is-on .emp-topbar-dark-state {
  background: #10b981;
  color: #052e16;
}

body.dark-mode .emp-topbar-dark-btn {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

@media (max-width: 640px) {
  .emp-topbar-dark-label {
    display: none;
  }
}


/* ==========================================================================
   Icon-Only Topbar Dark Mode & Bell-Only Due Alert Button (v173)
   ========================================================================== */
.emp-topbar-dark-btn.is-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 9999px;
}

.emp-topbar-dark-btn.is-icon-only i {
  font-size: 0.92rem;
}

.schedule-due-notif-btn.is-bell-only {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 9999px;
}

.schedule-due-notif-btn.is-bell-only .schedule-due-notif-label {
  display: none !important;
}

.schedule-due-notif-btn.is-bell-only .schedule-due-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9999px;
  font-size: 0.65rem;
  line-height: 17px;
  text-align: center;
}


/* ==========================================================================
   Crisp Sun & Moon Vector Icons for Employee Dark Mode Toggle (v174)
   ========================================================================== */
.emp-theme-svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
  transition: transform 0.2s ease, color 0.2s ease;
}

.emp-theme-svg.hidden {
  display: none !important;
}

.emp-theme-moon {
  color: #334155;
}

.emp-theme-sun {
  color: #fbbf24;
}

.emp-topbar-dark-btn:hover .emp-theme-svg {
  transform: rotate(14deg) scale(1.06);
}


/* ==========================================================================
   Modern Top-Bar Profile Modal Action Bar (v175)
   ========================================================================== */
.profile-modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 20px !important;
  background: var(--surface-subtle, #f8fafc);
  border-top: 1px solid var(--border-color, #e2e8f0);
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

body.dark-mode .profile-modal-footer {
  background: rgba(15, 23, 42, 0.72);
  border-top-color: #1e293b;
}

.profile-modal-footer-left,
.profile-modal-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.profile-modal-footer-left:has(.hidden:only-child) {
  display: none;
}

.profile-modal-footer:has(.profile-modal-footer-left .hidden:only-child) {
  justify-content: flex-end !important;
}

.profile-modal-footer .profile-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 40px !important;
  min-width: 112px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  line-height: 1 !important;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.profile-modal-footer .profile-action-btn.hidden {
  display: none !important;
}

.profile-modal-footer .profile-action-btn i,
.profile-modal-footer .profile-action-btn svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
}

.profile-modal-footer .profile-action-btn.is-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(37, 99, 235, 0.4) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.profile-modal-footer .profile-action-btn.is-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.38);
}

.profile-modal-footer .profile-action-btn.is-danger {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.32) !important;
  box-shadow: none;
}

.profile-modal-footer .profile-action-btn.is-danger:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.profile-modal-footer .profile-action-btn.is-neutral {
  background: var(--surface-bg, #ffffff) !important;
  color: var(--text-main, #334155) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
}

body.dark-mode .profile-modal-footer .profile-action-btn.is-neutral {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

.profile-modal-footer .profile-action-btn.is-neutral:hover {
  transform: translateY(-1px);
  border-color: #94a3b8 !important;
}

@media (max-width: 520px) {
  .profile-modal-footer {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
  }

  .profile-modal-footer-left,
  .profile-modal-footer-right {
    display: flex;
    width: 100%;
  }

  .profile-modal-footer .profile-action-btn {
    flex: 1 1 0;
  }
}


/* ==========================================================================
   Modern Post-Login Loading Screen & Smooth Entrance Transition (v176)
   ========================================================================== */
.login-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 10080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.22), transparent 52%),
              radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.16), transparent 52%),
              rgba(9, 14, 26, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-transition-overlay.hidden {
  display: none !important;
}

.login-transition-overlay.is-visible {
  opacity: 1;
}

.login-transition-overlay.is-exiting {
  opacity: 0;
  pointer-events: none;
}

.login-transition-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 28px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 28px 64px -12px rgba(2, 6, 23, 0.68),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-align: center;
  color: #f8fafc;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-transition-overlay.is-visible .login-transition-card {
  transform: translateY(0) scale(1);
}

.login-transition-overlay.is-exiting .login-transition-card {
  transform: translateY(-8px) scale(0.985);
}

.login-transition-orb-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-transition-ring {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2.5px solid transparent;
  border-top-color: #3b82f6;
  border-right-color: #60a5fa;
  animation: loginRingSpin 1.15s linear infinite;
}

.login-transition-ring.is-secondary {
  inset: 7px;
  border-top-color: #10b981;
  border-left-color: #34d399;
  border-right-color: transparent;
  animation: loginRingSpinReverse 1.6s linear infinite;
}

@keyframes loginRingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes loginRingSpinReverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

.login-transition-core {
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}

.login-transition-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-transition-avatar-initial {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.login-transition-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #60a5fa;
  margin-bottom: 6px;
}

.login-transition-title {
  margin: 0 0 6px;
  font-size: 1.28rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.login-transition-sub {
  margin: 0 0 20px;
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.4;
}

.login-transition-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.login-transition-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.65);
}

#appSection.app-entrance-anim {
  animation: appWorkspaceReveal 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes appWorkspaceReveal {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.992);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ==========================================================================
   Smooth Actual-Ready Page & Link Transition Screen (v178)
   ========================================================================== */
.page-switch-loader {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.page-switch-loader.hidden {
  display: none !important;
}

.page-switch-loader.is-active {
  opacity: 1;
  transform: translateY(0);
}

.page-switch-loader.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
}

.page-switch-loader-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 10px 26px -6px rgba(15, 23, 42, 0.12);
}

body.dark-mode .page-switch-loader-card {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 14px 30px -8px rgba(2, 6, 23, 0.55);
}

.page-switch-spinner-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.page-switch-spinner {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  border: 2.5px solid rgba(37, 99, 235, 0.18);
  border-top-color: var(--app-accent, #2563eb);
  animation: pageSwitchSpin 0.8s linear infinite;
}

.page-switch-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #10b981;
}

@keyframes pageSwitchSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.page-switch-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-switch-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  line-height: 1.25;
}

body.dark-mode .page-switch-title {
  color: #f8fafc;
}

.page-switch-status {
  font-size: 0.77rem;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}

.page-content-ready-anim {
  animation: pageReadyFadeIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pageReadyFadeIn {
  0% {
    opacity: 0.35;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ==========================================================================
   Small-Screen Hamburger Button & Collapsible Nav Drawer (v179)
   ========================================================================== */
.mobile-nav-hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--surface-bg, #ffffff);
  color: var(--text-main, #0f172a);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}

.mobile-nav-hamburger-btn:hover {
  border-color: var(--app-accent, #2563eb);
  transform: translateY(-1px);
}

body.dark-mode .mobile-nav-hamburger-btn {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

.mobile-hamburger-svg {
  display: block;
  pointer-events: none;
}

.mobile-nav-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav-hamburger-btn {
    display: inline-flex !important;
  }

  .mobile-nav-backdrop:not(.hidden) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 940;
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(2px);
  }

  .app-layout-shell > #navTabs.nav-tabs.left-sidenav,
  .app-layout-shell:not(.welcome-bulletin-wide) > #navTabs.nav-tabs.left-sidenav {
    display: none !important;
    position: relative;
    z-index: 950;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding: 10px !important;
    border-radius: 14px;
    background: var(--surface-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.24);
  }

  body.dark-mode .app-layout-shell > #navTabs.nav-tabs.left-sidenav,
  body.dark-mode .app-layout-shell:not(.welcome-bulletin-wide) > #navTabs.nav-tabs.left-sidenav {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 18px 40px -10px rgba(2, 6, 23, 0.72);
  }

  .app-layout-shell > #navTabs.nav-tabs.left-sidenav.is-mobile-open,
  .app-layout-shell:not(.welcome-bulletin-wide) > #navTabs.nav-tabs.left-sidenav.is-mobile-open {
    display: flex !important;
    animation: mobileDrawerReveal 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .app-layout-shell > #navTabs.nav-tabs.left-sidenav .tab-btn,
  .app-layout-shell:not(.welcome-bulletin-wide) > #navTabs.nav-tabs.left-sidenav .tab-btn {
    flex: 0 0 auto !important;
    width: 100% !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 10px 12px !important;
  }
}

@keyframes mobileDrawerReveal {
  0% {
    opacity: 0;
    transform: translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ==========================================================================
   Modern Clean Login UI Polish (v180)
   ========================================================================== */
#loginSection.login-wrapper {
  background:
    radial-gradient(circle at 14% 18%, rgba(37, 99, 235, 0.14), transparent 42%),
    radial-gradient(circle at 86% 82%, rgba(14, 165, 233, 0.12), transparent 45%),
    #eef2f7 !important;
}

body.dark-mode #loginSection.login-wrapper {
  background:
    radial-gradient(circle at 16% 18%, rgba(59, 130, 246, 0.18), transparent 44%),
    radial-gradient(circle at 84% 80%, rgba(16, 185, 129, 0.12), transparent 46%),
    #090e1a !important;
}

.login-info-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.86) 100%) !important;
}

body.dark-mode .login-info-card {
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.92) 0%, rgba(17, 24, 39, 0.88) 100%) !important;
  border-color: rgba(51, 65, 85, 0.7) !important;
  color: #f1f5f9;
}

body.dark-mode .login-info-title {
  color: #f8fafc;
}

body.dark-mode .login-info-body {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(71, 85, 105, 0.65);
  color: #e2e8f0;
}

body.dark-mode .login-highlight-chip {
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(71, 85, 105, 0.6);
  color: #e2e8f0;
}

body.dark-mode .login-info-pill {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(71, 85, 105, 0.6);
  color: #cbd5e1;
}

#loginSection .login-card {
  max-width: 440px;
  background: rgba(255, 255, 255, 0.97) !important;
  border-left: 1px solid rgba(203, 213, 225, 0.75) !important;
  box-shadow: -20px 0 48px -24px rgba(15, 23, 42, 0.16) !important;
  padding: clamp(28px, 3.6vw, 44px) clamp(24px, 3.2vw, 38px) !important;
  gap: 6px;
}

body.dark-mode #loginSection .login-card {
  background: rgba(15, 23, 42, 0.95) !important;
  border-left: 1px solid rgba(51, 65, 85, 0.75) !important;
  box-shadow: -20px 0 48px -24px rgba(2, 6, 23, 0.65) !important;
  color: #f8fafc;
}

.login-auth-top-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-accent, #2563eb);
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.2);
  margin-bottom: 12px;
}

.login-auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.login-welcome-block {
  margin-bottom: 14px;
}

body.dark-mode #loginSection .login-card h2,
body.dark-mode #loginSection .login-system-title {
  color: #f8fafc;
}

body.dark-mode #loginSection .login-subtitle,
body.dark-mode #loginSection .login-form .form-group label {
  color: #cbd5e1;
}

.login-field-group {
  margin-bottom: 14px;
}

.login-input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 13px;
  color: #64748b;
  pointer-events: none;
  z-index: 2;
  transition: color 0.16s ease;
}

.login-input-shell input[type="text"],
.login-input-shell input[type="password"] {
  width: 100%;
  padding: 11px 14px 11px 38px !important;
  border-radius: 11px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-size: 0.92rem !important;
  box-sizing: border-box;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.login-password-field.login-input-shell input[type="password"],
.login-password-field.login-input-shell input[type="text"] {
  padding-right: 76px !important;
}

.login-input-shell input:focus {
  background: #ffffff !important;
  border-color: var(--app-accent, #2563eb) !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14) !important;
  outline: none;
}

.login-input-shell:focus-within .login-input-icon {
  color: var(--app-accent, #2563eb);
}

body.dark-mode .login-input-shell input[type="text"],
body.dark-mode .login-input-shell input[type="password"] {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode .login-input-shell input:focus {
  background: #0f172a !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3.5px rgba(96, 165, 250, 0.18) !important;
}

body.dark-mode .login-pwd-toggle {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}

body.dark-mode .login-pwd-toggle:hover {
  background: #1e293b;
  color: #ffffff;
}

.login-submit-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100%;
  margin-top: 6px !important;
  padding: 12px 18px !important;
  border-radius: 11px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, var(--app-accent, #2563eb) 0%, #1d4ed8 100%) !important;
  box-shadow: 0 10px 22px -8px rgba(37, 99, 235, 0.52) !important;
}

.login-submit-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 14px 26px -8px rgba(37, 99, 235, 0.62) !important;
}

#loginSection .demo-hint {
  margin-top: 20px;
  padding: 13px 15px;
  border-radius: 13px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.demo-hint-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.demo-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-hint-row span {
  font-weight: 600;
  color: #475569;
}

.demo-hint-row code {
  padding: 2px 7px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 600;
}

body.dark-mode #loginSection .demo-hint {
  background: rgba(30, 41, 59, 0.65);
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .demo-hint-title,
body.dark-mode .demo-hint-row span {
  color: #94a3b8;
}

body.dark-mode .demo-hint-row code {
  background: #0f172a;
  color: #f8fafc;
}


/* ==========================================================================
   Ensure Top-Right Toast Positioning (Overrides Bottom-Right Inset) (v185)
   ========================================================================== */
.swal2-container.swal2-top-end,
body .swal2-container.swal2-top-end {
  top: 18px !important;
  right: 18px !important;
  bottom: auto !important;
  left: auto !important;
  inset: 18px 18px auto auto !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
}


/* ==========================================================================
   Larger, High-Visibility Toast Alerts (v186)
   ========================================================================== */
.swal2-popup.swal2-toast,
body .swal2-popup.swal2-toast {
  min-width: 340px !important;
  max-width: 480px !important;
  padding: 16px 22px !important;
  border-radius: 14px !important;
  gap: 14px !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.34), 0 0 0 1px rgba(37, 99, 235, 0.22) !important;
}

.swal2-popup.swal2-toast .swal2-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  margin: 0 !important;
  font-size: 1.15rem !important;
}

.swal2-popup.swal2-toast .swal2-title,
body .swal2-popup.swal2-toast .swal2-title {
  font-size: 1.04rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 !important;
}

.swal2-popup.swal2-toast .swal2-html-container,
body .swal2-popup.swal2-toast .swal2-html-container {
  font-size: 0.9rem !important;
  line-height: 1.4 !important;
  margin: 4px 0 0 !important;
}

.swal2-popup.swal2-toast .swal2-close {
  width: 28px !important;
  height: 28px !important;
  font-size: 1.25rem !important;
}

@media (max-width: 520px) {
  .swal2-popup.swal2-toast,
  body .swal2-popup.swal2-toast {
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    padding: 14px 16px !important;
  }
}


/* ==========================================================================
   Bulletin System Information Sidebar: 6 Visible Cards & Collapsed Versions (v187)
   ========================================================================== */
.whats-new-more-wrap {
  margin-top: 10px;
}

.whats-new-more-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
  color: var(--app-accent, #2563eb);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.whats-new-more-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--app-accent, #2563eb);
}

body.dark-mode .whats-new-more-btn {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
  color: #93c5fd;
}

.whats-new-extra-versions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.whats-new-extra-versions.hidden {
  display: none !important;
}

.whats-new-version-group {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.85);
  overflow: hidden;
}

body.dark-mode .whats-new-version-group {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.22);
}

.whats-new-version-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-main, #0f172a);
  font-size: 0.77rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

body.dark-mode .whats-new-version-toggle {
  color: #f1f5f9;
}

.whats-new-version-toggle-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.whats-new-version-toggle-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whats-new-version-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.18);
  font-weight: 800;
  font-size: 0.85rem;
}

.whats-new-version-panel.hidden {
  display: none !important;
}

.whats-new-sublist {
  list-style: none;
  margin: 0;
  padding: 0 10px 10px;
}

.whats-new-sublist .whats-new-item {
  margin: 0;
  border: none;
  background: transparent;
  padding: 4px 0 0;
}


/* ==========================================================================
   Employee Focus Dashboard (Grantee, Clients, Schedules, Directory) (v188)
   ========================================================================== */
.emp-focus-dash-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.emp-focus-dash-section.hidden {
  display: none !important;
}

.emp-focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
}

body.dark-mode .emp-focus-header {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.22);
}

.emp-focus-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

body.dark-mode .emp-focus-title {
  color: #f8fafc;
}

.emp-focus-subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.emp-focus-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

body.dark-mode .emp-focus-badge {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.emp-focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 640px) {
  .emp-focus-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cf-manual-collapse-panel.hidden {
  display: none !important;
}


/* ==========================================================================
   Case Folder Documents Modal — Wide Layout, Visible Actions & Inline Viewer
   ========================================================================== */
.modal-dialog.modal-dialog-wide.cf-docs-modal-dialog {
  width: min(98vw, 1340px) !important;
  max-width: 1340px !important;
  height: 95vh;
  max-height: 95vh !important;
  display: flex;
  flex-direction: column;
}

.cf-docs-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(95vh - 110px) !important;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cf-docs-modal-body > * {
  flex-shrink: 0;
}

.cf-docs-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: rgba(248, 250, 252, 0.85);
}

body.dark-mode .cf-docs-meta-grid {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.25);
}

.cf-docs-meta-lbl {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cf-docs-meta-val {
  font-weight: 700;
  font-size: 0.9rem;
  word-break: break-word;
}

.cf-docs-access-banner {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

body.dark-mode .cf-docs-access-banner {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.28);
}

.cf-docs-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
}

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

.cf-docs-table th,
.cf-docs-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.cf-doc-title-cell,
.cf-doc-file-cell {
  max-width: 210px;
  white-space: normal;
  word-break: break-word;
}

.cf-docs-actions-col,
.cf-docs-actions-cell {
  min-width: 225px;
  width: 225px;
  white-space: nowrap;
}

.cf-docs-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.cf-docs-action-btns .btn-secondary,
.cf-docs-action-btns .btn-delete {
  padding: 6px 10px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.cf-doc-preview-box {
  flex-shrink: 0 !important;
  width: 100%;
  border: 1.5px solid var(--border-color, #94a3b8);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-bg, #ffffff);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.cf-doc-preview-box.hidden {
  display: none !important;
}

.cf-doc-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: rgba(241, 245, 249, 0.9);
}

body.dark-mode .cf-doc-preview-head {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.25);
}

.cf-doc-preview-stage {
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(15, 23, 42, 0.04);
}

.cf-doc-preview-img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 82vh !important;
  min-height: 560px !important;
  border-radius: 8px;
  object-fit: contain;
}

.cf-doc-preview-frame {
  display: block;
  width: 100% !important;
  height: 82vh !important;
  min-height: 720px !important;
  border: none;
  border-radius: 6px;
  background: #ffffff;
}

@media (max-width: 820px) {
  .cf-docs-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cf-docs-upload-form {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ==========================================================================
   Grouped Navigation Links & Dividers (Grantee List, BTR, Case Folders)
   ========================================================================== */
.nav-group-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 4px 2px;
  color: var(--text-muted, #64748b);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
}

.nav-group-divider::before,
.nav-group-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-color, #cbd5e1);
}

.nav-group-divider-bottom {
  margin: 2px 4px 6px;
}

.nav-group-divider-bottom::after {
  display: none;
}

.nav-link-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: rgba(37, 99, 235, 0.04);
}

body.dark-mode .nav-link-group {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(148, 163, 184, 0.24);
}

@media (max-width: 768px) {
  .nav-group-divider {
    flex: 1 1 100%;
    margin: 4px 2px;
  }

  .nav-link-group {
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
}

.nav-group-divider-bottom-top {
  margin-top: auto;
  padding-top: 10px;
}

.nav-link-group-bottom {
  margin-top: 0;
}

@media (max-width: 768px) {
  .nav-group-divider-bottom-top {
    margin-top: 4px;
    padding-top: 0;
  }
}


/* ==========================================================================
   Grantee List Table — Always-Accessible Actions Column & Compact Layout
   ========================================================================== */
.grantee-list-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
}

.grantee-list-table th,
.grantee-list-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.grantee-list-table .grantee-name-cell {
  max-width: 190px;
  white-space: normal;
  word-break: break-word;
}

.grantee-list-table .grantee-hh-cell {
  max-width: 155px;
  white-space: normal;
  word-break: break-word;
}

.grantee-list-table .grantee-actions-col,
.grantee-list-table .grantee-actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface-bg, #ffffff);
  box-shadow: -4px 0 8px -4px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
}

body.dark-mode .grantee-list-table .grantee-actions-col,
body.dark-mode .grantee-list-table .grantee-actions-cell {
  background: #0f172a;
  box-shadow: -4px 0 8px -4px rgba(0, 0, 0, 0.45);
}

.grantee-list-table thead .grantee-actions-col {
  z-index: 3;
  background: #f1f5f9;
}

body.dark-mode .grantee-list-table thead .grantee-actions-col {
  background: #1e293b;
}

.grantee-list-table .grantee-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.grantee-list-table .grantee-action-btns .btn-secondary,
.grantee-list-table .grantee-action-btns .btn-edit,
.grantee-list-table .grantee-action-btns .btn-delete {
  padding: 5px 8px;
  font-size: 0.75rem;
  line-height: 1.2;
}


/* ==========================================================================
   Grantee List Table Pagination Bar
   ========================================================================== */
.grantee-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.grantee-pagination-bar.hidden {
  display: none !important;
}

.grantee-pagination-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.grantee-page-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.grantee-page-size-select {
  width: auto;
  padding: 5px 8px;
  font-size: 0.8rem;
}

.grantee-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.grantee-page-indicator {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 6px;
}


/* ==========================================================================
   Uninterruptible SweetAlert2 Import Progress Modal
   ========================================================================== */
.swal-import-lock-popup {
  border-radius: 14px !important;
  padding: 22px 24px !important;
}

.swal-import-progress-wrap {
  margin-top: 12px;
  text-align: left;
}

.swal-import-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.swal-import-progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.swal-import-progress-fill {
  height: 100%;
  width: 12%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 55%, #10b981 100%);
  transition: width 0.28s ease;
}

.swal-import-progress-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}


/* ==========================================================================
   Mid-Large Clean Family Members Viewing Modal
   ========================================================================== */
html body .swal2-container > .swal2-popup.swal-wide-family-modal,
html body .swal2-container .swal2-modal.swal-wide-family-modal,
.swal2-popup.swal-wide-family-modal {
  width: min(88vw, 1040px) !important;
  max-width: 1040px !important;
  border-radius: 14px !important;
  padding: 20px 24px 22px !important;
  box-sizing: border-box !important;
}

@media (min-width: 769px) {
  html body .swal2-container > .swal2-popup.swal-wide-family-modal {
    min-width: 760px !important;
  }
}

.swal-wide-family-modal .swal2-title {
  font-size: 1.32rem !important;
  font-weight: 800 !important;
  padding-top: 0 !important;
  margin-bottom: 10px !important;
}

.swal-wide-family-modal .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

.fmm-wrap {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.fmm-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 62%, #0ea5e9 100%);
  color: #ffffff;
}

.fmm-banner-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-top: 2px;
}

.fmm-banner-sub {
  font-size: 0.74rem;
  opacity: 0.92;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fmm-hh-pill {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.34);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.fmm-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

@media (max-width: 820px) {
  .fmm-meta-strip {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

.fmm-meta-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.fmm-meta-lbl {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 3px;
}

.fmm-meta-val {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.fmm-rel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fmm-table-box {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 390px;
  background: #ffffff;
  width: 100%;
}

.fmm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.fmm-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.fmm-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  vertical-align: middle;
}

.fmm-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.fmm-table tbody tr:hover td {
  background: #eff6ff;
}


/* ==========================================================================
   Roster Page Full-Width Content (Occupies Removed Sidebar Space)
   ========================================================================== */
html body .app-layout-shell.roster-wide-content,
html body .app-layout-shell.roster-wide-content:not(.welcome-bulletin-wide),
html body .app-layout-shell:has(#rosterTabContent:not(.hidden)) {
  grid-template-columns: 225px minmax(0, 1fr) !important;
  gap: 20px !important;
}

html body .app-layout-shell.roster-wide-content > #analyticsGraphSidebar,
html body .app-layout-shell:has(#rosterTabContent:not(.hidden)) > #analyticsGraphSidebar {
  display: none !important;
}

html body .app-layout-shell.roster-wide-content > .app-main-column,
html body .app-layout-shell:has(#rosterTabContent:not(.hidden)) > .app-main-column {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

html body .app-layout-shell.roster-wide-content #rosterTabContent,
html body .app-layout-shell:has(#rosterTabContent:not(.hidden)) #rosterTabContent,
html body .app-layout-shell.roster-wide-content #rosterTabContent > .card,
html body .app-layout-shell:has(#rosterTabContent:not(.hidden)) #rosterTabContent > .card {
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 1240px) {
  html body .app-layout-shell.roster-wide-content,
  html body .app-layout-shell.roster-wide-content:not(.welcome-bulletin-wide),
  html body .app-layout-shell:has(#rosterTabContent:not(.hidden)) {
    grid-template-columns: 205px minmax(0, 1fr) !important;
    gap: 16px !important;
  }
}

@media (max-width: 768px) {
  html body .app-layout-shell.roster-wide-content,
  html body .app-layout-shell.roster-wide-content:not(.welcome-bulletin-wide),
  html body .app-layout-shell:has(#rosterTabContent:not(.hidden)) {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  html body .app-layout-shell.roster-wide-content > .app-main-column,
  html body .app-layout-shell:has(#rosterTabContent:not(.hidden)) > .app-main-column {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
}

/* Clickable Roster Table Rows -> Open Family Members Modal */
#rosterTableBody tr.roster-row-clickable {
  cursor: pointer;
}
#rosterTableBody tr.roster-row-clickable:hover td {
  background: rgba(37, 99, 235, 0.06);
}

/* Smaller Font for Identified Family Members So Grantee / Family Head Dominates */
#rosterTableBody tr.roster-row-member td,
#rosterTableBody tr.roster-row-member .roster-member-name-cell {
  font-size: 0.78rem;
}

#rosterTableBody tr.roster-row-member .roster-member-name-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted, #475569);
}

#rosterTableBody tr.roster-row-member .roster-member-badge-sm {
  font-size: 0.72rem;
  padding: 2px 7px;
}

#rosterTableBody tr.roster-row-head .roster-head-name-dom {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

/* Possible Duplicate Grantee Across Different Household Numbers */
#rosterTableBody tr.roster-row-other-hh-dup td.grantee-hh-cell,
#rosterTableBody tr.roster-row-other-hh-dup .roster-other-hh-dup-note {
  color: #b45309;
  font-weight: 700;
}

#rosterTableBody tr.roster-row-other-hh-dup .roster-other-hh-dup-note {
  margin-top: 3px;
  font-size: 0.72rem;
  line-height: 1.25;
}

/* Hide Truncate Button from All Users & Enhance Larger High-Visibility Roster Search Bar */
#rosterTruncateTableBtn,
#rosterTabContent #rosterTruncateTableBtn {
  display: none !important;
  visibility: hidden !important;
}

#rosterTabContent .roster-header-badges {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#rosterTabContent .roster-total-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  color: var(--primary, #1d4ed8);
  font-size: 0.9rem;
  font-weight: 700;
}

#rosterTabContent .roster-directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#rosterTabContent .roster-spotlight-search-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.11) 0%, rgba(14, 165, 233, 0.08) 100%);
  border: 2px solid rgba(37, 99, 235, 0.44);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

#rosterTabContent .roster-spotlight-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
}

#rosterTabContent .roster-spotlight-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  position: relative;
}

#rosterTabContent .roster-spotlight-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #2563eb;
  font-size: 1.15rem;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}

#rosterTabContent .roster-spotlight-input {
  flex: 1 1 auto;
  min-width: 260px;
  height: 56px;
  padding: 12px 18px 12px 46px;
  font-size: 1.08rem;
  font-weight: 600;
  border-radius: 12px;
  border: 2.5px solid #2563eb;
  background: var(--card-bg, #ffffff);
  color: var(--text-main, #0f172a);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.16);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#rosterTabContent .roster-spotlight-input::placeholder {
  color: #64748b;
  font-weight: 500;
}

#rosterTabContent .roster-spotlight-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}

#rosterTabContent .roster-spotlight-submit {
  height: 56px;
  padding: 0 28px;
  font-size: 1.04rem;
  font-weight: 700;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

#rosterTabContent .roster-spotlight-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#rosterTabContent .roster-spotlight-select {
  min-width: 210px;
  height: 42px;
  font-size: 0.92rem;
  border-radius: 10px;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  font-weight: 600;
}

#rosterTabContent .roster-spotlight-aux-btn {
  height: 42px;
  padding: 0 15px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
}

body.dark-mode #rosterTabContent .roster-spotlight-search-panel {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.38) 0%, rgba(15, 23, 42, 0.78) 100%);
  border-color: rgba(96, 165, 250, 0.55);
}

body.dark-mode #rosterTabContent .roster-spotlight-label {
  color: #bfdbfe;
}

body.dark-mode #rosterTabContent .roster-spotlight-input {
  background: #0f172a;
  color: #f8fafc;
  border-color: #60a5fa;
}

body.dark-mode #rosterTabContent .roster-spotlight-input::placeholder {
  color: #94a3b8;
}

body.dark-mode #rosterTabContent .roster-total-pill {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
}

/* Roster Search Loading Animation */
@keyframes rosterSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rosterPulseBar {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}

#rosterTabContent .roster-search-loading-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  color: #1e3a8a;
  font-size: 0.9rem;
  font-weight: 700;
  animation: rosterPulseBar 1.2s ease-in-out infinite;
}

#rosterTabContent .roster-search-loading-banner.hidden {
  display: none;
}

#rosterTabContent .roster-search-spinner,
#rosterTabContent .roster-search-btn-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(37, 99, 235, 0.25);
  border-top-color: #2563eb;
  animation: rosterSpin 0.75s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

#rosterTabContent .roster-search-btn-spinner {
  width: 15px;
  height: 15px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

#rosterTabContent .roster-table-loading-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 14px !important;
  font-weight: 700;
  color: #1d4ed8;
}

body.dark-mode #rosterTabContent .roster-search-loading-banner {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.45);
  color: #bfdbfe;
}

body.dark-mode #rosterTabContent .roster-table-loading-cell {
  color: #93c5fd;
}

/* SweetAlert Search Loading Animation */
.roster-swal-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 6px 4px;
  font-size: 0.94rem;
  font-weight: 600;
  color: #1e3a8a;
}

.roster-swal-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563eb;
  animation: rosterSpin 0.8s linear infinite;
  display: inline-block;
}

body.dark-mode .roster-swal-loading-box {
  color: #bfdbfe;
}

body.dark-mode .roster-swal-spinner {
  border-color: rgba(96, 165, 250, 0.25);
  border-top-color: #60a5fa;
}

/* Optimized Roster Table & Collapsible Household Client Status Cell */
#rosterTabContent .roster-optimized-table-wrap {
  contain: layout style;
}

#rosterTabContent .roster-optimized-table th,
#rosterTabContent .roster-optimized-table td {
  padding: 8px 10px;
  vertical-align: middle;
  font-size: 0.85rem;
}

#rosterTabContent .roster-optimized-table .roster-col-client-status,
#rosterTabContent .roster-optimized-table .roster-client-status-cell {
  max-width: 210px;
  min-width: 145px;
}

#rosterTabContent .roster-client-status-collapsible {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 100%;
  line-height: 1.32;
}

#rosterTabContent .roster-client-status-collapsible.is-collapsed .roster-cs-full {
  display: none;
}

#rosterTabContent .roster-client-status-collapsible.is-expanded .roster-cs-preview {
  display: none;
}

#rosterTabContent .roster-client-status-collapsible .roster-cs-preview {
  display: inline-block;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

#rosterTabContent .roster-client-status-collapsible .roster-cs-full {
  display: inline-block;
  white-space: normal;
  word-break: break-word;
  font-weight: 500;
}

#rosterTabContent .roster-cs-toggle-btn {
  appearance: none;
  border: 1px solid rgba(37, 99, 235, 0.32);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.4;
}

#rosterTabContent .roster-cs-toggle-btn:hover {
  background: rgba(37, 99, 235, 0.16);
}

body.dark-mode #rosterTabContent .roster-cs-toggle-btn {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

/* Modern Clean BTR Page Styling */
#btrTabContent.btr-modern-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#btrTabContent.btr-modern-shell.hidden {
  display: none;
}

#btrTabContent .btr-top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}

#btrTabContent .btr-modern-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  padding: 16px 18px;
  margin-bottom: 0;
}

#btrTabContent .btr-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#btrTabContent .btr-entry-card-head {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

#btrTabContent .btr-eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

#btrTabContent .btr-eyebrow-badge.is-amber {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

#btrTabContent .btr-eyebrow-badge.is-emerald {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}

#btrTabContent .btr-active-batch-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1e40af;
  font-size: 0.82rem;
}

#btrTabContent .btr-pill-btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
}

#btrTabContent .btr-collapsible-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

#btrTabContent .btr-batch-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

#btrTabContent .btr-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

#btrTabContent .btr-structured-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#btrTabContent .btr-form-section {
  background: rgba(248, 250, 252, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 12px;
  padding: 13px 14px;
}

#btrTabContent .btr-form-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1e3a8a;
  margin-bottom: 10px;
}

#btrTabContent .btr-form-grid {
  display: grid;
  gap: 10px;
}

#btrTabContent .btr-form-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

#btrTabContent .btr-form-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
}

#btrTabContent .btr-field-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--card-bg, #ffffff);
  border: 1.5px solid rgba(59, 130, 246, 0.28);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

#btrTabContent .btr-field-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#btrTabContent .btr-field-pair {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 8px;
}

#btrTabContent .btr-field-pair > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#btrTabContent .btr-field-label {
  font-size: 0.77rem;
  font-weight: 700;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#btrTabContent .btr-field-card input,
#btrTabContent .btr-field-card select,
#btrTabContent .btr-field-box input,
#btrTabContent .btr-field-box select {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  font-size: 0.87rem;
}

#btrTabContent .btr-track-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  height: 38px;
  padding: 3px;
  border-radius: 9px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

#btrTabContent .btr-track-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#btrTabContent .btr-track-pill input[type="radio"] {
  accent-color: #2563eb;
  width: 14px;
  height: 14px;
  margin: 0;
}

#btrTabContent .btr-track-pill:has(input:checked) {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

#btrTabContent .btr-form-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

#btrTabContent .btr-submit-btn {
  height: 42px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

#btrTabContent .btr-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#btrTabContent .btr-search-input-wrap {
  position: relative;
  flex: 1 1 280px;
  display: flex;
  align-items: center;
}

#btrTabContent .btr-search-input-wrap > i {
  position: absolute;
  left: 13px;
  color: #64748b;
  pointer-events: none;
}

#btrTabContent .btr-search-input-wrap input {
  width: 100%;
  height: 40px;
  padding-left: 36px;
  border-radius: 10px;
}

#btrTabContent .btr-filter-toolbar select {
  height: 40px;
  border-radius: 10px;
  min-width: 185px;
}

#btrTabContent .btr-empty-prompt-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: left;
  padding: 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(14, 165, 233, 0.04) 100%);
  border: 1.5px dashed rgba(59, 130, 246, 0.35);
}

#btrTabContent .btr-empty-prompt-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

#btrTabContent .btr-finalize-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(248, 250, 252, 0.9);
}

#btrTabContent .btr-finalize-bar.hidden {
  display: none;
}

#btrTabContent .btr-modern-table-wrap {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  overflow-x: auto;
}

#btrTabContent .btr-modern-table thead th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 10px;
  border-bottom: 1.5px solid #cbd5e1;
}

#btrTabContent .btr-modern-table tbody td {
  padding: 9px 10px;
  font-size: 0.85rem;
  vertical-align: middle;
}

body.dark-mode #btrTabContent .btr-form-section {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 85, 105, 0.65);
}

body.dark-mode #btrTabContent .btr-form-section-title {
  color: #93c5fd;
}

body.dark-mode #btrTabContent .btr-field-card {
  background: #0f172a;
  border-color: rgba(96, 165, 250, 0.35);
}

body.dark-mode #btrTabContent .btr-field-label {
  color: #cbd5e1;
}

body.dark-mode #btrTabContent .btr-track-segmented {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode #btrTabContent .btr-track-pill {
  color: #cbd5e1;
}

body.dark-mode #btrTabContent .btr-track-pill:has(input:checked) {
  background: #0f172a;
  color: #60a5fa;
}

body.dark-mode #btrTabContent .btr-modern-table thead th {
  background: #1e293b;
  color: #f1f5f9;
  border-bottom-color: #334155;
}

/* Hide Grantee (Roster) card cleanly & remove button-like background on BTR radio buttons */
#btrTabContent .btr-field-card.hidden {
  display: none !important;
}

#btrTabContent .btr-track-segmented,
#btrTabContent .btr-track-plain-group {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  height: auto;
  min-height: 36px;
  padding: 4px 2px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#btrTabContent .btr-track-pill,
#btrTabContent .btr-track-plain-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 0.86rem;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
}

#btrTabContent .btr-track-pill:has(input:checked),
#btrTabContent .btr-track-plain-option:has(input:checked) {
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
}

#btrTabContent .btr-track-pill input[type="radio"],
#btrTabContent .btr-track-plain-option input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

/* Enhanced Spacing & Clean Alignment in BTR Entry Card */
#btrTabContent .btr-form-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}

#btrTabContent .btr-field-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

#btrTabContent .btr-field-pair {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 12px;
}

#btrTabContent .btr-month-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

#btrTabContent .btr-month-header-row .btr-field-label {
  margin: 0;
  white-space: nowrap;
}

#btrTabContent .btr-month-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 2px;
}

#btrTabContent .btr-field-box select.btr-month-mode-select {
  height: 34px !important;
  min-height: 34px;
  line-height: 1.25 !important;
  width: auto !important;
  min-width: 128px;
  padding: 6px 26px 6px 11px !important;
  font-size: 0.78rem !important;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

#btrTabContent .btr-month-inputs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#btrTabContent .btr-month-inputs-row input[type="month"] {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
}

#btrTabContent .btr-range-sep {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
  padding: 0 2px;
}

/* Full-Width col-md-4 Support for Non-Compliant Month Range Field */
#btrTabContent .btr-month-field-box.col-md-4 {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
}

#btrTabContent .btr-month-field-box.col-md-4.is-range-expanded .btr-month-inputs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
}

@media (max-width: 640px) {
  #btrTabContent .btr-month-field-box.col-md-4.is-range-expanded .btr-month-inputs-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Hide second dropdown buttons on Household Number and Non-Compliant Family Member visually while keeping DOM & JS functionality active */
#btrHouseholdNoInput.btr-second-dropdown-unclickable,
#btrFamilyMemberSelect.btr-second-dropdown-unclickable {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}

/* Fix Month Range Dropdown Height, Width & Text Clipping */
#btrTabContent .btr-month-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  margin-bottom: 4px;
}

#btrTabContent .btr-field-box select.btr-month-mode-select,
.btr-month-mode-select,
#btrEntryMonthModeSelect {
  display: inline-block !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: none !important;
  line-height: 1.3 !important;
  width: auto !important;
  min-width: 138px !important;
  padding: 4px 28px 4px 12px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

/* Enhanced Large Month Calendar Picker & Larger Month Input Field in BTR */
#btrTabContent input[type="month"].btr-enhanced-month-input {
  height: 44px !important;
  min-height: 44px !important;
  font-size: 0.96rem !important;
  font-weight: 600;
  padding: 6px 12px !important;
  border-radius: 10px !important;
  cursor: pointer;
}

#btrTabContent input[type="month"].btr-enhanced-month-input::-webkit-calendar-picker-indicator {
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.btr-large-month-popover {
  position: absolute;
  z-index: 99999;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  padding: 16px;
  user-select: none;
}

.btr-large-month-popover.hidden {
  display: none !important;
}

.btr-large-month-popover .btr-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.btr-large-month-popover .btr-cal-year-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.btr-large-month-popover .btr-cal-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btr-large-month-popover .btr-cal-nav-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btr-large-month-popover .btr-cal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.btr-large-month-popover .btr-cal-month-btn {
  height: 48px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btr-large-month-popover .btr-cal-month-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.btr-large-month-popover .btr-cal-month-btn.is-selected {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btr-large-month-popover .btr-cal-month-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f1f5f9;
}

.btr-large-month-popover .btr-cal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.btr-large-month-popover .btr-cal-action-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.btr-large-month-popover .btr-cal-action-btn.is-close {
  background: #f1f5f9;
  color: #475569;
}

.btr-large-month-popover .btr-cal-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

body.dark-mode .btr-large-month-popover {
  background: #0f172a;
  border-color: #334155;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

body.dark-mode .btr-large-month-popover .btr-cal-header,
body.dark-mode .btr-large-month-popover .btr-cal-footer {
  border-color: #1e293b;
}

body.dark-mode .btr-large-month-popover .btr-cal-year-title {
  color: #f8fafc;
}

body.dark-mode .btr-large-month-popover .btr-cal-nav-btn,
body.dark-mode .btr-large-month-popover .btr-cal-month-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .btr-large-month-popover .btr-cal-month-btn.is-selected {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

/* Visually indicate disabled state in Non-Compliance Track, Month & Member Details until Health or Education is selected */
#btrTrackMonthMemberDetailsSection input:disabled,
#btrTrackMonthMemberDetailsSection select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f1f5f9;
}

body.dark-mode #btrTrackMonthMemberDetailsSection input:disabled,
body.dark-mode #btrTrackMonthMemberDetailsSection select:disabled {
  background-color: #1e293b;
  opacity: 0.5;
}

/* User-Friendly GUI Styling for Dedicated Archived BTR Records Table */
#btrTabContent .btr-archive-records-card {
  margin-top: 18px;
  border-top: 3px solid #64748b;
}

#btrTabContent .btr-archive-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#btrTabContent .btr-archive-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#btrTabContent .btr-archive-header-actions select {
  height: 38px;
  border-radius: 9px;
  min-width: 210px;
  font-size: 0.85rem;
}

#btrTabContent .btr-eyebrow-badge.is-slate {
  background: rgba(100, 116, 139, 0.14);
  color: #334155;
}

body.dark-mode #btrTabContent .btr-eyebrow-badge.is-slate {
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

/* Dominating Visual Hierarchy for Current Period Encoded Non-Compliant Members Card & Table */
#btrTabContent .btr-current-dominant-card {
  margin-top: 14px;
  padding: 20px 22px;
  border: 2px solid rgba(37, 99, 235, 0.38);
  border-top: 5px solid #2563eb;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.10), 0 4px 12px rgba(15, 23, 42, 0.05);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.55) 0%, var(--card-bg, #ffffff) 96px);
}

#btrTabContent .btr-dominant-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid rgba(37, 99, 235, 0.16);
}

#btrTabContent .btr-dominant-title {
  font-size: 1.24rem !important;
  font-weight: 800 !important;
  margin: 5px 0 3px !important;
  color: #0f172a;
}

#btrTabContent .btr-eyebrow-badge.is-primary-dominant {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  font-weight: 800;
}

#btrTabContent .btr-dominant-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

#btrTabContent .btr-dominant-table-wrap {
  border: 1.5px solid rgba(37, 99, 235, 0.22);
  border-radius: 12px;
  background: var(--card-bg, #ffffff);
}

#btrTabContent .btr-dominant-table thead th {
  background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  padding: 12px 11px !important;
  letter-spacing: 0.01em;
}

#btrTabContent .btr-dominant-table tbody td {
  padding: 11px 11px !important;
  font-size: 0.88rem !important;
}

#btrTabContent .btr-dominant-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.06) !important;
}

/* Separate Collapsible Archived BTR Card */
#btrTabContent .btr-archive-records-card {
  margin-top: 22px;
  border: 1.5px solid rgba(100, 116, 139, 0.32);
  border-top: 3px solid #64748b;
  border-radius: 14px;
  opacity: 0.96;
}

#btrTabContent .btr-archive-records-card.is-collapsed {
  padding-bottom: 14px;
}

body.dark-mode #btrTabContent .btr-current-dominant-card {
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.25) 0%, #0f172a 110px);
  border-color: rgba(96, 165, 250, 0.4);
}

body.dark-mode #btrTabContent .btr-dominant-title {
  color: #f8fafc;
}

/* Manual Roster Entry Fallback Panel in BTR when Household or Member is Not in Imported Roster */
#btrTabContent .btr-manual-roster-panel {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px dashed rgba(37, 99, 235, 0.45);
  background: rgba(239, 246, 255, 0.65);
}

#btrTabContent .btr-manual-roster-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

body.dark-mode #btrTabContent .btr-manual-roster-panel {
  background: rgba(30, 58, 138, 0.22);
  border-color: rgba(96, 165, 250, 0.45);
}

/* Case Folders Table: Sticky Overlay Actions Column & File Icon-Only Documents Button */
.cf-table-overlay-wrap {
  position: relative;
  overflow-x: auto;
}

.cf-overlay-actions-table th.cf-sticky-actions-col,
.cf-overlay-actions-table td.cf-sticky-actions-cell {
  position: sticky;
  right: 0;
  z-index: 4;
  text-align: center;
  white-space: nowrap;
  width: 132px;
  min-width: 132px;
  box-shadow: -8px 0 16px -6px rgba(15, 23, 42, 0.14);
  border-left: 1px solid var(--border-color, #e2e8f0);
}

.cf-overlay-actions-table thead th.cf-sticky-actions-col {
  z-index: 6;
  background: var(--table-head-bg, #f1f5f9);
}

.cf-overlay-actions-table tbody td.cf-sticky-actions-cell {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cf-overlay-actions-table tbody tr:hover td.cf-sticky-actions-cell {
  background: rgba(239, 246, 255, 0.97);
}

body.dark-mode .cf-overlay-actions-table thead th.cf-sticky-actions-col {
  background: #1e293b;
}

body.dark-mode .cf-overlay-actions-table tbody td.cf-sticky-actions-cell {
  background: rgba(15, 23, 42, 0.93);
  box-shadow: -8px 0 18px -6px rgba(0, 0, 0, 0.45);
}

body.dark-mode .cf-overlay-actions-table tbody tr:hover td.cf-sticky-actions-cell {
  background: rgba(30, 41, 59, 0.97);
}

.cf-overlay-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.cf-overlay-action-group .btn-icon-only {
  position: relative;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
}

.cf-doc-icon-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Printable A4 Official Forms Simulation (210mm x 297mm) & Print Isolation
   ========================================================================== */
.forms-protected-zone {
  user-select: none;
  -webkit-user-select: none;
}

.forms-a4-viewport-stage {
  width: 100%;
  overflow-x: auto;
  padding: 18px 12px 28px;
  display: flex;
  justify-content: center;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  border: 1px solid var(--border-color, #cbd5e1);
}

.forms-a4-paper {
  position: relative;
  width: 210mm;
  min-width: 210mm;
  min-height: 297mm;
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 16mm 16mm 18mm;
  box-sizing: border-box;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  border: 1px solid #cbd5e1;
  font-family: "Times New Roman", Georgia, serif;
  overflow: hidden;
}

.forms-a4-screen-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-family: Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(37, 99, 235, 0.08);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.forms-a4-sheet-inner {
  position: relative;
  z-index: 2;
}

.a4-deped-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.a4-deped-title-block {
  text-align: center;
  flex: 1 1 auto;
}

.a4-rep-line {
  font-size: 11.5pt;
  font-weight: 700;
  color: #0f172a;
}

.a4-dept-line {
  font-size: 12pt;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #0f172a;
}

.a4-cert-heading {
  margin-top: 14px;
  font-size: 14pt;
  font-weight: 800;
  color: #0f172a;
}

.a4-cert-body {
  font-size: 11pt;
  line-height: 1.45;
  color: #0f172a;
}

.a4-field-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.a4-lbl-bold {
  font-weight: 700;
  white-space: nowrap;
}

.a4-grow {
  flex: 1 1 auto;
}

.a4-subline-group {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.a4-subcol {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
}

.a4-line-input {
  display: inline-block;
  min-height: 20px;
  padding: 0 5px 1px;
  border-bottom: 1.5px solid #0f172a;
  font-family: "Comic Sans MS", "Segoe Print", Georgia, serif;
  font-size: 11pt;
  font-weight: 600;
  color: #0f172a !important;
  background: transparent !important;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.a4-line-input:focus {
  background: rgba(37, 99, 235, 0.08) !important;
}

.a4-subcaption {
  font-family: Arial, sans-serif;
  font-size: 7.5pt;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
  margin-top: 2px;
}

.a4-signatory-block {
  margin-top: 46px;
  display: flex;
  justify-content: flex-end;
  gap: 24px;
}

.a4-signatory-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.a4-signatory-caption {
  font-family: Arial, sans-serif;
  font-size: 9pt;
  font-weight: 700;
  margin-top: 3px;
  text-align: center;
}

@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  html,
  body,
  .app-shell,
  .app-main-column,
  #formsTabContent,
  .forms-a4-viewport-stage {
    width: 100% !important;
    max-width: 194mm !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.printing-a4-form-mode .left-sidenav,
  body.printing-a4-form-mode .topbar,
  body.printing-a4-form-mode .system-footer,
  body.printing-a4-form-mode .forms-no-print-toolbar,
  body.printing-a4-form-mode .info-sidebar,
  body.printing-a4-form-mode .chat-widget-root,
  body.printing-a4-form-mode .mobile-nav-backdrop,
  body.printing-a4-form-mode .modal-backdrop,
  body.printing-a4-form-mode .swal2-container {
    display: none !important;
  }

  body.printing-a4-form-mode #printableA4FormsCard,
  body.printing-a4-form-mode #printableA4FormsBody {
    display: block !important;
    visibility: visible !important;
  }

  body.printing-a4-form-mode #formsA4PrintSheet {
    position: static !important;
    width: 194mm !important;
    max-width: 194mm !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 6mm 8mm !important;
    box-shadow: none !important;
    border: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.printing-a4-form-mode .forms-a4-sheet-inner {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 10pt !important;
  }

  body.printing-a4-form-mode .a4-deped-header {
    margin-bottom: 12px !important;
  }

  body.printing-a4-form-mode .a4-cert-heading {
    margin-top: 8px !important;
    font-size: 12.5pt !important;
  }

  body.printing-a4-form-mode .a4-cert-body {
    font-size: 10pt !important;
    line-height: 1.32 !important;
  }

  body.printing-a4-form-mode .a4-signatory-block {
    margin-top: 24px !important;
  }

  body.printing-a4-form-mode .forms-a4-screen-watermark {
    display: none !important;
  }
}

@media print {
  body.printing-uploaded-form-modal-mode .left-sidenav,
  body.printing-uploaded-form-modal-mode .topbar,
  body.printing-uploaded-form-modal-mode .system-footer,
  body.printing-uploaded-form-modal-mode .forms-no-print-toolbar,
  body.printing-uploaded-form-modal-mode .forms-a4-viewport-stage,
  body.printing-uploaded-form-modal-mode .info-sidebar,
  body.printing-uploaded-form-modal-mode .chat-widget-root,
  body.printing-uploaded-form-modal-mode .mobile-nav-backdrop,
  body.printing-uploaded-form-modal-mode .swal2-container {
    display: none !important;
  }

  body.printing-uploaded-form-modal-mode #uploadedFormPreviewModal,
  body.printing-uploaded-form-modal-mode #uploadedFormPreviewModal .modal-dialog,
  body.printing-uploaded-form-modal-mode #uploadedFormPreviewModal .modal-body,
  body.printing-uploaded-form-modal-mode #uploadedFormPreviewStage {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 194mm !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.printing-uploaded-form-modal-mode #uploadedFormPrintableDocumentBox {
    width: 194mm !important;
    max-width: 194mm !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 6mm 8mm !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   My Space — Accomplishment Report (Photo Layout & Schedule Sync)
   ========================================================================== */
.acc-info-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 6px;
  background: #d8eef8;
  color: #164e63;
  font-size: 0.88rem;
  font-weight: 500;
}

.acc-range-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.acc-range-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.acc-range-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e293b;
}

.acc-date-input {
  height: 36px;
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.9rem;
}

.acc-generate-btn {
  height: 36px;
  padding: 0 22px;
  border: none;
  border-radius: 6px;
  background: #14b88a;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.acc-generate-btn:hover {
  background: #0d9470;
}

.acc-single-sheet {
  width: 100%;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
}

.acc-period-heading {
  font-size: 0.92rem;
  color: #0f172a;
  margin-bottom: 8px;
}

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

.acc-main-report-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.86rem;
  table-layout: fixed;
}

.acc-main-report-table th,
.acc-main-report-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.acc-main-report-table thead tr {
  height: 36px;
}

.acc-main-report-table tbody tr.acc-data-row {
  height: 48px;
}

.acc-main-report-table th {
  background: #f8fafc;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #1e293b;
  text-align: center;
}

.acc-icon-cell {
  text-align: center;
  vertical-align: middle !important;
}

.acc-row-trash-btn,
.acc-row-expand-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.acc-row-trash-btn:hover {
  border-color: #ef4444;
  color: #dc2626;
  background: #fef2f2;
}

.acc-row-expand-btn:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.acc-date-cell {
  text-align: center;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.3;
  color: #334155;
}

.acc-date-cell.is-sunday {
  color: #ef4444;
}

.acc-editable-cell {
  min-height: 44px;
  outline: none;
  cursor: text;
  background: #ffffff;
  color: #0f172a;
}

.acc-editable-cell:focus {
  background: rgba(20, 184, 138, 0.08);
  box-shadow: inset 0 0 0 1px #14b88a;
}

.dtr-sheet-stage {
  width: 100%;
  overflow-x: auto;
  padding: 12px 8px 18px;
  display: flex;
  justify-content: center;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
}

.dtr-dual-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  width: 210mm;
  max-width: 100%;
  min-width: 0;
  background: #ffffff;
  color: #0f172a;
  padding: 6mm 7mm;
  border: 1px solid #94a3b8;
  box-sizing: border-box;
  overflow: hidden;
}

.dtr-single-copy {
  background: #ffffff;
  color: #0f172a;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.dtr-cs-no {
  font-size: 6.5pt;
  font-weight: 700;
  color: #0f172a;
}

.dtr-main-title {
  text-align: center;
  font-size: 10.5pt;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 1px 0 6px;
  color: #0f172a;
}

.dtr-name-block {
  text-align: center;
  margin-bottom: 6px;
}

.dtr-name-lbl {
  font-size: 7.5pt;
  font-weight: 700;
  margin-bottom: 1px;
}

.dtr-name-line {
  min-height: 14px;
  font-size: 8.2pt;
  font-weight: 700;
  padding: 0 4px;
  outline: none;
  word-break: break-word;
}

.dtr-name-underline {
  border-bottom: 1px solid #0f172a;
  margin-top: 1px;
}

.dtr-meta-grid {
  font-size: 7.2pt;
  line-height: 1.3;
  margin-bottom: 5px;
}

.dtr-meta-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 2px;
}

.dtr-meta-italic {
  font-style: italic;
  white-space: nowrap;
}

.dtr-meta-val {
  min-width: 68px;
  border-bottom: 1px solid #0f172a;
  padding: 0 3px;
  font-weight: 700;
  outline: none;
}

.dtr-meta-year {
  font-weight: 700;
}

.dtr-meta-line {
  flex: 1 1 auto;
  min-width: 45px;
  min-height: 12px;
  border-bottom: 1px solid #0f172a;
  padding: 0 3px;
  outline: none;
}

.dtr-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 6.8pt;
  color: #0f172a;
  table-layout: fixed;
}

.dtr-grid-table th,
.dtr-grid-table td {
  border: 1px solid #0f172a;
  padding: 1px 2px;
  text-align: center;
  line-height: 1.15;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.dtr-grid-table thead th {
  font-weight: 700;
  background: #ffffff;
}

.dtr-th-day {
  width: 22px;
}

.dtr-th-sub {
  font-size: 6.4pt;
}

.dtr-col-day {
  font-weight: 600;
}

.dtr-cell-edit {
  outline: none;
  cursor: text;
}

.dtr-cell-edit:focus,
.dtr-name-line:focus,
.dtr-meta-val:focus,
.dtr-meta-line:focus,
.dtr-total-line:focus,
.dtr-signatory-name:focus,
.dtr-signatory-sub:focus {
  background: rgba(37, 99, 235, 0.08);
}

.dtr-day-off-cell {
  font-size: 6.4pt;
  letter-spacing: 0.03em;
  color: #334155;
  outline: none;
  cursor: text;
}

.dtr-ob-task-line {
  margin-top: 1px;
  font-size: 5.6pt;
  line-height: 1.1;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.dtr-ob-badge {
  display: inline-block;
  font-weight: 800;
  color: #1d4ed8;
  margin-right: 2px;
}

.dtr-ob-task-name {
  color: #0f172a;
  font-weight: 600;
}

.dtr-row-out-of-month td {
  color: #94a3b8;
}

.dtr-total-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 7.5pt;
  font-weight: 700;
}

.dtr-total-line {
  flex: 1 1 auto;
  min-height: 13px;
  border-bottom: 1px solid #0f172a;
  padding: 0 3px;
  outline: none;
}

.dtr-cert-text {
  font-style: italic;
  font-size: 6.5pt;
  line-height: 1.25;
  margin: 5px 0 10px;
  text-align: justify;
  color: #0f172a;
}

.dtr-verified-rule {
  border-top: 1px solid #0f172a;
  margin: 0 4px 2px;
}

.dtr-verified-caption {
  text-align: center;
  font-size: 6.6pt;
  line-height: 1.2;
  margin-bottom: 12px;
}

.dtr-signatory-area {
  text-align: center;
  margin-top: 4px;
}

.dtr-signatory-name {
  font-size: 7.5pt;
  font-weight: 700;
  border-bottom: 1px solid #0f172a;
  display: inline-block;
  min-width: 145px;
  padding: 0 4px 1px;
  outline: none;
}

.dtr-signatory-sub {
  font-size: 6.6pt;
  font-weight: 700;
  margin-top: 2px;
  outline: none;
}

@media print {
  body.printing-dtr-mode .left-sidenav,
  body.printing-dtr-mode .topbar,
  body.printing-dtr-mode .system-footer,
  body.printing-dtr-mode .dtr-toolbar,
  body.printing-dtr-mode #mySpaceAccomplishmentCard,
  body.printing-dtr-mode .info-sidebar,
  body.printing-dtr-mode .chat-widget-root,
  body.printing-dtr-mode .mobile-nav-backdrop,
  body.printing-dtr-mode .modal-backdrop,
  body.printing-dtr-mode .swal2-container {
    display: none !important;
  }

  body.printing-dtr-mode,
  body.printing-dtr-mode .app-shell,
  body.printing-dtr-mode .app-main-column,
  body.printing-dtr-mode #mySpaceTabContent,
  body.printing-dtr-mode .dtr-workspace-card,
  body.printing-dtr-mode #mySpaceDtrCollapsibleBody,
  body.printing-dtr-mode .dtr-sheet-stage {
    display: block !important;
    width: 194mm !important;
    max-width: 194mm !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    background: #ffffff !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.printing-dtr-mode .dtr-dual-sheet {
    width: 194mm !important;
    max-width: 194mm !important;
    min-width: 0 !important;
    gap: 4mm !important;
    padding: 0 !important;
    border: none !important;
    grid-template-columns: repeat(2, 95mm) !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.printing-dtr-mode .dtr-single-copy {
    padding: 2mm 3mm !important;
    border: 0.5px solid #0f172a !important;
  }

  body.printing-dtr-mode .dtr-grid-table th,
  body.printing-dtr-mode .dtr-grid-table td {
    padding: 0.5px 1.5px !important;
    font-size: 6pt !important;
    line-height: 1.05 !important;
  }

  body.printing-dtr-mode .dtr-cert-text {
    margin: 3px 0 6px !important;
    font-size: 5.8pt !important;
  }

  body.printing-dtr-mode .dtr-verified-caption {
    margin-bottom: 8px !important;
  }

  body.printing-accomplishment-mode .left-sidenav,
  body.printing-accomplishment-mode .topbar,
  body.printing-accomplishment-mode .system-footer,
  body.printing-accomplishment-mode .acc-toolbar,
  body.printing-accomplishment-mode .acc-row-del-col,
  body.printing-accomplishment-mode #mySpaceDtrCard,
  body.printing-accomplishment-mode .info-sidebar,
  body.printing-accomplishment-mode .chat-widget-root,
  body.printing-accomplishment-mode .mobile-nav-backdrop,
  body.printing-accomplishment-mode .modal-backdrop,
  body.printing-accomplishment-mode .swal2-container {
    display: none !important;
  }

  body.printing-accomplishment-mode,
  body.printing-accomplishment-mode .app-shell,
  body.printing-accomplishment-mode .app-main-column,
  body.printing-accomplishment-mode #mySpaceTabContent,
  body.printing-accomplishment-mode #mySpaceAccomplishmentCard,
  body.printing-accomplishment-mode .acc-sheet-box {
    display: block !important;
    width: 194mm !important;
    max-width: 194mm !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 4mm !important;
    border: none !important;
    background: #ffffff !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
}

/* ==========================================================================
   My Space — Accomplishment Report (Photo Layout & Schedule Sync)
   ========================================================================== */
.acc-info-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 6px;
  background: #d8eef8;
  color: #164e63;
  font-size: 0.88rem;
  font-weight: 500;
}

.acc-range-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.acc-range-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.acc-range-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e293b;
}

.acc-date-input {
  height: 36px;
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.9rem;
}

.acc-generate-btn {
  height: 36px;
  padding: 0 22px;
  border: none;
  border-radius: 6px;
  background: #14b88a;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.acc-generate-btn:hover {
  background: #0d9470;
}

.acc-split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

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

.acc-period-heading {
  font-size: 0.88rem;
  color: #0f172a;
  margin-bottom: 6px;
}

.acc-mini-dtr-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.72rem;
  table-layout: fixed;
}

.acc-mini-dtr-table th,
.acc-mini-dtr-table td {
  border: 1px solid #cbd5e1;
  padding: 2px 3px;
  text-align: center;
  line-height: 1.25;
}

.acc-mini-dtr-table th {
  font-weight: 700;
  background: #f8fafc;
}

.acc-mini-day {
  font-weight: 600;
  color: #334155;
}

.acc-mini-wknd {
  letter-spacing: 0.14em;
  font-weight: 600;
  color: #334155;
}

.acc-main-report-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.84rem;
}

.acc-main-report-table th,
.acc-main-report-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  vertical-align: middle;
}

.acc-main-report-table th {
  background: #f8fafc;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #1e293b;
  text-align: center;
}

.acc-icon-cell {
  text-align: center;
  vertical-align: middle !important;
}

.acc-row-trash-btn,
.acc-row-expand-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.acc-row-trash-btn:hover {
  border-color: #ef4444;
  color: #dc2626;
  background: #fef2f2;
}

.acc-row-expand-btn:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.acc-date-cell {
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.25;
  color: #334155;
}

.acc-date-cell.is-sunday {
  color: #ef4444;
}

.acc-editable-cell {
  min-width: 150px;
  outline: none;
  cursor: text;
  background: #ffffff;
  color: #0f172a;
}

.acc-editable-cell:focus {
  background: rgba(20, 184, 138, 0.08);
  box-shadow: inset 0 0 0 1px #14b88a;
}

/* ==========================================================================
   My Space — My profile Top Card (Cover Banner + Circular Avatar + Editable)
   ========================================================================== */
.msp-profile-card {
  padding: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--border-color, #cbd5e1);
}

.msp-cover-banner-wrap {
  position: relative;
  width: 100%;
  height: 225px;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 55%, #0284c7 100%);
  overflow: hidden;
}

.msp-cover-banner-bg {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.msp-edit-cover-btn {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
}

.msp-edit-cover-btn:hover {
  background: #f1f5f9;
}

.msp-profile-hero-row {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 0 24px 16px;
  margin-top: -54px;
  position: relative;
  z-index: 2;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.msp-avatar-hero-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
}

.msp-hero-avatar-img,
.msp-hero-avatar-fallback {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  background: radial-gradient(circle at 30% 25%, #b91c1c, #7f1d1d);
  color: #ffffff;
  font-weight: 800;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msp-edit-avatar-btn {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #e2e8f0;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.24);
}

.msp-edit-avatar-btn:hover {
  background: #cbd5e1;
}

.msp-profile-identity-col {
  padding-top: 58px;
  flex: 1 1 240px;
}

.msp-hero-name {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main, #0f172a);
}

.msp-hero-position {
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
}

.msp-hero-handle {
  margin-top: 2px;
  font-size: 0.84rem;
  color: var(--text-muted, #64748b);
}

.msp-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  padding: 14px 24px 0;
}

.msp-profile-item {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(37, 99, 235, 0.03);
}

.msp-profile-lbl {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  margin-bottom: 2px;
}

.msp-profile-val {
  font-size: 0.92rem;
  color: var(--text-main, #0f172a);
  word-break: break-word;
}

/* ==========================================================================
   My Space — My Quick Links Sidebar (Editable URL Bookmarks)
   ========================================================================== */
.msp-quick-links-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msp-ql-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.msp-ql-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msp-ql-item {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(37, 99, 235, 0.03);
}

.msp-ql-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.msp-ql-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  color: #2563eb;
  text-decoration: none;
  word-break: break-word;
}

.msp-ql-link:hover {
  text-decoration: underline;
}

.msp-ql-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.msp-ql-url-sub {
  margin-top: 3px;
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msp-ql-edit-box {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media print {
  body.printing-dtr-mode .msp-quick-links-sidebar,
  body.printing-accomplishment-mode .msp-quick-links-sidebar {
    display: none !important;
  }
}

/* ==========================================================================
   Chat Group Creation Panel & Member Checklist
   ========================================================================== */
.messenger-group-create-panel {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(37, 99, 235, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.messenger-group-members-box {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px;
}

.messenger-group-member-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  cursor: pointer;
}

/* ==========================================================================
   Online Admin Animated Highlight (No Name Blinking)
   ========================================================================== */
@keyframes mspOnlineAdminRowHighlight {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45), 0 4px 12px rgba(37, 99, 235, 0.16);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 0 1.5px rgba(14, 165, 233, 0.75), 0 6px 16px rgba(14, 165, 233, 0.24);
  }
}

.messenger-contact-item.is-online-admin {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.18), rgba(37, 99, 235, 0.12));
  background-size: 220% 220%;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 10px;
  animation: mspOnlineAdminRowHighlight 2.6s ease-in-out infinite;
}

.messenger-online-admin-name {
  font-weight: 800;
  color: inherit;
  opacity: 1;
  animation: none !important;
  text-shadow: none !important;
}

/* ==========================================================================
   Per-Message Profile Photos & Live Typing Reply Indicator
   ========================================================================== */
.messenger-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.messenger-bubble-avatar,
.messenger-bubble-avatar-fallback {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.messenger-bubble-avatar-fallback {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messenger-typing-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-style: italic;
  color: var(--text-muted, #475569);
  background: rgba(37, 99, 235, 0.05);
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.msp-ql-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ==========================================================================
   My Space — Editable My Profile Inputs & Save Bar
   ========================================================================== */
.msp-profile-form {
  display: flex;
  flex-direction: column;
}

.msp-profile-input {
  width: 100%;
  margin-top: 3px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: var(--card-bg, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.msp-profile-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.msp-profile-item-locked {
  background: rgba(148, 163, 184, 0.08);
}

.msp-profile-input-readonly {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted, #64748b);
  cursor: not-allowed;
  border-style: dashed;
}

.msp-profile-input-readonly:focus {
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: none;
}

.msp-locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(100, 116, 139, 0.16);
  color: var(--text-muted, #475569);
  text-transform: none;
  letter-spacing: 0;
}

.msp-profile-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 24px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.msp-profile-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 24px 10px;
}

.msp-profile-display-val {
  display: block;
  margin-top: 3px;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  word-break: break-word;
}

/* ==========================================================================
   Directory Clickable Rows & Wide View Modal (Full Bottom Visibility)
   ========================================================================== */
.partner-clickable-row {
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.partner-clickable-row:hover {
  background: rgba(37, 99, 235, 0.06);
}

.modal-dialog.partner-wide-view-modal {
  max-width: 880px;
  width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-dialog.partner-wide-view-modal .modal-header,
.modal-dialog.partner-wide-view-modal .modal-footer {
  flex-shrink: 0;
}

.modal-body.partner-wide-view-body {
  overflow-y: auto;
  max-height: calc(88vh - 140px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.partner-view-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.partner-view-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .partner-view-details-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Directory Wide & Scrollable Edit Modal
   ========================================================================== */
.modal-backdrop.partner-edit-modal-backdrop {
  overflow-y: auto;
  align-items: center;
  padding: 16px;
}

.modal-dialog.partner-wide-edit-modal {
  max-width: 920px;
  width: min(95vw, 920px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  margin: auto;
}

.modal-dialog.partner-wide-edit-modal .modal-header {
  flex-shrink: 0;
}

.partner-wide-edit-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-body.partner-wide-edit-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 22px;
}

.partner-wide-edit-form .modal-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.partner-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

@media (max-width: 700px) {
  .partner-edit-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Walk-in Clients Monitoring Form & Roster Dropdown Picker
   ========================================================================== */
.walkin-monitoring-form.walkin-enhanced-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(300px, 1.65fr) minmax(210px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.walkin-picker-stack {
  display: flex;
  flex-direction: column;
}

.walkin-field-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  margin-bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.walkin-search-wrap {
  position: relative;
}

.walkin-search-input,
.walkin-person-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--card-bg, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.9rem;
}

.walkin-purpose-textarea {
  width: 100%;
  min-height: 92px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  background: var(--card-bg, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
  flex: 1 1 auto;
}

.walkin-purpose-textarea:focus,
.walkin-search-input:focus,
.walkin-person-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.walkin-suggestions-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 45;
  background: var(--card-bg, #ffffff);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.walkin-suggestion-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-main, #0f172a);
}

.walkin-suggestion-item:last-child {
  border-bottom: none;
}

.walkin-suggestion-item:hover {
  background: rgba(37, 99, 235, 0.08);
}

.walkin-suggestion-name {
  font-size: 0.88rem;
  font-weight: 700;
}

.walkin-suggestion-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.walkin-suggestion-empty {
  padding: 9px 12px;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.walkin-submit-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 960px) {
  .walkin-monitoring-form.walkin-enhanced-form {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Universal Mobile & Responsive Layout Overrides (Tables, Modals & GUI)
   ========================================================================== */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.app-shell,
.app-main-column,
.tab-content,
.tab-content > div,
.card {
  max-width: 100%;
  min-width: 0;
}

/* Mobile-friendly scrollable tables */
.table-wrap,
.data-table-wrap,
.grantee-list-table-wrap,
.partner-directory-table-wrap,
.cf-table-overlay-wrap,
.roster-optimized-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table,
.data-table {
  min-width: 640px;
}

.grantee-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.grantee-pagination-info,
.grantee-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Mobile-friendly modals & popups */
.modal-backdrop {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
}

.modal-dialog {
  width: min(96vw, 720px);
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  margin: auto;
}

.modal-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-header,
.modal-footer {
  flex-shrink: 0;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.swal2-popup {
  max-width: min(94vw, 540px) !important;
  font-size: 0.92rem !important;
}

@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px !important;
  }

  .system-brand-title {
    font-size: 0.92rem !important;
    line-height: 1.25;
  }

  .card {
    padding: 14px 12px !important;
    border-radius: 10px;
  }

  .section-title {
    font-size: 1.05rem !important;
  }

  .create-form,
  .partner-create-form,
  .walkin-monitoring-form,
  .walkin-monitoring-form.walkin-enhanced-form,
  .form-row-2,
  .form-row-3,
  .form-row-4,
  .msp-profile-grid,
  .partner-view-details-grid,
  .partner-edit-grid {
    grid-template-columns: 1fr !important;
  }

  .task-filters,
  .partner-filter-bar,
  .btr-filter-toolbar,
  .list-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  .task-filters > *,
  .partner-filter-bar > *,
  .btr-filter-toolbar > * {
    width: 100%;
    min-width: 0 !important;
  }

  .table-wrap th,
  .table-wrap td,
  .data-table th,
  .data-table td {
    padding: 8px 9px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal-dialog,
  .modal-dialog.partner-wide-view-modal,
  .modal-dialog.partner-wide-edit-modal {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-header h2 {
    font-size: 1rem;
  }

  .modal-body,
  .modal-body.partner-wide-view-body,
  .modal-body.partner-wide-edit-body {
    padding: 14px;
    max-height: calc(92vh - 124px);
  }

  .modal-footer {
    flex-wrap: wrap;
    justify-content: stretch;
    padding: 10px 14px;
  }

  .modal-footer > button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .messenger-dock-root {
    right: 10px !important;
    bottom: 10px !important;
  }

  .messenger-popup-window {
    width: min(94vw, 360px) !important;
    max-height: 76vh !important;
  }
}

@media (max-width: 480px) {
  .btn-add,
  .btn-secondary,
  .btn-edit,
  .btn-delete {
    min-height: 36px;
    font-size: 0.82rem;
  }

  .grantee-pagination-bar {
    justify-content: center;
    text-align: center;
  }

  .grantee-pagination-controls {
    justify-content: center;
  }
}

/* ==========================================================================
   Smooth Logout Transition & SweetAlert Feedback
   ========================================================================== */
.swa-logout-fade-out {
  opacity: 0.15;
  transform: translateY(6px) scale(0.992);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
