
/* =========================================================
   SITE HEADER
   ========================================================= */

.site-header {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
  z-index: 100;
}

.site-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo {
  display: block;
  width: auto;
  height: 40px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav > a,
.nav-group-btn {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.site-nav > a:hover,
.nav-group-btn:hover {
  background: #f1f5f9;
}

.nav-group {
  position: relative;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.nav-group.open .nav-dropdown {
  display: flex;
  flex-direction: column;
}

.nav-dropdown a {
  padding: 10px 12px;
  border-radius: 6px;
  color: #334155;
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-dropdown a:hover {
  background: #f1f5f9;
}

.nav-toggle-btn {
  display: none;
}


/* =========================================================
   MOBILE HEADER
   ========================================================= */

@media (max-width: 767px) {

  .site-header {
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .site-logo {
    height: 34px;
  }

  .nav-toggle-btn {
    display: flex;
    width: auto;
    min-height: 42px;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 4px;
    padding-top: 8px;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav > a,
  .nav-group-btn {
    width: 100%;
    justify-content: space-between;
    min-height: 44px;
  }

  .nav-group {
    width: 100%;
  }

  .nav-dropdown {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 2px;
    padding: 4px 0 4px 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #f8fafc;
  }

  .nav-dropdown a {
    min-height: 42px;
    display: flex;
    align-items: center;
  }
}




/* ==========================================================================
   shared.css (Global Variables, Reset, and Layout Elements)
   ========================================================================== */

:root {
  --primary-blue: #0056b3;
  --primary-hover: #003d82;
  --primary-color: #2563eb;
  --primary-active: #1d4ed8;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --danger-color: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);

  --alert-medium-bg: #fff9e6;
  --alert-medium-border: #ffc107;
  --alert-high-bg: #f8d7da;
  --alert-high-border: #dc3545;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  padding: 1rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  body {
    padding: 32px;
  }
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-top: 0;
  margin-bottom: 16px;
}

h3 {
  margin-top: 0;
  color: var(--text-main);
}

.subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* Containers */
.page-container,
.dashboard-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.container {
  background: var(--card-bg);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-header,
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Form Elements */
label,
.form-label,
.filter-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 6px;
}

input,
select,
.form-control {
  width: 100%;
  height: 48px;
  padding: 10px 14px;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  box-sizing: border-box;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

input:focus,
select:focus,
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* Buttons */
button,
.btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  height: 48px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #ccc !important;
}

.btn-primary,
.blue-button {
  background-color: var(--primary-color);
  color: #ffffff;
  width: 100%;
}

.btn-primary:hover,
.blue-button:hover {
  background-color: var(--primary-active);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-main);
  border-color: var(--border-color);
}

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

.btn-danger,
.red-button,
#clearAllBtn {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover,
.red-button:hover,
#clearAllBtn:hover {
  background-color: #b91c1c;
}

.btn-danger-outline {
  background-color: #ffffff;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-danger-outline:hover {
  background-color: #fef2f2;
  border-color: #dc2626;
}

.btn-sm {
  width: auto;
  height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Tables */
.table-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
  box-sizing: border-box;
}

.table-header {
  padding: 16px 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.table-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: #1e293b;
}

.table-responsive,
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: #ffffff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.data-table th {
  background-color: #f8fafc;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
  color: #334155;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.empty-state {
  text-align: center;
  color: #94a3b8;
  padding: 32px !important;
}

/* Modals & Overlays */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  gap: 12px;
  z-index: 200;
}

#loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.active,
.modal:not([aria-hidden="true"]) {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  line-height: 1;
}

.modal-buttons {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Autocomplete Suggestions */
.search-wrapper,
.search-section {
  position: relative;
  flex-grow: 1;
  width: 100%;
}

.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
}

.suggestions div,
.suggestion {
  padding: 12px 14px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.15s;
}

.suggestions div:last-child {
  border-bottom: none;
}

.suggestions div:active,
.suggestion:hover {
  background-color: #f1f5f9;
}




