*{
  box-sizing:border-box;
}

:root{
  --brown:#7a4a22;
  --brown-dark:#3b2414;
  --gold:#c1922e;
  --cream:#f8f3ea;
  --paper:#fffaf2;
  --ink:#24170f;
  --muted:#75685c;
  --line:#e2d3bf;
  --green:#92d050;
  --green-soft:#d9ead3;
  --yellow:#ffc000;
  --kitchen:#fff2cc;
  --exit:#d9eaf7;
  --wash:#d9d2e9;
  --shadow:0 18px 45px rgba(52,32,16,.12);
}

html,
body{
  margin:0;
  width:100%;
  min-height:100%;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR",Arial,sans-serif;
  color:var(--ink);
  background:linear-gradient(180deg,#f7efe4 0%,#fff 48%,#f8f3ea 100%);
}

button,
select,
input{
  font-family:inherit;
}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:16px 24px;
  background:rgba(255,250,242,.96);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.brand-mark{
  width:46px;
  height:46px;
  border-radius:15px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:900;
  font-size:21px;
  background:linear-gradient(135deg,#b88948,#7a4a22);
  box-shadow:0 10px 22px rgba(122,74,34,.24);
}

.brand strong{
  display:block;
  font-size:20px;
  letter-spacing:-.04em;
}

.brand span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.13em;
}

.top-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

button{
  border:0;
  border-radius:14px;
  padding:12px 15px;
  background:#f1e5d5;
  color:#392414;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
}

button:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(52,32,16,.1);
}

button.primary{
  background:var(--brown);
  color:#fff;
}

.wrap{
  width:100%;
  max-width:none;
  margin:0;
  padding:14px 18px 60px;
}

.hero{
  min-height:230px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:40px;
  padding:38px 42px;
  border-radius:34px;
  background:linear-gradient(135deg,#3b2414,#8a5a2b);
  color:#fff;
  box-shadow:var(--shadow);
}

.hero > div:first-child{
  flex:1;
}

.eyebrow{
  margin:0 0 16px;
  color:#ffd58a;
  font-size:13px;
  font-weight:900;
  letter-spacing:.24em;
}

.hero h1{
  margin:0 0 14px;
  font-size:44px;
  line-height:1.12;
  letter-spacing:-.07em;
}

.hero p{
  max-width:760px;
  margin:0;
  color:rgba(255,255,255,.9);
  font-size:16px;
  font-weight:700;
  line-height:1.7;
}

.week-box{
  width:320px;
  margin-left:auto;
  margin-right:0;
  flex-shrink:0;
  padding:24px;
  border-radius:26px;
  background:rgba(255,255,255,.94);
  color:var(--ink);
  display:grid;
  gap:12px;
}

.week-box label{
  font-weight:900;
  color:#5b3a21;
}

.week-box input{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  padding:13px 14px;
  font-size:16px;
  font-weight:800;
  background:#fff;
}

.week-buttons{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.notice{
  margin:12px 0;
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px 20px;
  border-radius:22px;
  background:#fff7e8;
  border:1px solid #ead7b9;
  color:#5c4025;
  font-size:14px;
  line-height:1.6;
}

.notice strong{
  white-space:nowrap;
  font-size:16px;
}

.loading{
  margin:12px 0;
  padding:18px;
  border-radius:20px;
  background:#eef6ff;
  color:#1d4f8f;
  font-weight:900;
  text-align:center;
}

.hidden{
  display:none !important;
}

.table-card{
  width:100%;
  margin:0;
  background:rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius:28px;
  padding:18px 22px;
  box-shadow:0 12px 32px rgba(52,32,16,.08);
}

.table-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:12px;
}

.table-head h2{
  margin:0;
  font-size:28px;
  letter-spacing:-.05em;
  white-space:nowrap;
}

.table-head p{
  margin:0;
  color:#a94438;
  font-size:14px;
  font-weight:900;
  line-height:1.45;
  text-align:right;
  white-space:nowrap;
}

.table-scroll{
  width:100%;
  overflow-x:hidden;
  border:1px solid #b8b8b8;
  border-radius:14px;
}

.schedule-table{
  width:100%;
  min-width:0;
  border-collapse:collapse;
  table-layout:fixed;
  background:#fff;
}

.schedule-table th,
.schedule-table td{
  border:1px solid #444;
  height:30px;
  padding:4px 2px;
  text-align:center;
  vertical-align:middle;
  font-size:11.5px;
  line-height:1.1;
  font-weight:800;
}

.schedule-table thead th{
  background:var(--yellow);
  color:#000;
}

.schedule-table .label-col{
  width:82px;
  font-weight:900;
  background:#fff;
}

.schedule-table .name-col{
  width:62px;
}

.schedule-table .time-col{
  width:70px;
}

.schedule-table select{
  width:100%;
  max-width:100%;
  height:26px;
  border:0;
  background:transparent;
  text-align:center;
  font-size:12px;
  font-weight:800;
  padding:2px 0;
  outline:none;
}

.schedule-table select:focus{
  background:#fff8d6;
}

.time-select{
  font-size:11.5px !important;
  font-weight:800 !important;
  letter-spacing:-0.6px;
}

.schedule-table .summary-row td{
  background:var(--green-soft);
  font-weight:900;
}

.schedule-table .kitchen-head td{
  background:var(--green);
  font-weight:900;
}

.schedule-table .kitchen-label{
  background:var(--kitchen) !important;
}

.schedule-table .exit-label{
  background:var(--exit) !important;
}

.schedule-table .wash-label{
  background:var(--wash) !important;
}

.schedule-table .empty-cell{
  background:#fff;
}

/* 알림 셀 - 화면용 */
.alert-cell,
.alert-cell select{
  background:#ffe600 !important;
  font-weight:900 !important;
}

footer{
  margin:0;
  padding:20px 22px 40px;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.staff-manager{
  margin:12px 0;
  padding:20px;
  border-radius:24px;
  background:#fffaf2;
  border:1px solid var(--line);
  box-shadow:0 12px 32px rgba(52,32,16,.08);
}

.staff-manager-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.staff-manager-head h2{
  margin:0;
  font-size:24px;
}

.staff-form{
  display:grid;
  grid-template-columns:1fr 220px 140px;
  gap:10px;
  margin-bottom:16px;
}

.staff-form input,
.staff-form select{
  height:46px;
  border:1px solid var(--line);
  border-radius:14px;
  padding:0 14px;
  font-size:15px;
  font-weight:800;
  background:#fff;
}

.weekly-staff-list{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
}

.staff-card{
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  font-size:14px;
  font-weight:800;
}

.staff-buttons{
  margin-top:10px;
}

.staff-card .danger{
  background:#b91c1c;
  color:#fff;
  padding:8px 12px;
  border-radius:10px;
}

@media screen and (max-width:1500px){
  .wrap{
    padding:10px 12px 44px;
  }

  .table-card{
    padding:14px 16px;
  }

  .table-head h2{
    font-size:24px;
  }

  .table-head p{
    font-size:12px;
  }

  .schedule-table th,
  .schedule-table td{
    height:28px;
    padding:3px 1px;
    font-size:11px;
  }

  .schedule-table .label-col{
    width:74px;
  }

  .schedule-table .name-col{
    width:54px;
  }

  .schedule-table .time-col{
    width:60px;
  }

  .schedule-table select{
    height:24px;
    font-size:11px;
  }

  .time-select{
  font-size:11px !important;
  font-weight:800 !important;
  letter-spacing:-0.7px;
}
}

@media screen and (max-width:1000px){
  .topbar{
    position:relative;
    display:block;
  }

  .top-actions{
    margin-top:14px;
    display:grid;
    grid-template-columns:1fr;
  }

  .hero{
    display:block;
    padding:28px 22px;
    border-radius:28px;
  }

  .hero h1{
    font-size:32px;
  }

  .hero p{
    font-size:14px;
  }

  .week-box{
    width:100%;
    margin-top:22px;
  }

  .notice{
    display:block;
  }

  .notice strong{
    display:block;
    margin-bottom:6px;
  }

  .table-head{
    display:block;
  }

  .table-head p{
    margin-top:8px;
    text-align:left;
    white-space:normal;
  }

  .table-scroll{
    overflow-x:auto;
  }

  .schedule-table{
    min-width:1280px;
  }

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

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

/* ==========================================================
   주간 근무표 이미지 복사
========================================================== */

.image-copy{
  background:#247a3b !important;
  color:#fff !important;
}

.image-copy:disabled{
  opacity:.65;
  cursor:wait;
}

.table-card.image-capture-mode{
  width:max-content;
  max-width:none;
  overflow:visible;
  padding:16px;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:#fff;
}

.image-capture-mode .table-head{
  display:block;
  text-align:center;
  margin:0 0 8px;
}

.image-capture-mode .table-head h2{
  margin:0;
  color:#000;
  font-size:26px;
  font-weight:900;
}

.image-capture-mode #dayOffSummary{
  display:block;
  margin:4px 0 6px;
  color:#b22222;
  font-size:12px;
  font-weight:900;
  text-align:center;
  white-space:nowrap;
}

.image-capture-mode .table-scroll{
  width:max-content;
  max-height:none;
  overflow:visible;
  border:0;
  border-radius:0;
}

.image-capture-mode .schedule-table{
  width:max-content;
  min-width:1400px;
  table-layout:fixed;
  border-collapse:collapse;
}

.image-capture-mode .schedule-table th,
.image-capture-mode .schedule-table td,
.image-capture-mode .schedule-table .label-col{
  position:static !important;
}

.image-capture-mode .schedule-table select{
  appearance:none;
  -webkit-appearance:none;
  background:transparent;
}

.capture-select-text{
  display:block;
  width:100%;
  padding:0 1px;
  color:#000;
  font-size:10px;
  font-weight:700;
  line-height:1.1;
  text-align:center;
  white-space:nowrap;
  overflow:visible;
}

/* ===========================
   A4 가로 1페이지 인쇄 전용
=========================== */
@media print{
  @page{
    size:A4 landscape;
    margin:4mm;
  }

  html,
  body{
    width:297mm;
    height:210mm;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    background:#fff !important;
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }

  .topbar,
  .hero,
  .notice,
  footer,
  button,
  .no-print,
  #staffManager,
  #loadingBox{
    display:none !important;
  }

  .wrap{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  transform:scale(0.97);
  transform-origin:top left;
}

  .table-card{
    width:100% !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    box-shadow:none !important;
    background:#fff !important;
  }

  .table-head{
    display:block !important;
    text-align:center !important;
    margin:0 0 3px 0 !important;
  }

  .table-head h2,
  #scheduleTitle{
    font-size:23px !important;
    font-weight:900 !important;
    line-height:1.1 !important;
    margin:0 !important;
    color:#000 !important;
  }

  .table-head p,
  #dayOffSummary{
    display:block !important;
    font-size:9px !important;
    font-weight:900 !important;
    line-height:1.1 !important;
    margin:2px 0 3px !important;
    color:#b22222 !important;
    text-align:center !important;
    white-space:nowrap !important;
  }

  .table-scroll{
    width:103% !important;
    overflow:visible !important;
    border:0 !important;
    border-radius:0 !important;
  }

  .schedule-table{
    width:100% !important;
    min-width:0 !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
    background:#fff !important;
  }

  .schedule-table th,
  .schedule-table td{
    border:1px solid #000 !important;
    height:18px !important;
    padding:1px !important;
    font-size:11px !important;
    font-weight:900 !important;
    line-height:1.05 !important;
    color:#000 !important;
    text-align:center !important;
    vertical-align:middle !important;
  }

  .schedule-table th{
    background:#ffc000 !important;
  }

  .schedule-table .label-col{
    width:46px !important;
  }

  .schedule-table .name-col{
    width:54px !important;
  }

  .schedule-table .time-col{
    width:60px !important;
  }

  .schedule-table select{
    width:100% !important;
    height:16px !important;
    border:0 !important;
    background:transparent !important;
    color:#000 !important;
    appearance:none !important;
    -webkit-appearance:none !important;
    font-size:10.8px !important;
    font-weight:500 !important;
    padding:0 !important;
    line-height:1.05 !important;
    text-align:center !important;
  }

  .time-select{
    font-size:10.8px !important;
    font-weight:400 !important;
    letter-spacing:-0.4px !important;
  }

  .schedule-table .summary-row td{
    background:#d9ead3 !important;
  }

  .schedule-table .kitchen-head td{
    background:#92d050 !important;
  }

  .schedule-table .kitchen-label{
    background:#fff2cc !important;
  }

  .schedule-table .exit-label{
    background:#d9eaf7 !important;
  }

  .schedule-table .wash-label{
    background:#d9d2e9 !important;
  }

  .alert-cell,
  .alert-cell select{
    background:#ffe600 !important;
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }
}

/* ==================================
   근무표 작성 단계 안내
================================== */

.schedule-workflow{
  margin:14px 0;
  padding:20px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:0 10px 26px rgba(52,32,16,.07);
}

.workflow-title{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}

.workflow-title strong{
  font-size:21px;
  color:var(--brown-dark);
}

.workflow-title span{
  color:var(--muted);
  font-weight:700;
}

.workflow-steps{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}

.workflow-step{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:16px;
  border:1px solid #eadbc8;
  border-radius:18px;
  background:#fffaf4;
}

.workflow-step > div{
  flex:1;
}

.workflow-step strong{
  display:block;
  margin-bottom:5px;
  font-size:16px;
}

.workflow-step p{
  min-height:42px;
  margin:0 0 12px;
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}

.step-number{
  flex-shrink:0;
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--brown);
  color:#fff;
  font-weight:900;
}

.usage-guide{
  margin:14px 0;
  padding:22px;
  border:2px solid #c89b62;
  border-radius:22px;
  background:#fff8ec;
}

.usage-guide-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.usage-guide-head h2{
  margin:0;
  color:var(--brown-dark);
}

.usage-guide ol{
  margin:18px 0 0;
  padding-left:24px;
}

.usage-guide li{
  margin:10px 0;
  line-height:1.6;
}

.schedule-final-actions{
  position:sticky;
  bottom:0;
  z-index:20;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:14px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,250,242,.96);
  box-shadow:0 -6px 20px rgba(52,32,16,.08);
}

.schedule-final-actions button{
  min-width:150px;
  font-size:15px;
}

@media(max-width:900px){

  .workflow-steps{
    grid-template-columns:1fr;
  }

  .workflow-step p{
    min-height:0;
  }

  .schedule-final-actions{
    position:static;
    display:grid;
    grid-template-columns:1fr;
  }

  .schedule-final-actions button{
    width:100%;
  }

}

@media print{

  .schedule-workflow,
  .usage-guide,
  #simulationPanel,
  .schedule-final-actions{
    display:none !important;
  }

}