*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #0000FF;
  --white: #FFFFFF;
  --black: #0A0A0A;
  --grey-100: #F5F5F5;
  --grey-200: #E5E5E5;
  --grey-400: #ABABAB;
  --grey-600: #666666;
  --panel-w: 420px;
  --font-main: 'Hanken Grotesk', sans-serif;
}

body {
  font-family: var(--font-main);
  background: var(--white);
  color: var(--black);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#map { position: fixed; inset: 0; z-index: 1; }

.admin-stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 20px;
  border-radius: 8px;
  background-color: var(--grey-100);
  border: 1px solid #E5E7EB;
  text-align: center;
}
.stat-label {
  display: block;
  font-size: 0.85rem;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--black);
}
.stat-card.pending { border-left: 4px solid #F59E0B; }
.stat-card.validated { border-left: 4px solid #10B981; }
.stat-card.total { border-left: 4px solid var(--blue); }

.float-actions {
  position: fixed; top: 20px; left: 20px;
  z-index: 1000; display: flex; gap: 8px;
}

.layer-toggle {
  position: fixed; bottom: 28px; left: 20px;
  z-index: 1000;
  display: flex; border: 1.5px solid var(--grey-200);
  background: var(--white); overflow: hidden;
}

.top-right-controls {
  position: fixed; top: 20px; right: 20px;
  z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}

.brand-logo-box a {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}

hr { border: 0; border-top: 1px solid var(--blue); margin: 20px 0; }

.brand-logo-box svg { height: 100%; width: auto; display: block; margin: auto; }

.brand-logo-box {
  background: var(--white); border: 1.5px solid var(--grey-200);
  width: 126px; height: 72px; display: flex; align-items: center; justify-content: center;
  padding: 8px;
}

.info-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--grey-200); background: var(--blue);
  color: var(--white); font-weight: 600; font-family: inherit; font-size: 14px;
  cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center;
}
.info-btn:hover { border-color: var(--white); background: rgba(0,0,255,0.05); }

.layer-btn {
  padding: 7px 14px; font-size: 10px; font-weight: 600;
  font-family: inherit; letter-spacing: 0.09em; text-transform: uppercase;
  cursor: pointer; background: transparent; border: none;
  color: var(--grey-400); transition: all 0.15s; white-space: nowrap;
}
.layer-btn.active { background: var(--blue); color: var(--white); }

.btn {
  font-family: inherit; font-size: 11px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 10px 20px; cursor: pointer;
  transition: all 0.15s; border: 1.5px solid transparent;
  background: none; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-outline { background: var(--white); border-color: var(--grey-200); color: var(--black); }
.btn-outline:hover { border-color: var(--black); }
.btn-blue, .btn-approve { background: var(--blue); border-color: var(--blue); color: var(--white); }
.btn-blue:hover, .btn-approve:hover { background: #0000CC; border-color: #0000CC; }
.btn-sm { padding: 6px 12px; font-size: 10px; }
.btn-reject { background: var(--white); border-color: var(--grey-200); color: var(--grey-600); }
.btn-reject:hover { border-color: #CC0000; color: #CC0000; }

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel-w);
  background: var(--white); border-left: 1.5px solid var(--grey-200);
  z-index: 1500; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel.open { transform: translateX(0); }

.panel-left {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--panel-w);
  background: var(--white); border-right: 1.5px solid var(--grey-200);
  z-index: 1500; display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel-left.open { transform: translateX(0); }

.panel-top { padding: 24px 28px 0; flex-shrink: 0; }
.panel-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-title { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

.close-btn {
  width: 30px; height: 30px; border: 1.5px solid var(--grey-200); border-radius: 50%;
  background: none; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-600); font-family: inherit; transition: all 0.15s;
}
.close-btn:hover { border-color: var(--black); color: var(--black); }

.panel-tabs { display: flex; border-bottom: 1.5px solid var(--grey-200); }
.panel-tab {
  flex: 1; padding: 12px 0;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  text-align: center; cursor: pointer; color: var(--grey-400);
  border: none; border-bottom: 2px solid transparent; background: none; font-family: inherit;
  margin-bottom: -1.5px; transition: all 0.15s;
}
.panel-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.panel-tab:hover:not(.active) { color: var(--black); }

.map-credits {
  position: absolute; bottom: 10px; right: 10px; z-index: 1000;
  background: rgba(255, 255, 255, 0.7); padding: 5px 10px;
  font-size: 10px; color: #555; border-radius: 4px; pointer-events: none; user-select: none;
}

.panel-body {
  flex: 1; overflow-y: auto; padding: 24px 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.panel-body::-webkit-scrollbar { width: 2px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--grey-200); }

.view { display: none; flex-direction: column; gap: 18px; }
.view.active { display: flex; }

.radius-search-box {
  background: var(--grey-100); padding: 15px; border-radius: 6px; border: 1px solid var(--grey-200);
  display: flex; flex-direction: column; gap: 10px;
}
.radius-inputs { display: flex; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--grey-400); }
.field-input, .search-input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--grey-200);
  font-family: inherit; font-size: 13px; color: var(--black); background: var(--white); outline: none;
  transition: border-color 0.15s; resize: none;
}
.field-input:focus, .search-input:focus { border-color: var(--blue); }
.field-input::placeholder, .search-input::placeholder { color: var(--grey-400); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.loc-wrap { position: relative; }
.loc-dropdown {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0;
  background: var(--white); border: 1.5px solid var(--grey-200);
  z-index: 9999; display: none; overflow: hidden;
}
.loc-dropdown.open { display: block; }
.loc-item { padding: 10px 12px; font-size: 12px; cursor: pointer; border-bottom: 1px solid var(--grey-200); transition: background 0.1s; }
.loc-item:last-child { border-bottom: none; }
.loc-item:hover { background: var(--grey-100); }
.loc-item-name { font-weight: 500; }
.loc-item-sub { color: var(--grey-400); font-size: 11px; margin-top: 1px; }

.loc-status {
  padding: 10px 12px; font-size: 12px; border: 1.5px solid var(--grey-200);
  color: var(--grey-600); background: var(--grey-100);
}
.loc-status.set { border-color: var(--blue); color: var(--blue); background: rgba(0,0,255,0.03); }

.sector-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.sector-chip {
  padding: 6px 11px; border: 1.5px solid var(--grey-200);
  font-size: 10px; font-weight: 600; font-family: inherit;
  text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer; background: var(--white); color: var(--black); transition: all 0.12s; user-select: none;
}
.sector-chip:hover { border-color: var(--blue); color: var(--blue); }
.sector-chip.selected { background: var(--blue); border-color: var(--blue); color: var(--white); }

.info-note {
  padding: 10px 12px; border-left: 2px solid var(--blue);
  background: rgba(0,0,255,0.03); font-size: 12px; color: var(--grey-600); line-height: 1.6;
}

.divider {
  display: flex; align-items: center; gap: 12px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--grey-400); font-weight: 600;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--grey-200); }

.pin-card {
  border: 1.5px solid var(--grey-200); padding: 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  background: var(--white);
}
.pin-card:hover { border-color: var(--blue); }
.pin-card-top { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.pin-company { font-size: 16px; font-weight: 600; }
.pin-sector-container { display: flex; flex-wrap: wrap; gap: 4px; }
.pin-sector-chip {
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--blue); padding: 3px 6px; border: 1px solid rgba(0,0,255,0.2); background: rgba(0,0,255,0.02);
}
.pin-meta { font-size: 12px; color: var(--grey-600); line-height: 1.6; display: flex; flex-direction: column; gap: 4px; }
.count-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--grey-400); }

.student-block {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--grey-200);
  display: flex; flex-direction: column; gap: 6px;
}
.student-header { font-size: 12px; font-weight: 600; color: var(--black); display: flex; align-items: center; gap: 6px; }
.student-notes { font-size: 12px; color: var(--grey-600); font-style: italic; background: var(--grey-100); padding: 10px; border-left: 2px solid var(--grey-400); }

.expanded-content { display: none; margin-top: 12px; }
.pin-card.expanded .expanded-content { display: block; }
.pin-card.expanded { border-color: var(--blue); background: #FCFCFC; }

.empty-state { text-align: center; padding: 40px 0; color: var(--grey-400); font-size: 13px; line-height: 1.7; }
.empty-icon { font-size: 28px; display: block; margin-bottom: 12px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,10,10,0.4);
  z-index: 5000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; backdrop-filter: blur(2px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border: 1.5px solid var(--grey-200);
  padding: 32px; width: min(440px, 92vw); max-height: 85vh; overflow-y: auto;
  transform: translateY(10px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: var(--grey-600); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; padding: 11px; }

.admin-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 24px; }
.admin-stat { padding: 14px; border: 1.5px solid var(--grey-200); text-align: center; }
.admin-stat-n { font-size: 22px; font-weight: 600; display: block; }
.admin-stat-n.blue { color: var(--blue); }
.admin-stat-n.amber { color: #B38600; }
.admin-stat-l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--grey-400); font-weight: 500; }
.admin-section { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--grey-400); font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--grey-200); }
.admin-card { border: 1.5px solid var(--grey-200); padding: 14px; margin-bottom: 10px; }
.admin-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.admin-card-actions .btn { flex: 1; font-size: 10px; padding: 8px; }

.maplibregl-popup-content {
  border-radius: 0 !important; border: 1.5px solid var(--grey-200) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1) !important; padding: 0 !important;
  margin: 0 !important; min-width: 280px !important; max-width: 320px !important;
  font-family: inherit;
}
.maplibregl-popup-close-button { display: none; }
.popup-body { padding: 16px 18px; max-height: 400px; overflow-y: auto; }
.popup-company { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.popup-row { font-size: 12px; color: var(--grey-600); margin-bottom: 4px; line-height: 1.4; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--black); color: var(--white);
  padding: 10px 22px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  z-index: 9999; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--blue); }
.toast.error { background: #CC0000; }

.map-hint {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%);
  background: var(--black); color: var(--white);
  padding: 8px 18px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  z-index: 1000; pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
.map-hint.visible { opacity: 1; }

.marker-icon { cursor: pointer; }

.bind-alert {
  background: #E8EAF6; border-left: 3px solid var(--blue); padding: 12px; margin-bottom: 16px; display: none;
}
.bind-alert.active { display: block; }
.bind-alert-title { font-size: 12px; font-weight: 600; color: var(--blue); margin-bottom: 4px; }
.bind-alert-text { font-size: 11px; color: var(--grey-600); }

.checkbox-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-top: 8px; }
.checkbox-wrap input { width: 16px; height: 16px; cursor: pointer; }
.checkbox-label { font-size: 12px; font-weight: 500; color: var(--black); }

@media (max-width: 768px) {
  .float-actions {
    top: auto; bottom: 85px; left: 0; right: 0; margin: 0 auto;
    width: 92vw; justify-content: center; flex-wrap: wrap;
  }
  .layer-toggle { bottom: 24px; left: 20px; }
  .map-hint { top: 110px; bottom: auto; }
  .panel, .panel-left {
    top: auto; bottom: 0; left: 0; width: 100vw; height: 60dvh;
    border-left: none; border-right: none; border-top: 1.5px solid var(--grey-200);
    transform: translateY(100%);
  }
  .panel.open, .panel-left.open { transform: translateY(0); }
}