/* SWeRP Premium Stylesheet */

/* Design Tokens & Theme Variables */
:root {
  --primary: #009B9E;
  --primary-dark: #007E80;
  --primary-light: #E3F6F6;
  --accent: #E0A96D;
  --bg-app: #F5F9F9;
  --bg-card: #FFFFFF;
  --text-dark: #1F3637;
  --text-light: #617D7F;
  --border: #D2E4E6;
  --success: #2EC4B6;
  --danger: #FF5A5F;
  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 2px 4px rgba(31, 54, 55, 0.04);
  --shadow-md: 0 8px 16px rgba(31, 54, 55, 0.08);
  --shadow-lg: 0 16px 32px rgba(31, 54, 55, 0.12);
  --font-family: 'Outfit', sans-serif;
  --font-sans: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables Override */
[data-theme="dark"] {
  --bg-app: #0A1314;
  --bg-card: #122122;
  --text-dark: #E6F1F2;
  --text-light: #90A9AB;
  --border: #213C3E;
  --primary-light: #153233;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.5);
  --bg-app-hover: #192D2E;
}


/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  font-weight: 600;
  color: var(--text-dark);
}

button {
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  transition: var(--transition);
}

input, select, textarea {
  font-family: var(--font-sans);
  color: var(--text-dark);
  outline: none;
}

/* Header Styles */
.app-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-logo {
  height: 60px;
  width: auto;
  display: flex;
  align-items: center;
}

.header-title-wrapper {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary-dark);
}

.header-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 1px;
}

.header-nav {
  display: flex;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.nav-button {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-button svg {
  width: 16px;
  height: 16px;
}

.nav-button.active {
  background-color: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.nav-button:hover:not(.active) {
  color: var(--primary);
  background-color: rgba(0, 155, 158, 0.05);
}

/* Main Content Layout */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 40px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
  display: block;
}

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

/* Guest Portal Hero */
.portal-hero {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 40px;
}

.portal-hero h2 {
  font-size: 28px;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.portal-hero p {
  color: var(--text-light);
  font-size: 16px;
}

/* Grid of Selection Cards */
.grid-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.module-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--primary);
  opacity: 0;
  transition: var(--transition);
}

.module-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 155, 158, 0.3);
}

.module-card:hover::before {
  opacity: 1;
}

.module-icon-box {
  width: 50px;
  height: 50px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.module-icon-box svg {
  width: 24px;
  height: 24px;
}

.module-badge {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.module-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.module-card p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
  flex: 1;
}

.module-link {
  font-family: var(--font-family);
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  transition: var(--transition);
}

.module-card:hover .module-link {
  color: var(--primary-dark);
  gap: 10px;
}

.module-link svg {
  width: 14px;
  height: 14px;
}

/* Back Button styling */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 20px;
}

.btn-back svg {
  width: 16px;
  height: 16px;
}

.btn-back:hover {
  color: var(--primary-dark);
}

/* Consent Form Container Layout */
#active-form-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.form-container-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}



.form-title-area {
  margin-bottom: 30px;
}

.form-title-area h2 {
  font-size: 24px;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.doc-code-tag {
  background-color: var(--text-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Fields Grid & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

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

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.form-group input, 
.form-group select {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  background-color: var(--bg-app);
  transition: var(--transition);
  height: 44px;
}

.form-group input:focus, 
.form-group select:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 155, 158, 0.15);
}

/* Terms and Conditions Scrollbox */
.terms-scroll-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 25px;
  height: 250px;
  overflow-y: auto;
  font-size: 13.5px;
  color: var(--text-light);
  margin-bottom: 35px;
  background-color: var(--bg-app);
}

.terms-scroll-box h3 {
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 12px;
  margin-top: 18px;
}

.terms-scroll-box h3:first-of-type {
  margin-top: 0;
}

.terms-scroll-box h4 {
  font-size: 14px;
  color: var(--text-dark);
  margin-bottom: 8px;
  margin-top: 14px;
}

.terms-scroll-box p {
  margin-bottom: 12px;
}

.terms-scroll-box ul,
.terms-scroll-box ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.terms-scroll-box li {
  margin-bottom: 6px;
}

.terms-scroll-box hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 15px 0;
}

/* Custom Scrollbar for scroll box */
.terms-scroll-box::-webkit-scrollbar {
  width: 6px;
}
.terms-scroll-box::-webkit-scrollbar-track {
  background: var(--bg-app);
  border-radius: var(--radius-md);
}
.terms-scroll-box::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-md);
}
.terms-scroll-box::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Checkbox Style */
.checkbox-group-wrapper {
  margin: 20px 0;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  user-select: none;
  color: var(--text-dark);
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.custom-checkbox:hover input ~ .checkmark {
  border-color: var(--primary);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.custom-checkbox .checkmark:after {
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.fieldset-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 30px;
}

.fieldset-wrapper h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.fieldset-wrapper p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 15px;
}

/* Signature Pad Layout & Canvas */
.signature-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 35px;
}

.signature-section label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
  display: block;
}

.signature-wrapper {
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  height: 180px;
  background-color: #FAFCFC;
  position: relative;
}

.signature-wrapper.height-sm {
  height: 120px;
}

.signature-pad {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Multi-signature layout (for NormaTec) */
.signature-section-complex {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 35px;
}

.signature-section-complex h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.signature-section-complex p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.sig-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sig-block label {
  font-size: 13px;
  font-weight: 600;
}

/* Button styles */
.btn-primary {
  background-color: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 155, 158, 0.15);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 155, 158, 0.25);
}

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

.btn-secondary {
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text-light);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-submit {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Staff Dashboard Elements */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card h4 {
  font-size: 13px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-family: var(--font-family);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}

.stat-value.highlight {
  color: var(--primary);
}

.stat-card p {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 5px;
}

/* Module stats flex container */
.module-stats-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.module-stat-pill {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  box-shadow: var(--shadow-sm);
}

.module-pill-code {
  font-weight: 700;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.module-pill-counts {
  font-weight: 600;
}

/* Dashboard Filters Controls */
.dashboard-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-light);
}

#dashboard-search-input {
  width: 100%;
  height: 44px;
  padding: 10px 14px 10px 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

#dashboard-search-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.filter-wrapper select {
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
}

.filter-wrapper select:focus {
  border-color: var(--primary);
}

/* Dashboard Registrations Table */
.table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.dashboard-table th {
  background-color: var(--bg-app);
  padding: 15px 20px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
}

.dashboard-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
}

.dashboard-table tbody tr {
  transition: var(--transition);
}

.dashboard-table tbody tr:hover {
  background-color: #FAFCFC;
}

.doc-id-link {
  font-family: var(--font-family);
  font-weight: 600;
  color: var(--primary);
}

.badge-code {
  background-color: #ECEFF1;
  color: #37474F;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Badge specific colors to differentiate */
.badge-code[data-code="GYM-U14-WR"] { background-color: #ECE8F7; color: #5B2C6F; }
.badge-code[data-code="SFRRE"] { background-color: #E8F5E9; color: #1B5E20; }
.badge-code[data-code="WBC-CF"] { background-color: #E3F2FD; color: #0D47A1; }
.badge-code[data-code="NLC-CF"] { background-color: #FFF3E0; color: #E65100; }
.badge-code[data-code="ONS-RD"] { background-color: #E0F7FA; color: #006064; }
.badge-code[data-code="WTCA"] { background-color: #F3E5F5; color: #4A148C; }

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background-color: #fff;
  color: var(--text-light);
  transition: var(--transition);
}

.btn-action:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-action.btn-delete:hover {
  color: var(--danger);
  border-color: var(--danger);
  background-color: rgba(255, 90, 95, 0.05);
}

.btn-action svg {
  width: 14px;
  height: 14px;
}

/* Loader spinning animation */
.spin {
  animation: rotation 1.5s infinite linear;
}
@keyframes rotation {
  from { transform: rotate(0deg); }
  to { transform: rotate(356deg); }
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(31, 54, 55, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: var(--transition);
}

.modal-container {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 850px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-close {
  color: var(--text-light);
  font-size: 20px;
}

.btn-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

/* Document Viewer layouts inside Modal */
.modal-viewer-doc {
  background-color: #fff;
}

.viewer-logo-row {
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.viewer-logo-row img {
  height: 60px;
}

.viewer-title-row {
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.viewer-title-row h2 {
  font-size: 20px;
}

.viewer-doc-tag {
  background-color: var(--primary-dark);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.viewer-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px 30px;
  margin-bottom: 30px;
  background-color: var(--bg-app);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-item span.label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.info-item span.val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  word-break: break-word;
}

.viewer-terms-wrapper {
  margin-bottom: 30px;
  font-size: 13px;
  color: var(--text-light);
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  padding: 15px;
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
}

.viewer-terms-wrapper h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.viewer-terms-wrapper p,
.viewer-terms-wrapper ul {
  margin-bottom: 8px;
}

.viewer-sig-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  margin-top: 30px;
  border-top: 1px solid var(--border);
  padding-top: 25px;
}

.viewer-sig-block {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  background-color: #FAFCFC;
}

.viewer-sig-block label {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 10px;
  color: var(--text-light);
  text-transform: uppercase;
}

.viewer-sig-image {
  max-height: 100px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.viewer-sig-date {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--text-dark);
  color: #fff;
  padding: 15px 25px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transition: var(--transition);
}

.toast-icon {
  color: var(--success);
  width: 20px;
  height: 20px;
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Responsive Styles for iPad & Mobile */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .header-logo-container {
    justify-content: center;
  }
  
  .header-nav {
    justify-content: center;
  }
  
  .main-content {
    padding: 20px;
  }
  
  .grid-modules {
    grid-template-columns: 1fr;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
  
  .signature-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-controls {
    flex-direction: column;
  }
  
  .viewer-info-grid {
    grid-template-columns: 1fr;
  }
  
  .viewer-sig-grid {
    grid-template-columns: 1fr;
  }
}

/* Settings and Database Management Card styles */
.settings-card-wrapper {
  margin-top: 40px;
  margin-bottom: 20px;
}

.settings-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
}

.settings-card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.settings-card-header h3 {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
}

.settings-card-header h3 svg {
  color: var(--primary);
  width: 22px;
  height: 22px;
}

.settings-card-header p {
  font-size: 13.5px;
  color: var(--text-light);
  margin-top: 4px;
}

.settings-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.settings-action-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.settings-action-block h4 {
  font-size: 16px;
  color: var(--text-dark);
  font-weight: 600;
}

.settings-action-block p {
  font-size: 13px;
  color: var(--text-light);
  flex: 1;
}

.file-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.upload-file-name {
  font-size: 12px;
  color: var(--text-light);
  word-break: break-all;
}

.danger-block {
  border-left: 1px solid var(--border);
  padding-left: 30px;
}

.btn-danger {
  background-color: var(--danger);
  box-shadow: 0 4px 6px rgba(255, 90, 95, 0.15);
}

.btn-danger:hover {
  background-color: #E04D51;
  box-shadow: 0 6px 12px rgba(255, 90, 95, 0.25);
}

/* Header theme toggle button style */
.theme-toggle-button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-button:hover {
  color: var(--primary);
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.theme-toggle-button svg {
  width: 20px;
  height: 20px;
}

/* Theme-adaptive SVG Logo rules */
.logo-svg {
  display: block;
  margin: 0 auto;
}

.header-logo svg {
  height: 50px;
  width: auto;
  display: inline-block;
}

.form-logo-header svg,
.form-logo-header img {
  height: 95px;
  width: auto;
  display: block;
}

.viewer-logo-address-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.viewer-logo-col {
  width: 95px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.viewer-logo-col svg,
.viewer-logo-col img {
  height: 90px;
  width: auto;
  display: block;
}

.viewer-address-col {
  flex: 1;
  text-align: left;
}

.viewer-address-col h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.viewer-address-col p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
  margin: 0;
}


.logo-svg .cls-1 {
  fill: #000000 !important;
  transition: var(--transition);
}

.logo-svg .cls-2 {
  fill: #000000 !important;
  transition: var(--transition);
}

.logo-svg .cls-3 {
  fill: #000000 !important;
  transition: var(--transition);
}

.logo-svg .cls-4 {
  stroke: #000000 !important;
  transition: var(--transition);
}


/* Dark theme overrides logo to white */
[data-theme="dark"] .logo-svg .cls-1 {
  fill: #FFFFFF !important;
}

[data-theme="dark"] .logo-svg .cls-2 {
  fill: #FFFFFF !important;
}

[data-theme="dark"] .logo-svg .cls-3 {
  fill: #FFFFFF !important;
}

[data-theme="dark"] .logo-svg .cls-4 {
  stroke: #FFFFFF !important;
}

/* Dashboard Layout & Responsive Sidebar */
.dashboard-layout {
  width: 100%;
}

.dashboard-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 25px;
  min-width: 0;
}

.dashboard-sidebar {
  background-color: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 25px;
  transition: var(--transition);
}

.sidebar-block {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.sidebar-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-block h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.sidebar-help-text {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 15px;
  line-height: 1.4;
}

.sidebar-setting-action {
  margin-bottom: 16px;
}

.sidebar-setting-action:last-child {
  margin-bottom: 0;
}

.sidebar-setting-action h5 {
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 6px;
  font-weight: 600;
}

.btn-sidebar-action {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.danger-zone {
  border-top: 1px dashed var(--border);
  padding-top: 15px;
  margin-top: 15px;
}

.theme-toggle-button.btn-sidebar-action {
  background-color: var(--bg-app);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text-dark);
  height: 40px;
  border-radius: var(--radius-md);
}

.theme-toggle-button.btn-sidebar-action:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Live Clock Display in Sidebar */
.sidebar-footer-clock {
  margin-top: auto; /* Pushes the clock to the absolute bottom of the sidebar */
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-family: 'Outfit', 'Courier New', Courier, monospace;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

/* Live Clock Display in Header */
.header-clock-container {
  font-family: 'Outfit', 'Courier New', Courier, monospace;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

/* Module Distribution Card styles */
.distribution-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.distribution-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
}

.distribution-card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.distribution-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.distribution-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.distribution-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}

.distribution-label {
  color: var(--text-dark);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.distribution-code {
  font-size: 10px;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
}

.distribution-value {
  color: var(--text-light);
  font-size: 12px;
}

.distribution-value strong {
  color: var(--text-dark);
  font-weight: 700;
}

.distribution-bar-bg {
  height: 8px;
  background-color: var(--bg-app);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.distribution-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #10b981 100%); /* Premium Teal to Emerald Gradient */
  border-radius: 4px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Document Detail/Print Footer styling */
.viewer-footer-row {
  margin-top: 35px;
  padding-top: 15px;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-family: 'Outfit', 'Courier New', Courier, monospace;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

/* Media Query: Desktop View (Flush Left Sidebar & Main Content Shift) */




@media (min-width: 1025px) {
  body.dashboard-active .main-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 340px !important; /* Shuffled to right to clear sidebar */
    padding-right: 40px !important;
    transition: var(--transition);
  }

  body.dashboard-active .app-header {
    padding-left: 40px !important; /* Header remains full width or we can shift it if needed */
  }

  .dashboard-sidebar {
    position: fixed;
    left: 0;
    top: 81px; /* Align directly under the sticky header (height 80px + border) */
    bottom: 0;
    width: 300px;
    height: calc(100vh - 81px);
    border-right: 1px solid var(--border);
    border-left: none;
    border-top: none;
    border-bottom: none;
    border-radius: 0 !important; /* Touch viewport edges flush */
    padding: 30px 25px;
    z-index: 99;
    overflow-y: auto;
  }
}

/* Media Query: Tablet & Mobile View (Fallback to Normal Flow Stack) */
@media (max-width: 1024px) {
  .dashboard-sidebar {
    width: 100%;
    position: static;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    height: auto;
  }
}



/* Print Specific Styles */
@media print {

  body {
    background-color: #fff !important;
    color: #000 !important;
    font-size: 12pt;
  }
  
  /* Hide all interactive components */
  .app-header, 
  .main-content, 
  .modal-overlay,
  .toast,
  button,
  .btn-back,
  .signature-actions {
    display: none !important;
  }
  
  /* Show only the print-container */
  #print-container {
    display: block !important;
    padding: 40px;
    width: 100%;
  }

  .viewer-info-grid {
    background-color: #fff !important;
    border: 1px solid #000 !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 15px !important;
  }

  .viewer-terms-wrapper {
    background-color: #fff !important;
    border: 1px solid #000 !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  .viewer-sig-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    border-top: 1px solid #000 !important;
    margin-top: 30px !important;
  }

  .viewer-sig-block {
    background-color: #fff !important;
    border: 1px solid #000 !important;
  }

  .viewer-sig-image {
    max-height: 80px !important;
  }
}

/* Header theme toggle switcher */
.header-theme-toggle {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-light);
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.header-theme-toggle:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.header-theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Login screen styling */
.login-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}

.login-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.4s ease-out;
}

.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-top: 20px;
  margin-bottom: 8px;
}

.login-card p {
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 25px;
  line-height: 1.45;
}

.login-logo-placeholder {
  display: flex;
  justify-content: center;
}

.login-logo-placeholder svg,
.login-logo-placeholder img {
  height: 80px;
  width: auto;
  margin-bottom: 10px;
}



/* ==========================================================================
   32-MODULE DEPARTMENT TABS & CUSTOMER DATABASE STYLES
   ========================================================================== */

.portal-filter-bar {
  max-width: 1200px;
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dept-tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.dept-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.dept-tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.dept-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.dept-tab-btn svg {
  width: 15px;
  height: 15px;
}

.portal-module-search {
  position: relative;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.portal-module-search input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dark);
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
}

.portal-module-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-light);
}

.module-dept-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary-dark);
  margin-left: 6px;
}

/* Quick Customer Lookup & Auto-Fill Bar inside Active Forms */
.customer-autofill-bar {
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.autofill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.autofill-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dark);
}

.autofill-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.autofill-search-box {
  position: relative;
}

.autofill-search-box input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dark);
  font-size: 13.5px;
}

.btn-clear-lookup {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
}

.customer-lookup-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 500;
}

.customer-lookup-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease;
}

.customer-lookup-item:last-child {
  border-bottom: none;
}

.customer-lookup-item:hover {
  background: var(--primary-light);
}

.customer-lookup-main {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
}

.customer-lookup-sub {
  font-size: 12px;
  color: var(--text-light);
}

.customer-lookup-badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Customer Database Section */
.customer-db-wrapper {
  max-width: 1250px;
  margin: 0 auto;
}

.customer-db-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.customer-db-header h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.customer-db-header p {
  font-size: 13.5px;
  color: var(--text-light);
}

.checkbox-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-app);
}

.checkbox-group-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0;
}


/* ==========================================================================
   1:1 ORIGINAL DOCUMENT / PAPER REPLICA LAYOUT STYLES (ALL 32 MODULES)
   ========================================================================== */

.paper-doc-sheet {
  background: var(--bg-card);
  border: 1.5px solid #334155;
  border-radius: 6px;
  padding: 28px 30px;
  margin-bottom: 24px;
  color: var(--text-dark);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.doc-sheet-title-center {
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1E293B;
}

.doc-sheet-title-center h2 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dark);
  margin: 0 0 4px;
}

.doc-sheet-title-center h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
}

.doc-form-code-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: monospace;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
}

/* Standard Bordered Document Table (Word / PDF 1:1 Table) */
.doc-bordered-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 13px;
}

.doc-bordered-table th,
.doc-bordered-table td {
  border: 1px solid #334155;
  padding: 7px 10px;
  vertical-align: top;
}

.doc-bordered-table th {
  background: #F1F5F9;
  color: #0F172A;
  font-weight: 700;
}

.cell-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  margin-bottom: 3px;
}

[data-theme="dark"] .cell-lbl {
  color: #94A3B8;
}

.doc-cell-input {
  width: 100%;
  border: none !important;
  border-bottom: 1px dashed #CBD5E1 !important;
  border-radius: 0 !important;
  padding: 4px 2px !important;
  font-size: 13.5px !important;
  font-weight: 500;
  background: transparent !important;
  color: var(--text-dark) !important;
  box-shadow: none !important;
}

.doc-cell-input:focus {
  outline: none !important;
  border-bottom: 1.5px solid var(--primary) !important;
  background: rgba(13, 148, 136, 0.04) !important;
}

.doc-inline-input {
  display: inline-block;
  border: none !important;
  border-bottom: 1.5px solid #475569 !important;
  border-radius: 0 !important;
  padding: 2px 6px !important;
  font-size: 13.5px !important;
  font-weight: 600;
  background: rgba(241, 245, 249, 0.5) !important;
  color: var(--text-dark) !important;
  vertical-align: baseline;
}

.doc-line-input {
  width: 100%;
  border: none !important;
  border-bottom: 1px solid #64748B !important;
  border-radius: 0 !important;
  padding: 4px 4px !important;
  font-size: 13.5px !important;
  background: transparent !important;
  color: var(--text-dark) !important;
}

.doc-bordered-textarea {
  width: 100%;
  border: 1px solid #334155 !important;
  border-radius: 4px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  background: var(--bg-card) !important;
  color: var(--text-dark) !important;
}

/* Document Prose (Paragraphs, Lists, Headings) */
.doc-prose {
  font-size: 13.2px;
  line-height: 1.65;
  color: var(--text-dark);
  text-align: justify;
}

.doc-prose p {
  margin: 0 0 10px;
}

.doc-prose h4 {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dark);
  margin: 16px 0 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.doc-prose ol,
.doc-prose ul {
  margin: 6px 0 12px 22px;
  padding: 0;
}

.doc-prose li {
  margin-bottom: 5px;
}

/* 1. FO-REG Registration Card Specifics */
.reg-card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid #0F172A;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.reg-card-header-bar h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
}

.reg-card-rules-box {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid #334155;
  background: rgba(248, 250, 252, 0.6);
  font-size: 11.8px;
  line-height: 1.5;
}

[data-theme="dark"] .reg-card-rules-box {
  background: rgba(30, 41, 59, 0.5);
}

.reg-card-rules-box ol {
  margin: 0 0 0 18px;
  padding: 0;
  columns: 2;
  column-gap: 24px;
}

.reg-card-rules-box li {
  margin-bottom: 4px;
  break-inside: avoid;
}

@media (max-width: 768px) {
  .reg-card-rules-box ol {
    columns: 1;
  }
}

/* 2. FO-SSP Stay Smart Policy */
.smart-policy-section {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-left: 4px solid var(--primary);
  background: rgba(241, 245, 249, 0.55);
  border-radius: 0 6px 6px 0;
}

[data-theme="dark"] .smart-policy-section {
  background: rgba(30, 41, 59, 0.5);
}

.smart-policy-section h4 {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin: 0 0 8px;
}

.smart-policy-section ul {
  margin: 0 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
}

.smart-policy-eviction-box {
  margin-top: 16px;
  padding: 12px 16px;
  border: 2px solid #B91C1C;
  background: #FEF2F2;
  color: #7F1D1D;
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.55;
  border-radius: 6px;
}

/* 3. LeSpa Olive-Green & Cream Theme (SPA-FCF & SPA-GCF) */
.lespa-paper-sheet {
  border-color: #4E654E;
}

.lespa-olive-banner {
  background: #4E654E;
  color: #FFFFFF;
  text-align: center;
  padding: 12px 18px;
  border-radius: 4px;
  margin-bottom: 18px;
}

.lespa-olive-banner h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
  color: #FFFFFF;
}

.lespa-olive-banner p {
  font-size: 12px;
  margin: 4px 0 0;
  opacity: 0.92;
}

.lespa-fcf-two-col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 820px) {
  .lespa-fcf-two-col {
    grid-template-columns: 1fr;
  }
}

.lespa-line-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.lespa-line-field label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  margin: 0;
  color: var(--text-dark);
}

.lespa-cream-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin-bottom: 16px;
}

.lespa-cream-box {
  background: #FDF6EE;
  border: 1px solid #DFD3C3;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-theme="dark"] .lespa-cream-box {
  background: #1E293B;
  border-color: #475569;
}

.lespa-cream-box label {
  font-size: 12.5px;
  font-weight: 700;
  color: #4E654E;
  white-space: nowrap;
  margin: 0;
}

.lespa-cream-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px 12px;
}

.lespa-cream-check {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FDF6EE;
  border: 1px solid #E2D5C5;
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #1E293B;
  cursor: pointer;
  margin: 0;
}

[data-theme="dark"] .lespa-cream-check {
  background: #1E293B;
  border-color: #475569;
  color: #E2E8F0;
}

/* SPA-FCF Page 2 Phytomer 6-Column 11-Step Table */
.phytomer-step-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-top: 10px;
}

.phytomer-step-table th,
.phytomer-step-table td {
  border: 1px solid #4E654E;
  padding: 6px 7px;
  vertical-align: top;
}

.phytomer-step-table thead th {
  background: #4E654E;
  color: #FFFFFF;
  text-align: center;
  font-weight: 700;
  font-size: 11.5px;
}

.phytomer-step-table tbody tr:nth-child(even) {
  background: rgba(253, 246, 238, 0.55);
}

[data-theme="dark"] .phytomer-step-table tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.45);
}

.phytomer-step-label {
  font-weight: 700;
  color: #3A4D3A;
  background: #EFF3EE;
}

[data-theme="dark"] .phytomer-step-label {
  color: #A7F3D0;
  background: #1E293B;
}

/* SPA-GCF Interactive Front/Back Body Silhouette */
.gcf-bottom-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin-top: 18px;
  align-items: start;
}

@media (max-width: 820px) {
  .gcf-bottom-split {
    grid-template-columns: 1fr;
  }
}

.body-diagram-card {
  background: #FDF6EE;
  border: 1px solid #D8CBB8;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

[data-theme="dark"] .body-diagram-card {
  background: #1E293B;
  border-color: #475569;
}

.body-diagram-toolbar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.body-tool-btn {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid #4E654E;
  background: #FFFFFF;
  color: #4E654E;
  cursor: pointer;
  transition: all 0.15s ease;
}

.body-tool-btn.active {
  background: #4E654E;
  color: #FFFFFF;
}

.body-tool-btn.btn-clear {
  border-color: #B91C1C;
  color: #B91C1C;
}

.body-diagram-stage {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  cursor: crosshair;
  user-select: none;
}

.body-diagram-svg {
  width: 100%;
  height: auto;
  display: block;
}

#gcf-body-markers-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.body-mark-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.body-mark-pin.mark-o {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  border: 1.5px solid #065F46;
}

.body-mark-pin.mark-x {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: 1.5px solid #991B1B;
}

/* 4. Stay Well Clinic Specifics (Photo Consent, Disclaimer, Interpreter, Nutrition) */
.clinic-photo-consent-box {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid #334155;
  background: rgba(248, 250, 252, 0.7);
  border-radius: 4px;
}

[data-theme="dark"] .clinic-photo-consent-box {
  background: rgba(30, 41, 59, 0.5);
}

.clinic-photo-consent-box h4 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.clinic-disclaimer-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 3.5px solid #475569;
  background: rgba(241, 245, 249, 0.6);
  font-size: 12px;
  font-style: italic;
  line-height: 1.5;
}

[data-theme="dark"] .clinic-disclaimer-box {
  background: rgba(30, 41, 59, 0.5);
}

.doc-interpreter-box {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px dashed #475569;
  background: rgba(248, 250, 252, 0.6);
  border-radius: 6px;
}

.doc-interpreter-box h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px;
}

.nut-section-block {
  margin-bottom: 14px;
}

.nut-sec-banner {
  background: #1E293B;
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 12px;
}

/* 5. Wellness Report (WLN-WAR, WLN-WCN, WTCA) */
.wln-report-header {
  background: linear-gradient(135deg, #134E4A 0%, #0F766E 100%);
  color: #FFFFFF;
  padding: 18px 22px;
  border-radius: 6px;
  text-align: center;
  margin-bottom: 14px;
}

.wln-report-brand {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.88;
  margin-bottom: 4px;
}

.wln-report-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin: 0 0 4px;
  color: #FFFFFF;
}

.wln-report-header p {
  font-size: 12.5px;
  margin: 0;
  opacity: 0.92;
}

.wln-sec-heading {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0F766E;
  border-bottom: 2px solid #0F766E;
  padding-bottom: 4px;
  margin: 16px 0 10px;
}

.wln-sub-title {
  font-size: 13px;
  font-weight: 700;
  color: #134E4A;
  background: #F0FDFA;
  border-left: 4px solid #0D9488;
  padding: 5px 10px;
  margin: 12px 0 6px;
}

[data-theme="dark"] .wln-sub-title {
  background: #1E293B;
  color: #5EEAD4;
}

.wln-status-select {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-dark);
}

.wln-device-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 720px) {
  .wln-device-grid {
    grid-template-columns: 1fr;
  }
}

.wln-device-card {
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 12px 14px;
  background: rgba(240, 253, 250, 0.45);
}

[data-theme="dark"] .wln-device-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: #475569;
}

.wln-device-num {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  background: #0F766E;
  color: #FFFFFF;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.wln-device-card h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-dark);
}

.wln-device-card p {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  color: var(--text-light);
}

/* Hydrated Print / View Modal Values */
.print-filled-value {
  display: inline-block;
  font-weight: 700;
  color: #0F172A;
  border-bottom: 1px dotted #64748B;
  padding: 1px 4px;
  min-width: 40px;
}

[data-theme="dark"] .print-filled-value {
  color: #F8FAFC;
}

.print-filled-textarea {
  font-weight: 600;
  color: #0F172A;
  white-space: pre-wrap;
  padding: 4px 6px;
  min-height: 28px;
}

[data-theme="dark"] .print-filled-textarea {
  color: #F8FAFC;
}

.print-check-box {
  display: inline-block;
  font-size: 14px;
  margin-right: 4px;
  color: #64748B;
}

.print-check-box.checked {
  color: #0F766E;
  font-weight: 800;
}

@media print {
  .paper-doc-sheet {
    border: 1px solid #000 !important;
    padding: 16px !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
  }

  .print-filled-value,
  .print-filled-textarea {
    color: #000 !important;
  }

  .lespa-olive-banner,
  .nut-sec-banner,
  .wln-report-header,
  .phytomer-step-table thead th {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


/* ==========================================================================
   HEADER LOGIN/LOGOUT CONTROLS & STEP 1 GUEST TYPE SELECTOR (IN-HOUSE / WALK-IN)
   ========================================================================== */

.header-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(13, 148, 136, 0.3);
  font-size: 12.5px;
  font-weight: 700;
}

.header-user-pill svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

.btn-header-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--danger);
  background: transparent;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-header-logout:hover {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-header-logout svg {
  width: 15px;
  height: 15px;
}

/* Step 1: Guest Type Selection Screen */
.guest-type-selector-view {
  max-width: 1020px;
  margin: 10px auto 40px;
  animation: fadeIn 0.35s ease-out;
}

.welcome-step-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.guest-type-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  margin-top: 24px;
}

@media (max-width: 820px) {
  .guest-type-cards-grid {
    grid-template-columns: 1fr;
  }
}

.guest-type-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.guest-type-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.guest-type-card.walkin-card:hover {
  border-color: #0284C7;
}

.guest-type-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.guest-type-icon-wrap svg {
  width: 32px;
  height: 32px;
}

.guest-type-icon-wrap.walkin-icon {
  background: rgba(2, 132, 199, 0.12);
  color: #0284C7;
}

.guest-type-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.guest-type-badge.walkin-badge {
  background: rgba(2, 132, 199, 0.12);
  color: #0369A1;
}

.guest-type-card h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 4px;
}

.guest-type-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 12px;
}

.guest-type-card.walkin-card h4 {
  color: #0284C7;
}

.guest-type-card p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-light);
  margin: 0 0 18px;
}

.guest-type-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guest-type-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dark);
}

.guest-type-features li svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.guest-type-card.walkin-card .guest-type-features li svg {
  color: #0284C7;
}

.guest-type-cta {
  margin-top: auto;
  width: 100%;
  justify-content: center;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 700;
}

.guest-type-cta.walkin-cta {
  background: #0284C7;
}

.guest-type-cta.walkin-cta:hover {
  background: #0369A1;
}

/* Step 2: Active Guest Type Top Banner */
.active-guest-type-banner {
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.guest-type-status-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.guest-type-pill-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.guest-type-pill-indicator.walkin {
  background: rgba(2, 132, 199, 0.14);
  color: #0369A1;
}

.guest-type-pill-indicator svg {
  width: 16px;
  height: 16px;
}

.guest-type-subtext {
  font-size: 12.5px;
  color: var(--text-light);
}


/* ==========================================================================
   MASTER CUSTOMER DATABASE FILTER TABS & GUEST TYPE BADGES
   ========================================================================== */

.customer-filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.customer-type-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cust-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.cust-type-tab svg {
  width: 15px;
  height: 15px;
}

.cust-type-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cust-type-tab.walkin-tab:hover {
  border-color: #0284C7;
  color: #0284C7;
}

.cust-type-tab.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.cust-type-tab.walkin-tab.active {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0284C7;
}

.cust-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.cust-type-tab.active .cust-count-pill {
  background: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}

.cust-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.cust-type-badge svg {
  width: 13px;
  height: 13px;
}

.cust-type-badge.inhouse {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(13, 148, 136, 0.3);
}

.cust-type-badge.walkin {
  background: rgba(2, 132, 199, 0.12);
  color: #0369A1;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

[data-theme="dark"] .cust-type-badge.walkin {
  background: rgba(56, 189, 248, 0.15);
  color: #7DD3FC;
}

/* ==========================================================================
   USER MANAGEMENT & STRICT DEPARTMENT MODULE ISOLATION STYLES
   ========================================================================== */

.dept-isolation-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  margin-bottom: 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-md);
  color: #92400E;
  font-size: 13px;
}

[data-theme="dark"] .dept-isolation-banner {
  background: rgba(245, 158, 11, 0.15);
  color: #FCD34D;
}

.dept-isolation-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #D97706;
}

.profile-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.profile-matrix-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.profile-matrix-card.profile-card-admin {
  border-top: 3px solid #7C3AED;
}

.profile-matrix-card.profile-card-operator {
  border-top: 3px solid #0284C7;
}

.profile-matrix-card.profile-card-staff {
  border-top: 3px solid var(--primary);
}

.profile-matrix-card.profile-card-viewer {
  border-top: 3px solid #64748B;
}

.profile-matrix-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-code-hint {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
}

.profile-matrix-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.profile-matrix-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profile-matrix-card ul li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-medium);
  line-height: 1.4;
}

.profile-matrix-card ul li svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.profile-badge.admin {
  background: rgba(124, 58, 237, 0.14);
  color: #6D28D9;
  border: 1px solid rgba(124, 58, 237, 0.35);
}

.profile-badge.operator {
  background: rgba(2, 132, 199, 0.14);
  color: #0369A1;
  border: 1px solid rgba(2, 132, 199, 0.35);
}

.profile-badge.staff {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(13, 148, 136, 0.35);
}

.profile-badge.viewer {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.dept-access-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.dept-access-pill svg {
  width: 13px;
  height: 13px;
}

.dept-access-pill.all {
  background: rgba(124, 58, 237, 0.1);
  color: #6D28D9;
}

.dept-access-pill.restricted {
  background: rgba(13, 148, 136, 0.1);
  color: var(--primary-dark);
}

.pwd-code-pill {
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 5px;
  font-family: monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
}

.perm-cell-yes {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  font-weight: 700;
  font-size: 11.5px;
}

.perm-cell-no {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.12);
  color: #B91C1C;
  font-weight: 700;
  font-size: 11.5px;
}

.perm-cell-admin {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.12);
  color: #6D28D9;
  font-weight: 700;
  font-size: 11.5px;
}

/* ==========================================================================
   INTERACTIVE REGISTRATION DISTRIBUTION, ANALYTICS, HISTORY & REPORT CENTER
   ========================================================================== */

.stats-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 16px;
}

.stat-card-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.stat-card-top h4 {
  margin: 0 !important;
}

.stat-period-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.stat-period-tag.today {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.stat-period-tag.week {
  background: rgba(2, 132, 199, 0.14);
  color: #0284C7;
}

.stat-period-tag.month {
  background: rgba(217, 119, 6, 0.14);
  color: #D97706;
}

.stat-period-tag.total {
  background: rgba(124, 58, 237, 0.14);
  color: #7C3AED;
}

.distribution-card-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.distribution-subtitle {
  font-size: 12.5px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.45;
}

.dist-period-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  flex-wrap: wrap;
}

.dist-period-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-medium);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dist-period-btn svg {
  width: 15px;
  height: 15px;
}

.dist-period-btn:hover {
  color: var(--primary);
  background: var(--bg-card);
}

.dist-period-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.dist-section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.dist-section-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-dark);
}

.dist-section-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* Department Distribution Cards Grid */
.dept-distribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.dept-dist-card {
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dept-dist-card:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dept-dist-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.dept-dist-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dept-dist-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dept-dist-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-dark);
}

.dept-dist-mod-count {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
}

.dept-dist-main-num {
  text-align: right;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.dept-dist-main-num strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.dept-dist-main-num span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-light);
}

.dept-dist-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.dept-dist-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #14B8A6);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.dept-dist-mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font-size: 11px;
  color: var(--text-medium);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 6px;
  text-align: center;
}

.dept-dist-mini-metrics span.active-metric {
  color: var(--primary-dark);
  font-weight: 700;
}

.dept-dist-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}

.dept-guest-split {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-medium);
}

.btn-dept-report {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: var(--bg-card);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dept-report svg {
  width: 13px;
  height: 13px;
}

.btn-dept-report:hover {
  background: var(--primary);
  color: #FFFFFF;
}

/* Interactive Service Module Distribution Rows */
.distribution-item-interactive {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.distribution-item-interactive:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.distribution-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.distribution-module-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.distribution-code-pill {
  background: var(--primary);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.distribution-dept-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-medium);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.distribution-label-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

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

.distribution-period-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.distribution-period-pills .p-pill {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-medium);
}

.distribution-period-pills .p-pill.highlight {
  background: var(--primary-light);
  border-color: rgba(13, 148, 136, 0.4);
  color: var(--primary-dark);
}

.btn-module-drilldown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-module-drilldown svg {
  width: 13px;
  height: 13px;
}

.btn-module-drilldown:hover {
  background: var(--primary-dark);
}

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

.distribution-bar-row .distribution-bar-bg {
  flex: 1;
}

.distribution-pct-label {
  font-size: 12px;
  color: var(--text-medium);
  min-width: 105px;
  text-align: right;
}

.distribution-sub-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-light);
  flex-wrap: wrap;
  gap: 8px;
}

/* Analytics, Detail, History & Report Modal */
.analytics-modal-container {
  max-width: 1120px !important;
  width: 95% !important;
  max-height: 92vh !important;
}

.analytics-modal-header {
  align-items: flex-start !important;
}

.analytics-type-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.analytics-modal-body {
  padding: 22px !important;
  overflow-y: auto;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.analytics-kpi-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.analytics-kpi-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.analytics-kpi-card.today { border-top: 3px solid #10B981; }
.analytics-kpi-card.week { border-top: 3px solid #0284C7; }
.analytics-kpi-card.month { border-top: 3px solid #D97706; }
.analytics-kpi-card.total { border-top: 3px solid #7C3AED; }
.analytics-kpi-card.inhouse { border-top: 3px solid var(--primary); }
.analytics-kpi-card.walkin { border-top: 3px solid #0EA5E9; }

.analytics-kpi-card .kpi-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-light);
}

.analytics-kpi-card .kpi-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.15;
}

.analytics-kpi-card .kpi-sub {
  font-size: 11px;
  color: var(--text-light);
}

.analytics-two-col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.analytics-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

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

.analytics-section-header h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-dark);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.analytics-section-header h4 svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.module-spec-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
}

.module-spec-list .spec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
}

.trend-bars-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  height: 165px;
  align-items: end;
  padding-top: 10px;
}

.trend-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 5px;
}

.trend-bar-val {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary);
}

.trend-bar-track {
  width: 100%;
  max-width: 34px;
  height: 105px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.trend-bar-fill {
  width: 100%;
  background: var(--border);
  border-radius: 5px 5px 0 0;
  transition: height 0.3s ease;
}

.trend-bar-fill.has-val {
  background: linear-gradient(180deg, #14B8A6, var(--primary));
}

.trend-bar-lbl {
  font-size: 10.5px;
  color: var(--text-light);
  text-align: center;
  white-space: nowrap;
}

.analytics-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.analytics-history-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hist-pill-group {
  display: inline-flex;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  gap: 3px;
}

.hist-filter-btn {
  border: none;
  background: transparent;
  color: var(--text-medium);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.hist-filter-btn.active {
  background: var(--primary);
  color: #FFFFFF;
}

.hist-search-wrap input {
  padding: 6px 12px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 220px;
  background: var(--bg-main);
  color: var(--text-dark);
}

/* ==========================================================================
   SYSTEM ACTIVITY & AUDIT LOG BADGES
   ========================================================================== */

.audit-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.audit-cat-badge.auth {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.audit-cat-badge.form {
  background: rgba(13, 148, 136, 0.14);
  color: var(--primary-dark);
  border: 1px solid rgba(13, 148, 136, 0.35);
}

.audit-cat-badge.customer {
  background: rgba(2, 132, 199, 0.14);
  color: #0369A1;
  border: 1px solid rgba(2, 132, 199, 0.35);
}

.audit-cat-badge.user {
  background: rgba(124, 58, 237, 0.14);
  color: #6D28D9;
  border: 1px solid rgba(124, 58, 237, 0.35);
}

.audit-cat-badge.system {
  background: rgba(217, 119, 6, 0.14);
  color: #B45309;
  border: 1px solid rgba(217, 119, 6, 0.35);
}
