/* ===========================================================================
   SmartRide 그룹웨어 디자인 토큰 + 레이아웃
   보고서 Part 4: GNB 56px / LNB 240px / 본문 목록·상세 2단
   =========================================================================== */
:root {
  --gw-gnb-h: 56px;
  --gw-lnb-w: 240px;

  --gw-brand: #1b4e8f;
  --gw-brand-dark: #16406f;
  --gw-brand-soft: #e8f0fa;
  --gw-ink: #1f2430;
  --gw-ink-2: #5a6372;
  --gw-ink-3: #8b94a3;
  --gw-line: #e2e6ed;
  --gw-bg: #f4f6f9;
  --gw-surface: #ffffff;
  --gw-danger: #c62828;
  --gw-warn: #e07b00;
  --gw-ok: #1e7d48;

  --gw-radius: 10px;
  --gw-shadow: 0 1px 2px rgba(23, 31, 48, .06), 0 4px 14px rgba(23, 31, 48, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--gw-bg);
  color: var(--gw-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕",
               "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--gw-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------- GNB */
.gw-gnb {
  position: sticky; top: 0; z-index: 1030;
  height: var(--gw-gnb-h);
  display: flex; align-items: center; gap: 4px;
  padding: 0 16px;
  background: var(--gw-brand);
  color: #fff;
}
.gw-gnb__brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: #fff; white-space: nowrap;
  margin-right: 12px;
}
.gw-gnb__brand:hover { text-decoration: none; }
.gw-gnb__nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; flex: 1 1 auto; }
.gw-gnb__nav::-webkit-scrollbar { display: none; }
.gw-gnb__link {
  color: rgba(255, 255, 255, .85);
  padding: 8px 13px; border-radius: 7px; white-space: nowrap; font-size: 14.5px;
}
.gw-gnb__link:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.gw-gnb__link.is-active { background: rgba(0, 0, 0, .22); color: #fff; font-weight: 600; }
.gw-gnb__right { display: flex; align-items: center; gap: 8px; }
.gw-gnb__search {
  height: 34px; border: 0; border-radius: 17px; padding: 0 14px; width: 190px;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 14px;
}
.gw-gnb__search::placeholder { color: rgba(255, 255, 255, .7); }
.gw-gnb__search:focus { outline: 2px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .24); }
.gw-gnb__icon {
  position: relative; color: #fff; padding: 6px 9px; border-radius: 7px; font-size: 16px;
  background: none; border: 0; cursor: pointer;
}
.gw-gnb__icon:hover { background: rgba(255, 255, 255, .14); }
.gw-gnb__count {
  position: absolute; top: 0; right: 0;
  min-width: 17px; height: 17px; line-height: 17px;
  background: #e53935; color: #fff; border-radius: 9px;
  font-size: 11px; font-weight: 700; text-align: center; padding: 0 4px;
}

/* ----------------------------------------------------------------- 본문 틀 */
.gw-shell { display: flex; align-items: flex-start; min-height: calc(100vh - var(--gw-gnb-h)); }

.gw-lnb {
  width: var(--gw-lnb-w); flex: 0 0 var(--gw-lnb-w);
  background: var(--gw-surface);
  border-right: 1px solid var(--gw-line);
  min-height: calc(100vh - var(--gw-gnb-h));
  padding: 16px 12px;
  position: sticky; top: var(--gw-gnb-h);
  max-height: calc(100vh - var(--gw-gnb-h));
  overflow-y: auto;
}
.gw-lnb__primary {
  display: block; text-align: center; font-weight: 600;
  background: var(--gw-brand); color: #fff;
  padding: 10px; border-radius: var(--gw-radius); margin-bottom: 14px;
}
.gw-lnb__primary:hover { background: var(--gw-brand-dark); color: #fff; text-decoration: none; }
.gw-lnb__group { font-size: 12px; color: var(--gw-ink-3); padding: 10px 10px 4px; font-weight: 600; letter-spacing: .02em; }
.gw-lnb__link {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 8px; color: var(--gw-ink); font-size: 14.5px;
}
.gw-lnb__link:hover { background: var(--gw-bg); text-decoration: none; }
.gw-lnb__link.is-active { background: var(--gw-brand-soft); color: var(--gw-brand); font-weight: 600; }
.gw-lnb__badge {
  background: #e53935; color: #fff; border-radius: 10px; font-size: 11.5px;
  font-weight: 700; min-width: 20px; text-align: center; padding: 1px 6px;
}
.gw-lnb__meta { font-size: 12px; color: var(--gw-ink-3); padding: 12px 10px 0; border-top: 1px solid var(--gw-line); margin-top: 12px; }

.gw-main { flex: 1 1 auto; min-width: 0; padding: 20px 24px 48px; }

.gw-page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.gw-page-head h1 { font-size: 21px; font-weight: 700; margin: 0; }
.gw-page-head .gw-sub { color: var(--gw-ink-2); font-size: 13.5px; margin-top: 2px; }

/* ----------------------------------------------------------------- 카드 */
.gw-card {
  background: var(--gw-surface);
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-radius);
  box-shadow: var(--gw-shadow);
  margin-bottom: 16px;
}
.gw-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px 16px; border-bottom: 1px solid var(--gw-line);
  font-weight: 600; font-size: 15px;
}
.gw-card__body { padding: 16px; }
.gw-card__body--tight { padding: 0; }

.gw-grid { display: grid; gap: 16px; }
.gw-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gw-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gw-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 숫자 타일 */
.gw-stat { display: flex; flex-direction: column; gap: 2px; }
.gw-stat__num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.gw-stat__label { font-size: 13px; color: var(--gw-ink-2); }
.gw-stat--alert .gw-stat__num { color: var(--gw-danger); }
.gw-stat--warn .gw-stat__num { color: var(--gw-warn); }
.gw-stat--ok .gw-stat__num { color: var(--gw-ok); }

.gw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.gw-tile {
  border: 1px solid var(--gw-line); border-radius: var(--gw-radius);
  padding: 13px 14px; background: var(--gw-surface);
}
.gw-tile:hover { border-color: var(--gw-brand); text-decoration: none; }

/* ----------------------------------------------------------------- 테이블 */
.gw-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gw-table th, .gw-table td { padding: 10px 12px; border-bottom: 1px solid var(--gw-line); text-align: left; vertical-align: middle; }
.gw-table th { background: #fafbfd; font-weight: 600; color: var(--gw-ink-2); font-size: 13px; white-space: nowrap; }
.gw-table tbody tr:hover { background: #fbfcfe; }
.gw-table td.num, .gw-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.gw-table td.mid, .gw-table th.mid { text-align: center; }
.gw-table .gw-title-cell { font-weight: 500; }
.gw-table--compact th, .gw-table--compact td { padding: 7px 10px; font-size: 13.5px; }

.gw-empty { padding: 36px 16px; text-align: center; color: var(--gw-ink-3); font-size: 14px; }

/* ----------------------------------------------------------------- 배지/칩 */
.gw-badge {
  display: inline-block; padding: 2px 8px; border-radius: 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.gw-badge--light { background: #eef0f4; color: var(--gw-ink-2); }
.gw-badge--secondary { background: #e3e6ec; color: #4a515f; }
.gw-badge--primary { background: var(--gw-brand-soft); color: var(--gw-brand); }
.gw-badge--success { background: #e3f3e9; color: var(--gw-ok); }
.gw-badge--danger { background: #fde8e8; color: var(--gw-danger); }
.gw-badge--warning { background: #fdf0dc; color: var(--gw-warn); }
.gw-chip-must { background: var(--gw-danger); color: #fff; }

/* ----------------------------------------------------------------- 폼 */
.gw-field { margin-bottom: 14px; }
.gw-field > label { display: block; font-size: 13px; font-weight: 600; color: var(--gw-ink-2); margin-bottom: 5px; }
.gw-field .req { color: var(--gw-danger); }
.gw-input, .gw-select, .gw-textarea {
  width: 100%; border: 1px solid var(--gw-line); border-radius: 8px;
  padding: 9px 11px; font-size: 14.5px; font-family: inherit; background: #fff; color: var(--gw-ink);
}
.gw-input:focus, .gw-select:focus, .gw-textarea:focus {
  outline: none; border-color: var(--gw-brand); box-shadow: 0 0 0 3px rgba(27, 78, 143, .12);
}
.gw-textarea { min-height: 160px; resize: vertical; }
.gw-help { font-size: 12.5px; color: var(--gw-ink-3); margin-top: 4px; }
.gw-row { display: flex; gap: 12px; flex-wrap: wrap; }
.gw-row > * { flex: 1 1 180px; min-width: 0; }

.gw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--gw-line); background: #fff; color: var(--gw-ink);
  border-radius: 8px; padding: 8px 15px; font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.gw-btn:hover { background: var(--gw-bg); text-decoration: none; }
.gw-btn--primary { background: var(--gw-brand); border-color: var(--gw-brand); color: #fff; }
.gw-btn--primary:hover { background: var(--gw-brand-dark); color: #fff; }
.gw-btn--danger { background: var(--gw-danger); border-color: var(--gw-danger); color: #fff; }
.gw-btn--danger:hover { background: #a71f1f; color: #fff; }
.gw-btn--ghost { background: transparent; }
.gw-btn--sm { padding: 5px 11px; font-size: 13px; }
.gw-btn[disabled] { opacity: .5; cursor: not-allowed; }

.gw-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 16px; border-bottom: 1px solid var(--gw-line); background: #fafbfd;
}
.gw-toolbar--bottom { border-bottom: 0; border-top: 1px solid var(--gw-line); }
.gw-spacer { flex: 1 1 auto; }

.gw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gw-line); margin-bottom: 16px; flex-wrap: wrap; }
.gw-tabs a {
  padding: 9px 14px; color: var(--gw-ink-2); font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.gw-tabs a:hover { color: var(--gw-brand); text-decoration: none; }
.gw-tabs a.is-active { color: var(--gw-brand); border-bottom-color: var(--gw-brand); font-weight: 600; }

/* ----------------------------------------------------------------- 알림/플래시 */
.gw-flash { padding: 11px 15px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.gw-flash--info { background: var(--gw-brand-soft); color: var(--gw-brand-dark); }
.gw-flash--error { background: #fde8e8; color: var(--gw-danger); }

.gw-noti { position: relative; }
.gw-noti__panel {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 6px;
  width: 340px; max-height: 420px; overflow-y: auto;
  background: #fff; border: 1px solid var(--gw-line); border-radius: var(--gw-radius);
  box-shadow: 0 8px 28px rgba(23, 31, 48, .16); z-index: 1040; color: var(--gw-ink);
}
.gw-noti.is-open .gw-noti__panel { display: block; }
.gw-noti__item { display: block; padding: 11px 14px; border-bottom: 1px solid var(--gw-line); color: var(--gw-ink); }
.gw-noti__item:hover { background: var(--gw-bg); text-decoration: none; }
.gw-noti__item.is-unread { background: #f7fafe; }
.gw-noti__time { font-size: 11.5px; color: var(--gw-ink-3); }

/* ----------------------------------------------------------------- 결재선 */
.gw-line { display: flex; gap: 10px; flex-wrap: wrap; }
.gw-line__step {
  border: 1px solid var(--gw-line); border-radius: var(--gw-radius);
  padding: 10px 12px; min-width: 150px; background: #fff;
}
.gw-line__step.is-active { border-color: var(--gw-brand); background: var(--gw-brand-soft); }
.gw-line__step.is-done { border-color: #bfe0cc; background: #f3faf6; }
.gw-line__step.is-rejected { border-color: #f0bcbc; background: #fdf3f3; }
.gw-line__no { font-size: 11.5px; color: var(--gw-ink-3); font-weight: 600; }
.gw-line__member { font-size: 14px; }
.gw-line__sign { font-size: 11.5px; color: var(--gw-ink-2); }

/* ----------------------------------------------------------------- 문서 본문 */
.gw-doc { background: #fff; padding: 28px 32px; }
.gw-doc h2 { font-size: 19px; margin: 0 0 18px; text-align: center; letter-spacing: .08em; }
.gw-doc__meta { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 18px; }
.gw-doc__meta th, .gw-doc__meta td { border: 1px solid var(--gw-line); padding: 7px 10px; }
.gw-doc__meta th { background: #fafbfd; width: 110px; font-weight: 600; color: var(--gw-ink-2); }
.gw-doc__body { min-height: 180px; font-size: 14.5px; white-space: pre-wrap; }
.gw-doc__hash { font-size: 11.5px; color: var(--gw-ink-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }

/* ----------------------------------------------------------------- 조직도 */
.gw-tree { list-style: none; padding-left: 0; margin: 0; }
.gw-tree ul { list-style: none; padding-left: 18px; margin: 0; border-left: 1px dashed var(--gw-line); }
.gw-tree__node {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14.5px;
}
.gw-tree__node:hover { background: var(--gw-bg); }
.gw-tree__node.is-active { background: var(--gw-brand-soft); color: var(--gw-brand); font-weight: 600; }
.gw-tree__count { font-size: 12px; color: var(--gw-ink-3); }

/* ----------------------------------------------------------------- 근무표 그리드 */
.gw-sched-wrap { overflow-x: auto; }
.gw-sched { border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.gw-sched th, .gw-sched td { border: 1px solid var(--gw-line); padding: 4px 6px; text-align: center; min-width: 30px; }
.gw-sched th.sticky, .gw-sched td.sticky {
  position: sticky; left: 0; background: #fafbfd; text-align: left; min-width: 150px; z-index: 1;
}
.gw-sched td.d-day { background: #fffbe8; }
.gw-sched td.d-night { background: #eaeefb; }
.gw-sched td.d-off { background: #f2f3f5; color: var(--gw-ink-3); }
.gw-sched td.d-sub { background: #fdecec; }
.gw-sched td.is-weekend { background: #fcfcfd; }

/* ----------------------------------------------------------------- 체크리스트 */
.gw-check { border: 1px solid var(--gw-line); border-radius: var(--gw-radius); overflow: hidden; }
.gw-check__row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--gw-line); }
.gw-check__row:last-child { border-bottom: 0; }
.gw-check__label { flex: 1 1 auto; font-size: 15px; }
.gw-check__opts { display: flex; gap: 6px; }
.gw-check__opt { position: relative; }
.gw-check__opt input { position: absolute; opacity: 0; width: 100%; height: 100%; left: 0; top: 0; margin: 0; cursor: pointer; }
.gw-check__opt span {
  display: block; min-width: 54px; text-align: center; padding: 9px 10px;
  border: 1px solid var(--gw-line); border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--gw-ink-2);
}
.gw-check__opt input:checked + span.ok { background: var(--gw-ok); border-color: var(--gw-ok); color: #fff; }
.gw-check__opt input:checked + span.ng { background: var(--gw-danger); border-color: var(--gw-danger); color: #fff; }

/* ----------------------------------------------------------------- 기사 포털 */
.gw-d { background: var(--gw-bg); min-height: 100vh; padding-bottom: 76px; }
.gw-d__top {
  position: sticky; top: 0; z-index: 20;
  background: var(--gw-brand); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 54px;
}
.gw-d__top h1 { font-size: 17px; font-weight: 700; margin: 0; flex: 1 1 auto; }
.gw-d__top a { color: #fff; }
.gw-d__body { padding: 14px; max-width: 640px; margin: 0 auto; }
.gw-d__card {
  background: #fff; border-radius: 12px; border: 1px solid var(--gw-line);
  margin-bottom: 12px; overflow: hidden;
}
.gw-d__card h2 { font-size: 15px; margin: 0; padding: 13px 15px; border-bottom: 1px solid var(--gw-line); }
.gw-d__card-body { padding: 15px; }
.gw-d__item { display: block; padding: 13px 15px; border-bottom: 1px solid var(--gw-line); color: var(--gw-ink); }
.gw-d__item:last-child { border-bottom: 0; }
.gw-d__item:hover { background: var(--gw-bg); text-decoration: none; }
.gw-d__tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--gw-line);
  padding-bottom: env(safe-area-inset-bottom);
}
.gw-d__tab {
  flex: 1 1 0; text-align: center; padding: 9px 2px 10px;
  color: var(--gw-ink-3); font-size: 11.5px; min-height: 56px;
}
.gw-d__tab:hover { text-decoration: none; }
.gw-d__tab.is-active { color: var(--gw-brand); font-weight: 700; }
.gw-d__tab-ico { display: block; font-size: 20px; line-height: 1.25; }
.gw-d__cta {
  display: block; width: 100%; text-align: center;
  background: var(--gw-brand); color: #fff; border: 0; border-radius: 12px;
  padding: 15px; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.gw-d__cta:hover { background: var(--gw-brand-dark); color: #fff; text-decoration: none; }
.gw-d__cta--danger { background: var(--gw-danger); }
.gw-d__cta--danger:hover { background: #a71f1f; }
.gw-d .gw-input, .gw-d .gw-select, .gw-d .gw-textarea { font-size: 16px; padding: 12px; min-height: 48px; }
.gw-d__big { font-size: 1.12em; }

/* 고령 승무사원 대비 '큰 글씨' 토글 (보고서 Part 4-3) */
body.gw-large { font-size: 17px; }
body.gw-large .gw-d__card h2 { font-size: 17px; }
body.gw-large .gw-d__item { padding: 16px 15px; }
body.gw-large .gw-d__cta { font-size: 18px; padding: 17px; }

/* ----------------------------------------------------------------- 로그인 */
.gw-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1b4e8f 0%, #123966 100%); padding: 20px;
}
.gw-login__box {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 14px; padding: 32px 28px; box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}
.gw-login__brand { text-align: center; margin-bottom: 22px; }
.gw-login__brand strong { display: block; font-size: 21px; color: var(--gw-brand); }
.gw-login__brand span { font-size: 13px; color: var(--gw-ink-3); }
.gw-login__alt { text-align: center; margin-top: 18px; font-size: 13.5px; }

/* ----------------------------------------------------------------- 반응형 */
@media (max-width: 1100px) {
  .gw-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gw-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  /* 768px 미만에서 LNB는 드로어로 전환 (보고서 Part 4-3) */
  .gw-lnb {
    position: fixed; top: var(--gw-gnb-h); left: 0; bottom: 0; z-index: 1020;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, .14); max-height: none;
  }
  .gw-lnb.is-open { transform: translateX(0); }
  .gw-main { padding: 14px 14px 40px; }
  .gw-grid--2, .gw-grid--3, .gw-grid--4 { grid-template-columns: minmax(0, 1fr); }
  .gw-gnb__search { width: 120px; }
  .gw-lnb-toggle { display: inline-flex !important; }
  .gw-table { font-size: 13.5px; }
  .gw-table-wrap { overflow-x: auto; }
  .gw-doc { padding: 18px 16px; }
}
.gw-lnb-toggle { display: none; }

@media print {
  .gw-gnb, .gw-lnb, .gw-toolbar, .gw-btn, .gw-tabs { display: none !important; }
  .gw-main { padding: 0; }
  .gw-card { border: 0; box-shadow: none; }
  body { background: #fff; }
}
