/* 색상 테마 토큰 (다크/라이트).
   이 파일은 색상 값만 정의합니다. 레이아웃·간격 등은 style.css 에 있습니다.
   기본값은 다크(기존 디자인)이며, 사용자가 아직 테마를 고르지 않았다면
   OS 설정이 라이트일 때만 라이트로 전환됩니다. */

:root {
  /* 표면(배경) */
  --bg: #16241c;
  --bg-deep: #101a14;
  --sidebar: #1c2f24;
  --topbar: #13211a;
  --panel: #1f3529;
  --panel-soft: #244030;
  --panel-hover: #2b4a37;
  --surface-alt: #2b3443;
  --field-bg: #20372a;
  --field-bg-soft: #1c3024;
  --table-head-bg: #303847;
  --table-stripe-bg: #394353;
  --badge-bg: #22452f;

  /* 경계선 */
  --border-strong: #2f5340;
  --border: #33513d;
  --border-faint: #3f6650;
  --field-border: #3a5c45;
  --brand-border: #2a4634;
  --topbar-border: #26412f;
  --line: #35543f;
  --line-soft: rgba(255, 255, 255, .07);

  /* 본문 텍스트 */
  --ink: #eaf4ed;
  --muted: #9db3a6;
  --text-strong: #ffffff;
  --text-faint: #9ba7b8;
  --text-label: #cbd3de;
  --text-body-alt: #dce2eb;
  --field-placeholder: #7e899a;
  --h1-color: #f2f5f9;
  --h2-color: #f0f3f8;
  --h3-color: #eef2f7;

  /* 사이드바/탑바/테이블 (슬레이트 계열) */
  --nav-text: #aab5c5;
  --nav-hover-bg: #3b4658;
  --nav-hover-text: #ffffff;
  --nav-icon: #7d8b9f;
  --chrome-label: #748196;
  --chrome-caption: #8390a3;
  --topbar-title: #dfe5ee;
  --topbar-user: #b9c3d2;
  --guest-footer: #778397;
  --table-head-text: #cbd3df;
  --table-cell-text: #dce2eb;

  /* 브랜드/강조 */
  --accent: #6fd39a;
  --accent-strong: #4fbd80;
  --accent-ink: #0f2618;
  --primary: #2f9e63;
  --success: #33c86b;
  --warning: #f0b94c;
  --danger: #ef6470;
  --link-hover: #8fe0b0;
  --badge-text: #8fe0b0;

  /* 안내/배지/플래시 */
  --chip-warn-bg: rgba(240, 185, 76, .14);
  --chip-warn-text: #ffd27a;
  --chip-success-bg: rgba(51, 200, 107, .14);
  --chip-success-text: #72e49b;
  --flash-warn-bg: #554b2e;
  --flash-warn-border: #74663a;
  --flash-warn-text: #ffe8a6;
  --flash-danger-bg: #5b2028;
  --flash-danger-border: #a94051;
  --flash-danger-text: #ffd5da;
  --status-active-bg: #153f32;
  --status-active-text: #65e6b2;
  --status-suspended-bg: #502229;
  --status-suspended-text: #ff9aa8;
  --danger-btn-bg: #a9384b;
  --danger-btn-border: #c64b60;

  --sidebar-width: 180px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e3eee7;
    --bg-deep: #d3e3d9;
    --sidebar: #ffffff;
    --topbar: #ffffff;
    --panel: #ffffff;
    --panel-soft: #eaf4ef;
    --panel-hover: #dcefe4;
    --surface-alt: #e7f1eb;
    --field-bg: #eaf5ef;
    --field-bg-soft: #ffffff;
    --table-head-bg: #eaf3ee;
    --table-stripe-bg: #f2f8f4;
    --badge-bg: #d8f0e2;

    --border-strong: #a9cdb8;
    --border: #bcdbc9;
    --border-faint: #b3d4bf;
    --field-border: #94bfa3;
    --brand-border: #d3e6da;
    --topbar-border: #d3e6da;
    --line: #c3dccb;
    --line-soft: rgba(22, 64, 42, .08);

    --ink: #16241c;
    --muted: #5b6b62;
    --text-strong: #16241c;
    --text-faint: #66756c;
    --text-label: #3c4a42;
    --text-body-alt: #33413a;
    --field-placeholder: #8a968f;
    --h1-color: #16241c;
    --h2-color: #1c2b21;
    --h3-color: #223327;

    --nav-text: #4a5a63;
    --nav-hover-bg: #e7edf3;
    --nav-hover-text: #16241c;
    --nav-icon: #5f6e79;
    --chrome-label: #6b7a86;
    --chrome-caption: #7c8b96;
    --topbar-title: #1c2733;
    --topbar-user: #465361;
    --guest-footer: #6b7885;
    --table-head-text: #3d4a58;
    --table-cell-text: #2b3540;

    --accent: #2f9e63;
    --accent-strong: #22824f;
    --accent-ink: #ffffff;
    --primary: #2f9e63;
    --success: #1f9c53;
    --warning: #b5790a;
    --danger: #d1425a;
    --link-hover: #1f7a4c;
    --badge-text: #1f7a4c;

    --chip-warn-bg: #fdf1d6;
    --chip-warn-text: #8a5a05;
    --chip-success-bg: #dff5e6;
    --chip-success-text: #1c8a52;
    --flash-warn-bg: #fdf3da;
    --flash-warn-border: #f0dba3;
    --flash-warn-text: #7a5b12;
    --flash-danger-bg: #fbe3e6;
    --flash-danger-border: #f2b9c1;
    --flash-danger-text: #a12f42;
    --status-active-bg: #dcf5e6;
    --status-active-text: #1c8a52;
    --status-suspended-bg: #fbe1e4;
    --status-suspended-text: #b8394d;
    --danger-btn-bg: #d1425a;
    --danger-btn-border: #e07d8d;
  }
}

:root[data-theme="light"] {
  --bg: #e3eee7;
  --bg-deep: #d3e3d9;
  --sidebar: #ffffff;
  --topbar: #ffffff;
  --panel: #ffffff;
  --panel-soft: #eaf4ef;
  --panel-hover: #dcefe4;
  --surface-alt: #e7f1eb;
  --field-bg: #eaf5ef;
  --field-bg-soft: #ffffff;
  --table-head-bg: #eaf3ee;
  --table-stripe-bg: #f2f8f4;
  --badge-bg: #d8f0e2;

  --border-strong: #a9cdb8;
  --border: #bcdbc9;
  --border-faint: #b3d4bf;
  --field-border: #94bfa3;
  --brand-border: #d3e6da;
  --topbar-border: #d3e6da;
  --line: #c3dccb;
  --line-soft: rgba(22, 64, 42, .08);

  --ink: #16241c;
  --muted: #5b6b62;
  --text-strong: #16241c;
  --text-faint: #66756c;
  --text-label: #3c4a42;
  --text-body-alt: #33413a;
  --field-placeholder: #8a968f;
  --h1-color: #16241c;
  --h2-color: #1c2b21;
  --h3-color: #223327;

  --nav-text: #4a5a63;
  --nav-hover-bg: #e7edf3;
  --nav-hover-text: #16241c;
  --nav-icon: #5f6e79;
  --chrome-label: #6b7a86;
  --chrome-caption: #7c8b96;
  --topbar-title: #1c2733;
  --topbar-user: #465361;
  --guest-footer: #6b7885;
  --table-head-text: #3d4a58;
  --table-cell-text: #2b3540;

  --accent: #2f9e63;
  --accent-strong: #22824f;
  --accent-ink: #ffffff;
  --primary: #2f9e63;
  --success: #1f9c53;
  --warning: #b5790a;
  --danger: #d1425a;
  --link-hover: #1f7a4c;
  --badge-text: #1f7a4c;

  --chip-warn-bg: #fdf1d6;
  --chip-warn-text: #8a5a05;
  --chip-success-bg: #dff5e6;
  --chip-success-text: #1c8a52;
  --flash-warn-bg: #fdf3da;
  --flash-warn-border: #f0dba3;
  --flash-warn-text: #7a5b12;
  --flash-danger-bg: #fbe3e6;
  --flash-danger-border: #f2b9c1;
  --flash-danger-text: #a12f42;
  --status-active-bg: #dcf5e6;
  --status-active-text: #1c8a52;
  --status-suspended-bg: #fbe1e4;
  --status-suspended-text: #b8394d;
  --danger-btn-bg: #d1425a;
  --danger-btn-border: #e07d8d;
}

:root[data-theme="dark"] {
  --bg: #16241c;
  --bg-deep: #101a14;
  --sidebar: #1c2f24;
  --topbar: #13211a;
  --panel: #1f3529;
  --panel-soft: #244030;
  --panel-hover: #2b4a37;
  --surface-alt: #2b3443;
  --field-bg: #20372a;
  --field-bg-soft: #1c3024;
  --table-head-bg: #303847;
  --table-stripe-bg: #394353;
  --badge-bg: #22452f;

  --border-strong: #2f5340;
  --border: #33513d;
  --border-faint: #3f6650;
  --field-border: #3a5c45;
  --brand-border: #2a4634;
  --topbar-border: #26412f;
  --line: #35543f;
  --line-soft: rgba(255, 255, 255, .07);

  --ink: #eaf4ed;
  --muted: #9db3a6;
  --text-strong: #ffffff;
  --text-faint: #9ba7b8;
  --text-label: #cbd3de;
  --text-body-alt: #dce2eb;
  --field-placeholder: #7e899a;
  --h1-color: #f2f5f9;
  --h2-color: #f0f3f8;
  --h3-color: #eef2f7;

  --nav-text: #aab5c5;
  --nav-hover-bg: #3b4658;
  --nav-hover-text: #ffffff;
  --nav-icon: #7d8b9f;
  --chrome-label: #748196;
  --chrome-caption: #8390a3;
  --topbar-title: #dfe5ee;
  --topbar-user: #b9c3d2;
  --guest-footer: #778397;
  --table-head-text: #cbd3df;
  --table-cell-text: #dce2eb;

  --accent: #6fd39a;
  --accent-strong: #4fbd80;
  --accent-ink: #0f2618;
  --primary: #2f9e63;
  --success: #33c86b;
  --warning: #f0b94c;
  --danger: #ef6470;
  --link-hover: #8fe0b0;
  --badge-text: #8fe0b0;

  --chip-warn-bg: rgba(240, 185, 76, .14);
  --chip-warn-text: #ffd27a;
  --chip-success-bg: rgba(51, 200, 107, .14);
  --chip-success-text: #72e49b;
  --flash-warn-bg: #554b2e;
  --flash-warn-border: #74663a;
  --flash-warn-text: #ffe8a6;
  --flash-danger-bg: #5b2028;
  --flash-danger-border: #a94051;
  --flash-danger-text: #ffd5da;
  --status-active-bg: #153f32;
  --status-active-text: #65e6b2;
  --status-suspended-bg: #502229;
  --status-suspended-text: #ff9aa8;
  --danger-btn-bg: #a9384b;
  --danger-btn-border: #c64b60;
}
