:root {
    /* --- Brand Identity --- */
    --color-primary:        #0056b3;
    --color-primary-dark:   #003d84;
    --color-primary-light:  #c4e1ff;
    --color-accent:         #2c3e50;

    /* --- Typography --- */
    --font-family-base:     'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-heading:  inherit; /* Optional: Set a different font for headers */
    
    --font-header-size:         0.80em;
    --font-xsm-size:         0.95em;
    --font-sm-size:         1.25em;
    --font-md-size:         1.4em;
    --font-lg-size:         1.65em;
    --line-height-base:     1.6;

    /* --- Text Colors --- */
    --text-main:            #333333;
    --text-light:           #595959;
    --text-inverse:         #ffffff;
    --text-link:            #2b3ba1; 

    /* --- Backgrounds --- */
    --bg-page:              #f4f7f6;
    --bg-card:              #ffffff;
    --bg-panel:             #f8f9fa;
    --bg-input:             #ffffff;
    --bg-readonly:          #e9ecef;
    --bg-header:            #eef2f5;

    /* --- Feedback & States --- */
    --state-error-bg:       #fffee5;
    --state-error-text:     #c20000;
    --state-success-bg:     #f0fff0;
    --state-success-text:   #008000;
    --state-warning-bg:     #fffaeb;
    --state-warning-text:   #614903;
    --state-focus:          #ff9900;

    /* --- Spacing System --- */
    --space-xs:             0.25rem; /* 4px */
    --space-sm:             0.5rem;  /* 8px */
    --space-md:             1rem;    /* 16px */
    --space-lg:             2rem;    /* 32px */

    /* --- Component Dimensions --- */
    --input-height:         38px;
    --input-height-sm:      32px;
    --btn-padding-y:        0.75rem;
    --btn-padding-x:        1.5rem;
    --border-width:         1px;
    --radius-md:            4px;
    
    /* --- Visual FX --- */
    --border-color:         #ced4da;
    --border-light:         #eee;
    --shadow-card:          0 2px 4px rgba(0,0,0,0.1);
    --transition-base:      0.2s ease-in-out;

    /* --- Specific Vendor/Button Overrides --- */
    --table-head-bg:        #f1f3f5;
    --btn-cancel-bg:        #cccccc;
    --btn-cancel-hover:     #b54c4c;
    --btn-secondary-bg:     #515253;
}

/* ==========================================================================
   Base Utilities & Accessibility
   ========================================================================== */

/* Screen Reader Only (WCAG standard) */
.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;
}

/* Skip Navigation (SC 2.4.1) */
#skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--text-main);
  color: var(--text-inverse);
  padding: var(--space-md);
  text-decoration: none;
  font-weight: bold;
  border-bottom-right-radius: var(--radius-md);
  transition: left 0.3s ease;
}

#skip-link:focus {
  left: 0;
  width: auto;
  height: auto;
  outline: 3px solid var(--state-focus);
}

/* ==========================================================================
   1. Main Header & Top Bar
   ========================================================================== */

.main-header {
  background-color: var(--bg-panel);
  border-bottom: 4px solid var(--color-accent); 
  font-family: var(--font-family-base);
}

/* Top Info Bar */
.site-top-bar {
  background-color: var(--bg-header); 
  color: var(--text-main);
  padding: 0 var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; 
  font-size: var(--font-xsm-size);
  min-height: 40px; 
}

.top-bar-info {
  display: flex;
  gap: var(--space-md);
}

.user-greeting strong {
  color: var(--text-link); 
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* Top Bar Navigation */
.top-bar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.top-bar-nav a {
  color: var(--text-link); 
  text-decoration: none;
  font-weight: bold;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
}

.icon-logout {
  margin-left: var(--space-sm);
  height: 16px; width: 16px;
  fill: currentColor; /* SVG adopts text color */
}

/* Top Bar States */
.top-bar-nav a:hover {
  text-decoration: underline;
  color: var(--text-main);
}

.top-bar-nav a:focus {
  outline: 3px solid var(--state-focus); 
  background-color: rgba(0,0,0,0.2);
  color: var(--text-inverse);
}

/* Branding Section */
.branding-container {
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.logo-wrapper img {
  max-width: 200px;
  height: auto;
  display: block;
}

.title-wrapper { color: var(--text-main); }

.title-wrapper .head-1 {
  font-size: var(--font-header-size) !important;
  margin: 0;
  line-height: 1.2;
  font-weight: bold;
}

.title-wrapper .head-2 {
  font-size: var(--font-header-size);
  margin: var(--space-xs) 0 0 0;
  font-weight: normal;
  color: var(--text-light); 
}

.title-wrapper .head-3 {
  font-size: var(--font-header-size);
  margin: var(--space-xs) 0 0 0;
  font-weight: bold;
  color: var(--color-primary); 
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   2. Main Navigation (Sticky)
   ========================================================================== */

nav#main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-header); 
  border-bottom: 1px solid var(--border-color);
  padding: 5px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 5px;
  flex-wrap: wrap; 
}

.nav-list > li {
  position: relative;
}

/* Nav Links & Buttons */
.nav-list a,
.nav-list button {
  display: inline-block;
  padding: var(--space-sm) var(--btn-padding-x);
  text-decoration: none;
  color: var(--text-main);
  background: none;
  border: none;
  font-family: var(--font-family-base);
  font-size: var(--font-xsm-size);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

/* Nav Focus & Hover (WCAG 2.4.7) */
.nav-list a:hover,
.nav-list button:hover {
  background-color: var(--border-light);
  color: var(--color-primary);
  text-decoration: underline;
}

.nav-list a:focus,
.nav-list button:focus {
  outline: 3px solid var(--state-focus);
  background-color: var(--bg-card);
  color: #000;
}

/* Dropdown Arrow */
.arrow {
  display: inline-block;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor; 
  margin-left: var(--space-xs);
  vertical-align: middle;
}

/* Submenu */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-card); 
  list-style: none;
  padding: var(--space-sm) 0;
  margin: 0;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  z-index: 999;
  border-radius: var(--radius-md);
}

.submenu.is-open { display: block; }

.submenu a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-main);
  text-decoration: none;
}

.submenu a:hover {
  background-color: var(--bg-header); 
  color: var(--color-primary);
  text-decoration: underline;
}

/* ==========================================================================
   3. Mini Page / Contact Card
   ========================================================================== */

body.mini-page-body {
  background-color: var(--bg-page); 
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: var(--space-lg);
  margin: 0;
}

.mini-page-container {
  font-family: var(--font-family-base);
  color: var(--text-main);
  background-color: var(--bg-card);
  
  width: 100%;
  max-width: 600px;
  margin-top: 40px;
  
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mini-page-header {
  background-color: var(--color-accent);
  color: var(--text-inverse);
  padding: 15px 20px;
}

.mini-page-header h1 {
  margin: 0;
  font-size: var(--font-md-size);
  font-weight: bold;
}

.mini-page-content {
  padding: var(--space-lg);
  line-height: var(--line-height-base);
}

.intro-text {
  margin-bottom: var(--space-lg);
  font-size: var(--font-md-size);
  color: var(--text-light);
}

.contact-section {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-light);
}

.contact-section:last-of-type { border-bottom: none; }

.contact-label {
  display: block;
  color: var(--color-primary);
  font-weight: bold;
  font-size: var(--font-xsm-size);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

address.contact-address {
  font-style: normal;
  font-size: var(--font-xsm-size);
  color: var(--text-main);
}

.contact-email {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: bold;
  font-size: var(--font-xsm-size);
}

/* Buttons */
.action-area {
  margin-top: var(--space-md);
  text-align: center;
}

.back-btn {
  background-color: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-size: var(--font-xsm-size);
  cursor: pointer;
  border-radius: var(--radius-md);
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: var(--transition-base);
}

.back-btn:hover {
  background-color: var(--border-light);
  border-color: #adb5bd;
}

.back-btn:focus, 
.contact-email:focus {
  outline: 3px solid var(--state-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   4. Footer
   ========================================================================== */

.main-footer {
  background-color: var(--bg-header); 
  color: var(--text-main);
  padding: var(--space-md);
  text-align: center;
  font-family: var(--font-family-base);
  border-top: 1px solid var(--border-color);
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* Link Styling & Target Size (2.5.5) */
.footer-nav a {
  color: var(--color-primary);
  text-decoration: underline;
  font-size: var(--font-xsm-size);
  font-weight: bold;
  padding: 10px 15px; 
  display: inline-block;
  border-radius: var(--radius-md);
}

/* Focus Visibility (2.4.7) */
.footer-nav a:focus {
  outline: 3px solid var(--state-focus);
  outline-offset: 2px;
  background-color: var(--bg-card);
  text-decoration: none;
  box-shadow: var(--shadow-card);
}

.footer-nav a:hover {
  text-decoration: none;
  background-color: rgba(0,0,0,0.05);
  color: var(--color-primary-dark);
}

.divider {
  color: var(--text-light);
  font-weight: normal;
}

.copyright {
  font-size: var(--font-xsm-size);
  color: var(--text-light);
}

/* Responsive Footer */
@media (max-width: 600px) {
  .footer-nav {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .divider { display: none; }
  
  .footer-nav a {
    display: block;
    width: 100%;
    padding: 12px;
  }
}

/* Responsive Header */
@media (max-width: 768px) {
  .site-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
  }
  
  .top-bar-nav {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  .branding-container {
    flex-direction: column;
    text-align: center;
  }
}

/* Help Modal Styles */
.help-dialog {
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  padding: 0;
  max-width: 800px;
  width: 90%;
  position: fixed;
}

.help-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5); /* Optional: darkens background behind modal */
}

.help-header {
  display: flex;
  justify-content: flex-end;
  padding: 10px;
  background: #f1f1f1;
}

.help-close-btn {
  font-size: 1.5rem;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0 10px;
}

.help-content {
  width: 100%;
  height: 325px;
  display: block;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

/* System Message Styles */
.help-sys-msg {
  text-align: center;
}

.help-sys-error {
  text-align: center;
  color: red;
}