/* 대동에프이 ERP — 시트와 같은 색 (paper·ink·accent·입력 노랑·자동 파랑) */
:root {
  --paper: #F6F8F7; --paper-2: #E3EDF2; --card: #FFFFFF; --line: #D5DEE3;
  --ink: #263238; --muted: #4E6470; --soft: #546E7A;
  --accent: #21675F; --accent-2: #2E8B7F; --link: #2E5AA8;
  --input: #FFF8E1; --auto: #EEF4FB;
  --warn: #B45309; --warn-bg: #FEF3C7; --bad: #C62828; --bad-bg: #FDECEA; --ok: #1B7A3A; --ok-bg: #E7F5EC;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 틀: 위 머리줄 + 왼쪽 세로 메뉴(흰색, 묶음 제목·아이콘·건수) + 숫자 띠 */
.top { position: sticky; top: 0; z-index: 10; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.5px; }
.brand b { display: block; font-size: 17px; letter-spacing: -.4px; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.top .who { display: flex; align-items: center; gap: 10px; }
.top .me { text-align: right; font-size: 13.5px; color: var(--ink); line-height: 1.25; }
.top .me small { display: block; color: var(--muted); font-size: 11.5px; }
.top form { margin: 0; }
.bell { position: relative; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--ink); }
.bell svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell i { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 600 11px/18px system-ui; text-align: center; font-style: normal; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.shell { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - 60px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 14px 12px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.side .group { font-size: 11.5px; color: var(--soft); padding: 14px 10px 6px; }
.side .group:first-child { padding-top: 2px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin-bottom: 2px; border-radius: 8px; color: var(--ink); font-size: 14.5px; }
.side a:hover { background: var(--paper); text-decoration: none; }
.side a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side a span { flex: 1; }
.side a em { font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 22px; padding: 1px 7px; border-radius: 10px; background: #F5B700; color: #fff; text-align: center; }
.side a.on { background: var(--ink); color: #fff; font-weight: 600; }
.body { min-width: 0; }
.strip { display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-bottom: 1px solid var(--line); }
.strip a { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; color: var(--ink); border-right: 1px solid #EEF2F4; text-align: center; }
.strip a:last-child { border-right: 0; }
.strip a:hover { background: var(--paper); text-decoration: none; }
.strip span { font-size: 11.5px; color: var(--muted); }
.strip b { font-size: 19px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.strip small { font-size: 11px; color: var(--soft); }
.strip .warn b { color: var(--warn); } .strip .sign b { color: var(--link); } .strip .money b { color: var(--ok); } .strip .violet b { color: #7B3FC4; }
main { padding: 22px 26px 48px; max-width: 1400px; }
.title { display: flex; align-items: center; gap: 10px; }
.title svg { width: 24px; height: 24px; fill: none; stroke: var(--link); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.4px; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
h2 { font-size: 16px; margin: 0 0 12px; }

/* 카드·숫자 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: block; color: inherit; }
a.kpi:hover { border-color: var(--accent-2); text-decoration: none; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi .hint { font-size: 12px; color: var(--soft); margin-top: 2px; }
.kpi.warn { border-left: 4px solid var(--warn); }
.kpi.sign { border-left: 4px solid var(--link); }
.kpi.money { border-left: 4px solid var(--accent); }
.grid2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; overflow-x: auto; }
.card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.empty { color: var(--soft); padding: 14px 0; text-align: center; font-size: 14px; }

/* 표 */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--paper-2); font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; }
tr.total td { font-weight: 700; background: #F1F5F4; }
tbody tr:hover td { background: #FAFCFB; }

/* 상태 표시 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-작성중 { background: #ECEFF1; color: var(--soft); }
.st-보냄 { background: var(--warn-bg); color: var(--warn); }
.st-사인대기 { background: var(--auto); color: var(--link); }
.st-발주완료 { background: var(--ok-bg); color: var(--ok); }

/* 탭·버튼 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1A544D; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* 알림 */
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.msg.success { background: var(--ok-bg); color: var(--ok); }
.msg.error { background: var(--bad-bg); color: var(--bad); }
.note { background: var(--auto); border-radius: 8px; padding: 10px 14px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }

/* 입력 */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field .help { font-size: 12px; color: var(--soft); }
.field .err { font-size: 12px; color: var(--bad); }
input, select, textarea { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; width: 100%; background: var(--input); color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--accent-2); outline-offset: -1px; }
table.lines td { padding: 4px; }
table.lines input { padding: 6px 7px; }
.info { display: grid; grid-template-columns: repeat(4, auto 1fr); gap: 6px 14px; font-size: 14px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; font-weight: 500; }

/* 로그인 */
.login { max-width: 360px; margin: 12vh auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.login h1 { margin-bottom: 2px; }
.login .field { margin-bottom: 12px; }
.login .btn { width: 100%; margin-top: 6px; }

/* 좁은 화면: 메뉴는 그대로 세로, 폭만 줄이고 아주 좁으면 아이콘만 */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 150px 1fr; }
  .strip { grid-template-columns: repeat(3, 1fr); }
  .strip a:nth-child(n+4) { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid2, .form-grid { grid-template-columns: 1fr; }
  .info { grid-template-columns: auto 1fr; }
  main { padding: 16px 16px 40px; }
  .top .me small { display: none; }
}
@media (max-width: 560px) {
  .shell { grid-template-columns: 58px 1fr; }
  .side { padding: 10px 6px; }
  .side .group { font-size: 0; padding: 6px 0; border-top: 1px solid var(--line); margin-top: 6px; }
  .side .group:first-child { border: 0; margin: 0; }
  .side a { justify-content: center; padding: 10px 0; position: relative; }
  .side a span { display: none; }
  .side a em { position: absolute; top: 2px; right: 2px; min-width: 16px; padding: 0 4px; font-size: 10px; }
  .brand small, .top .me { display: none; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip a:nth-child(n+3) { display: none; }
  .kpi .value { font-size: 22px; }
}

/* 샘플 참고(11-12): 건수 카드·검색줄·합계·파란 추가 버튼·페이지 */
.btn.blue { background: #1D5FD6; border-color: #1D5FD6; color: #fff; }
.btn.blue:hover { background: #164BAA; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.cards5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 16px 0 14px; }
.cards5 a { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink); }
.cards5 a:hover { text-decoration: none; border-color: var(--soft); }
.cards5 a.on { border-color: #1D5FD6; background: #F2F7FF; box-shadow: 0 0 0 1px #1D5FD6 inset; }
.cards5 b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.cards5 span { font-size: 12.5px; color: var(--muted); }
.search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search input[name=q] { flex: 1 1 240px; width: auto; background: #fff; }
.search input[type=date] { width: 150px; background: #fff; }
.sums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sums > div { background: var(--paper); border-radius: 8px; padding: 10px 12px; }
.sums span { display: block; font-size: 12px; color: var(--muted); }
.sums b { font-size: 18px; font-variant-numeric: tabular-nums; }
.sums b.g { color: var(--ok); } .sums b.v { color: #7B3FC4; }
.sums small { display: block; font-size: 11px; color: var(--soft); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pills a { padding: 4px 12px; border-radius: 999px; background: var(--paper-2); color: var(--ink); font-size: 13px; }
.pills a.on { background: #1D5FD6; color: #fff; }
@media (max-width: 1000px) { .cards5 { grid-template-columns: repeat(3, 1fr); } .sums { grid-template-columns: 1fr 1fr; } }
.btn.danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.side a.sub { padding: 6px 12px 6px 42px; font-size: 13.5px; color: var(--muted); }
.side a.sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side a.sub.on { background: var(--paper-2); color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .side a.sub { display: none; } }
.sitecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sitecards a { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--ink); }
.sitecards a:hover { border-color: #1D5FD6; text-decoration: none; }
.sitecards b { display: block; font-size: 16px; }
.sitecards small { color: var(--muted); }
.sitecards .n { margin-top: 8px; font-size: 13px; }
.field ul { list-style: none; margin: 0; padding: 6px 8px; background: var(--input); border: 1px solid var(--line); border-radius: 6px; }
.field ul li label { display: flex; gap: 6px; align-items: center; color: var(--ink); font-size: 14px; margin: 2px 0; }
.field ul input { width: auto; }
