/* 글로스터 수분양자 앱 — 원본 디자인 재현 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: #f4f6f8;
  color: #191f28;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px; /* 하단 고정 탭바(62px)에 콘텐츠가 가려지지 않도록 */
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---- 상단 헤더 (서브페이지) ---- */
.page-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid #f2f4f6;
  height: 52px; display: flex; align-items: center; justify-content: center;
}
.page-header .back {
  position: absolute; left: 14px; top: 0; height: 52px; width: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: #191f28;
}
.page-header h1 { font-size: 16px; font-weight: 700; }

/* ---- 홈 로고 ---- */
.home-logo { text-align: center; padding: 34px 0 10px; }
.home-logo img { width: 118px; height: auto; }

.greeting { padding: 10px 0 18px; }
.greeting .hi { font-size: 14px; color: #8b95a1; }
.greeting .name { font-size: 22px; font-weight: 700; margin-top: 2px; }

/* ---- 카드 ---- */
.card {
  background: #fff; border-radius: 16px; padding: 20px;
  box-shadow: 0 1px 3px rgba(25,31,40,.04);
  margin-bottom: 14px;
}
.card .card-title { font-size: 15px; font-weight: 700; }
.card .card-sub { font-size: 12px; color: #8b95a1; margin-top: 3px; }

/* 계약 카드 */
.contract-card { display: flex; align-items: center; gap: 12px; }
.contract-card .icon {
  width: 40px; height: 40px; border-radius: 12px; background: #f2f4f6;
  display: flex; align-items: center; justify-content: center; color: #8b95a1; flex: none;
}
.contract-card .title { font-size: 15px; font-weight: 700; flex: 1; }
.badge {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  background: #e6f9f2; color: #00ab6b;
}
.badge.gray { background: #f2f4f6; color: #8b95a1; }
.badge.red { background: #fdeaea; color: #f04452; }

/* 스탯 카드 */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.stat-card { background: #fff; border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(25,31,40,.04); }
.stat-card .label { font-size: 13px; color: #6b7684; display: flex; justify-content: space-between; align-items: center; }
.stat-card .label svg { color: #3182f6; }
.stat-card .value { font-size: 22px; font-weight: 800; margin-top: 8px; letter-spacing: -0.3px; }
.stat-card .value .suffix { font-size: 13px; font-weight: 500; color: #6b7684; margin-left: 2px; }
.stat-card .foot { font-size: 12px; color: #8b95a1; margin-top: 4px; }
.stat-card .foot.green { color: #00ab6b; font-weight: 600; }

/* 가로형 스탯 (나의수익/호텔매출) */
.hstat { display: flex; align-items: center; justify-content: space-between; }
.hstat .l { display: flex; align-items: center; gap: 12px; }
.hstat .icon { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.hstat .t1 { font-size: 14px; font-weight: 700; }
.hstat .t2 { font-size: 12px; color: #8b95a1; margin-top: 1px; }
.hstat .v { font-size: 20px; font-weight: 800; text-align: right; letter-spacing: -0.3px; }
.hstat .v .sub { display: block; font-size: 12px; font-weight: 600; color: #00ab6b; margin-top: 2px; }
.icon.blue { background: #e8f1fe; color: #3182f6; }
.icon.green { background: #e6f9f2; color: #00ab6b; }
.icon.orange { background: #fff3e0; color: #f7941e; }
.icon.purple { background: #f1ecfe; color: #7d5ef7; }
.icon.pink { background: #fdeefa; color: #d94fc0; }
.icon.yellow { background: #fff8e1; color: #e2a600; }
.icon.gray { background: #f2f4f6; color: #6b7684; }

/* 퀵메뉴 */
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.quick-card {
  background: #fff; border-radius: 16px; padding: 22px 0 18px; text-align: center;
  box-shadow: 0 1px 3px rgba(25,31,40,.04); display: block;
}
.quick-card .icon { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.quick-card .label { font-size: 13px; font-weight: 600; }

/* 월 선택 */
.month-nav { display: flex; align-items: center; justify-content: space-between; }
.month-nav .cur { text-align: center; flex: 1; }
.month-nav .cur .cap { font-size: 12px; color: #8b95a1; }
.month-nav .cur .val { font-size: 17px; font-weight: 800; margin-top: 2px; }
.month-nav button {
  width: 36px; height: 36px; border: none; background: none; color: #b0b8c1;
  font-size: 20px; border-radius: 50%;
}
.month-nav button:not(:disabled):hover { background: #f2f4f6; color: #191f28; }
.month-nav button:disabled { opacity: .3; cursor: default; }

/* 구성 리스트 (매출/원가/판관비) */
.hl-row {
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 12px; padding: 14px 16px; margin: 14px 0 6px; font-weight: 800;
}
.hl-row.blue { background: #e8f1fe; color: #1b64da; }
.hl-row.orange { background: #fff3e0; color: #d97e00; }
.hl-row.red { background: #fdeaea; color: #e5344c; }
.hl-row .amt { font-size: 15px; }
.sec-cap { text-align: center; font-size: 12px; color: #b0b8c1; margin: 12px 0 4px; }
.comp-item { padding: 9px 0; }
.comp-item .top { display: flex; align-items: center; gap: 10px; }
.comp-item .top .icon { width: 30px; height: 30px; border-radius: 9px; font-size: 0; }
.comp-item .top .name { font-size: 13.5px; color: #4e5968; flex: 1; }
.comp-item .top .amt { font-size: 14px; font-weight: 700; }
.comp-item .top .pct { font-size: 12px; color: #8b95a1; width: 34px; text-align: right; }
.comp-item .bar { height: 5px; background: #f2f4f6; border-radius: 3px; margin: 7px 0 0 40px; overflow: hidden; }
.comp-item .bar i { display: block; height: 100%; border-radius: 3px; }
.cogs-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.cogs-row .sign { width: 22px; height: 22px; border-radius: 50%; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.cogs-row .sign.plus { background: #e6f9f2; color: #00ab6b; }
.cogs-row .sign.minus { background: #fdeaea; color: #f04452; }
.cogs-row .name { font-size: 13.5px; color: #4e5968; flex: 1; }
.cogs-row .amt { font-size: 14px; font-weight: 700; }
.cogs-row .amt.red { color: #f04452; }

/* 나의수익 월 카드 */
.rev-month-card { background: #fff; border-radius: 16px; padding: 4px 20px; box-shadow: 0 1px 3px rgba(25,31,40,.04); margin-bottom: 14px; }
.rev-month-card .head { font-size: 15px; font-weight: 800; padding: 16px 0 8px; border-bottom: 1px solid #f2f4f6; display:flex; justify-content: space-between; align-items:center; }
.rev-month-card .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; }
.rev-month-card .row .k { color: #6b7684; }
.rev-month-card .row .v { font-weight: 600; }
.rev-month-card .row .v.red { color: #f04452; }
.rev-month-card .total { display: flex; justify-content: space-between; padding: 13px 0 16px; border-top: 1px solid #f2f4f6; margin-top: 6px; }
.rev-month-card .total .k { font-size: 14.5px; font-weight: 800; }
.rev-month-card .total .v { font-size: 16px; font-weight: 800; }
.list-heading { font-size: 15px; font-weight: 800; margin: 22px 0 12px; }

/* 공지 */
.chip-row { display: flex; gap: 8px; padding: 14px 0; }
.chip {
  border: 1px solid #e5e8eb; background: #fff; color: #4e5968;
  font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 20px;
}
.chip.active { background: #b0b8c1; border-color: #b0b8c1; color: #fff; }
.notice-item { background: #fff; border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; display: block; }
.notice-item .meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.notice-item .cat { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #e8f1fe; color: #3182f6; }
.notice-item .cat.g { background: #f2f4f6; color: #6b7684; }
.notice-item .pin { font-size: 11px; color: #f04452; font-weight: 700; }
.notice-item .title { font-size: 14.5px; font-weight: 600; }
.notice-item .date { font-size: 12px; color: #8b95a1; margin-top: 4px; }
.empty-state { text-align: center; padding: 90px 0; color: #b0b8c1; }
.empty-state svg { margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* 마이페이지 */
.profile-hero {
  background: linear-gradient(135deg, #5b6470, #434b57);
  border-radius: 18px; padding: 24px; color: #fff; margin-bottom: 14px;
}
.profile-hero .who { display: flex; align-items: center; gap: 14px; }
.profile-hero .avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; }
.profile-hero .nm { font-size: 19px; font-weight: 800; }
.profile-hero .rm { font-size: 13px; opacity: .75; margin-top: 2px; }
.profile-hero .boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.profile-hero .box { background: rgba(255,255,255,.10); border-radius: 12px; padding: 12px 16px; }
.profile-hero .box .k { font-size: 12px; opacity: .7; }
.profile-hero .box .v { font-size: 16px; font-weight: 800; margin-top: 4px; }
.info-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f7f8fa; }
.info-row:last-child { border-bottom: none; }
.info-row .ic { color: #8b95a1; width: 22px; display: flex; justify-content: center; padding-top: 2px; flex: none; }
.info-row .k { font-size: 12px; color: #8b95a1; }
.info-row .v { font-size: 14px; font-weight: 600; margin-top: 2px; word-break: break-all; }
.info-row.link { cursor: pointer; align-items: center; }
.info-row.link .chev { margin-left: auto; color: #b0b8c1; }
.logout-btn {
  width: 100%; background: #fff; border: 1px solid #f0d5d8; color: #f04452;
  font-size: 14.5px; font-weight: 700; border-radius: 14px; padding: 15px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.app-footer { text-align: center; color: #b0b8c1; font-size: 12px; padding: 26px 0 10px; }

/* ---- 하단 탭바 ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: #fff; border-top: 1px solid #f2f4f6;
  display: flex; height: 62px; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #8b95a1; font-size: 10.5px; font-weight: 600;
}
.tabbar a.active { color: #191f28; }
.tabbar a.active .ico { position: relative; }
.tabbar a.active .ico::before {
  content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2px; background: #191f28;
}

/* ---- 로그인 ---- */
.login-wrap { max-width: 420px; margin: 0 auto; padding: 70px 24px 40px; }
.login-wrap .logo { text-align: center; margin-bottom: 36px; }
.login-wrap .logo img { width: 132px; }
.login-wrap h2 { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 26px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #6b7684; margin-bottom: 7px; font-weight: 600; }
.field input {
  width: 100%; border: 1px solid #e5e8eb; border-radius: 12px; padding: 14px 16px;
  font-size: 15px; font-family: inherit; background: #fff;
}
.field input:focus { outline: none; border-color: #191f28; }
.btn-primary {
  width: 100%; background: #191f28; color: #fff; border: none; border-radius: 12px;
  padding: 15px; font-size: 15px; font-weight: 700; margin-top: 8px;
}
.btn-primary:disabled { opacity: .5; }
.form-error { color: #f04452; font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }

/* 모달 */
.modal-back { position: fixed; inset: 0; background: rgba(25,31,40,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 380px; }
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 18px; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions button { flex: 1; border-radius: 12px; padding: 13px; font-size: 14px; font-weight: 700; border: none; }
.modal .actions .cancel { background: #f2f4f6; color: #4e5968; }
.modal .actions .ok { background: #191f28; color: #fff; }
.hidden { display: none !important; }

@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
