/* ==========================================================================
   HYDRION PWA & SERVER CONSOLE DESIGN SYSTEM (v5.8 Executive Edition)
   Developed for Terra Ledger Advisory
   ========================================================================== */

:root {
  --primary-navy: #1a2332;
  --primary-cyan: #28d1de;
  --accent-cyan: #28d1de;
  --bg-light: #e2e8f0;
  --card-white: #ffffff;
  --text-main: #0D1B22;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --border-color: #e2e8f0;
  --border-dark: #1e293b;
  --status-completed: #059669;
  --status-pending: #d97706;
  --status-danger: #dc2626;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
}

/* BASE RESET */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { background-color: var(--bg-light); color: var(--text-main); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* LOGIN OVERLAY & WIDE RESPONSIVE CARD */
.login-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(8px);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto;
}

.login-card {
  background: var(--card-white); border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 32px; width: 100%; max-width: 840px; text-align: center;
  position: relative; z-index: 10; border: 1px solid var(--border-color);
  margin: auto; max-height: 90vh; overflow-y: auto;
}

/* SERVER LOGIN OVERLAY (COMPACT SLEEK LAPTOP CARD) */
#admin-login-overlay .login-card {
  max-width: 440px !important;
  padding: 28px !important;
}

.login-logo { max-height: 60px; width: auto; max-width: 100%; margin-bottom: 14px; object-fit: contain; }
.login-title { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700; color: var(--primary-navy); letter-spacing: 0.5px; }
.login-subtitle { font-size: 11px; font-weight: 800; color: var(--primary-cyan); text-transform: uppercase; margin-bottom: 20px; letter-spacing: 1px; }

/* WIDE 2-COLUMN REGISTRATION FORM FOR LAPTOPS & RESPONSIVE ON MOBILE */
.registration-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: left;
}
@media (max-width: 768px) {
  .registration-grid { grid-template-columns: 1fr; }
}

.form-group { margin-bottom: 14px; text-align: left; }
.form-label { font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 6px; display: block; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px; font-size: 14px; font-weight: 500; color: var(--text-main);
  background: #ffffff; border: 1px solid #cbd5e1; border-radius: 12px;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary-navy); background: #ffffff; box-shadow: 0 0 0 3px rgba(16, 67, 159, 0.15);
}

.btn-submit-large {
  width: 100%; background: var(--primary-navy);
  color: #ffffff; border: none; padding: 12px 20px; font-size: 13px; font-weight: 800;
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s ease;
}
.btn-submit-large:hover { background: #1e293b; transform: translateY(-1px); }

/* MAIN APP HEADER (BALANCED PROPORTIONATE LOGO ON LAPTOPS) */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: 66px;
  background: #ffffff; border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.brand-container { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.terra-logo-img { height: 35px; width: auto; max-width: 150px; object-fit: contain; flex-shrink: 0; }
.brand-titles { display: flex; flex-direction: column; overflow: hidden; white-space: nowrap; border-left: 2px solid #e2e8f0; padding-left: 8px; }
.app-name { display: flex; align-items: baseline; gap: 6px; font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--primary-navy); letter-spacing: 0.5px; margin-bottom: 2px; }
.app-tech-suffix { font-family: 'Inter', sans-serif; font-size: 6px; font-weight: 900; background: linear-gradient(90deg, #94a3b8, #f8fafc, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 1px; text-transform: uppercase; text-shadow: 0px 1px 2px rgba(255,255,255,0.2); }
.app-subtitle { font-size: 9px; font-weight: 700; color: #64748b; letter-spacing: 0.5px; text-transform: uppercase; text-overflow: ellipsis; overflow: hidden; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-user-badge { font-size: 12px; font-weight: 700; color: var(--primary-navy); background: #f1f5f9; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px; }
.btn-logout { background: transparent; border: none; font-size: 11px; font-weight: 800; color: #dc2626; cursor: pointer; }

@media (max-width: 600px) {
  .app-header { padding: 0 10px; height: 58px; gap: 6px; }
  .brand-container { gap: 6px; flex: 1; min-width: 0; }
  .terra-logo-img { height: 26px; max-width: 80px; }
  .brand-titles { padding-left: 6px; border-left: 1px solid #e2e8f0; }
  .app-name { font-size: 14px; flex-direction: column; align-items: flex-start; gap: 1px; margin-bottom: 2px; }
  .app-tech-suffix { font-size: 5.5px; background: linear-gradient(90deg, #94a3b8, #f8fafc, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
  .app-subtitle { font-size: 6.5px; display: block; white-space: nowrap; margin-top: 1px; }
  .header-actions { flex-shrink: 0; min-width: 0; gap: 4px; }
  .header-user-badge { font-size: 10px; padding: 4px 8px; max-width: 110px; }
  .header-user-badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 65px; }
}

/* NAVIGATION BAR */
.bottom-nav-bar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 60px;
  background: #ffffff; border-top: 1px solid var(--border-color);
  display: flex; justify-content: space-around; align-items: center; z-index: 1000;
}
.nav-item {
  background: transparent; border: none; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 700; cursor: pointer; flex: 1; padding: 6px 0; transition: color 0.2s ease;
}
.nav-item.active { color: var(--primary-cyan); }
.nav-item .icon-svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* TAB CONTENTS & SECTIONS */
.tab-content-section { display: none; padding-top: 90px; padding-bottom: 70px; max-width: 1000px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (max-width: 600px) {
  .tab-content-section { padding-top: 72px; }
}
.tab-content-section:not(.hidden) { display: block !important; }
.hidden { display: none !important; }

/* MAP CONTAINER */
#map-container { height: 60vh; max-height: 450px; width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border-color); z-index: 10; }

/* MAP NAVIGATION HUD */
.nav-hud-overlay {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
.nav-hud-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
}
.nav-hud-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
}
.nav-hud-meta {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
}

/* PROJECT SELECTOR & METRICS CARD */
.project-selector-card {
  background: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.project-selector-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.project-select-dropdown { width: 100%; padding: 10px; font-size: 14px; font-weight: 700; color: var(--primary-navy); background: #f8fafc; border: 1px solid var(--border-color); border-radius: var(--radius-sm); margin-bottom: 10px; }

.assigned-tech-badge { font-size: 11px; color: #1a2332; background: #e0f2fe; padding: 6px 12px; border-radius: 6px; margin-bottom: 12px; }

.project-metrics-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.metric-box { background: #f8fafc; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 10px; text-align: center; cursor: pointer; transition: all 0.2s ease; }
.metric-box:hover, .metric-box.active-filter { border-color: var(--primary-cyan); background: #f0f9ff; }
.metric-val { font-size: 20px; font-weight: 900; color: var(--primary-navy); }
.metric-lbl { font-size: 10px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }

/* CARDS & ACCORDIONS */
.point-card, .client-card, .calendar-card {
  background: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-md); transition: all 0.2s ease; border-radius: 12px;
}
.point-card-header, .client-header, .calendar-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.point-code-badge { font-size: 11px; font-weight: 800; color: var(--primary-navy); background: #f1f5f9; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border-color); }
.point-status-badge { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 12px; text-transform: uppercase; }
.point-status-badge.completed { background: #d1fae5; color: #059669; }
.point-status-badge.pending { background: #fffbeb; color: #b45309; }

.client-profile-body, .calendar-body { display: none; padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--border-color); }
.client-card.open .client-profile-body, .calendar-card.open .calendar-body { display: block; }


/* EXECUTIVE MODAL DIALOGS */
.exec-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px);
  z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.exec-modal-card {
  background: #ffffff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 24px; width: 100%; max-width: 440px; text-align: left; border: 1px solid var(--border-color);
}
.exec-modal-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--primary-navy); margin-bottom: 8px; }
.exec-modal-body { font-size: 13px; color: var(--text-main); margin-bottom: 20px; white-space: pre-wrap; line-height: 1.6; }
.exec-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.btn-modal-cancel { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
.btn-modal-confirm { background: #1a2332; color: #ffffff; border: none; padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }

/* MODAL DRAWERS */
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 2500; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal-card { background: #ffffff; border-radius: var(--radius-md); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--primary-navy); }
.btn-close-modal { background: transparent; border: none; font-size: 18px; color: var(--text-muted); cursor: pointer; }

/* BUTTONS */
.btn-edit-item { background: #f1f5f9; color: var(--primary-navy); border: 1px solid var(--border-color); padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; }
.btn-delete-item { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-sample-now { background: var(--primary-navy); color: #ffffff; border: none; padding: 8px 14px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }

.sub-tabs-bar { display: flex; gap: 6px; border-bottom: 1px solid var(--border-color); margin-bottom: 14px; overflow-x: auto; }
.sub-tab-btn { background: transparent; border: none; color: var(--text-muted); padding: 8px 14px; font-size: 12px; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.sub-tab-btn.active { color: var(--primary-cyan); border-bottom-color: var(--primary-cyan); }
.sub-tab-content { display: none; }
.sub-tab-content.active-subtab { display: block; }

/* SEARCH & SORT TOOLBAR */
.search-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-input { flex: 1; padding: 8px 12px; font-size: 13px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }

.sort-select { padding: 8px 12px; font-size: 12px; font-weight: 700; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: #ffffff; }

.btn-download-nearby { width: 100%; background: #e0f2fe; color: #1a2332; border: 1px solid #bae6fd; padding: 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 14px; }

/* TOASTS */
.toast-container { position: fixed; top: 88px; right: 16px; z-index: 3500; display: flex; flex-direction: column; gap: 8px; }
.toast-msg { background: var(--primary-navy); color: #ffffff; padding: 10px 16px; border-radius: 12px; font-size: 12px; font-weight: 700; box-shadow: var(--shadow-md); border-left: 4px solid var(--accent-cyan); }


/* OFFLINE BANNER */
.offline-banner { background: #b45309; color: #ffffff; font-size: 12px; font-weight: 700; text-align: center; padding: 6px; position: fixed; top: 78px; left: 0; right: 0; z-index: 999; }

/* PILL STYLE NAVIGATION PANEL (MATCHING REFERENCE SPECIFICATIONS) */
.pill-nav-container {
  display: flex;
  width: fit-content;
  margin: 0 auto 16px auto;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 5px 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pill-nav-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: normal;
  text-align: center;
  outline: none;
}

.pill-nav-btn:hover {
  background: #f1f5f9;
  color: var(--primary-navy);
}

.pill-nav-btn.active {
  background: var(--primary-navy);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}


.pill-panel-content {
  display: none;
}

.pill-panel-content.active-panel {
  display: block !important;
}

/* ==========================================================================
   MOBILE RESPONSIVE SIZING ENGINE (FOR ALL PHONES & TABLETS)
   Ensures single unified codebase adapts seamlessly to any screen width.
   ========================================================================== */

/* HIDE HORIZONTAL SCROLLBARS FOR CLEAN PILL SLIDING ON MOBILE */
.pill-nav-container::-webkit-scrollbar,
.sub-tabs-bar::-webkit-scrollbar {
  display: none;
}
.pill-nav-container,
.sub-tabs-bar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tech-trip-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.tech-trip-btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* SMART TABLET & SMALL LAPTOP RESPONSIVENESS (max-width: 768px) */
@media (max-width: 768px) {
  .modal-card {
    width: 95%;
    max-height: 92vh;
    padding: 16px;
  }
  
  .exec-modal-card {
    width: 94%;
    padding: 20px;
  }

  .pill-nav-btn {
    font-size: 12px;
    padding: 7px 14px;
  }

  .search-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
  }
}






/* ==========================================================================
   GLOBAL STANDARDIZED BUTTONS & INTERACTIVE ELEMENTS
   ========================================================================== */

/* Primary Buttons */
.btn-submit, .btn-submit-large, .btn-action, .btn-primary, .btn-secondary {
  border-radius: 24px !important;
  text-transform: uppercase;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 700 !important;
  padding: 12px 24px !important;
  color: #ffffff !important;
  min-height: 54px;
  font-size: 13px !important;
  letter-spacing: 0.5px;
  background: var(--primary-navy) !important;
  border: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-submit:hover, .btn-submit-large:hover, .btn-action:hover, .btn-primary:hover, .btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  background: #0d1b22 !important;
}

/* Secondary / Outline / Polygon-Equivalent Buttons */
.btn-polygon {
  border-radius: 12px;
  text-transform: uppercase;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  padding: 8px 16px;
  min-height: 38px;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease-in-out;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-polygon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-polygon-blue {
  background: var(--primary-navy);
  color: #ffffff;
}

.btn-polygon-light {
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}
.btn-polygon-light:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-polygon-dark {
  background: #1e293b;
  color: #ffffff;
}

.accordion-point.open .point-card-body { display: block !important; }
.accordion-point.open .point-card-header svg { transform: rotate(180deg); }

#header-dropdown-menu.show { display: block !important; }

/* PHOTO CAPTURE */
.photo-preview-container { text-align: center; margin-bottom: 14px; position: relative; }
.photo-preview-img { width: 100%; max-height: 250px; object-fit: contain; border-radius: 12px; border: 1px solid var(--border-color); }
.btn-remove-photo { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.6); color: #fff; border: none; width: 30px; height: 30px; border-radius: 15px; font-weight: bold; cursor: pointer; }
.camera-capture-zone { border: 2px dashed #94a3b8; border-radius: 12px; padding: 30px; text-align: center; cursor: pointer; margin-bottom: 14px; background: #f8fafc; transition: all 0.2s ease; }
.camera-capture-zone:hover { border-color: var(--primary-cyan); background: #f0f9ff; }
