/* ===========================
   layout.css
   Layout / Sidebar / Header / Tabs
=========================== */

/* Layout Wrapper */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ===========================
   TOP NAV (Title 영역)
=========================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 999;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 프로그램 타이틀 */
.logo {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;  /* ✔ 선명한 진남색 */
  letter-spacing: -0.3px;
}

/* ===========================
   SIDEBAR
=========================== */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: #111827;
  color: #ffffff;
  flex-shrink: 0;
  padding-top: 52px; /* top-nav 공간 */
  height: 100vh;
  overflow-y: auto;
}

.menu {
  display: flex;
  flex-direction: column;
}

.menu-item {
  padding: 14px 20px;
  font-size: 15px;
  color: #cbd5e1;
  text-decoration: none;
  transition: 0.15s;
}

.menu-item:hover {
  background: #1e40af;
  color: #ffffff;
}

/* ✔ 클릭 시 파란색 */
.menu-item.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

/* ===========================
   CONTENT
=========================== */
.content {
  flex: 1;
  padding: 76px 32px 32px 32px; /* top-nav + spacing */
}

/* ===========================
   GRID COMMON
=========================== */
.dashboard-grid,
.right-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media(max-width: 768px) {
  .dashboard-grid,
  .right-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   TAB NAV (이사회·예산결산·국세청·기안 결재)
=========================== */
.tab-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.tab-item {
  padding: 10px 16px;
  font-size: 14px;
  background: #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
}

.tab-item.active {
  background: #2563eb;
  color: #fff;
}

/* ===========================
  회사정보 메인화면
=========================== */
.company-layout {
  display: grid;
  grid-template-columns: 0.7fr 2.3fr;
  gap: 32px;
}
.form-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 32px;
  background-color: #ffffff;
}


/* LEFT BIG CARD */
.company-base {
 min-height: auto;
}

/* RIGHT 2×2 GRID */
.company-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* 카드 내부 우측 상단 +추가 버튼 */
.card {
  position: relative;
  padding-bottom: 56px; /* 하단 영역 확보 */
}

/* 섹션 헤더 항목 (제목 + 추가버튼) */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.card .save-btn.small {
  position: absolute;
  bottom: 10px;
  right: 12px;
  z-index: 1;
}
/* ADD 버튼은 항상 위 */
.card .add-btn.small {
  z-index: 2;
}
/* 공통 Add 버튼 */
.btn-add {
  padding: 6px 14px;
  border: 1px solid #2563eb;
  background-color: #2563eb;
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
}
.btn-add:hover {
  background-color: #1e40af;
}

/* 리스트 영역 아래 padding */
.card-list {
  padding-bottom: 40px;
}

/* 버튼 기본 스타일 (작게) */
.add-btn {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
}
.row {
  border-bottom: 1px solid #eee;
  padding: 8px 4px;
}

.card {
  border: 1px solid #e3e3e3;
  border-radius: 10px;
}
.card-list .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 4px;
}


/* ===========================
   MOBILE BUTTON
=========================== */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
}

/* Responsive Sidebar */
@media(max-width: 992px) {
  .sidebar {
    position: fixed;
    transform: translateX(-240px);
    transition: 0.25s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: block;
  }
  .content {
    padding: 76px 24px;
  }
}
/* ========= 카드 공통 레이아웃 ========= */
.card {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 300px;
  background: #fff;
}

/* header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 2px solid #334155;
}

/* 제목 */
.card-header h3 {
  font-size: 16px;
  margin: 0;
}

/* 버튼 */
.card-actions {
  display: flex;
  gap: 6px;
}

.card-actions .text-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

/* 리스트 영역만 스크롤 */
.card-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

/* 행 스타일 */
.row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 1fr 1fr;
  border-bottom: 1px solid #e2e8f0;
  padding: 6px 4px;
  font-size: 13px;
}

/* header 행 */
.row-header {
  font-weight: 600;
  background: #f8fafc;
  border-bottom: 2px solid #cbd5e1;
}

/* hover 느낌 */
.card-list .row:hover {
  background: #f1f5f9;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 2px solid #334155;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.text-btn {
  padding: 6px 12px;
  font-size: 13px;
  background: #2563eb;
  border: 1px solid #2563eb;
  color:#fff;
  border-radius: 4px;
  cursor: pointer;
}

.company-base input,
.company-base textarea,
.company-base select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  box-sizing: border-box;
}

.company-base .save-btn {
  margin-top: 20px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 13px;
}

.company-base .save-btn:hover {
  background-color: #1e40af;
}
/* 기관정보 카드 */
.company-base {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 20px;
  background: #ffffff;
  width: 420px;       /* 고정폭 */
  box-sizing: border-box;
}

/* form 구조 */
.company-base .form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.company-base label {
  margin-bottom: 6px;
  color: #334155;
  font-size: 14px;
}

/* 입력창 테두리 (#cbd5e1) */
.company-base input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.company-base input:focus {
  border-color: #2563eb;
}

/* 저장 버튼(하단 왼쪽) */
.base-save-btn {
  margin-top: 5px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
}

.base-save-btn:hover {
  background-color: #1e40af;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 30;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.3);
}

.modal-content {
  background: white;
  padding: 25px 30px;
  border-radius: 10px;
  width: 260px;
  text-align: center;
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0px 3px 14px rgba(0,0,0,0.2);
}

.modal-btn {
  margin-top: 12px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 7px 18px;
  cursor: pointer;
}
.modal-btn:hover {
  background: #1e40af;
}
.base-save-btn {
  margin-top: 5px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
}
.base-save-btn:hover {
  background-color: #1e40af;
}
.text-btn {
  background: #2563eb !important;
  border: 1px solid #2563eb !important;
  color: #fff !important;
}
/* 전체 레이아웃 구성 */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;   /* 전체 스크롤 제거 */
}

/* 왼쪽 메뉴 */
.sidebar {
  flex: 0 0 240px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;   /* 메뉴만 스크롤(필요 시) */
}

/* 오른쪽 화면 전체 */
.content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 상단 탭 + 버튼 포함 영역 */
.page-header {
  padding: 20px 32px 0;
}

/* 실제 내용 스크롤 */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}
/* ===== 오른쪽 화면만 스크롤 ===== */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  position: fixed;
  top: 52px; /* 상단 nav 높이 */
  bottom: 0;
  left: 0;
  overflow-y: auto;
}

.content {
  margin-left: 240px;
  margin-top: 52px; /* 상단 nav 높이 */
  height: calc(100vh - 52px);
  overflow-y: auto; /* ← 오른쪽만 스크롤 */
  padding: 32px;
  background: #ffffff;
}

/* ===== 탭 + 버튼 한 줄 라인 ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.tab-nav {
  display: flex;
  gap: 8px;
}

.tab-item {
  padding: 6px 14px;
  background: #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #1e293b;
}

.tab-item.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.top-buttons {
  display: flex;
  gap: 8px;
}

.top-buttons button {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
}

