:root {
  --ink: #14213d; --muted: #6b7489; --line: #e3e7ef; --bg: #f6f7fa; --card: #fff;
  --blue: #1f4fd8; --blue-soft: #e8eefc; --yellow: #ffd23f; --yellow-soft: #fff6d1; --red: #c8372d; --mile: #f0f1f5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.3; } h2 { font-size: 19px; margin-top: 28px; } h3 { font-size: 15px; margin-top: 22px; }
a { color: var(--blue); } .muted { color: var(--muted); font-size: 13px; } .err { color: var(--red); font-size: 13px; min-height: 1em; }
button, input, select { font: inherit; color: inherit; }
button { border: 1px solid var(--blue); background: var(--blue); color: #fff; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
button.ghost, a.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; text-decoration: none; font-size: 13px; }
button.danger { background: var(--red); border-color: var(--red); } button.danger.ghost { background: transparent; color: var(--red); border-color: var(--line); }
button.mini { background: transparent; border: 0; color: var(--muted); font-size: 12px; padding: 0 4px; text-decoration: underline; }
input, select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; min-width: 0; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.login .card { width: min(380px, 100%); display: grid; gap: 12px; }

header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; } .brand small { font-weight: 400; color: var(--muted); font-size: 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 3px var(--blue); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button { background: transparent; color: var(--ink); border-color: transparent; } nav button.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
nav b { background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 12px; } nav b:empty { display: none; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 24px; }
.filters input { flex: 1 1 180px; }
main { padding: 0 24px 60px; max-width: 1400px; margin: 0 auto; }

.calbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 10px; }
.calbar h2 { margin: 0; min-width: 130px; text-align: center; } .calbar > button:not(.ghost) { background: #fff; color: var(--ink); border-color: var(--line); padding: 4px 12px; font-size: 18px; }
.legend { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.c-fixed { background: var(--yellow); } .c-plain { background: var(--blue-soft); border: 1px solid #c9d6f7; } .c-mile { background: var(--mile); border: 1px dashed #b9bfcc; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow span { padding: 6px 8px; font-size: 12px; color: var(--muted); }
.grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: #fff; border-radius: 0 0 12px 12px; overflow: hidden; }
.cell { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.cell.out { background: #fafbfc; } .cell.out .num { color: #b5bac6; }
.num { font-size: 12px; color: var(--muted); padding: 0 4px; } .cell.today .num { background: var(--blue); color: #fff; border-radius: 10px; align-self: flex-start; padding: 0 7px; }
.chip { text-align: left; border: 0; border-radius: 5px; padding: 2px 6px; font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; color: var(--ink); }
.chip.fixed { background: var(--yellow); font-weight: 600; } .chip.plain { background: var(--blue-soft); } .chip.off { background: #eee; color: #999; text-decoration: line-through; }
.chip.mile { background: var(--mile); border: 1px dashed #b9bfcc; color: #4a5266; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; } tbody tr { cursor: pointer; } tbody tr:hover { background: #fafbff; }
td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; background: var(--blue-soft); color: var(--blue); white-space: nowrap; }
.tag.soft { background: var(--mile); color: #4a5266; } .tag.p-1, .tag.p-2 { background: var(--yellow-soft); color: #7a5b00; font-weight: 600; } .tag.p-3 { background: #eee; color: #888; }
.rev { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; padding: 14px 18px; }

.form { display: grid; gap: 12px; max-width: 760px; } #view-add .form { margin-top: 16px; }
.form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); flex: 1 1 0; min-width: 140px; } .form label input, .form label select { color: var(--ink); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; } .grow2 { flex: 2 1 0 !important; } .form > button { justify-self: start; }
.inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .inline input { flex: 1 1 150px; }
.items { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; } .items li { padding: 8px 10px; background: var(--bg); border-radius: 8px; overflow-wrap: anywhere; } .items.small li { font-size: 12px; color: var(--muted); padding: 4px 10px; }
.metric { font-weight: 600; color: #7a5b00; }

dialog { border: 0; border-radius: 16px; padding: 0; width: min(880px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(20, 33, 61, .25); }
dialog::backdrop { background: rgba(20, 33, 61, .45); }
#detailBody { padding: 26px 28px; position: relative; } #detailBody .form { max-width: none; } #detailBody h2 { margin-top: 0; padding-right: 36px; }
.x { position: absolute; top: 14px; right: 16px; background: transparent; border: 0; color: var(--muted); font-size: 24px; padding: 0 8px; }

@media (max-width: 760px) {
  header, .filters { padding-left: 12px; padding-right: 12px; } main { padding: 0 12px 40px; }
  .cell { min-height: 78px; } .chip { font-size: 10px; padding: 1px 3px; } .legend { margin-left: 0; width: 100%; }
  table, thead, tbody, tr, td { display: block; } thead { display: none; } td { border: 0; padding: 2px 12px; } tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
}
#gbtn { min-height: 44px; } #gbtn:empty { display: none; } #codeBox { display: grid; gap: 12px; } nav { align-items: center; }
