/* SNA 그룹웨어 모바일 — 큰 글씨(고령 사용자), 한 손 조작(아래 탭), ERP 문서는 원래 모양 그대로 축소해 보여 줌 */
:root { --c-main: #1f4e8c; --c-main2: #2f6bbd; --c-bg: #f3f5f8; --c-card: #ffffff; --c-line: #dde2e8; --c-text: #1b2430; --c-sub: #66717f;
        --c-red: #c62828; --c-green: #2e7d32; --c-amber: #b26a00; --tab-h: 64px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; font-size: 17px; color: var(--c-text); background: var(--c-bg); }
.hidden { display: none !important; }
button { font: inherit; }

/* 로그인·OTP */
.auth { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand img { width: 56px; height: 56px; }
.brand b { display: block; font-size: 24px; }
.brand small { color: var(--c-sub); font-size: 15px; }
.auth label { display: block; font-size: 15px; color: var(--c-sub); margin-bottom: 14px; }
.auth input:not([type=checkbox]) { display: block; width: 100%; margin-top: 6px; padding: 14px; font-size: 20px; border: 1px solid #c3cbd5; border-radius: 10px; background: #fff; }
.auth input:focus { outline: 2px solid var(--c-main2); border-color: transparent; }
#otpCode { letter-spacing: 10px; text-align: center; font-size: 28px !important; }
.auth .check { display: flex; align-items: center; gap: 8px; color: var(--c-text); }
.auth .check input { width: 22px; height: 22px; }
.err { color: var(--c-red); min-height: 22px; margin: 10px 0 0; }
.hint { color: var(--c-sub); font-size: 14px; line-height: 1.5; margin-top: 18px; }

.btn { border: 1px solid #c3cbd5; background: #fff; color: var(--c-text); border-radius: 10px; padding: 12px 16px; cursor: pointer; }
.btn.primary { background: var(--c-main); border-color: var(--c-main); color: #fff; }
.btn.danger { background: #fff; border-color: var(--c-red); color: var(--c-red); }
.btn.ok { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.btn.big { width: 100%; padding: 16px; font-size: 19px; margin-top: 6px; }
.btn.link { border: none; background: none; color: var(--c-main2); width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .5; }

/* 앱 틀 */
#app { min-height: 100%; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; height: 56px; padding: 0 8px; padding-top: env(safe-area-inset-top);
       background: var(--c-main); color: #fff; }
.top h1 { flex: 1; margin: 0; font-size: 20px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .icon { width: 44px; height: 44px; border: none; background: none; color: #fff; font-size: 26px; }
#view { padding: 12px 12px calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--c-line); }
.tabs a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--c-sub); text-decoration: none; font-size: 14px; }
.tabs a .ico { font-size: 22px; line-height: 1; }
.tabs a.on { color: var(--c-main); font-weight: bold; }
.badge { position: absolute; top: 6px; left: 54%; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--c-red); color: #fff; font-size: 12px; font-weight: bold; text-align: center; }

/* 결재함 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 14px; border-radius: 20px; border: 1px solid var(--c-line); background: #fff; color: var(--c-text); font-size: 16px; text-decoration: none; }
.chip.on { background: var(--c-main); border-color: var(--c-main); color: #fff; }
.chip b { margin-left: 4px; }
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search input { flex: 1; padding: 11px 12px; font-size: 17px; border: 1px solid var(--c-line); border-radius: 10px; }
.card { display: block; background: var(--c-card); border: 1px solid var(--c-line); border-radius: 12px; padding: 14px; margin-bottom: 10px; color: inherit; text-decoration: none; }
.card .t { font-size: 18px; font-weight: bold; line-height: 1.35; word-break: keep-all; }
.card .m { margin-top: 6px; color: var(--c-sub); font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 13px; font-weight: bold; border: 1px solid; margin-right: 6px; vertical-align: 2px; }
.tag.urgent { color: var(--c-red); border-color: var(--c-red); }
.tag.s-결재중 { color: var(--c-main2); border-color: var(--c-main2); }
.tag.s-완료 { color: var(--c-green); border-color: var(--c-green); }
.tag.s-반려, .tag.s-회수 { color: var(--c-red); border-color: var(--c-red); }
.empty { text-align: center; color: var(--c-sub); padding: 48px 12px; }

/* 문서 */
.docwrap { background: #fff; border: 1px solid var(--c-line); border-radius: 12px; overflow: hidden; }
.docwrap iframe { display: block; border: 0; width: 820px; transform-origin: 0 0; }
.files { margin-top: 12px; }
.files a { display: flex; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--c-line); border-radius: 10px; padding: 12px; margin-bottom: 8px; color: var(--c-main2); text-decoration: none; word-break: break-all; }
.files a small { color: var(--c-sub); flex: none; }
.actions { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 4; display: flex; gap: 8px; padding: 10px 12px;
           background: rgba(255,255,255,.97); border-top: 1px solid var(--c-line); }
.actions .btn { flex: 1; padding: 14px 6px; font-size: 18px; }
.withact { padding-bottom: calc(var(--tab-h) + 86px + env(safe-area-inset-bottom)) !important; }
.proxy { background: #fff8e1; border: 1px solid #f0d58c; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; color: var(--c-amber); }

/* 알림·내 정보·준비 중 */
.list .item { background: #fff; border: 1px solid var(--c-line); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.list .item.new { border-left: 4px solid var(--c-main2); }
.list .item small { display: block; color: var(--c-sub); margin-top: 4px; font-size: 14px; }
.info { background: #fff; border: 1px solid var(--c-line); border-radius: 12px; padding: 16px; line-height: 1.8; }
.info b { display: inline-block; width: 88px; color: var(--c-sub); font-weight: normal; }

/* 의견 입력·알림 띠 */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: #fff; border-radius: 16px 16px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 8px; font-size: 20px; }
.sheet textarea { width: 100%; font: inherit; font-size: 17px; padding: 10px; border: 1px solid var(--c-line); border-radius: 10px; margin: 8px 0 12px; }
.sheet .row { display: flex; gap: 8px; }
.sheet .row .btn { flex: 1; padding: 14px; font-size: 18px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + 96px + env(safe-area-inset-bottom)); z-index: 30; padding: 14px 16px; border-radius: 12px;
         background: #263238; color: #fff; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.toast.bad { background: var(--c-red); }

/* 달력(FullCalendar) — 큰 글씨, 한 손 조작 */
.fcwrap { background: #fff; border: 1px solid var(--c-line); border-radius: 12px; padding: 8px 6px; }
.fcwrap .fc { font-size: 15px; --fc-today-bg-color: #fff8e1; --fc-border-color: #e3e7ec; --fc-button-bg-color: var(--c-main); --fc-button-border-color: var(--c-main);
  --fc-button-active-bg-color: var(--c-main2); --fc-button-active-border-color: var(--c-main2); }
.fcwrap .fc .fc-toolbar { margin-bottom: 8px; }
.fcwrap .fc .fc-toolbar-title { font-size: 17px; font-weight: bold; text-align: center; }
.fcwrap .fc .fc-toolbar { gap: 6px; }
.fcwrap .fc .fc-button { white-space: nowrap; }
.fcwrap .fc .fc-button { padding: 6px 12px; font-size: 16px; }
.fcwrap .fc .fc-daygrid-day-number { font-size: 14px; padding: 3px 5px; color: var(--c-text); text-decoration: none; }
.fcwrap .fc .fc-day-sun .fc-daygrid-day-number, .fcwrap .fc .fc-col-header-cell.fc-day-sun a { color: var(--c-red); }
.fcwrap .fc .fc-day-sat .fc-daygrid-day-number, .fcwrap .fc .fc-col-header-cell.fc-day-sat a { color: #1565c0; }
.fcwrap .fc .fc-col-header-cell a { color: var(--c-text); text-decoration: none; }
.fcwrap .fc .fc-daygrid-event { font-size: 12.5px; border-radius: 4px; }
.fcwrap .fc .fc-daygrid-dot-event .fc-event-title { font-weight: normal; }
.fcwrap .fc .fc-list-event-title, .fcwrap .fc .fc-list-event-time { font-size: 16px; }
.fcwrap .fc .fc-list-day-cushion a { color: var(--c-text); text-decoration: none; }
.fcwrap .fc .fc-event.hol { font-weight: bold; }
.fab { position: fixed; right: 18px; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); z-index: 6; width: 60px; height: 60px; border-radius: 50%;
  border: none; background: var(--c-main); color: #fff; font-size: 32px; line-height: 1; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
body.noscroll { overflow: hidden; }
.fsheet { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; }
.fsheet .fbody { width: 100%; max-height: 92%; overflow-y: auto; background: #fff; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.fsheet h3 { margin: 0 0 12px; font-size: 20px; }
.fsheet .btn.big + .btn.big { margin-top: 8px; }
.fsheet .row2 { display: flex; gap: 8px; margin-top: 14px; }
.fsheet .row2 .btn.big { flex: 1; margin: 0; }
.fsheet .f { display: block; font-size: 15px; color: var(--c-sub); margin-bottom: 12px; flex: 1; }
.fsheet .f input:not([type=checkbox]), .fsheet .f select, .fsheet .f textarea { display: block; width: 100%; margin-top: 5px; padding: 11px 10px; font: inherit; font-size: 17px;
  color: var(--c-text); border: 1px solid #c3cbd5; border-radius: 10px; background: #fff; }
.fsheet .f.chk { display: flex; align-items: center; gap: 8px; color: var(--c-text); font-size: 17px; }
.fsheet .f.chk input { width: 22px; height: 22px; }
.fsheet .f2 { display: flex; gap: 10px; align-items: flex-end; }
.fsheet .f2 .f.tm { flex: 0 0 38%; }
.attsel { max-height: 180px; overflow-y: auto; margin-top: 6px; }
.attsel label, .calpick label { display: flex; align-items: center; gap: 8px; padding: 9px 4px; border-bottom: 1px solid #eef1f4; color: var(--c-text); font-size: 17px; }
.attsel label input, .calpick label input { width: 22px; height: 22px; }
.attsel small, .calpick small { color: var(--c-sub); margin-left: auto; font-size: 14px; }
.calpick i, .evhead i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; }
.evhead { display: flex; align-items: center; gap: 8px; color: var(--c-sub); font-size: 15px; }
.evhead em { font-style: normal; font-size: 13px; border: 1px solid var(--c-sub); border-radius: 6px; padding: 0 6px; }
.evtitle { font-size: 22px !important; margin: 8px 0 12px !important; word-break: keep-all; }
.evrow { padding: 6px 0; font-size: 17px; }
.evbody { white-space: pre-wrap; background: var(--c-bg); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 16px; line-height: 1.5; }
.evatt { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.evatt b { width: 100%; font-size: 15px; color: var(--c-sub); font-weight: normal; }
.evatt span { border: 1px solid var(--c-line); border-radius: 16px; padding: 4px 10px; font-size: 15px; }
.evatt span small { margin-left: 5px; color: var(--c-sub); }
.evatt .st-A small { color: var(--c-green); } .evatt .st-D small { color: var(--c-red); }
.evresp { display: flex; gap: 6px; align-items: center; margin: 10px 0; }
.evresp b { font-weight: normal; color: var(--c-sub); margin-right: 4px; }
.evresp .btn { flex: 1; padding: 10px 4px; }
.evmeta { color: var(--c-sub); font-size: 13px; margin-top: 8px; }
