*{box-sizing:border-box}

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Noto Sans KR","Pretendard",Arial,sans-serif;
  background:#f5efe6;
  color:#241812;
}

.wrap{
  max-width:1400px;
  margin:0 auto;
  padding:24px;
}

.header{
  background:linear-gradient(135deg,#3a2517,#8b5b2b);
  color:#fff;
  padding:30px;
  border-radius:24px;
  margin-bottom:20px;
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:center;
}

.header h1{
  margin:0 0 8px;
  font-size:32px;
}

.header p{
  margin:0;
  opacity:.85;
}

.print-btn,
.main-btn,
.toolbar button{
  border:0;
  border-radius:14px;
  padding:14px 20px;
  font-weight:800;
  cursor:pointer;
  background:#6b3f22;
  color:#fff;
}

.print-btn{
  background:#fff;
  color:#3a2517;
}

.tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.tab{
  border:1px solid #d8c5ad;
  background:#fffaf2;
  color:#3a2517;
  padding:14px 20px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
}

.tab.active{
  background:#3a2517;
  color:#fff;
}

.panel{
  display:none;
  background:#fffaf2;
  border:1px solid rgba(70,45,25,.14);
  border-radius:24px;
  padding:26px;
  box-shadow:0 14px 34px rgba(60,35,20,.08);
}

.panel.active{
  display:block;
}

.panel h2{
  margin:0 0 22px;
  font-size:26px;
}

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

.form-grid label{
  display:flex;
  flex-direction:column;
  gap:8px;
  font-weight:800;
}

.form-grid .wide{
  grid-column:1 / -1;
}

input,
select{
  width:100%;
  height:48px;
  border:1px solid #d8c5ad;
  border-radius:14px;
  padding:0 14px;
  font-size:16px;
  background:#fff;
}

.day-checks{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
  margin-top:8px;
}

.day-checks label{
  display:flex;
  align-items:center;
  justify-content:center;
  height:44px;
  border:1px solid #d8c5ad;
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  font-weight:700;
}

.day-checks input{
  display:none;
}

.day-checks label:has(input:checked){
  background:#ffe08a;
  border-color:#d6a700;
}

.main-btn{
  margin-top:20px;
}

.toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.toolbar input,
.toolbar select{
  width:220px;
}

.toolbar .save{
  background:#14532d;
}

.legend{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:14px 0 18px;
  padding:14px;
  background:#fff;
  border:1px solid #eadcc9;
  border-radius:16px;
  font-weight:700;
}

.legend span{
  display:flex;
  align-items:center;
  gap:6px;
}

.legend b{
  display:inline-block;
  width:18px;
  height:18px;
  border-radius:5px;
  border:1px solid #bbb;
}

.work{background:#fff}
.request-off{background:#ffe08a}
.admin-off{background:#bde7ff}
.confirmed-off{background:#ffb4b4}
.annual{background:#c8f7c5}
.excluded-work{
  background:#ffe9a8;
}

.summary{
  margin:16px 0;
  padding:16px;
  background:#fff;
  border:1px solid #eadcc9;
  border-radius:16px;
  line-height:1.7;
}

.table-scroll{
  overflow:auto;
  border:1px solid #d8c5ad;
  border-radius:18px;
  background:#fff;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:1200px;
}

th,
td{
  border:1px solid #eadcc9;
  padding:8px;
  text-align:center;
  font-size:14px;
  white-space:nowrap;
}

th{
  background:#3a2517;
  color:#fff;
  position:sticky;
  top:0;
  z-index:1;
}

td.name-cell{
  position:sticky;
  left:0;
  background:#fffaf2;
  font-weight:900;
  z-index:2;
}

th.name-head{
  position:sticky;
  left:0;
  z-index:3;
}

.schedule-cell{
  cursor:pointer;
  min-width:58px;
  height:42px;
  font-weight:800;
}

.schedule-cell.work{
  background:#fff;
}

.schedule-cell.request-off{
  background:#ffe08a;
}

.schedule-cell.admin-off{
  background:#bde7ff;
}

.schedule-cell.confirmed-off{
  background:#ffb4b4;
}

.schedule-cell.annual{
  background:#c8f7c5;
}

.schedule-cell.excluded-work{
  background:#ffe9a8;
}

.result-box{
  margin-top:20px;
  background:#fff;
  border:1px solid #eadcc9;
  border-radius:18px;
  padding:20px;
  line-height:1.9;
}

.staff-list{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}

.staff-card{
  background:#fff;
  border:1px solid #eadcc9;
  border-radius:16px;
  padding:16px;
}

.staff-card strong{
  display:block;
  font-size:18px;
  margin-bottom:6px;
}

@media(max-width:800px){
  .header{
    flex-direction:column;
    align-items:flex-start;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .day-checks{
    grid-template-columns:repeat(4,1fr);
  }

  .staff-list{
    grid-template-columns:1fr;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button{
    width:100%;
  }
}

@media print{
  body{
    background:#fff;
  }

  .tabs,
  .toolbar,
  .print-btn,
  .main-btn,
  #off,
  #view,
  #staff{
    display:none !important;
  }

  .wrap{
    max-width:none;
    padding:0;
  }

  .panel{
    box-shadow:none;
    border:0;
  }

  #admin{
    display:block !important;
  }
}
.off-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid #eadcc9;
}

.off-item:last-child{
  border-bottom:0;
}

.status{
  margin-left:8px;
  color:#8b5b2b;
  font-weight:900;
}

.off-actions{
  display:flex;
  gap:8px;
}

.off-actions button{
  border:0;
  border-radius:10px;
  padding:8px 12px;
  background:#14532d;
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

.off-actions button.reject{
  background:#991b1b;
}
@media print {

  @page{
    size:A4 landscape;
    margin:4mm;
  }

  body{
    background:#fff !important;
    zoom:0.62;
  }

  .header,
  .tabs,
  .toolbar,
  .legend,
  #offRequestSummary,
  .print-btn,
  button,
  #off,
  #view,
  #staff,
  #admin h2{
    display:none !important;
  }

  .wrap{
    width:100% !important;
    max-width:none !important;
    padding:0 !important;
    margin:0 !important;
  }

  #admin{
    display:block !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    box-shadow:none !important;
    background:#fff !important;
  }

  .table-scroll{
    overflow:visible !important;
    border:0 !important;
  }

  table{
    width:100% !important;
    min-width:0 !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
  }

  th,
  td{
    font-size:8px !important;
    padding:0 !important;
    height:17px !important;
    line-height:1 !important;
    text-align:center !important;
    border:1px solid #999 !important;
  }

  th{
    background:#fff !important;
    color:#000 !important;
    font-weight:700 !important;
  }

  td.name-cell,
  th.name-head{
    width:42px !important;
    min-width:42px !important;
    max-width:42px !important;
    background:#fff !important;
    color:#000 !important;
    font-weight:700 !important;
    position:static !important;
  }

  .schedule-cell{
    width:22px !important;
    min-width:22px !important;
    max-width:22px !important;
  }

  .schedule-cell.request-off,
  .schedule-cell.admin-off,
  .schedule-cell.confirmed-off,
  .schedule-cell.annual{
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
}
.schedule-toolbar{
  display:grid;
  grid-template-columns:220px 210px 240px 180px 230px;
  align-items:center;
  gap:12px;
}

.schedule-toolbar button{
  white-space:nowrap;
}

.pattern-btn{
  background:#8b5b2b !important;
}

.load-btn{
  background:#5b4636 !important;
}

@media(max-width:900px){
  .schedule-toolbar{
    grid-template-columns:1fr;
  }
}
#printScheduleArea{
  display:none;
}

 @media print {

  @page{
    size:A4 landscape;
    margin:6mm;
  }

  *{
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body{
  background:#fff !important;
  display:flex !important;
  justify-content:center !important;
  align-items:flex-start !important;
  zoom:0.84 !important;
}

  .wrap{
    display:none !important;
  }

  #printScheduleArea{
  display:block !important;
  width:96% !important;
  margin:0 auto !important;
}

  .print-header{
    text-align:center;
    margin-bottom:8px;
    border-bottom:2px solid #333;
    padding-bottom:8px;
  }

  .print-header h1{
    margin:0;
    font-size:28px;
    font-weight:900;
    letter-spacing:1px;
  }

  .print-header h2{
    margin:6px 0 0;
    font-size:18px;
    font-weight:900;
    letter-spacing:3px;
  }

  .print-schedule-table{
    width:100% !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
    margin-bottom:10px !important;
  }

  .print-schedule-table th,
  .print-schedule-table td{
    border:1px solid #888 !important;
    text-align:center !important;
    height:24px !important;
    padding:0 !important;
    font-size:12px !important;
    line-height:1.1 !important;
    font-weight:800 !important;
  }

  .print-schedule-table th{
    background:#f8f8f8 !important;
    color:#000 !important;
  }

  .print-schedule-table .name{
    width:82px !important;
    background:#fff3c4 !important;
    font-weight:900 !important;
  }

  .print-schedule-table .saturday{
    background:#d9ecff !important;
    color:#004080 !important;
  }

  .print-schedule-table .sunday{
    background:#ffe0e0 !important;
    color:#b00000 !important;
  }

  .print-schedule-table .schedule-cell.request-off{
    background:#ffe08a !important;
    color:#000 !important;
  }

  .print-schedule-table .schedule-cell.admin-off{
    background:#bde7ff !important;
    color:#000 !important;
  }

  .print-schedule-table .schedule-cell.confirmed-off{
    background:#ffb4b4 !important;
    color:#000 !important;
  }

  .print-schedule-table .schedule-cell.annual{
    background:#c8f7c5 !important;
    color:#000 !important;
  }

  .print-schedule-table .schedule-cell.excluded-work{
    background:#ffe9a8 !important;
    color:#000 !important;
}

  .print-schedule-table .available-row td{
    background:#eef4ff !important;
    font-weight:900 !important;
  }

  .print-legend{
    display:flex !important;
    justify-content:center !important;
    gap:28px !important;
    margin-top:14px !important;
    font-size:13px !important;
    font-weight:800 !important;
  }

  .print-legend span{
    display:flex !important;
    align-items:center !important;
    gap:6px !important;
  }

  .print-legend b{
    width:20px !important;
    height:20px !important;
    display:inline-block !important;
    border:1px solid #aaa !important;
  }

  .legend-request{background:#ffe08a !important;}
  .legend-admin{background:#bde7ff !important;}
  .legend-confirmed{background:#ffb4b4 !important;}
  .legend-annual{background:#c8f7c5 !important;}
  .legend-excluded{background:#ffe9a8 !important;}
  .legend-saturday{background:#d9ecff !important;}
  .legend-sunday{background:#ffe0e0 !important;}

  .print-note{
    margin-top:10px !important;
    text-align:left !important;
    font-size:12px !important;
    font-weight:700 !important;
  }
}
.work-status{
    display:none;
    margin:12px 0;
    padding:14px 18px;
    border-radius:14px;
    background:#fff4d6;
    color:#5b3518;
    font-weight:900;
    text-align:center;
    border:1px solid #e1c48a;
}

.work-status.show{
    display:block;
}

.hidden{
    display:none !important;
}

.processing{
  opacity:.55;
  cursor:wait;
}
.tabs .tab-btn{
  border:1px solid #d9c7ad;
  border-radius:999px;
  padding:14px 24px;
  background:#fffaf2;
  color:#24170f;
  font-size:15px;
  font-weight:900;
  cursor:pointer;
}

.tabs .tab-btn:hover{
  background:#f1e5d5;
}
.delete-btn{
  margin-top:12px;
  padding:10px 14px;
  border:0;
  border-radius:12px;
  background:#b91c1c;
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.restore-btn{
  margin-top:12px;
  padding:10px 14px;
  border:0;
  border-radius:12px;
  background:#166534;
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
/* 월간 근무표를 말일까지 한 화면에 표시 */
.table-scroll {
  width: 100%;
  overflow-x: hidden !important;
}

#scheduleTable {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

#scheduleTable th,
#scheduleTable td {
  min-width: 0 !important;
  width: auto !important;
  padding: 6px 2px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

#scheduleTable th:first-child,
#scheduleTable td:first-child {
  width: 70px !important;
  min-width: 70px !important;
  font-size: 13px;
  font-weight: 900;
}

#scheduleTable select,
#scheduleTable input {
  width: 100%;
  font-size: 11px;
  padding: 2px;
}

.kakao-btn{
  background:#2f6b3b;
  color:#fff;
  border:none;
  font-weight:800;
}

.kakao-btn:hover{
  background:#24572f;
}
/* =========================================
   월간 근무표 카톡용 이미지 미리보기
========================================= */

.kakao-monthly-modal-bg{
  display:none;
  position:fixed;
  inset:0;
  z-index:99999;
  padding:24px;
  background:rgba(0,0,0,.68);
  align-items:center;
  justify-content:center;
}

.kakao-monthly-modal-bg.show{
  display:flex;
}

.kakao-monthly-modal{
  display:flex;
  flex-direction:column;
  width:min(1500px, 96vw);
  max-height:94vh;
  overflow:hidden;
  background:#fff;
  border-radius:22px;
  box-shadow:0 22px 70px rgba(0,0,0,.35);
}

.kakao-monthly-modal-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  padding:20px 24px;
  border-bottom:1px solid #e8dfd3;
}

.kakao-monthly-modal-header strong{
  display:block;
  font-size:22px;
  color:#2d1a0d;
}

.kakao-monthly-modal-header p{
  margin:6px 0 0;
  color:#74665b;
  font-size:14px;
}

.kakao-monthly-close{
  flex:0 0 auto;
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:#f1ece5;
  color:#382414;
  font-size:20px;
  font-weight:900;
  cursor:pointer;
}

.kakao-monthly-preview{
  flex:1;
  overflow:auto;
  padding:20px;
  background:#eee9e2;
  text-align:center;
}

.kakao-monthly-preview img{
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  margin:0 auto;
  background:#fff;
  border-radius:8px;
  box-shadow:0 4px 18px rgba(0,0,0,.15);
}

.kakao-monthly-actions{
  display:flex;
  justify-content:center;
  gap:12px;
  padding:16px 20px;
  border-top:1px solid #e8dfd3;
  background:#fff;
}

.kakao-monthly-actions button{
  min-width:150px;
  padding:14px 22px;
  border:0;
  border-radius:12px;
  font-size:15px;
  font-weight:900;
  cursor:pointer;
}

.kakao-copy-btn{
  background:#2f6b3b;
  color:#fff;
}

.kakao-download-btn{
  background:#724823;
  color:#fff;
}

.kakao-cancel-btn{
  background:#eee8df;
  color:#3c2b1d;
}

@media(max-width:700px){

  .kakao-monthly-modal-bg{
    padding:8px;
  }

  .kakao-monthly-modal{
    width:100%;
    max-height:97vh;
    border-radius:14px;
  }

  .kakao-monthly-actions{
    flex-wrap:wrap;
  }

  .kakao-monthly-actions button{
    flex:1 1 130px;
    min-width:0;
  }
}
.schedule-toolbar{
  display:grid;
  grid-template-columns:
    240px
    repeat(5, minmax(180px, 1fr));
  gap:12px;
  align-items:center;
}

.schedule-toolbar > *{
  width:100%;
  min-width:0;
}

.schedule-toolbar button{
  padding:16px 12px;
  font-size:14px;
  white-space:nowrap;
}
@media(max-width:1200px){
  .schedule-toolbar{
    grid-template-columns:1fr 1fr;
  }
}