/* ===== components.css — 버튼 · 카드 · 모달 · 폼 · 표 · 배지 등 재사용 조각 =====
   base.css 다음, mobile.css 앞에 로드된다. ===== */
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: #c4b5a5; margin-bottom: 1px; border: none; background: none; width: 100%; text-align: left; transition: background 0.12s, color 0.12s; }
.nav-item:hover { background: #1a1209; color: #D4A843; }
.nav-item.active { background: #1a1209; color: #F5E6C0; font-weight: 600; }
.nav-item.active .nav-icon { color: #AE831F; }
.nav-icon { font-size: 13px; width: 17px; text-align: center; color: #c4b5a5; flex-shrink: 0; }
.nav-section { font-size: 9.5px; font-weight: 700; color: #7a6a5a; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 11px 3px; }
/* CARDS */
.card { background: #fff; border: 1px solid #e8edf5; border-radius: 13px; padding: 18px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 13.5px; font-weight: 700; color: #1e293b; }
.card-more { font-size: 11.5px; color: #94a3b8; cursor: pointer; background: none; border: none; }
.card-more:hover { color: #AE831F; }
/* STAT ROW */
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { background: #fff; border: 1px solid #e8edf5; border-radius: 13px; padding: 16px 18px; cursor: pointer; transition: border-color 0.15s; }
.stat-card:hover { border-color: #e6c87a; }
.stat-card .label { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 8px; letter-spacing: -0.01em; }
.stat-card .value { font-size: 26px; font-weight: 800; color: #1e293b; line-height: 1.1; margin-bottom: 6px; }
.stat-card .sub   { font-size: 11px; color: #94a3b8; font-weight: 400; }
.stat-label { font-size: 11px; color: #94a3b8; margin-bottom: 6px; }
.stat-value { font-size: 21px; font-weight: 700; color: #1e293b; }
.btn-outline { padding: 7px 14px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; font-size: 12px; color: #475569; cursor: pointer; font-weight: 500; }
.btn-outline:hover { background: #f8fafc; }
.btn-primary { padding: 7px 14px; border: none; border-radius: 8px; background: #AE831F; font-size: 12px; color: #fff; cursor: pointer; font-weight: 600; }
.btn-primary:hover { background: #8B6718; }
.btn-sm { padding: 4px 10px; border-radius: 6px; font-size: 11px; cursor: pointer; font-weight: 500; border: 1px solid #e2e8f0; background: #fff; color: #475569; }
.btn-sm.approve { background: #dcfce7; border-color: #86efac; color: #16a34a; }
.btn-sm.reject { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
/* TABLE */
.tbl-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 600; }
.badge-blue { background: #FDF6E3; color: #AE831F; }
.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-yellow { background: #fefce8; color: #ca8a04; }
.badge-gray { background: #f8fafc; color: #64748b; }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-purple { background: #faf5ff; color: #7c3aed; }
.welcome-card { background: #fff; border: 1px solid #e8edf5; border-radius: 13px; padding: 20px 22px; margin-bottom: 14px; }
.welcome-date { font-size: 11.5px; color: #AE831F; font-weight: 500; margin-bottom: 5px; }
.welcome-greeting { font-size: 20px; font-weight: 700; color: #1e293b; margin-bottom: 3px; }
.welcome-sub { font-size: 12px; color: #94a3b8; }
.profile-card { background: #fff; border: 1px solid #e8edf5; border-radius: 13px; padding: 22px 18px; text-align: center; }
.profile-logo { width: 60px; height: 60px; background: #1e293b; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; margin: 0 auto 10px; }
.profile-name { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 3px; }
.profile-role { font-size: 11px; color: #94a3b8; margin-bottom: 14px; }
.profile-btns { display: flex; gap: 7px; }
.profile-btn { flex: 1; padding: 8px 8px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; font-size: 11.5px; font-weight: 500; color: #475569; cursor: pointer; }
.profile-btn:hover { background: #f8fafc; }
.notice-card { background: #fff; border: 1px solid #e8edf5; border-radius: 13px; padding: 18px; }
.notice-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.notice-item:last-child { border-bottom: none; }
.notice-item:hover .notice-text { color: #AE831F; }
.notice-text { font-size: 12.5px; color: #374151; }
.notice-date { font-size: 10.5px; color: #cbd5e1; flex-shrink: 0; margin-left: 10px; }
.cal-days-hd { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; margin-bottom: 4px; }
.cal-days-hd span { font-size: 9.5px; color: #94a3b8; padding: 3px 0; }
/* ─── 공지사항 ─── */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-list-item { background: #fff; border: 1px solid #e8edf5; border-radius: 12px; padding: 16px 20px; cursor: pointer; transition: border-color 0.15s; }
.notice-list-item:hover { border-color: #d4a843; }
.notice-list-date { font-size: 10.5px; color: #94a3b8; margin-bottom: 5px; }
.notice-list-title { font-size: 13.5px; font-weight: 600; color: #1e293b; }
.cal-cell { min-height: 90px; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; padding: 6px 8px; }
.cal-cell-num { font-size: 11.5px; color: #374151; font-weight: 500; }
.cal-cell-num.today-num { background: #AE831F; color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cal-cell-num.other-num { color: #cbd5e1; }
.cal-event { margin-top: 3px; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; background: #FDF6E3; color: #AE831F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-row{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.form-group{display:flex;flex-direction:column;gap:4px;flex:1;min-width:140px}
.form-group label{font-size:11px;font-weight:600;color:#475569}
.form-group input,.form-group select,.form-group textarea{padding:8px 10px;border:1px solid #e2e8f0;border-radius:7px;font-size:12px;outline:none;font-family:inherit}
.form-group input:focus,.form-group select:focus{border-color:#AE831F}
.form-group textarea{resize:vertical;min-height:70px}
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:999;display:none;align-items:center;justify-content:center}
.modal-backdrop.show{display:flex}
.modal{background:#fff;border-radius:14px;width:90%;max-width:700px;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}
.modal>h3{padding:24px 28px 0;font-size:16px;font-weight:700;color:#1e293b;margin:0;flex-shrink:0}
.modal-inner{padding:20px 28px 28px;overflow-y:auto;flex:1}
.modal-header{padding:22px 28px 16px;border-bottom:1px solid #f1f5f9;flex-shrink:0}
.modal-header h3{font-size:16px;font-weight:700;color:#1e293b;margin:0}
.modal h3{font-size:16px;font-weight:700;margin-bottom:20px;color:#1e293b}
.modal-footer{padding:16px 28px;border-top:1px solid #e2e8f0;display:flex;gap:8px;justify-content:flex-end;flex-shrink:0}
.btn{display:inline-flex;align-items:center;gap:5px;padding:7px 14px;border-radius:7px;border:none;cursor:pointer;font-size:12px;font-weight:600;transition:.15s}
.btn-primary{background:#AE831F;color:#fff}
.btn-primary:hover{background:#8B6718}
.btn-success{background:#16a34a;color:#fff}
.btn-success:hover{background:#15803d}
.btn-danger{background:#dc2626;color:#fff}
.btn-danger:hover{background:#b91c1c}
.btn-ghost{background:transparent;border:1px solid #e2e8f0;color:#475569}
.btn-ghost:hover{background:#f8fafc}
.btn-sm{padding:4px 10px!important;font-size:11px!important}
.empty-state{text-align:center;padding:48px 24px;color:#94a3b8}
.empty-state .icon{font-size:40px;margin-bottom:12px}
.loading{text-align:center;padding:32px;color:#94a3b8}
.memo-entry{background:#f8fafc;border-radius:8px;padding:10px 14px;margin-bottom:8px;border-left:3px solid #AE831F}
.memo-split{display:grid;grid-template-columns:minmax(0,0.95fr) minmax(0,1.05fr);gap:16px;align-items:start}
.memo-pane-write{position:sticky;top:0}
.memo-pane-hist{min-width:0;display:flex;flex-direction:column;min-height:0}
.memo-card{background:#fff;border:1px solid #e5e7eb;border-radius:9px;padding:10px 13px;display:flex;flex-direction:column;min-width:0;transition:border-color .12s,box-shadow .12s}
.memo-card:hover{border-color:#d6c08a;box-shadow:0 1px 6px rgba(174,131,31,.10)}
.memo-card.latest{border-color:#AE831F;background:#fffdf7}
.memo-card.pinned{border-color:#f59e0b;background:#fffbeb;box-shadow:0 1px 8px rgba(245,158,11,.14)}
.memo-card .mc-body{font-size:12.5px;color:#374151;white-space:pre-wrap;line-height:1.65;overflow:hidden;word-break:break-word}
.memo-card:not(.expanded) .mc-body{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical}
.memo-card.expanded{grid-column:1/-1;background:#fffdf7;border-color:#AE831F}
.memo-entry .meta{font-size:10px;color:#94a3b8;margin-bottom:4px;display:flex;align-items:center;justify-content:space-between}
.memo-entry .text{font-size:12px;color:#374151;white-space:pre-wrap}
.memo-btn{background:none;border:1px solid #e2e8f0;border-radius:4px;font-size:10px;padding:1px 6px;cursor:pointer;color:#94a3b8}
.memo-btn.del{border-color:#fca5a5;color:#ef4444}
.badge-freedb{background:#ede9fe;color:#5b21b6}
.badge-prospect{background:#fef9ec;color:#8B6718}
.badge-complete{background:#fef3c7;color:#92400e}
.badge-noprospect{background:#f0ece4;color:#5a4f45}
.badge-long{background:#fee2e2;color:#991b1b}
.badge-payment{background:#fef9ec;color:#8B6718}
.badge-highprospect{background:#dcfce7;color:#15803d}
.badge-absent{background:#ffe4e6;color:#be123c}
.badge-admin{background:#fef9ec;color:#8B6718}
.badge-staff{background:#FDF6E3;color:#AE831F}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-bottom:16px}
/* ===== 로딩 스켈레톤 (PHASE 2) ===== */
.sk-line{background:linear-gradient(90deg,#eef1f5 25%,#f6f8fa 37%,#eef1f5 63%);background-size:400% 100%;
  border-radius:5px;animation:sk 1.3s ease infinite}
/* ===== 관리자 모드 토글 (PHASE 3-3) ===== */
.adm-toggle{display:flex;align-items:center;cursor:pointer;user-select:none;margin-left:auto;flex:0 0 auto}
.adm-switch{position:relative;display:inline-block;width:40px;height:22px;background:#262626;
  border-radius:11px;transition:background .2s;flex:0 0 auto;box-shadow:inset 0 0 0 1px rgba(255,255,255,.07)}
.adm-knob{position:absolute;top:2px;left:2px;width:18px;height:18px;background:#fff;border-radius:50%;
  box-shadow:0 1px 3px rgba(0,0,0,.45);transition:transform .2s}
.adm-switch:hover{background:#333}
#adminToggle:checked + .adm-switch{background:#AE831F;box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
#adminToggle:checked + .adm-switch .adm-knob{transform:translateX(18px)}
.adm-label{font-size:10.5px;color:#7a6a5a;font-weight:700;letter-spacing:.02em;white-space:nowrap}
#adminToggle:checked ~ .adm-label{color:#F5E6C0}
/* 색 고르기 패널 */
.admtheme-fab{position:fixed;left:14px;bottom:14px;z-index:9998;width:34px;height:34px;border:none;
  border-radius:50%;background:rgba(255,255,255,.1);color:#fff;font-size:15px;cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.3);display:none}
.admtheme-fab:hover{background:rgba(255,255,255,.2)}
.admtheme-sheet{position:fixed;inset:0;z-index:100001;background:rgba(15,23,42,.55);
  display:flex;align-items:center;justify-content:center;padding:20px}
.admtheme-card{background:#fff;border-radius:14px;max-width:460px;width:100%;padding:22px;
  box-shadow:0 20px 50px rgba(0,0,0,.3)}
.admtheme-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.admtheme-opt{border:2px solid #e5e7eb;border-radius:10px;padding:10px;cursor:pointer;background:#fff;
  text-align:left;font-family:inherit}
.admtheme-opt.on{border-color:#AE831F;background:#fdf6e3}
.admtheme-opt:hover{border-color:#cbd5e1}
.admtheme-swatch{height:44px;border-radius:7px;display:flex;align-items:center;padding:0 8px;gap:5px}
.admtheme-dot{width:7px;height:7px;border-radius:50%}
.admtheme-name{font-size:12.5px;font-weight:700;color:#1e293b;margin-top:7px}


/* 사이드바 알림 점 — 그 화면에 새로 올라온 게 있을 때만 */
.nav-item { position: relative; }
.nav-item .nav-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #f97316; box-shadow: 0 0 0 2px rgba(249,115,22,.22);
  display: inline-block; flex: 0 0 auto; margin-left: 6px;
  vertical-align: middle;
}

/* 모드 토글 위의 알림 점 — 반대쪽 화면에 새 게 있을 때 */
.adm-toggle { position: relative; }
.adm-toggle > .nav-dot {
  position: absolute; top: -3px; right: -3px; margin: 0;
}
