/* =================================================
   RESET / BASE
================================================= */
* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Noto Sans KR", sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #111;
}

/* =================================================
   ADMIN LAYOUT - SIDEBAR
================================================= */

body.admin-layout {
  flex-direction: row;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  height: 100vh;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

.sidebar-logo svg {
  color: #7c7cf8;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
}

.sidebar-close:hover {
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #a0a0a0;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-item.active {
  background: rgba(124, 124, 248, 0.1);
  color: #7c7cf8;
  border-left-color: #7c7cf8;
}

.nav-item svg {
  flex-shrink: 0;
}

.nav-item-add {
  color: #7c7cf8;
}

.nav-item-add:hover {
  color: #9c9cff;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 8px;
  color: #a0a0a0;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: 260px;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #333;
  border-radius: 8px;
}

.menu-toggle:hover {
  background: #f5f5f5;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.main-content {
  flex: 1;
  overflow: hidden;
}

.main-content .content-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Mobile responsive */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-close {
    display: block;
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  .main-wrapper {
    margin-left: 0;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .topbar-search {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .topbar-search .branch-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  
  .topbar-search .search-container {
    width: 100%;
  }
  
  .topbar-search .confirm-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 12px 16px;
  }
  
  .sidebar-logo span {
    font-size: 14px;
  }
}

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

.header {
  flex-shrink: 0;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 22px;
}

.title {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 18px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* LEFT */
.branch-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.branch-label {
  font-size: 14px;
  color: #555;
}

.branch-select {
  width: 300px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

/* 기본 화살표 제거 */
.branch-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* 오른쪽 패딩 확보 */
  padding-right: 40px;

  /* 커스텀 화살표 */
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;

  /* 👉 여기서 10px 왼쪽 이동 */
  background-position: right 10px center;

  background-size: 10px 6px;
}


.confirm-btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  background: #222;
  color: #fff;
  cursor: pointer;
}

/* MENU */
.menu {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.menu-item {
  text-decoration: none;
  color: #666;
  padding: 8px 16px;
  border-radius: 6px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 500;
}

.menu-item:hover {
  background: #e9ecef;
  color: #111;
}

.menu-item.active {
  background: #222;
  color: #fff;
  border-color: #222;
  font-weight: 600;
}

.menu-item.add-new {
  background: #333;
  color: #fff;
  border-color: #333;
  font-weight: 600;
}

.menu-item.add-new:hover {
  background: #444;
  border-color: #444;
}

/* =================================================
   MAIN / IFRAME
================================================= */

.main {
  flex: 1;
  width: 100%;
  overflow: hidden;
}

.content-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* =================================================
   SHOP INFO – DESKTOP (DEFAULT)
================================================= */

.shop-info {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.shop-title {
  font-size: 28px;
  margin-bottom: 24px;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.shop-col {
  min-width: 0;
}

/* ROW STRUCTURE (DESKTOP) */
.row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  margin-bottom: 18px;
}

.label {
  font-size: 14px;
}

.label.bold {
  font-weight: 700;
}

.field {
  min-width: 0;
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =================================================
   INPUT / SELECT
================================================= */

.input {
  width: 180px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.input.wide {
  width: 220px;
  max-width: 100%;
}

.select.small {
  width: 160px;
}

.branch-select--small {
  width: 180px;
}

/* =================================================
   CHECKBOX
================================================= */

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #666;
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 24px;
}

/* =================================================
   SAVE BUTTON
================================================= */

.save-btn {
  display: block;
  margin: 20px 0 20px;
  width: 220px;
  padding: 12px 0;
  border-radius: 10px;
  border: none;
  background: #222;
  color: #fff;
  cursor: pointer;
}

/* =================================================
   MOBILE (완전 분리, 웹 침범 없음)
================================================= */

@media (max-width: 768px) {

  /* HEADER */
  .header-inner {
    padding: 20px 16px;
  }

  .title {
    font-size: 26px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .branch-area {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .branch-select,
  .confirm-btn {
    width: 300px;
  }

  .menu {
    gap: 18px;
    flex-wrap: wrap;
  }

  /* SHOP INFO */
  .shop-info {
    padding: 24px 16px 48px;
  }

  .shop-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* ROW 구조 완전 변경 (모바일 핵심) */
  .row {
    display: block;
    margin-bottom: 18px;
  }

  .label {
    margin-bottom: 6px;
    font-weight: 600;
  }

  .field {
    width: 100%;
  }

  .input,
  .input.wide,
  .select.small,
  .save-btn {
    width: 100%;
  }

  /* CHECKBOX 재배치 */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
  }

  input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }
}

/* ===== 공통 ===== */
.shop-info {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.washer-title {
  font-size: 28px;
  margin-bottom: 24px;
}

.label {
  width: 90px;
  font-weight: 500;
  flex-shrink: 0;
}

/* ===== select 공통 (지점명과 동일) ===== */
.select-box {
  width: 110px;
  padding: 8px 36px 8px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  background-color: #fff;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'>\
<path d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none' stroke-linecap='round'/>\
</svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
}

/* ===== 상단 설정 ===== */
.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 13px;
}

.washer-onoff {
  display: flex;
  gap: 24px;
}

.washer-onoff label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ===== WASHER ===== */

.washer-unit {
  margin-top: 28px;
}

.washer-unit-body {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
}

/* ===== COURSE GRID (WEB) ===== */

.course-grid {
  display: grid;
  gap: 12px;
  align-items: center;
}

.course-col-title {
  text-align: center;
  font-weight: 700;
}

.course-label {
  font-weight: 600;
  font-size: 14px;
}

.course-grid input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

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

.mobile-course-group {
  display: none;
}

@media (max-width: 768px) {

  /* 레이아웃 */
  .washer-unit-body {
    grid-template-columns: 1fr;
  }

  /* 웹용 코스 그리드 완전 숨김 */
  .course-grid {
    display: none !important;
  }

  /* 모바일 코스 그룹 */
  .mobile-course-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }


  /* 코스 카드 */
  .mobile-course {
    padding: 0;
  }

  .mobile-course-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
  }

  /* 각 입력 row */
  .mobile-course .row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
  }

  .mobile-course .label {
    font-size: 12px;
    font-weight: 600;
  }

  .mobile-course input {
    
    padding: 6px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
  }

  .washer-onoff label {
    flex-direction: row-reverse;   /* 텍스트 → 체크박스 */
    justify-content: flex-start;
    gap: 8px;
  }

  /* 세탁기 탭 */
  .washer-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0;
  }

  .washer-tabs button {
    flex: 1;
    padding: 7px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
  }

  .washer-tabs .active {
    border-color: #111;
    font-weight: 700;
  }

}


.hidden {
  display: none !important;
}

/* ===== 웹에서는 세탁기 탭 숨김 ===== */
@media (min-width: 769px) {
  .washer-tabs {
    display: none !important;
  }
}


/* =================================================
   DRYER PAGE ONLY (ADD ONLY – SAFE)
================================================= */

.dryer-head,
.dryer-row {
  display: grid;
  grid-template-columns: 90px repeat(6, minmax(110px, 1fr));
  gap: 10px;
  align-items: center;
}

.dryer-head {
  font-size: 12px;
  font-weight: 700;
  padding: 40px 0 10px 0;
  border-bottom: 1px solid #ddd;
}

.dryer-row {
  padding: 20px 0;
}

.dryer-no {
  font-weight: 700;
}

.dryer-unit.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* MOBILE – DRYER ONLY */
@media (max-width: 768px) {
  .dryer-head {
    display: none;
  }

  .dryer-row {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 12px;
  }

  .dryer-no {
    grid-column: 1 / -1;
  }
}

/* ===== DRYER MOBILE LABEL (정석) ===== */
.dryer-label {
  display: none;
}

@media (max-width: 768px) {
  .dryer-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .dryer-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
  }

  .dryer-field .select-box {
    width: 100%;
  }

  .washer-onoff {
      flex-direction: column;
      gap: 10px;
    }

}


/* =================================================
   VENDING MACHINE
================================================= */

.vending-info {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
}

.vending-table {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vending-head,
.vending-row {
  display: grid;
  grid-template-columns: 80px 80px 1fr 1fr 120px;
  gap: 10px;
  align-items: center;
}

.vending-head {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.vending-row input[type="text"],
.vending-row input[type="number"] {
  width: 95%;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.vending-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

  .vending-onoff-row {
    display : none;
  }


@media (max-width: 768px) {

  /* ===============================
     MOBILE – ON / OFF (VENDING)
  ============================== */

  /* 모바일에서만 On/Off 노출 */
  .vending-mobile-only {
    display: center;
    margin-bottom: 24px;
  }

  /* On / Off 한 줄 레이아웃 */
  .vending-onoff-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
  }

  /* 왼쪽 라벨 */
  .vending-onoff-label {
    width: 90px;
    font-weight: 500;
    flex-shrink: 0;
  }

  /* 오른쪽 Line 리스트 */
  .vending-onoff {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Line + 체크박스 한 줄 */
  .vending-onoff label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    white-space: nowrap;
    gap: 10px;
  }


  /* ===============================
     MOBILE – VENDING TABLE → CARD
  ============================== */

  /* 테이블 헤더 숨김 */
  .vending-head {
    display: none;
  }

  /* 카드 형태 */
  .vending-row {
    display: block;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #fff;
  }

  /* Line 제목 */
  .vending-row > div:first-child {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
  }

  /* 모바일에서는 카드 내부 On/Off 숨김 */
  .vending-row > div:nth-child(2) {
    display: none;
  }

  /* input 공통 */
  .vending-row input[type="text"],
  .vending-row input[type="number"] {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
  }

  /* 모바일 라벨 */
  .vending-row > div:nth-child(3)::before {
    content: "물품명(한글)";
  }

  .vending-row > div:nth-child(4)::before {
    content: "물품명(영문)";
  }

  .vending-row > div:nth-child(5)::before {
    content: "가격";
  }

  .vending-row > div:nth-child(3)::before,
  .vending-row > div:nth-child(4)::before,
  .vending-row > div:nth-child(5)::before {
    display: block;
    margin-top: 5px;
    margin-bottom: 0px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
  }

}

/* style.css 하단 추가 */

/* 검색 컨테이너 (위치 기준점) */
.search-container {
  position: relative;
  width: 300px;
}

/* 검색 인풋 스타일 */
.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

/* 자동완성 목록 박스 (평소엔 숨김) */
.suggestions-list {
  display: none; /* JS로 제어 */
  position: absolute;
  top: 100%; /* 인풋 바로 아래 */
  left: 0;
  width: 100%;
  max-height: 200px; /* 너무 길면 스크롤 */
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-top: 4px;
  padding: 0;
  list-style: none;
  z-index: 1000; /* 다른 요소보다 위에 */
}

/* 목록 아이템 */
.suggestions-list li {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
}

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

.suggestions-list li:hover {
  background-color: #f0f0f0; /* 마우스 올렸을 때 색상 */
}

/* style.css 맨 아래에 추가 */

.is-changed {
  color: #007bff !important; /* 파란색 */
  font-weight: bold !important;
}

.multi-badge {
  display: inline-block;
  background-color: #8d8a89;
  color: #ffffff;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 10px;
}
