:root {
  /* Soft light CRM — 오래 봐도 편한 밝기·대비 */
  --ink: #2f353b;
  --ink-soft: #4a525a;
  --muted: #6b7280;
  --paper: #f3f1ec;
  --paper-2: #ebe8e1;
  --white: #fffcf8;
  --panel: #ffffff;
  --line: #ddd8cf;
  --line-soft: #e8e4db;
  --accent: #3d6f66;
  --accent-soft: #e4f0ed;
  --accent-deep: #2c544d;
  --focus: #4b7cbf;
  --danger: #b42318;
  --warn: #a15c07;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(47, 53, 59, 0.04), 0 4px 14px rgba(47, 53, 59, 0.04);
  --font-display: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-body: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --nav-w: 248px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--paper);
}

.login-card {
  width: min(100%, 400px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.7rem;
  display: grid;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  text-align: center;
}
.login-brand-logo {
  display: block;
  width: min(200px, 72%);
  height: auto;
  margin: 0 auto 0.15rem;
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.login-brand p {
  text-align: center;
}
.login-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-card label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.login-card input {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.login-card input:focus {
  outline: 2px solid rgba(75, 124, 191, 0.35);
  border-color: var(--focus);
}

.login-remember {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.login-remember input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  accent-color: var(--accent);
}
.login-remember-note {
  margin: -0.35rem 0 0;
  padding-left: 1.6rem;
  font-size: 0.8rem;
  color: var(--warn);
  line-height: 1.4;
  font-weight: 600;
}

.login-error {
  margin: 0;
  min-height: 1.3em;
  color: var(--danger);
  font-size: 0.88rem;
}
.login-ok {
  margin: 0;
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 600;
}
.login-foot-link {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}
.login-foot-link a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shell {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--panel);
  color: var(--ink);
  padding: 1.25rem 0.9rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar .brand {
  padding: 0.35rem 0.35rem 0.95rem;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 0.85rem;
}

.sidebar .brand-logo {
  display: block;
  width: auto;
  height: 1.35rem;
  max-width: 148px;
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
}

.account-card,
.account-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.account-card {
  padding: 0.65rem 0.7rem;
  border-radius: 14px;
  background: linear-gradient(165deg, #f4f7f6 0%, #eef3f1 100%);
  border: 1px solid #dde6e3;
}

.account-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(145deg, #5b8a81 0%, #3d6f66 70%);
  box-shadow: 0 4px 10px rgba(61, 111, 102, 0.22);
}

.account-avatar[data-tone="staff"] {
  background: linear-gradient(145deg, #7a8ea3 0%, #5b7c99 70%);
  box-shadow: 0 4px 10px rgba(91, 124, 153, 0.22);
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.account-copy strong {
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-copy span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid #cfe0db;
}

.account-badge[data-tone="staff"] {
  background: #e8eef4;
  color: #3d5a80;
  border-color: #d2dde8;
}

.app-userbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: -0.15rem 0 1rem;
  position: sticky;
  top: 0;
  z-index: 5;
}

.account-chip {
  padding: 0.45rem 0.55rem 0.45rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(47, 53, 59, 0.06);
  backdrop-filter: blur(8px);
  max-width: min(100%, 360px);
}

.account-chip .account-avatar {
  width: 2.15rem;
  height: 2.15rem;
  font-size: 0.82rem;
}

.account-chip .account-copy strong {
  font-size: 0.88rem;
}

.sidebar .brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-weight: 700;
}

.sidebar .brand > span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar nav {
  display: grid;
  gap: 0.2rem;
}

.sidebar nav button,
.sidebar nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar nav button > i,
.sidebar nav .nav-link > i {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: var(--paper-2);
  color: var(--ink-soft);
}

/* 메뉴별 아이콘 색 — 빠르게 찾기 */
.sidebar nav [data-view="dashboard"] > i { background: #e8edf5; color: #3d5a80; }
.sidebar nav [data-view="stats"] > i { background: #e7f0fa; color: #2f6fad; }
.sidebar nav [data-view="schedule"] > i { background: #e6f3f0; color: #2f6f64; }
.sidebar nav [data-view="customers"] > i { background: #eaf3e6; color: #3d6b2f; }
.sidebar nav [data-view="alimtalk"] > i { background: #fff3df; color: #9a5b00; }
.sidebar nav [data-view="listings"] > i { background: #ebe8f8; color: #4f46a5; }
.sidebar nav [data-view="map"] > i { background: #e4f4f6; color: #0f6b78; }
.sidebar nav [data-view="inquiries"] > i { background: #fceaea; color: #a33b3b; }
.sidebar nav [data-view="settings"] > i { background: #eeeae4; color: #5b554c; }
.sidebar nav .nav-link > i { background: #e8edf2; color: #45607a; }
.sidebar nav .nav-logout > i { background: #f5e8e6; color: #9b3a30; }

.sidebar nav button:hover,
.sidebar nav .nav-link:hover {
  background: var(--paper);
  color: var(--ink);
}

.sidebar nav button.is-active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.sidebar nav button.is-active > i {
  box-shadow: inset 0 0 0 1px rgba(61, 111, 102, 0.22);
}

.sidebar nav .nav-logout {
  margin-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 10px 10px;
  padding-top: 0.85rem;
}

.main {
  padding: 1.45rem clamp(1rem, 3vw, 2rem) 2.5rem;
  min-width: 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
  font-weight: 700;
  color: var(--ink);
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.35rem;
  box-shadow: var(--shadow);
}

.card span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.card b {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow: auto;
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.toolbar input,
.toolbar select {
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  min-width: 160px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.8rem;
  background: var(--paper);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-new {
  background: #d7ebe4;
  color: var(--accent-deep);
}

.badge-done {
  background: #e8eef2;
  color: var(--muted);
}

.badge-progress {
  background: #fdead7;
  color: var(--warn);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.68rem 1.05rem;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--paper);
  color: var(--ink);
}

.btn-danger {
  color: var(--danger);
  border: 1px solid rgba(180,35,24,0.25);
  background: #fff8f7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.actions button {
  font-size: 0.78rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.hidden { display: none !important; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 26, 0.35);
  display: grid;
  justify-content: end;
  z-index: 50;
}

.drawer {
  width: min(100%, 420px);
  height: 100%;
  background: #fff;
  padding: 1.25rem;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0.85rem;
}

.drawer.drawer-wide {
  width: min(100%, 560px);
}

.drawer h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: -0.03em;
}

.drawer dl {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.drawer dt {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.drawer dd { margin: 0; }

.drawer textarea,
.drawer select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.drawer textarea { min-height: 110px; resize: vertical; }

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.drawer-form {
  display: grid;
  gap: 0.85rem;
}

.drawer-form input,
.drawer-form select,
.drawer-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.drawer-form textarea {
  min-height: 110px;
  resize: vertical;
}

.form-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.hope-checks {
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.hope-checks legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.hope-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.35rem 0;
}
.hope-row + .hope-row {
  border-top: 1px dashed var(--line);
  margin-top: 0.25rem;
  padding-top: 0.55rem;
}
.hope-label {
  min-width: 4.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
.hope-checks .chk {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.hope-checks .chk input {
  width: auto;
  margin: 0;
  accent-color: var(--accent, #2f6fed);
}
.hope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}
.hope-tag {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #eef3ff;
  color: #2f4f9a;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-meet { background: #e8f1ff; color: #1f5bb5; }
.badge-pre { background: #fff3e0; color: #b65c00; }

.card-warn b { color: var(--warn); }

.kakao-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff8e8;
  cursor: pointer;
}

.kakao-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kakao-toggle-ui {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #d9d9d9;
  transition: background .2s ease, transform .2s ease;
}

.kakao-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #3c1e1e;
  color: #fee500;
  font-size: 0.72rem;
  font-weight: 800;
}

.kakao-toggle input:checked + .kakao-toggle-ui {
  background: #fee500;
  transform: scale(1.04);
}

.kakao-toggle-text {
  display: grid;
  gap: 0.15rem;
}

.kakao-toggle-text strong {
  font-size: 0.92rem;
}

.kakao-toggle-text small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.kakao-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #f0f0f0;
  color: var(--muted);
  line-height: 1.25;
}

.kakao-pill.is-on {
  background: #fee500;
  color: #191600;
}

.kakao-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  display: inline-block;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.kakao-pill-sub {
  font-weight: 600;
  font-size: 0.7rem;
  opacity: 0.8;
}

.kakao-pill-sub.warn {
  color: var(--warn);
  opacity: 1;
  font-weight: 800;
}

.row-expire {
  background: #fff7ed;
}

.expire-soon {
  color: var(--warn);
  font-weight: 700;
  font-size: 0.82rem;
}
.sm { font-size: 0.82rem; }
.clamp { max-width: 240px; }
.empty-row {
  color: var(--muted);
  padding: 2rem 0.55rem !important;
}

/* Schedule calendar */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.cal-nav strong {
  min-width: 7.5rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.2rem;
  margin: -0.35rem 0 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}
.cal-legend .dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.cal-legend .dot.visit { background: #2f6fed; }
.cal-legend .dot.dist { background: #b65c00; }
.cal-legend .dot.movein { background: #1f6b58; }
.cal-legend .dot.custom { background: #6b5b95; }
.cal-legend .dot.off { background: #8a5cf6; }

.cal-panel { padding: 0.75rem; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.cal-dow {
  background: #f4f7f9;
  padding: 0.55rem 0.4rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}
.cal-dow.is-sun { color: #c23b2a; }
.cal-dow.is-sat { color: #1f5bb5; }
.cal-cell {
  min-height: 108px;
  background: var(--white);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cal-cell.is-out {
  background: #f7f9fb;
  color: #a0aab4;
}
.cal-cell.is-today {
  box-shadow: inset 0 0 0 2px rgba(31, 107, 88, 0.45);
}
.cal-cell.has-off {
  background: #f7f3ff;
}
.cal-daynum {
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.1rem;
}
.cal-events {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-height: 0;
}
.cal-ev {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 6px;
  padding: 0.18rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev:hover { filter: brightness(0.96); }
.cal-ev.visit { background: #e8f0ff; color: #1f5bb5; }
.cal-ev.dist { background: #fff1e0; color: #9a4b00; }
.cal-ev.movein { background: #e5f5ef; color: #145044; }
.cal-ev.off {
  background: #efe7ff;
  color: #5b35b0;
  cursor: default;
}
.cal-more {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
}

.subhead {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.holiday-panel { margin-top: 1rem; }
.holiday-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.85rem;
}
.holiday-form label {
  display: grid;
  gap: 0.3rem;
}
.holiday-form .field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.holiday-form input,
.holiday-form select {
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.holiday-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.holiday-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}
.holiday-list .meta {
  font-size: 0.88rem;
}
.holiday-list .meta strong { margin-right: 0.35rem; }
.holiday-list .meta span { color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Dashboard */
.dash-year-label select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-weight: 700;
}
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.dash-card.dash-wide { grid-column: 1 / -1; }
.dash-card {
  border: 1px solid var(--line-soft);
  box-shadow: none;
  background: linear-gradient(180deg, #fffcf8 0%, #faf8f4 100%);
}
.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.dash-card-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.dash-card-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.dash-card-head > strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.dash-split {
  display: grid;
  grid-template-columns: 152px 1fr;
  gap: 1.25rem;
  align-items: center;
}
.pie-wrap {
  position: relative;
  width: 148px;
  height: 148px;
}
.pie-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#e8e4db 0 100%);
  box-shadow: inset 0 0 0 1px rgba(47, 53, 59, 0.04);
}
.pie-wrap::after,
.pie-center {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--panel);
}
.pie-wrap::after {
  content: "";
  box-shadow: 0 0 0 1px var(--line-soft);
  z-index: 0;
}
.pie-center {
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.05rem;
  background: transparent;
  box-shadow: none;
}
.pie-center strong {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
}
.pie-center span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.dash-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.dash-legend li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.65rem;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
}
.dash-legend .swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.45rem;
  display: inline-block;
  flex-shrink: 0;
}
.dash-legend .left {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--ink-soft);
  font-weight: 600;
}
.dash-legend .val {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 600;
}
.dash-legend .val b {
  color: var(--ink);
  font-weight: 700;
}
.dash-legend .val em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.dash-legend .legend-track {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}
.dash-legend .legend-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  opacity: 0.85;
}
.dash-legend-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-weight: 500;
}

.funnel { display: grid; gap: 0.7rem; }
.funnel-row {
  display: grid;
  grid-template-columns: 5.6rem 1fr 3.6rem;
  gap: 0.65rem;
  align-items: center;
}
.funnel-row span {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink-soft);
}
.funnel-bar {
  height: 10px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}
.funnel-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s ease;
  min-width: 0;
}
.funnel-row.funnel-a .funnel-bar i { background: #9aa5b1; }
.funnel-row.funnel-b .funnel-bar i { background: #5b7c99; }
.funnel-row.funnel-c .funnel-bar i { background: var(--accent); }
.funnel-row em {
  font-style: normal;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 0.88rem;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.funnel-row em small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

.stats-expire-note {
  margin: 0;
  padding: 1.1rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}
.stats-expire-note strong {
  color: var(--accent-deep);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.dash-table-wrap { overflow: auto; max-height: 260px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.dash-table th,
.dash-table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.dash-table th {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 800;
}
.dash-table button.linkish {
  background: none;
  border: 0;
  color: #1f5bb5;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.dash-table button.linkish:hover { text-decoration: underline; }

.bar-chart {
  display: grid;
  gap: 0.85rem;
  min-height: 200px;
  padding: 0.15rem 0 0;
}
.bar-chart-plot {
  position: relative;
  min-height: 168px;
  padding: 1.15rem 0.15rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.bar-grid {
  position: absolute;
  inset: 1.15rem 0 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}
.bar-grid span {
  border-top: 1px dashed #e4dfd5;
}
.bar-chart-cols {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  height: 148px;
}
.bar-col {
  display: grid;
  gap: 0.4rem;
  align-content: end;
  min-width: 0;
  height: 100%;
}
.bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 100%;
  overflow: visible;
  padding-top: 1.05rem;
}
.bar {
  width: 38%;
  max-width: 12px;
  border-radius: 999px 999px 3px 3px;
  min-height: 2px;
  position: relative;
  transition: height 0.4s ease, opacity 0.2s ease;
  opacity: 0.92;
}
.bar:hover { opacity: 1; }
.bar-val {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.bar-col:hover .bar-val,
.bar:hover .bar-val {
  opacity: 1;
  color: var(--ink-soft);
}

.addr-search-row {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}
.addr-search-row input { flex: 1; min-width: 0; }
.addr-search-row .btn { flex-shrink: 0; white-space: nowrap; }

.map-side-item.is-active {
  border-color: #1f6b58;
  background: #e8f5f1;
}
.bar.ask { background: #5b7c99; }
.bar.deal { background: var(--accent); }
.bar.target { background: #cfd6d4; }
.bar.actual { background: var(--accent); }
.bar-col label {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.bar-hint {
  display: flex;
  gap: 1.1rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}
.bar-hint i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.income-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.65rem;
  align-items: end;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.income-form label { display: grid; gap: 0.3rem; }
.income-form .field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.income-form input,
.income-form select {
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

/* Listings · Map */
.lst-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: #e8eef3;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 800;
}
.lst-thumb.is-empty { border: 1px dashed var(--line); }
.pin-pill {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #efe7ff;
  color: #5b35b0;
  font-size: 0.7rem;
  font-weight: 800;
}
.unit-groups {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.unit-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #f8fafb;
}
.unit-group h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.unit-group h3 em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}
.unit-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.unit-group li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  font-size: 0.88rem;
}
.attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 0.65rem;
}
.attach-chip {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.attach-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attach-chip.file {
  width: auto;
  height: auto;
  padding: 0.45rem 1.6rem 0.45rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.attach-chip button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: stretch;
}
.map-panel { padding: 0.65rem; }
.listing-map {
  width: 100%;
  height: min(68vh, 640px);
  border-radius: 12px;
  background: #e8eef3;
  z-index: 1;
}
.map-side {
  max-height: min(68vh, 640px);
  overflow: auto;
  display: grid;
  gap: 0.45rem;
  align-content: start;
}
.map-side-item {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: grid;
  gap: 0.2rem;
}
.map-side-item:hover { border-color: rgba(31,107,88,.35); }
.map-side-item strong { font-size: 0.9rem; }
.map-side-item span { font-size: 0.78rem; color: var(--muted); }
button.linkish {
  background: none;
  border: 0;
  color: #1f5bb5;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
button.linkish:hover { text-decoration: underline; }

.dash-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.dash-quick-card {
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
  font: inherit;
  color: inherit;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.dash-quick-card:hover {
  border-color: rgba(61, 111, 102, 0.35);
  background: var(--accent-soft);
}
.dash-quick-card strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0.2rem;
  color: var(--ink);
}
.dash-quick-card span {
  color: var(--muted);
  font-size: 0.82rem;
}
.stats-expire-note {
  margin: 0.25rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}
.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(31, 107, 88, 0.22);
  background: linear-gradient(135deg, rgba(232, 244, 242, 0.95), rgba(239, 246, 255, 0.9));
  font-size: 0.88rem;
}
.sync-banner.soft {
  background: var(--paper);
  border-color: var(--line);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.settings-grid .export-panel {
  grid-column: 1 / -1;
}
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  width: 100%;
  font-weight: 650;
}
.export-btn > i {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.settings-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.75rem;
}
.settings-form label { display: grid; gap: 0.3rem; }
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.check-row input { margin-top: 0.2rem; }
.account-hint {
  margin: 0.75rem 0;
  padding-left: 1.1rem;
  color: var(--ink);
  line-height: 1.7;
  font-size: 0.9rem;
}
.cal-legend .dot.custom,
.cal-ev.custom {
  --ev: #6b5b95;
}
.cal-ev.custom {
  background: rgba(107, 91, 149, 0.14);
  color: #4a3d73;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
}
.dot.custom {
  background: #6b5b95;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--paper);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .sidebar .brand { width: 100%; border-bottom: 0; padding-bottom: 0.2rem; }
  .app-userbar { display: none; }
  .sidebar nav { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .sidebar nav button,
  .sidebar nav .nav-link {
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
    font-size: 0.78rem;
    padding: 0.55rem 0.35rem;
  }
  .sidebar nav .nav-logout {
    margin-top: 0;
    border-top: 0;
    padding-top: 0.55rem;
  }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .holiday-form { grid-template-columns: 1fr 1fr; }
  .cal-cell { min-height: 88px; }
  .dash-grid { grid-template-columns: 1fr; }
  .income-form { grid-template-columns: 1fr 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .dash-quick { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .sidebar nav { grid-template-columns: 1fr 1fr; }
  .holiday-form { grid-template-columns: 1fr; }
  .dash-quick { grid-template-columns: 1fr; }
  table { min-width: 640px; }
  .cal-ev { font-size: 0.68rem; }
  .dash-split { grid-template-columns: 1fr; justify-items: center; }
  .dash-legend { width: 100%; max-width: 280px; }
  .income-form { grid-template-columns: 1fr; }
  .bar-chart-cols { gap: 0.2rem; }
  .bar { max-width: 9px; }
  .bar-val { opacity: 1; font-size: 0.55rem; }
}
