*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:"Segoe UI","Noto Sans KR",sans-serif;
}

body{
    background:#020617;
    color:white;
    overflow:hidden;
}

/* =========================
   시작화면
========================= */

.start-screen{
    position:fixed;
    inset:0;
    display:flex;
    justify-content:center;
    align-items:center;

    background:
    radial-gradient(circle at top,#0ea5e944 0%,transparent 40%),
    linear-gradient(#020617,#0f172a);

    z-index:9999;
}

.start-card{

    width:500px;

    background:#111827;

    border:1px solid #334155;

    border-radius:24px;

    padding:45px;

    text-align:center;

    box-shadow:0 20px 60px rgba(0,0,0,.45);

}

.company{

    font-size:28px;

    font-weight:800;

    margin-bottom:15px;

}

.start-card h1{

    color:#38bdf8;

    font-size:40px;

    margin-bottom:15px;

}

.start-card p{

    color:#94a3b8;

    margin-bottom:30px;

    line-height:1.7;

}

.start-card input{

    width:100%;

    padding:15px;

    margin-bottom:15px;

    border-radius:12px;

    border:1px solid #334155;

    background:#020617;

    color:white;

    font-size:16px;

}

.start-card button{

    width:100%;

    padding:15px;

    border:none;

    border-radius:12px;

    background:#0284c7;

    color:white;

    cursor:pointer;

    font-size:16px;

    font-weight:bold;

    transition:.25s;

}

.start-card button:hover{

    background:#0369a1;

}

/* =========================
   Header
========================= */

header{

    height:70px;

    background:#111827;

    border-bottom:1px solid #334155;

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 25px;

}

.logo{

    font-size:22px;

    font-weight:800;

}

.logo span{

    color:#38bdf8;

}

.header-right{

    display:flex;

    gap:10px;

}

.header-right input{

    width:270px;

    padding:10px;

    border-radius:10px;

    border:1px solid #334155;

    background:#020617;

    color:white;

}

.header-right button{

    padding:10px 18px;

    border:none;

    border-radius:10px;

    cursor:pointer;

    background:#334155;

    color:white;

    font-weight:bold;

}

.header-right button:hover{

    background:#0284c7;

}

/* =========================
   Layout
========================= */

.layout{

    display:grid;

    grid-template-columns:260px 1fr 360px;

    height:calc(100vh - 70px);

}

aside{

    background:#111827;

    border-right:1px solid #334155;

    overflow:auto;

    padding:18px;

}

main{

    background:black;

}

#panorama{

    width:100%;

    height:100%;

}

.info{

    background:#111827;

    border-left:1px solid #334155;

    overflow:auto;

    padding:20px;

}

/* =========================
   Card
========================= */

.card{

    background:#1e293b;

    border-radius:16px;

    padding:18px;

    margin-bottom:15px;

    border:1px solid #334155;

}


.area-title{
    display:block;
    margin:18px 0 10px;
    color:#38bdf8;
    font-weight:900;
    font-size:16px;
    cursor:pointer;
    user-select:none;
}

.floor-group{
    display:none;
    margin-bottom:18px;
}

.floor-group.open{
    display:block;
}

.floor-btn{
    display:block;
    width:100%;
    padding:13px 14px;
    margin-bottom:8px;
    background:#1e293b;
    border:1px solid #334155;
    color:white;
    border-radius:12px;
    cursor:pointer;
    text-align:left;
    font-weight:700;
}

.floor-btn:hover{
    background:#334155;
}

.floor-btn.active{
    background:#0284c7;
    border-color:#38bdf8;
}

.custom-hotspot {
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.hotspot-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 12px rgba(0,0,0,.7);
}

/* ===========================
   TAG COLOR
=========================== */

.hotspot-major .hotspot-dot {
  background: #E53935;
  border-color: #C62828;
}

.hotspot-pump .hotspot-dot {
  background: #FB8C00;
  border-color: #EF6C00;
}

.hotspot-valve .hotspot-dot {
  background: #FDD835;
  border-color: #F9A825;
}

.hotspot-motor .hotspot-dot {
  background: #8E24AA;
  border-color: #6A1B9A;
}

.hotspot-fan .hotspot-dot {
  background: #F57C00;
  border-color: #E65100;
}

.hotspot-damper .hotspot-dot {
  background: #FFF176;
  border-color: #FBC02D;
}

.hotspot-instrument .hotspot-dot {
  background: #43A047;
  border-color: #2E7D32;
}

.hotspot-breaker .hotspot-dot {
  background: #1E88E5;
  border-color: #1565C0;
}


@keyframes searchBlink {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.9); opacity: 0.25; }
  100% { transform: scale(1); opacity: 1; }
}

.home-screen{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background-image:
    linear-gradient(rgba(2,6,23,.45), rgba(2,6,23,.78)),
    url("/images/plant_main.jpg");
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}

.home-card{
  text-align:center;
  padding:50px;
  border:1px solid #334155;
  border-radius:24px;
  background:rgba(17,24,39,.92);
  box-shadow:0 0 45px rgba(56,189,248,.18);
}

.home-card h1{
  font-size:36px;
}

.home-card h2{
  color:#38bdf8;
  font-size:42px;
  margin:12px 0;
}

.home-card p{
  color:#94a3b8;
  line-height:1.8;
}


.tag-form h3 {
  margin-bottom: 15px;
  color: #38bdf8;
}

.tag-form label {
  display: block;
  margin: 12px 0 6px;
  color: #cbd5e1;
  font-weight: bold;
  font-size: 14px;
}

.tag-form input,
.tag-form select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: white;
}

.save-btn {
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #0284c7;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.cancel-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #475569;
  color: white;
  font-weight: bold;
  cursor: pointer;
}
.admin-btn{
    background:#334155;
    color:white;
    border:1px solid #475569;
    border-radius:10px;
    padding:10px 16px;
    font-weight:700;
    cursor:pointer;
    transition:all .25s ease;
}

.admin-btn.on{
    background:#16a34a;
    border:1px solid #22c55e;
    color:white;
    box-shadow:0 0 15px rgba(34,197,94,.45);
}

/* 관리자 모드 */

.admin-mode #panorama{
    outline:4px solid #22c55e;
    outline-offset:-4px;
    transition:.25s;

    cursor:crosshair;
}

.admin-badge{

    background:#16a34a;
    color:white;

    padding:8px 14px;

    border-radius:999px;

    margin-left:15px;

    font-size:13px;

    font-weight:bold;

    box-shadow:0 0 18px rgba(34,197,94,.45);

}

.admin-guide{

position:absolute;

bottom:20px;

left:50%;

transform:translateX(-50%);

background:rgba(22,163,74,.95);

color:white;

padding:12px 22px;

border-radius:30px;

font-weight:bold;

box-shadow:0 0 20px rgba(34,197,94,.5);

}

.temp-hotspot .hotspot-dot{
  background:#fb923c !important;
  border:3px solid white;
  animation: tempPulse .8s infinite;
  box-shadow:0 0 25px #fb923c;
}

@keyframes tempPulse{
  0%{ transform:scale(1); opacity:1; }
  50%{ transform:scale(1.5); opacity:.45; }
  100%{ transform:scale(1); opacity:1; }
}
.search-card{
  background:linear-gradient(180deg,#1e293b,#111827);
  border:1px solid #334155;
  border-radius:18px;
  padding:18px;
}

.search-card h3{
  color:#38bdf8;
  margin-bottom:16px;
  font-size:20px;
}

.search-card label{
  display:block;
  margin:12px 0 7px;
  color:#cbd5e1;
  font-size:13px;
  font-weight:800;
}

.search-card input,
.search-card select{
  width:100%;
  height:42px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid #334155;
  background:#020617;
  color:white;
  margin-bottom:8px;
  font-weight:600;
}

.search-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:12px;
}

.search-btn,
.filter-btn,
.reset-filter-btn{
  height:42px;
  border:none;
  border-radius:10px;
  color:white;
  font-weight:800;
  cursor:pointer;
}

.search-btn{
  background:#0284c7;
}

.filter-btn{
  background:#0f766e;
}

.reset-filter-btn{
  width:100%;
  margin-top:8px;
  background:#475569;
}
.admin-help{
  color:#94a3b8;
  font-size:13px;
  margin-right:10px;
  white-space:nowrap;
}

.admin-help{
  color:#94a3b8;
  font-size:13px;
  white-space:nowrap;
}

.hotspot-search .hotspot-dot {
  animation: searchBlink 0.45s ease-in-out infinite;
  box-shadow: 0 0 28px #38bdf8;
  border-color: #38bdf8;
}

.selected-tag-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.selected-label {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.selected-tag-no {
  color: #38bdf8;
  font-size: 22px;
  font-weight: 900;
}
.pid-link.active {
  color: #38bdf8;
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
}

.pid-link.active:hover {
  color: #7dd3fc;
}
.pid-link.active,
#pidText.active {
  color: #38bdf8;
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
}

.pid-link.active:hover,
#pidText.active:hover {
  color: #7dd3fc;
}

.temp-roadview-link .roadview-arrow {
  background: #22c55e;
  box-shadow: 0 0 25px rgba(34,197,94,.9);
}

/* =========================
   ROADVIEW 개선
========================= */

.roadview-link {
  width: 60px;
  height: 60px;
  cursor: pointer;
  text-align: center;
}

.roadview-arrow {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(56,189,248,.9);
  transition: transform .2s ease, background .2s ease;
}

.roadview-link:hover .roadview-arrow {
  transform: scale(1.12);
  background: #38bdf8;
  color: white;
}

.temp-roadview-link .roadview-arrow {
  background: #22c55e;
  color: white;
  box-shadow: 0 0 25px rgba(34,197,94,.95);
}

.moving-roadview #panorama {
  opacity: 0.25;
  transform: scale(1.03);
}

#panorama {
  transition: all 0.45s ease;
}

.delete-ready .roadview-arrow {
  background: #dc2626 !important;
  color: white !important;
  box-shadow: 0 0 25px rgba(220,38,38,.95);
}
main {
  position: relative;
}

.roadview-direction-panel {
  position: absolute;
  right: 25px;
  bottom: 25px;
  width: 230px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #38bdf8;
  border-radius: 18px;
  padding: 16px;
  z-index: 50;
  box-shadow: 0 0 25px rgba(56,189,248,.35);
}

.direction-title {
  text-align: center;
  font-weight: 900;
  color: #38bdf8;
  margin-bottom: 12px;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.direction-grid button {
  height: 52px;
  border: none;
  border-radius: 12px;
  background: #334155;
  color: white;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.direction-grid button:hover {
  background: #0284c7;
}

.direction-grid button:disabled {
  background: transparent;
  cursor: default;
}

.move-ready .roadview-arrow {
  background: #f59e0b !important;
  color: white !important;
  box-shadow: 0 0 25px rgba(245,158,11,.95);
}

.roadview-arrow-icon {
  display: inline-block;
  line-height: 1;
}
.roadview-link {
  width: 64px;
  height: 64px;
  cursor: pointer;
}

.roadview-move-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.9);
  border: 4px solid white;
  box-shadow: 0 0 18px rgba(56,189,248,.95);
  animation: roadviewPulse 1.4s ease-in-out infinite;
}

@keyframes roadviewPulse {
  0% {
    transform: scale(0.85);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    opacity: 0.65;
  }
}

.delete-ready .roadview-move-dot {
  background: #dc2626 !important;
  box-shadow: 0 0 25px rgba(220,38,38,.95);
}

.move-ready .roadview-move-dot {
  background: #f59e0b !important;
  box-shadow: 0 0 25px rgba(245,158,11,.95);
}

.existing-node-picker h3 {
  color: #38bdf8;
  margin-bottom: 8px;
}

.existing-node-picker p {
  color: #cbd5e1;
  font-size: 13px;
  margin-bottom: 12px;
}

.existing-node-picker button {
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: #334155;
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.existing-node-picker button:hover {
  background: #0284c7;
}

.existing-node-picker .cancel-node-picker {
  background: #7f1d1d;
}

.existing-node-picker {
  position: fixed;
  right: 390px;
  top: 90px;
  width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid #38bdf8;
  border-radius: 16px;
  padding: 16px;
  z-index: 9999;
  box-shadow: 0 0 30px rgba(56,189,248,.35);
}

.existing-node-picker h3 {
  color: #38bdf8;
  margin-bottom: 8px;
}

.existing-node-picker p {
  color: #cbd5e1;
  font-size: 13px;
  margin-bottom: 12px;
}

.node-preview-card {
  width: 100%;
  margin-bottom: 12px;
  padding: 8px;
  border: none;
  border-radius: 12px;
  background: #334155;
  color: white;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.node-preview-card:hover {
  background: #0284c7;
}

.node-preview-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin-bottom: 6px;
}

.node-preview-card span {
  display: block;
  text-align: center;
}

.cancel-node-picker {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #7f1d1d;
  color: white;
  cursor: pointer;
  font-weight: 800;
}

/* 설비 TAG 은은한 존재감 */
.custom-hotspot:not(.temp-hotspot):not(.hotspot-search) .hotspot-dot {
  animation: tagBreath 2.6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes tagBreath {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.12);
    filter: brightness(1.25);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.hidden {
  display: none !important;
}

/* =========================
   RIGHT ACTION MENU - MODERN
========================= */

.info .card:last-of-type {
  background: linear-gradient(180deg, #111827, #0f172a);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  padding: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 18px 40px rgba(0,0,0,.28);
}

.doc-btn {
  position: relative;
  width: 100%;
  height: 48px;
  margin-bottom: 10px;
  padding: 0 18px;

  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;

  background: linear-gradient(180deg, #334155, #273449);
  color: #e5e7eb;

  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;

  cursor: pointer;
  transition: all .18s ease;
}

.doc-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.45);
  background: linear-gradient(180deg, #3b4b63, #2f3f56);
  box-shadow: 0 8px 20px rgba(56,189,248,.12);
}

.doc-btn:active {
  transform: translateY(0);
}

#adminActionPanel {
  margin-top: 14px;
}

.admin-section {
  margin-top: 14px;
  overflow: hidden;

  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 12px 26px rgba(0,0,0,.22);
}

.admin-section[open] {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow:
    inset 4px 0 0 #38bdf8,
    0 16px 30px rgba(0,0,0,.28);
}

.admin-section summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  user-select: none;

  padding: 15px 46px 15px 18px;

  color: #60a5fa;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.admin-section summary::-webkit-details-marker {
  display: none;
}

.admin-section summary::after {
  content: "⌄";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #cbd5e1;
  font-size: 22px;
  transition: transform .2s ease;
}

.admin-section[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.admin-section summary:hover {
  background: rgba(30, 41, 59, 0.72);
}

.admin-section .doc-btn {
  height: 50px;
  margin: 0;
  border-radius: 0;

  background: rgba(30, 41, 59, 0.72);
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-top: 1px solid rgba(148, 163, 184, 0.12);

  box-shadow: none;
}

.admin-section .doc-btn:first-of-type {
  border-top: 1px solid rgba(56, 189, 248, 0.18);
}

.admin-section .doc-btn:last-of-type {
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

.admin-section .doc-btn:hover {
  transform: none;
  background: rgba(51, 65, 85, 0.92);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #38bdf8;
}

.node-picker-close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 30px !important;
  height: 30px;
  padding: 0 !important;
  margin: 0 !important;

  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 50% !important;

  background: rgba(15, 23, 42, 0.9) !important;
  color: #cbd5e1 !important;

  font-size: 20px;
  font-weight: 800;
  line-height: 26px;
  cursor: pointer;
}

.node-picker-close:hover {
  background: #dc2626 !important;
  color: white !important;
}

.search-result-panel {
  position: fixed;
  right: 390px;
  top: 90px;
  width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 20px;
  padding: 18px;
  z-index: 9999;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

.search-result-panel h3 {
  color: #38bdf8;
  margin-bottom: 8px;
}

.search-result-panel p {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 14px;
}

.search-result-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
}

.search-result-close:hover {
  background: #dc2626;
  color: white;
}

.search-result-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 13px 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, #1e293b, #111827);
  color: white;
  cursor: pointer;
}

.search-result-item:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: #334155;
}

.search-result-item strong {
  display: block;
  color: #38bdf8;
  font-size: 15px;
  margin-bottom: 4px;
}

.search-result-item span {
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.search-result-item small {
  color: #94a3b8;
  font-size: 12px;
}

.tag-label-toggle {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #38bdf8;
  border-radius: 999px;
  padding: 9px 16px;
  color: white;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(56,189,248,.25);
}

.tag-label-toggle input {
  margin-right: 6px;
}

.hotspot-label {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  white-space: nowrap;

  background: none;
  border: none;
  padding: 0;

  color: white;
  font-size: 12px;
  font-weight: 900;

  text-shadow:
    0 0 4px black,
    0 0 8px black,
    0 0 12px black;

  pointer-events: none;
}

.hide-tag-label .hotspot-label {
  display: none;
}