:root {
  --navy:   #0D1B2A;
  --blue:   #1A5276;
  --mid:    #2471A3;
  --sky:    #3498DB;
  --light:  #EBF5FB;
  --teal:   #0E9488;
  --teal-l: #CCFBF1;
  --green:  #16A34A;
  --green-l:#DCFCE7;
  --amber:  #D97706;
  --amber-l:#FEF3C7;
  --red:    #DC2626;
  --red-l:  #FEE2E2;
  --purple: #7C3AED;
  --purple-l:#EDE9FE;
  --gray-l: #F7F9FC;
  --gray-1: #F1F4F8;
  --gray-2: #E2E8F0;
  --gray-3: #CBD5E1;
  --gray-4: #94A3B8;
  --gray-5: #64748B;
  --gray-7: #334155;
  --white:  #FFFFFF;
  --sidebar-w: 256px;
  --font-d: 'Gmarket Sans', 'Noto Sans KR', sans-serif;
  --font-b: 'Noto Sans KR', sans-serif;
  --shadow-sm: 0 1px 4px rgba(13,27,42,.06);
  --shadow:    0 4px 16px rgba(13,27,42,.10);
  --r: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font-b); background: var(--gray-l); min-height: 100vh; display: flex; -webkit-font-smoothing: antialiased; }

/* ── Sidebar ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex; flex-direction: column;
  z-index: 200;
}

.sb-logo { display: flex; align-items: center; gap: 10px; padding: 20px; border-bottom: 1px solid rgba(255,255,255,.07); text-decoration: none; }
.sb-logo-box { width: 36px; height: 36px; border-radius: 10px; background: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.sb-logo-text { font-family: var(--font-d); font-size: 17px; font-weight: 700; color: #fff; }

.sb-user { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sb-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--sky), var(--teal)); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.sb-name { font-size: 13px; font-weight: 700; color: #fff; }
.sb-plan { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 1px; }

.sb-quota { margin: 10px 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); border-radius: 9px; padding: 11px 13px; }
.sq-label { font-size: 11px; color: rgba(255,255,255,.4); margin-bottom: 6px; }
.sq-bar-wrap { height: 5px; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; margin-bottom: 5px; }
.sq-bar { height: 100%; background: linear-gradient(90deg, var(--sky), #48C9B0); border-radius: 3px; }
.sq-nums { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.4); }
.sq-nums strong { color: #fff; }

.nav-section { font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: rgba(255,255,255,.25); padding: 12px 20px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin: 1px 8px; border-radius: 9px; cursor: pointer; text-decoration: none; color: rgba(255,255,255,.5); font-size: 13px; font-weight: 500; transition: all .18s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.8); }
.nav-item.active { background: rgba(52,152,219,.2); color: #fff; font-weight: 700; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; display: flex; align-items: center; justify-content: center; }

/* ── Main ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.header { height: 64px; background: var(--white); border-bottom: 1px solid var(--gray-2); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.header-left { display: flex; align-items: center; gap: 14px; }
.mob-toggle { display: none; border: none; background: none; font-size: 20px; cursor: pointer; color: var(--gray-5); }
.header-title { font-family: var(--font-d); font-size: 17px; font-weight: 700; color: var(--navy); }
.header-sub { font-size: 13px; color: var(--gray-4); margin-top: 1px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.hbtn { width: 38px; height: 38px; border-radius: 10px; background: var(--gray-1); border: none; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: background .18s; position: relative; }
.hbtn:hover { background: var(--gray-2); }
.hbtn-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid var(--white); }
.save-header-btn { display: flex; align-items: center; gap: 6px; background: var(--blue); color: #fff; border: none; border-radius: 10px; padding: 9px 18px; font-family: var(--font-b); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .22s cubic-bezier(.34,1.56,.64,1); }

/* ── Content ── */
.content { padding: 24px 28px; flex: 1; }
.content-inner { max-width: 820px; }

/* ── 마스터 토글 배너 ── */
.master-banner {
  background: linear-gradient(135deg, #0D1B2A 0%, #1A5276 60%, #0E9488 100%);
  border-radius: 20px; padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.mb-title { font-family: var(--font-d); font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 5px; }
.mb-sub { font-size: 13px; color: rgba(255,255,255,.6); }
.mb-right { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; }
.mb-label { font-size: 14px; font-weight: 700; color: rgba(255,255,255,.8); }

/* ── 토글 스위치 ── */
.sw { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw-slider { position: absolute; inset: 0; background: rgba(255,255,255,.2); border-radius: 30px; cursor: pointer; transition: background .25s; }
.sw-slider::before { content: ''; position: absolute; height: 24px; width: 24px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.sw input:checked + .sw-slider { background: var(--green); }
.sw input:checked + .sw-slider::before { transform: translateX(22px); }

.sw-sm { width: 44px; height: 26px; }
.sw-sm .sw-slider::before { height: 20px; width: 20px; }
.sw-sm input:checked + .sw-slider::before { transform: translateX(18px); }
.sw-sm .sw-slider { background: var(--gray-3); }
.sw-sm input:checked + .sw-slider { background: var(--blue); }

/* ── 최근 알림 리스트 ── */
.notif-preview-card { background: var(--white); border: 1px solid var(--gray-2); border-radius: var(--r); overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-1); }
.card-title { font-family: var(--font-d); font-size: 14px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 7px; }
.card-action { font-size: 13px; color: var(--sky); font-weight: 600; cursor: pointer; border: none; background: none; }

.notif-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--gray-1); cursor: pointer; transition: background .15s; }
.notif-item:last-child { border: none; }
.notif-item.unread { background: var(--light); }
.ni-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); flex-shrink: 0; }
.ni-unread-dot.read { background: transparent; }
.ni-icon-wrap { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.ni-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.ni-title.read { font-weight: 500; color: var(--gray-5); }
.ni-time { font-size: 11px; color: var(--gray-4); }
.ni-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 100px; flex-shrink: 0; }

/* ── 설정 섹션 카드 ── */
.settings-card { background: var(--white); border: 1px solid var(--gray-2); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.settings-card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--gray-l); border-bottom: 1px solid var(--gray-2); }
.sch-left { display: flex; align-items: center; gap: 10px; }
.sch-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.sch-title { font-family: var(--font-d); font-size: 14px; font-weight: 700; color: var(--navy); }
.sch-sub { font-size: 12px; color: var(--gray-4); }

.setting-row { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--gray-1); transition: background .15s; }
.setting-row:last-child { border: none; }
.sr-icon { font-size: 20px; flex-shrink: 0; width: 26px; text-align: center; }
.sr-body { flex: 1; min-width: 0; }
.sr-label { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.sr-desc { font-size: 12px; color: var(--gray-4); line-height: 1.5; }
.sr-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.ch-btns { display: flex; gap: 4px; }
.ch-btn { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 100px; border: 1.5px solid var(--gray-2); background: var(--white); color: var(--gray-5); cursor: pointer; transition: all .18s; }
.ch-btn.on.push   { border-color: var(--sky);    background: var(--light);    color: var(--sky);  }
.ch-btn.on.sms    { border-color: var(--green);   background: var(--green-l);  color: var(--green); }
.ch-btn.on.email  { border-color: var(--amber);   background: var(--amber-l);  color: var(--amber); }
.ch-btn.on.kakao  { border-color: #C09000; background: #FEF3C7; color: #92690A; }

/* ── 방해금지 카드 ── */
.dnd-card { background: var(--white); border: 1px solid var(--gray-2); border-radius: var(--r); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.dnd-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dnd-title-wrap { display: flex; align-items: center; gap: 10px; }
.dnd-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--gray-1); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.dnd-title { font-family: var(--font-d); font-size: 14px; font-weight: 700; color: var(--navy); }
.dnd-body { display: none; }
.dnd-body.show { display: block; }
.dnd-time-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.time-select { padding: 10px 14px; border: 1.5px solid var(--gray-2); border-radius: 11px; font-family: var(--font-b); font-size: 14px; color: var(--navy); background: var(--white); cursor: pointer; }
.dnd-days { display: flex; gap: 6px; flex-wrap: wrap; }
.day-btn { width: 40px; height: 40px; border-radius: 11px; border: 1.5px solid var(--gray-2); background: var(--white); font-family: var(--font-b); font-size: 13px; font-weight: 700; cursor: pointer; color: var(--gray-5); transition: all .18s; }
.day-btn.active { border-color: var(--blue); background: var(--light); color: var(--blue); }

/* ── 채널 요약 카드 ── */
.channel-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.ch-sum-card { background: var(--white); border: 1px solid var(--gray-2); border-radius: 13px; padding: 14px 12px; text-align: center; transition: all .2s; cursor: pointer; }
.ch-sum-card.active { border-color: var(--sky); background: var(--light); }
.ch-sum-count { font-size: 18px; font-weight: 700; color: var(--blue); font-family: var(--font-d); }

/* ── 저장 바 ── */
.save-bar { background: var(--white); border: 1px solid var(--gray-2); border-radius: 14px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; margin-top: 4px; box-shadow: var(--shadow-sm); }
.unsaved-badge { display: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 100px; background: var(--amber-l); color: var(--amber); margin-left: 6px; }
.unsaved-badge.show { display: inline-flex; align-items: center; gap: 4px; }
.save-btn { padding: 11px 24px; border-radius: 10px; border: none; background: linear-gradient(135deg, var(--blue), var(--mid)); color: #fff; font-family: var(--font-b); font-size: 14px; font-weight: 700; cursor: pointer; transition: all .22s; }
.reset-btn { padding: 11px 20px; border-radius: 10px; border: 1.5px solid var(--gray-2); background: var(--white); font-family: var(--font-b); font-size: 13px; font-weight: 600; color: var(--gray-5); cursor: pointer; }

/* ── 토스트 ── */
.toast { position: fixed; bottom: 24px; left: calc(var(--sidebar-w) + 24px); background: var(--navy); color: #fff; padding: 13px 18px; border-radius: 12px; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 32px rgba(13,27,42,.25); transform: translateY(70px); opacity: 0; transition: all .35s cubic-bezier(.34,1.56,.64,1); z-index: 600; }
.toast.show { transform: translateY(0); opacity: 1; }

@keyframes fadeUpNotif { from{opacity:0;transform:translateY(14px);} to{opacity:1;transform:none;} }
.master-banner, .channel-summary, .notif-preview-card, .settings-card, .dnd-card, .save-bar { animation: fadeUpNotif .4s ease both; }

@media (max-width: 860px) { .sidebar { transform: translateX(-100%); } .sidebar.open { transform: translateX(0); } .main { margin-left: 0; } .mob-toggle { display: flex; } .channel-summary { grid-template-columns: repeat(2,1fr); } .toast { left: 16px; right: 16px; } }
