/* ==========================================================================
   1. COLOR VARIABLES & THEMES
   ========================================================================== */ :root {
  --bg-primary: #f4f4f4;
  --bg-secondary: #ffffff;
  --text-main: #333333;
  --text-muted: #666666;
  --border-color: #cccccc;
  --header-bg: #333333;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --accent-color: #007bff;
  --nav-text: #ffffff;
}
/* Dark Mode Overrides - Dimmed for Comfort */
[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --text-main: #d1d1d1;
  --text-muted: #888888;
  --border-color: #2d2d2d;
  --header-bg: #000000;
  --card-shadow: rgba(0, 0, 0, 0.4);
  --accent-color: #3794ff;
  --nav-text: #e0e0e0;
}
/* ==========================================================================
   2. BASE STYLES
   ========================================================================== */
body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}
/* ==========================================================================
   3. LAYOUT & CONTAINERS
   ========================================================================== */
.container {
  margin: 0 auto;
  max-width: 1400px;
  width: 90%;
}
.content-section {
  background-color: var(--bg-primary);
  padding: 3rem 0;
}
.site-header .top-bar-full-width {
  background-color: var(--header-bg);
  color: var(--nav-text);
  padding: 0.7rem 0;
}
.full-width-content {
  align-items: center;
  display: flex;
  justify-content: space-between;
}
.logo-container img {
  display: block;
  height: 67px;
  width: 186px;
}
/* --- HERO STATUS PANEL --- */
.hero-content.status-panel {
  background: rgba(0, 0, 0, 0.85);
  padding: 1.2rem 2rem;
  border-radius: 6px;
  border-left: 4px solid var(--accent-color);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 2.5rem;
  max-width: fit-content;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-text {
  display: flex;
  flex-direction: column;
}
.status-text .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: bold;
}
.status-text .value {
  font-size: 1.1rem;
  color: #ffffff;
  font-weight: bold;
}
.pulse {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.pulse.green {
  color: #00e676;
  background-color: #00e676;
  animation: pulse-green 2s infinite;
}
.pulse.amber {
  color: #ff9100;
  background-color: #ff9100;
}
.pulse.red {
  color: #ff1744;
  background-color: #ff1744;
  animation: pulse-red 1s infinite;
}
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 230, 118, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
  }
}
@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 23, 68, 0.6);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(255, 23, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 23, 68, 0);
  }
}
/* ==========================================================================
   4. NAVIGATION
   ========================================================================== */
.main-nav > ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav li {
  position: relative;
}
.main-nav a {
  color: var(--nav-text);
  display: block;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 10px 0;
  text-decoration: none;
  transition: color 0.3s ease;
}
.main-nav a:hover {
  color: var(--accent-color);
}
.dropdown {
  background-color: #444;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 16px var(--card-shadow);
  display: none;
  left: 0;
  list-style: none;
  margin: 0;
  min-width: 200px;
  padding: 0;
  position: absolute;
  top: 100%;
  z-index: 1000;
}
.dropdown a {
  border-bottom: 1px solid #555;
  color: #fff;
  font-size: 0.95rem;
  font-weight: normal;
  padding: 12px 16px;
}
.dropdown a:hover {
  background-color: var(--accent-color);
  color: #ffffff !important; /* Overrides the main nav text hover */
}
.has-dropdown:hover > .dropdown {
  display: block;
}
/* ==========================================================================
   5. HEADER UTILITIES & THEME TOGGLE
   ========================================================================== */
.header-actions {
  align-items: center;
  display: flex;
  gap: 1rem;
}
.right-icons {
  align-items: center;
  display: flex;
}
.icon-link {
  color: var(--nav-text);
  text-decoration: none;
}
#theme-toggle {
  background: transparent;
  border: 1px solid var(--nav-text);
  border-radius: 20px;
  color: var(--nav-text);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 5px 12px;
  transition: all 0.3s ease;
}
#theme-toggle:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
}
.search-box input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-sizing: border-box;
  color: var(--text-main);
  font-size: 0.9rem;
  height: 32px;
  padding: 0.4rem 0.8rem;
  width: 180px;
}
/* ==========================================================================
   6. THE GLOBAL COMPONENT SYSTEM (Deduplicated Elements)
   ========================================================================== */
/* --- UNIFIED CARDS & CONTAINERS --- */
.section-card, .profile-card, .vault-filter-bar, .modal-box, .calc-card, .contact-form, .result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 10px var(--card-shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.section-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.profile-card, .modal-box, .contact-form, .calc-card {
  padding: 2.5rem;
}
.vault-filter-bar {
  padding: 1.8rem;
  margin-bottom: 2rem;
}
/* --- CALCULATOR HUB CARDS --- */
.calc-card {
  text-decoration: none !important; /* Kills the underline */
  color: var(--text-main) !important; /* Kills the magenta/blue link colors */
  display: block; /* Ensures the whole card acts as a clickable block */
  text-align: center;
  border-top: 4px solid var(--accent-color) !important; /* Restores the tactical top border */
}
.calc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px var(--card-shadow);
}
/* Ensures any headings inside the card don't turn magenta either */
.calc-card h3 {
  color: var(--accent-color);
  margin-top: 0;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
}
.card-header .icon {
  font-size: 1.2rem;
  display: inline-block;
}
.card-header h3 {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-color);
}
.card-center-container {
  max-width: 700px;
  margin: 0 auto;
}
.calc-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 2rem;
}
/* --- UNIFIED INPUTS & FORMS --- */
/* Core Form Elements */
.form-control {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 4px;
  padding: 12px;
  box-sizing: border-box;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.3s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
}
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}
.directory-search-input, .modal-box input, .modal-box select, .input-field input, .profile-select, .filter-control, .contact-form input, .contact-form select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 4px;
  padding: 12px;
  box-sizing: border-box;
  font-size: 0.95rem;
  width: 100%;
  margin-bottom: 1rem;
}
.filter-control, .input-field input, .profile-select {
  background: var(--bg-primary);
}
.contact-form label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 1rem;
}
.form-row > div {
  flex: 1;
}
.radio-group-horizontal {
  display: flex;
  gap: 20px;
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  align-items: center;
  margin-bottom: 1.5rem;
}
.radio-group-horizontal input[type="radio"] {
  width: auto !important;
  margin: 0 8px 0 0 !important;
  display: inline-block !important;
}
.radio-label {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: normal !important;
  margin-bottom: 0 !important;
  cursor: pointer;
}
/* --- UNIFIED DATA TABLES --- */
.vault-container {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--card-shadow);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.vault-table, .directory-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-main);
}
.vault-table thead tr {
  background: var(--header-bg);
  color: var(--nav-text);
  text-align: left;
}
/* --- UPDATED DIRECTORY TABLE (Close-Ended Grid) --- */
.directory-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
    /* Close-ended outer border */
    border: 1px solid var(--border-color); 
    background: var(--bg-secondary);
}

.directory-table thead tr {
    /* Distinct background for headers */
    background: var(--bg-primary); 
}

.directory-table th {
    text-align: left;
    color: var(--accent-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 12px 10px;
    font-weight: bold;
    /* Full borders for header cells */
    border: 1px solid var(--border-color); 
}

.directory-table td {
    padding: 12px 1.5rem;
    /* Full borders for data cells */
    border: 1px solid var(--border-color); 
}

/* Ensure no double borders on the very top of the table */
.directory-table thead th {
    border-top: none;
}
/* --- DIRECTORY LAYOUT ENGINE --- */
.directory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Increased gap to shrink table width and add space */
    gap: 6rem; 
    margin-top: 2rem;
}

/* Removes card styling for the table wrappers to keep the look clean */
.directory-card-wrapper {
    padding: 0; 
    overflow: hidden; 
    border: none; 
    background: transparent; 
    box-shadow: none;
}

/* Table Header Background Update */
.directory-table thead tr {
    background: var(--bg-primary); 
}

/* Center alignment utility for the EXT column */
.column-ext {
    text-align: center;
}
.vault-table th, .vault-table td, .directory-table td {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border-color);
}
.vault-table tbody tr:last-child td {
  border-bottom: none;
}
.vault-table td div {
  margin-bottom: 4px;
  line-height: 1.2;
}
.vault-table td strong {
  color: var(--accent-color);
  text-transform: capitalize;
}
/* --- UNIFIED BADGES --- */
.badge-vault {
  display: inline-block;
  min-width: 65px;
  text-align: center;
  padding: 0.2rem 0.7rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}
/* --- UNIFIED PAGINATION --- */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding: 1rem 0;
}
.pagination-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.pagination-controls {
  display: flex;
  gap: 0.5rem;
}
.page-link {
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.page-link:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.page-link.active {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}
/* --- UNIFIED BUTTONS & LINKS --- */
.text-link {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
  transition: color 0.3s ease;
  display: inline-block;
  margin-top: 1rem;
}
.text-link:hover {
  text-decoration: underline;
  color: #0056b3;
}
.dno-btn, .cta-button, .btn-submit, .btn-reset, .btn-copy, .action-tile, .directory-btn {
  border-radius: 4px;
  text-decoration: none !important;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.85rem;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.cta-button, .btn-submit, .btn-copy {
  background: var(--accent-color);
  color: #fff;
}
.cta-button:hover, .btn-submit:hover, .btn-copy:hover {
  background: #0056b3;
}
.dno-btn, .directory-btn, .btn-reset {
  background: var(--bg-primary);
  color: var(--text-main);
  border-color: var(--border-color);
}
.dno-btn:hover, .directory-btn:hover, .btn-reset:hover {
  background: var(--header-bg);
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.accent-tile {
  border-color: var(--accent-color) !important;
  color: var(--accent-color) !important;
}
/* ==========================================================================
   7. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
  .full-width-content {
    flex-direction: column;
    gap: 1rem;
  }
}
/* ==========================================================================
   8. FOOTER STYLING
   ========================================================================== */
.site-footer {
  background-color: var(--header-bg);
  color: var(--nav-text);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
}
.footer-column h4 {
  color: var(--accent-color);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
  margin-top: 0;
}
.footer-tagline {
  color: var(--text-muted);
  margin: 1rem 0;
  max-width: 250px;
  line-height: 1.4;
}
.copyright {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2rem;
}
.footer-column address {
  font-style: normal;
  line-height: 1.8;
  color: var(--nav-text);
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin-bottom: 0.8rem;
}
.site-footer a {
  color: var(--nav-text);
  text-decoration: none;
  transition: color 0.3s ease;
}
.site-footer a:hover {
  color: var(--accent-color);
}
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }
  .footer-tagline {
    margin: 1rem auto;
  }
}
/* ==========================================================================
   9. UTILITIES & ALERTS
   ========================================================================== */
/* System Alerts */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  font-weight: bold;
  border-radius: 4px;
  border-left: 4px solid transparent;
}
.alert-success {
  background: rgba(0, 230, 118, 0.1);
  border-left-color: #00e676;
  color: #00e676;
}
.alert-error {
  background: rgba(255, 23, 68, 0.1);
  border-left-color: #ff1744;
  color: #ff1744;
}
/* Layout Helpers */
.text-center {
  text-align: center;
}
.flex-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.w-100 {
  width: 100%;
}
.m-0 {
  margin: 0;
}
.mb-0 {
  margin-bottom: 0;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}
.mt-4 {
  margin-top: 2rem;
}
/* ==========================================================================
   10. MISSING CLASSES PATCH (Headers & Unified Buttons)
   ========================================================================== */
/* Page Headers (Restores the flex layout and spacing) */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}
.page-header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--text-main);
}
/* Missing Button Classes for the Directory & Manage Pages */
.btn {
  border-radius: 4px;
  text-decoration: none !important;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.85rem;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent-color);
  color: #fff;
}
.btn-primary:hover {
  background: #0056b3;
}
/* Apply vertical borders to directory table columns */
.directory-table th:not(:last-child), 
.directory-table td:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

/* --- Header Search & Theme UI --- */
.search-form { 
    display: flex; 
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding-right: 5px;
    margin-right: 20px;
}
#global-search-input {
    border: none;
    background: transparent;
    padding: 8px 12px;
    outline: none;
    width: 200px;
    color: var(--text-main);
}
#search-submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: background 0.2s;
}
#search-submit-btn:hover { 
    background: var(--accent-hover); 
}

#theme-toggle {
    background: var(--bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 15px;
    transition: all 0.2s;
}
#theme-toggle:hover { 
    border-color: var(--accent-color); 
}

/* ==========================================================================
   11. RESPONSIVE DESIGN (MOBILE FIXES)
   ========================================================================== */
@media (max-width: 768px) {
  /* Fix containers and padding bleeding off screen */
  .container { width: 95%; overflow-x: hidden; }
  .profile-card, .modal-box, .contact-form, .calc-card, .section-card, .vault-filter-bar {
      padding: 1.2rem;
  }
  
  /* Force all form rows to stack vertically instead of side-by-side */
  .form-row { 
      flex-direction: column; 
      gap: 0; 
  }
  
  /* Fix Directory Grid breaking horizontal layout */
  .directory-grid { 
      grid-template-columns: 1fr; 
      gap: 2rem; 
  }
  
  /* Make Data Tables swipeable instead of breaking layout */
  .vault-table, .directory-table { 
      display: block; 
      overflow-x: auto; 
      white-space: nowrap; 
      -webkit-overflow-scrolling: touch; 
  }
  
  /* Stack Header Elements */
  .page-header { 
      flex-direction: column; 
      align-items: flex-start; 
      gap: 1rem; 
  }
  .header-actions { 
      flex-direction: column; 
      width: 100%; 
      align-items: stretch; 
  }
  .search-form { 
      width: 100%; 
      margin: 1rem 0; 
      box-sizing: border-box; 
      margin-right: 0; 
  }
  #global-search-input { width: 100%; }
  
  /* Adjust Status Panel on Hero */
  .hero-content.status-panel { 
      flex-direction: column; 
      gap: 1rem; 
      width: 100%; 
      box-sizing: border-box; 
  }
  
  /* Stack Radio Buttons */
  .radio-group-horizontal { 
      flex-direction: column; 
      align-items: flex-start; 
  }
  
  /* Footer Stacking */
  .footer-grid { 
      grid-template-columns: 1fr; 
      text-align: center; 
      gap: 2.5rem; 
  }
  .footer-tagline { margin: 1rem auto; }
}