/* my-admin 공용 디자인 토큰 + 부품. 셸과 모든 앱이 함께 링크한다.
   테마는 html[data-theme="light|dark"] 로 전환한다(shared/embed.js 또는 셸이 설정). */

html[data-theme="light"], :root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f4; --line: #e3e6eb;
  --text: #1c1f26; --text-dim: #6b7280;
  --accent: #3b82f6; --accent-soft: #e8f0ff; --on-accent: #ffffff;
  --success: #17794a; --success-soft: #e3f4ea;
  --warn: #b4530d; --warn-soft: #fdeede;
  --danger: #c62b3f;
  --side: #1f2430; --side-text: #cfd5e1; --side-active: #2e3546;
  --shadow: 0 1px 2px rgba(20,20,40,.06), 0 8px 24px rgba(20,20,40,.08);
  --scrim: rgba(0,0,0,.45);
  --radius: 12px; --radius-sm: 8px;
  --content-max: 1280px; /* 셸 안 앱 콘텐츠 공통 최대 폭 */
  --font: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", "IBM Plex Mono", monospace;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a21; --surface-2: #1f232c; --line: #262b36;
  --text: #e7e9ee; --text-dim: #8b93a5;
  --accent: #6ea0ff; --accent-soft: #1d2a44; --on-accent: #0f1115;
  --success: #5cd39a; --success-soft: #16302a;
  --warn: #f0a763; --warn-soft: #35251a;
  --danger: #ff7b8c;
  --side: #0b0d12; --side-text: #aab2c3; --side-active: #1c212c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);
  --scrim: rgba(0,0,0,.6);
  color-scheme: dark;
}

/* 기본 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }
.ui-muted { color: var(--text-dim); }

/* 부품 */
.ui-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ui-card.raised { box-shadow: var(--shadow); }

.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 600; }
.ui-btn:hover { border-color: var(--text-dim); }
.ui-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ui-btn.ghost { background: transparent; }
.ui-btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.ui-btn[disabled] { opacity: .55; cursor: default; }
.ui-btn.block { width: 100%; }

.ui-icon-btn { width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-dim); font-size: 16px; }
.ui-icon-btn:hover { color: var(--text); }

.ui-field { width: 100%; padding: 11px 14px; font-size: 15px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; }
.ui-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.ui-chip { display: inline-flex; align-items: center; padding: 6px 13px; font-size: 13px; border-radius: 999px; cursor: pointer; user-select: none;
  background: var(--surface); color: var(--text-dim); border: 1px solid var(--line); }
.ui-chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.ui-segment { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--radius-sm); }
.ui-segment > button { padding: 7px 14px; border: 0; border-radius: 6px; background: transparent; color: var(--text-dim); font-size: 14px; font-weight: 600; }
.ui-segment > button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.ui-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ui-table th, .ui-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.ui-table th { color: var(--text-dim); font-weight: 600; font-size: 12px; }
.ui-table td.num, .ui-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.ui-empty { text-align: center; color: var(--text-dim); padding: 48px 20px; font-size: 14px; }

/* 임베드(셸 iframe 안) 공통: 앱 자체 제목 줄은 숨긴다 */
html[data-embed] .app-own-title { display: none !important; }
