/* ============================================
   나눔보청기 CRM — Design System
   Teal 메인 + 딥네이비, Comfortable 밀도
   ============================================ */

:root {
  /* Brand */
  --teal: #0FA3A3;
  --teal-hover: #0B8585;
  --teal-deep: #086A6A;
  --teal-tint: #E6F5F5;
  --teal-tint-2: #CFEBEB;

  --navy: #0F1E33;
  --navy-2: #1A2B44;
  --navy-3: #2A3B54;

  /* Signal (로고 3색을 상태 컬러로) */
  --sig-blue: #0B6FB0;
  --sig-blue-bg: #E6F0F8;
  --sig-yellow: #E8AC10;
  --sig-yellow-bg: #FDF4DC;
  --sig-red: #DC2E26;
  --sig-red-bg: #FCE7E6;
  --sig-green: #17936A;
  --sig-green-bg: #E4F3EC;

  /* Neutral */
  --bg: #F5F7F9;
  --bg-2: #EEF2F6;
  --card: #FFFFFF;
  --border: #E4E8EE;
  --border-strong: #CBD3DD;
  --text: #0F1E33;
  --text-2: #475467;
  --text-3: #64748B;
  --text-muted: #94A3B8;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 30, 51, 0.04), 0 1px 3px rgba(15, 30, 51, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 30, 51, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 30, 51, 0.12);
  --shadow-xl: 0 24px 60px rgba(15, 30, 51, 0.18);

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Type */
  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-num: 'Inter', 'Pretendard Variable', sans-serif;
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' on, 'ss02' on;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   App Shell
   ============================================ */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 1fr;
  grid-template-areas:
    "sidebar main";
  height: 100vh;
  overflow: hidden;
}

.app.login-mode {
  display: block;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  grid-area: sidebar;
  background: var(--navy);
  color: #E5EAF2;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
  padding: 20px 20px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand img {
  width: 32px;
  height: 32px;
  filter: brightness(1.2);
}

.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-brand .brand-name {
  font-weight: 700;
  font-size: 15px;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.sidebar-brand .brand-sub {
  font-size: 11px;
  color: #8DA0B8;
  margin-top: 2px;
  font-weight: 500;
}

.sidebar-section-label {
  padding: 18px 20px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #6E809A;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  margin: 2px 12px;
  border-radius: var(--r-md);
  color: #B8C4D6;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #FFFFFF;
}

.nav-item.active {
  background: rgba(15, 163, 163, 0.15);
  color: #FFFFFF;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--teal);
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  font-weight: 600;
  font-family: var(--font-num);
}

.nav-item .nav-count.alert {
  background: var(--sig-red);
  color: #fff;
}

/* v6: 헤더 오른쪽 연동 상태 칩 (문자왕국 등) */
.integration-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
  cursor: default;
}

.integration-chip .ic-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.integration-chip-pending {
  background: #FDF4DC;
  border-color: #F0D989;
  color: #7A5A00;
}

.integration-chip-pending .ic-dot {
  background: #E8AC10;
  box-shadow: 0 0 0 3px rgba(232,172,16,0.18);
}

.integration-chip-live {
  background: #E4F3EC;
  border-color: #B7DFC8;
  color: #0F6E4F;
}

.integration-chip-live .ic-dot {
  background: #17936A;
  box-shadow: 0 0 0 3px rgba(23,147,106,0.18);
}

/* v6: 연동 예정(비활성) 항목 */
.nav-item.disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-item .nav-badge-soon {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: #8DA0B8;
  font-family: var(--font-num);
}

.nav-item .nav-badge-beta {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in oklab, #F59E0B 25%, transparent);
  color: #FDE68A;
  font-family: var(--font-num);
}
.nav-item.active .nav-badge-beta {
  background: color-mix(in oklab, #F59E0B 40%, transparent);
  color: #FEF3C7;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.sidebar-user .user-role {
  font-size: 11px;
  color: #8DA0B8;
}

.sidebar-logout {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #8DA0B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-logout:hover {
  background: rgba(220,46,38,0.14);
  border-color: rgba(220,46,38,0.35);
  color: #FEE;
}

.sidebar-logout:active {
  transform: scale(0.96);
}

/* ============================================
   Call Bar (상단 풀폭)
   ============================================ */

.callbar {
  grid-area: callbar;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}

.callbar.idle {
  color: var(--text-3);
}

.callbar.ringing {
  background: linear-gradient(90deg, var(--teal-tint) 0%, #FFFFFF 100%);
  border-bottom-color: var(--teal);
}

.callbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  flex-shrink: 0;
}

.callbar-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94A3B8;
}

.callbar.ringing .dot {
  background: var(--teal);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15,163,163,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(15,163,163,0); }
}

.callbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.callbar-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.callbar-info > * { flex-shrink: 0; }
.callbar-info > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

.callbar-info strong {
  color: var(--text);
  font-weight: 600;
}

.callbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.callbar-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  height: 30px;
}

.callbar-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.callbar-btn.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  padding: 6px 14px;
  height: 32px;
}

.callbar-btn.primary:hover {
  background: var(--teal-hover);
}

.callbar-btn.icon-only {
  padding: 0;
  width: 30px;
  justify-content: center;
}

/* ============================================
   Main
   ============================================ */

.main {
  grid-area: main;
  overflow-y: auto;
  background: var(--bg);
}

.page-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin: 2px 0 0;
}

.page-header-right {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.page-body {
  padding: 24px 32px 40px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--teal);
  color: #fff;
}
.btn-primary:hover { background: var(--teal-hover); }

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }

.btn-danger {
  background: var(--sig-red);
  color: #fff;
}
.btn-danger:hover { background: #B92620; }

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}

/* ============================================
   Forms
   ============================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.field-label .req {
  color: var(--sig-red);
  margin-left: 2px;
}

.input, .select, .textarea {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15,163,163,0.12);
}

.input-icon {
  position: relative;
}

.input-icon .input {
  padding-left: 38px;
}

.input-icon svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon .input:focus + svg,
.input-icon:focus-within svg {
  color: var(--teal);
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-3);
  margin: 0 0 16px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.card-head .card-title { margin: 0; }
.card-head-right { margin-left: auto; }

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-blue { background: var(--sig-blue-bg); color: var(--sig-blue); }
.badge-yellow { background: var(--sig-yellow-bg); color: #A67A00; }
.badge-red { background: var(--sig-red-bg); color: var(--sig-red); }
.badge-redark { background: #2A0F0F; color: #FDD; }
.badge-green { background: var(--sig-green-bg); color: var(--sig-green); }
.badge-teal { background: var(--teal-tint); color: var(--teal-deep); }
.badge-gray { background: var(--bg-2); color: var(--text-2); }

/* Status Badge — colored dot + label */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.status-badge .sb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-badge.tone-green   { background: var(--sig-green-bg);  color: var(--sig-green); }
.status-badge.tone-red     { background: var(--sig-red-bg);    color: var(--sig-red); }
.status-badge.tone-yellow  { background: var(--sig-yellow-bg); color: #A67A00; }
.status-badge.tone-blue    { background: var(--sig-blue-bg);   color: var(--sig-blue); }
.status-badge.tone-gray    { background: var(--bg-2);          color: var(--text-2); }
.status-badge.tone-redark  { background: #2A0F0F;              color: #FEE; }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================
   Tables
   ============================================ */

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table thead th {
  background: #F9FBFC;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  height: 48px;
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover {
  background: #FAFBFC;
  cursor: pointer;
}

.table .cell-strong { font-weight: 600; }
.table .cell-muted { color: var(--text-3); font-size: 13px; }

/* ============================================
   Tabs
   ============================================ */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}

.tab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--teal-deep);
  border-bottom-color: var(--teal);
}

.tab .tab-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text-3);
  font-family: var(--font-num);
}

.tab.active .tab-count {
  background: var(--teal-tint);
  color: var(--teal-deep);
}

/* ============================================
   Utilities
   ============================================ */

.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.text-muted { color: var(--text-3); }
.text-sub { color: var(--text-2); }
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); }
.divider-v { width: 1px; background: var(--border); align-self: stretch; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD3DD; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }


/* ============================================
   Screen-specific styles
   ============================================ */

/* ---------- Login ---------- */
.login-screen {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  height: 100vh;
  background: #fff;
}

.login-brand {
  background: linear-gradient(160deg, #0F1E33 0%, #14283F 60%, #0F1E33 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-brand-inner {
  position: relative;
  z-index: 2;
  max-width: 480px;
  padding: 60px 60px;
  width: 100%;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 80px;
}

.login-logo img {
  width: 44px;
  height: 44px;
  filter: brightness(1.3);
}

.login-brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.login-brand-tag {
  font-size: 12px;
  color: #8DA0B8;
  letter-spacing: 0.06em;
  margin-top: 2px;
  font-family: var(--font-num);
  text-transform: uppercase;
}

.login-headline h1 {
  font-size: 42px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.login-headline p {
  font-size: 15px;
  color: #B8C4D6;
  line-height: 1.7;
  margin: 0 0 60px;
}

.login-stats {
  display: flex;
  gap: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.login-stat .stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: -0.01em;
}

.login-stat .stat-label {
  font-size: 12px;
  color: #8DA0B8;
  margin-top: 4px;
}

.login-waves {
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 500px;
  height: 500px;
  opacity: 0.6;
  pointer-events: none;
}

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-form {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-form-head {
  margin-bottom: 12px;
}

.login-form-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.login-form-sub {
  font-size: 14px;
  color: var(--text-3);
  margin-top: 4px;
}

.login-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  margin: 4px 0 8px;
}

.login-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.login-submit {
  width: 100%;
  font-size: 15px;
}

.login-form-foot {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 8px;
}

.login-form-foot a {
  color: var(--text-2);
  text-decoration: none;
}
.login-form-foot a:hover { color: var(--teal); }

.login-version {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 40px;
  font-family: var(--font-num);
}

/* v7.2: 로그인 모드 세그먼트 */
.login-mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 20px;
}
.login-mode-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.15s;
}
.login-mode-tab:hover { color: var(--text); }
.login-mode-tab.active {
  background: var(--card);
  color: var(--teal-deep);
  box-shadow: 0 1px 2px rgba(15, 30, 51, 0.06);
}

.admin-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-size: 12.5px;
  margin-bottom: 16px;
  border: 1px solid var(--teal-tint-2);
  line-height: 1.5;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--sig-red-bg);
  color: var(--sig-red);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 12px;
}

/* ---------- Dashboard ---------- */
.quick-search {
  position: relative;
  margin-bottom: 24px;
}

.quick-search-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  height: 60px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

.quick-search-inner:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15,163,163,0.08);
}

.quick-search-inner > svg { color: var(--text-3); }
.quick-search-inner:focus-within > svg { color: var(--teal); }

.quick-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
}

.kbd {
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  font-family: var(--font-num);
}

.quick-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  overflow: hidden;
}

.quick-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.quick-result:last-child { border-bottom: none; }
.quick-result:hover { background: var(--bg); }

.result-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.result-info { flex: 1; }
.result-name { font-weight: 600; font-size: 14px; }
.result-id { color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: 6px; }
.result-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* v6: 2개 KPI 카드 노출 시 좌측 정렬 + 카드 크기 유지 */
.kpi-grid.kpi-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 320px));
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--teal);
}

.kpi-card.tone-teal::before { background: var(--teal); }
.kpi-card.tone-blue::before { background: var(--sig-blue); }
.kpi-card.tone-yellow::before { background: var(--sig-yellow); }
.kpi-card.tone-red::before { background: var(--sig-red); }

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tone-teal .kpi-icon { background: var(--teal-tint); color: var(--teal-deep); }
.tone-blue .kpi-icon { background: var(--sig-blue-bg); color: var(--sig-blue); }
.tone-yellow .kpi-icon { background: var(--sig-yellow-bg); color: #A67A00; }
.tone-red .kpi-icon { background: var(--sig-red-bg); color: var(--sig-red); }

.kpi-body { flex: 1; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--text-3); font-weight: 500; }
.kpi-value { font-size: 32px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; flex-wrap: wrap; }
.kpi-foot .kpi-delta { white-space: nowrap; }
.kpi-foot .kpi-sub { white-space: nowrap; font-size: 11px; }

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}
.kpi-delta.up { color: var(--sig-green); background: var(--sig-green-bg); }
.kpi-delta.down { color: var(--sig-red); background: var(--sig-red-bg); }
.kpi-delta.neutral { color: var(--text-3); background: var(--bg-2); }

.kpi-sub { color: var(--text-3); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.list-item:hover { background: var(--bg); }

.list-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.list-body { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; color: var(--text); }
.list-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.list-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sig-red);
  display: inline-block;
}

.memo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.memo-item {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.memo-item:hover { border-color: var(--teal); background: var(--teal-tint); background: rgba(15,163,163,0.03); }

.memo-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.memo-name { font-weight: 700; font-size: 14px; }

.memo-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.memo-foot { margin-top: 8px; }

.schedule {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}
.schedule-item:last-child { border-bottom: none; }

.schedule-time {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  width: 60px;
  flex-shrink: 0;
}

.schedule-item.done .schedule-time { color: var(--text-3); }
.schedule-item.done .schedule-name { color: var(--text-3); }
.schedule-item.now { background: var(--teal-tint); border-radius: 8px; padding-left: 16px; padding-right: 16px; margin: 2px 0; }
.schedule-item.now .schedule-time { color: var(--teal-deep); }

.schedule-body { flex: 1; }
.schedule-name { font-weight: 600; }
.schedule-type { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- Customer Detail ---------- */
.customer-hero {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  flex-shrink: 0;
}

.hero-main { flex: 1; min-width: 0; }

.hero-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero-meta { color: var(--text-3); font-size: 14px; }

.hero-facts {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.fact-item svg { color: var(--text-3); }

.hero-highlights {
  display: flex;
  gap: 12px;
}

.highlight-tile {
  min-width: 130px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.highlight-tile.warn {
  background: var(--sig-yellow-bg);
  border-color: rgba(232,172,16,0.3);
}

.tile-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tile-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.tile-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.detail-tabs { margin-bottom: 20px; }

.detail-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.detail-main {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  min-height: 400px;
}

.detail-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}

.side-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.side-card-head .teal { color: var(--teal); }

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-item {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
}
.action-item:last-child { margin-bottom: 0; }

.action-title { font-weight: 600; font-size: 13px; }
.action-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.file-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.file-item:last-child { border-bottom: none; }
.file-item svg { color: var(--text-3); flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; }
.file-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--text-muted);
  box-shadow: 0 0 0 1px var(--border);
}

.timeline-dot.tone-blue { background: var(--sig-blue); }
.timeline-dot.tone-yellow { background: var(--sig-yellow); }
.timeline-dot.tone-red { background: var(--sig-red); }
.timeline-dot.tone-green { background: var(--sig-green); }
.timeline-dot.tone-gray { background: var(--text-muted); }

.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline-title { font-weight: 700; font-size: 15px; }
.timeline-body { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.timeline-foot { font-size: 12px; margin-top: 6px; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.info-row {
  display: flex;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.info-label {
  width: 120px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}

.info-value {
  flex: 1;
  font-weight: 500;
}

.memo-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.memo-timeline-item {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--teal);
}

.memo-timeline-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 8px;
}

.memo-timeline-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* ---------- Call Drawer ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 51, 0.4);
  z-index: 100;
  animation: fadeIn 0.2s;
}

.call-drawer {
  position: fixed;
  top: 56px;
  left: 240px;
  bottom: 0;
  width: 480px;
  background: #fff;
  z-index: 101;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: slideInLeft 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInLeft {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.call-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.ringing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 600;
}

.ring-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 1.2s infinite;
}

.call-hero {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.call-hero.unknown { background: var(--sig-red-bg); }

.unknown-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--sig-red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
}

.call-hero-name {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.name-big {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.name-meta {
  font-size: 15px;
  color: var(--text-3);
}

.phone-big {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.call-hero-line { margin-bottom: 14px; }

.call-hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.call-hero.unknown .chip { background: #fff; }

.call-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1.5px solid var(--border-strong);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
}

.quick-action:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: var(--teal-tint);
}

.quick-action svg { color: var(--text-2); }
.quick-action:hover svg { color: var(--teal-deep); }

.quick-action.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.quick-action.primary svg { color: #fff; }
.quick-action.primary:hover { background: var(--teal-hover); color: #fff; }
.quick-action.primary:hover svg { color: #fff; }

.call-highlight {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.highlight-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.highlight-body strong {
  font-size: 14px;
  font-weight: 700;
}

.highlight-body p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.call-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

.fact {
  padding: 16px 24px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fact-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fact-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.fact-sub {
  font-size: 12px;
  color: var(--text-3);
}

/* Register form (unregistered) */
.register-form {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.register-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---------- Message Screen ---------- */
.msg-layout {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 16px;
}

.chip-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-tab {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  background: var(--bg-2);
}

.chip-tab.active {
  background: var(--teal);
  color: #fff;
}

.template-list {
  max-height: 620px;
  overflow-y: auto;
}

.template-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.template-item:hover { background: var(--bg); }
.template-item.active {
  background: var(--teal-tint);
  border-left-color: var(--teal);
}

.template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.template-name { font-weight: 700; font-size: 14px; }

.template-preview {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipient-box {
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.recipient-chip button {
  color: var(--teal-deep);
  display: flex;
  padding: 2px;
  border-radius: 3px;
}
.recipient-chip button:hover { background: rgba(11,122,122,0.15); }

.add-recipient {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
.add-recipient {
  cursor: pointer;
  background: transparent;
  font-family: inherit;
}
.add-recipient:hover { border-color: var(--teal); color: var(--teal); }

/* v7.4: 수신자 관련 */
.recipient-empty {
  font-size: 12.5px;
  color: var(--text-3);
  padding: 4px 8px;
  font-style: italic;
}
.btn-textlink {
  border: none;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  font-family: inherit;
}
.btn-textlink:hover { text-decoration: underline; }

/* 수신자 선택 모달 리스트 */
.picker-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card);
}
.picker-head {
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.picker-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.picker-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
  cursor: pointer;
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: var(--teal-tint); }
.picker-row.checked { background: var(--teal-tint); }
.picker-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}
.picker-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal-tint-2);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.picker-info { flex: 1; min-width: 0; }
.picker-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
}
.picker-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.picker-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.picker-empty svg {
  display: block;
  margin: 0 auto 8px;
}
.picker-hint {
  padding: 10px 14px;
  background: var(--sig-yellow-bg);
  color: #A67A00;
  font-size: 12px;
  border-top: 1px solid var(--border);
}

.msg-preview-card {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.msg-preview-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.msg-preview-bubble {
  padding: 12px 14px;
  background: #fff;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  max-width: 380px;
}

.msg-preview-foot {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-3);
}

code.mono {
  padding: 1px 5px;
  background: var(--bg-2);
  border-radius: 3px;
  font-size: 12px;
  color: var(--teal-deep);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  padding: 12px;
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.history-name { font-weight: 700; font-size: 14px; }
.history-meta { font-size: 12px; color: var(--text-3); }
.history-tpl { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.history-time { font-size: 11px; margin-top: 4px; }


/* ============================================
   3차 추가 화면 스타일
   - 고객 목록 / 해피콜 / 엑셀 업로드 / 시스템 설정
   ============================================ */

/* ---------- Filter Bar (공통) ---------- */
.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
}

.filter-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.filter-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.filter-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  justify-content: space-between;
}

.filter-actions-left, .filter-actions-right {
  display: flex;
  gap: 8px;
}

.field-compact { gap: 4px; }
.field-compact .field-label { font-size: 12px; }
.field-compact .input,
.field-compact .select { height: 36px; font-size: 13px; }

/* ---------- Data Table 강화 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  background: #F9FBFC;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table thead th.num,
.data-table tbody td.num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.data-table thead th.center,
.data-table tbody td.center { text-align: center; }

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.data-table tbody tr:hover { background: #FAFBFC; }

.data-table .col-id { color: var(--text-2); }
.data-table .col-name { font-weight: 600; }
.data-table .col-muted { color: var(--text-3); }

.data-table .row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.data-table tbody tr:hover .row-actions { opacity: 1; }

.mini-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.mini-btn:hover { border-color: var(--teal); color: var(--teal); }
.mini-btn.danger:hover { border-color: var(--sig-red); color: var(--sig-red); }
.mini-btn.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.mini-btn.primary:hover { background: var(--teal-hover); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #FAFBFC;
  gap: 4px;
}

.pagination .page-info {
  margin-right: auto;
  font-size: 13px;
  color: var(--text-3);
}

.pagination .page-info .mono { color: var(--text-2); }

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
}
.page-btn:hover { border-color: var(--teal); color: var(--teal); }
.page-btn.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Happycall Summary Cards ---------- */
.happycall-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.summary-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  position: relative;
}

.summary-card .sc-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-card .sc-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.summary-card.tone-blue   .sc-label .dot { background: var(--sig-blue); }
.summary-card.tone-green  .sc-label .dot { background: var(--sig-green); }
.summary-card.tone-red    .sc-label .dot { background: var(--sig-red); }
.summary-card.tone-gray   .sc-label .dot { background: var(--text-muted); }
.summary-card.tone-yellow .sc-label .dot { background: var(--sig-yellow); }

.summary-card .sc-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-top: 6px;
  letter-spacing: -0.02em;
  font-family: var(--font-num);
  line-height: 1.1;
}

.summary-card .sc-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.hc-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--sig-blue-bg);
  border: 1px solid rgba(11,111,176,0.2);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--sig-blue);
  margin-bottom: 16px;
}
.hc-notice strong { color: #085B94; }

/* ---------- Upload — Mode Cards ---------- */
.upload-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.mode-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.mode-card:hover {
  border-color: var(--teal);
}

.mode-card.selected {
  border-color: var(--teal);
  background: var(--teal-tint);
}

.mode-card.danger {
  border-color: rgba(220,46,38,0.3);
}
.mode-card.danger:hover { border-color: var(--sig-red); }
.mode-card.danger.selected {
  border-color: var(--sig-red);
  background: var(--sig-red-bg);
}

.mode-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mode-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-card.danger .mode-icon {
  background: var(--sig-red-bg);
  color: var(--sig-red);
}

.mode-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.mode-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-2);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-num);
}

.mode-card.danger .mode-badge { background: var(--sig-red); color: #fff; }

.mode-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 12px;
}

.mode-effects {
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
}

.mode-card.danger .mode-effects {
  background: #fff;
  border: 1px solid rgba(220,46,38,0.15);
  color: #7A1B15;
}

.mode-effects strong { color: var(--text); }
.mode-card.danger .mode-effects strong { color: var(--sig-red); }

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 0;
  margin-bottom: 20px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-num);
}

.step.done .step-num {
  background: var(--teal);
  color: #fff;
}

.step.active .step-num {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(15,30,51,0.08);
}

.step-label {
  font-size: 13px;
  font-weight: 600;
}

.step.done .step-label, .step.active .step-label {
  color: var(--text);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
}

.step-line.done { background: var(--teal); }

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 40px;
  text-align: center;
  background: #FAFBFC;
  cursor: pointer;
  transition: all 0.15s;
}

.dropzone:hover {
  border-color: var(--teal);
  background: var(--teal-tint);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.dropzone-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.dropzone-sub { font-size: 13px; color: var(--text-3); }

/* Validation row status */
.val-row-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.val-row-status.success { color: var(--sig-green); }
.val-row-status.warning { color: #A67A00; }
.val-row-status.error   { color: var(--sig-red); }

/* Upload result summary */
.upload-result {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.result-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px;
}
.result-tile .rt-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.result-tile .rt-value { font-size: 24px; font-weight: 700; margin-top: 4px; font-family: var(--font-num); }
.result-tile.success .rt-value { color: var(--sig-green); }
.result-tile.error   .rt-value { color: var(--sig-red); }
.result-tile.warning .rt-value { color: #A67A00; }

/* ---------- Settings ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}

.settings-nav {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
}

.settings-nav-item:hover { background: var(--bg); color: var(--text); }

.settings-nav-item.active {
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-weight: 700;
}

.settings-nav-item svg { width: 16px; height: 16px; }

.settings-nav-section {
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.settings-nav-section:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.settings-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}

.settings-head {
  display: flex;
  align-items: baseline;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.settings-sub {
  margin-left: 12px;
  font-size: 13px;
  color: var(--text-3);
}

.settings-head-right { margin-left: auto; display: flex; gap: 8px; }

/* ---------- v7: Wordprocess Import (Placeholder) ---------- */
.page-title-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  vertical-align: middle;
  background: color-mix(in oklab, #F59E0B 20%, transparent);
  color: color-mix(in oklab, #F59E0B 85%, black);
  font-family: var(--font-num);
}

.wp-hero {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 20px,
      color-mix(in oklab, var(--sig-yellow) 4%, transparent) 20px,
      color-mix(in oklab, var(--sig-yellow) 4%, transparent) 21px
    ),
    color-mix(in oklab, var(--sig-yellow) 3%, var(--card));
  border-radius: 10px;
  margin-bottom: 20px;
}
.wp-hero-left {
  display: flex;
  gap: 16px;
  flex: 1;
}
.wp-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--sig-yellow) 15%, var(--card));
  border: 1px solid color-mix(in oklab, var(--sig-yellow) 30%, var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in oklab, var(--sig-yellow) 75%, black);
  flex-shrink: 0;
}
.wp-hero-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.wp-hero-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.wp-hero-progress {
  width: 240px;
  flex-shrink: 0;
}
.wp-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 600;
}
.wp-progress-bar {
  height: 8px;
  background: color-mix(in oklab, var(--border) 60%, var(--card));
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.wp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--sig-yellow) 80%, transparent),
    var(--sig-yellow));
  border-radius: 4px;
}
.wp-progress-hint {
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.wp-progress-hint svg { color: var(--sig-green); }

.wp-pipeline {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.wp-step {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.wp-step-done   { border-color: color-mix(in oklab, var(--sig-green) 40%, var(--border)); background: color-mix(in oklab, var(--sig-green) 5%, var(--card)); }
.wp-step-current { border-color: color-mix(in oklab, var(--sig-yellow) 55%, var(--border)); background: color-mix(in oklab, var(--sig-yellow) 8%, var(--card)); }
.wp-step-pending { opacity: 0.55; }
.wp-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-2);
  flex-shrink: 0;
}
.wp-step-done .wp-step-num   { background: var(--sig-green); color: #fff; border-color: var(--sig-green); }
.wp-step-current .wp-step-num { background: var(--sig-yellow); color: #fff; border-color: var(--sig-yellow); }
.wp-step-body { flex: 1; min-width: 0; }
.wp-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.wp-step-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}
.wp-step-done svg { color: var(--sig-green); flex-shrink: 0; }
.wp-step-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 6px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--sig-yellow) 20%, transparent);
  color: color-mix(in oklab, var(--sig-yellow) 85%, black);
  flex-shrink: 0;
}
.wp-step-arrow {
  align-self: center;
  color: var(--text-3);
  font-size: 14px;
  flex-shrink: 0;
}

.wp-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.wp-tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.wp-tab:hover { color: var(--text); }
.wp-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* Overview */
.wp-overview { display: grid; gap: 20px; }
.wp-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.wp-info-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
}
.wp-info-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}
.wp-info-label svg { color: var(--teal); }
.wp-info-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.wp-info-sub {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.wp-checklist {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  padding: 20px 24px;
}
.wp-checklist-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.wp-checklist-items { display: grid; gap: 10px; }
.wp-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
}
.wp-check-item.done { background: color-mix(in oklab, var(--sig-green) 5%, transparent); }
.wp-check-item.current { background: color-mix(in oklab, var(--sig-yellow) 6%, transparent); }
.wp-check-box {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  color: #fff;
}
.wp-check-item.done .wp-check-box   { background: var(--sig-green); border-color: var(--sig-green); }
.wp-check-item.current .wp-check-box { border-color: var(--sig-yellow); }
.wp-check-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sig-yellow);
  animation: wp-pulse 1.6s ease-in-out infinite;
}
@keyframes wp-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.6; }
}
.wp-check-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.wp-check-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Panels */
.wp-panel {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
}
.wp-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.wp-panel-head > div:first-child { flex: 1; }
.wp-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.wp-panel-desc {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.wp-panel-body { padding: 20px 24px; }

.wp-field-grid { display: grid; gap: 0; }
.wp-field-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  align-items: center;
}
.wp-field-row:last-child { border-bottom: none; }
.wp-field-label {
  color: var(--text-2);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.wp-field-lock { color: var(--text-3); }
.wp-field-value {
  color: var(--text);
  font-size: 12.5px;
}

.wp-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 12px,
      color-mix(in oklab, var(--border) 40%, transparent) 12px,
      color-mix(in oklab, var(--border) 40%, transparent) 13px
    );
  margin-top: 16px;
}
.wp-empty svg {
  display: block;
  margin: 0 auto 10px;
  color: var(--text-3);
}

.wp-mapping-table { padding: 0; }
.wp-mapping-row {
  display: grid;
  grid-template-columns: 140px 1fr 70px 130px;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
}
.wp-mapping-row:last-child { border-bottom: none; }
.wp-mapping-head {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.wp-mapping-field { font-weight: 600; color: var(--text); }
.wp-mapping-source { color: var(--text-2); font-size: 12px; }

/* ---------- v7: Integration / API Keys ---------- */
.integ-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.integ-card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.integ-card:hover { border-color: var(--border-strong); }
.integ-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--teal) 15%, transparent);
}
.integ-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.integ-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
  color: #fff;
  flex-shrink: 0;
  font-family: var(--font-sans);
}
.integ-logo-munja  { background: linear-gradient(135deg, #E85D5D, #C13535); }
.integ-logo-skb    { background: linear-gradient(135deg, #EC4C34, #B8341E); letter-spacing: -0.5px; }
.integ-logo-wp     { background: linear-gradient(135deg, #6B7280, #374151); }
.integ-card-title {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
}
.integ-card-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.integ-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.integ-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.integ-status-pending {
  background: color-mix(in oklab, var(--sig-yellow) 15%, transparent);
  color: color-mix(in oklab, var(--sig-yellow) 80%, black);
}
.integ-status-pending .dot { background: var(--sig-yellow); }
.integ-status-soon {
  background: var(--bg);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.integ-status-soon .dot { background: var(--text-3); }
.integ-status-active {
  background: color-mix(in oklab, var(--sig-green) 15%, transparent);
  color: color-mix(in oklab, var(--sig-green) 80%, black);
}
.integ-status-active .dot { background: var(--sig-green); }

.integ-form {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
}
.integ-notice {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  background: color-mix(in oklab, var(--sig-blue) 6%, transparent);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.integ-notice svg {
  color: var(--sig-blue);
  flex-shrink: 0;
  margin-top: 2px;
}
.integ-notice strong { color: var(--text); }

.integ-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.integ-section:last-of-type { border-bottom: none; }
.integ-section-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.integ-section-head svg {
  color: var(--teal);
  margin-top: 2px;
  flex-shrink: 0;
}
.integ-section-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.integ-section-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.integ-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field-full { grid-column: 1 / -1; }
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label .req {
  color: var(--sig-red);
  font-size: 13px;
  line-height: 1;
}
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--teal) 18%, transparent);
}
.form-input::placeholder { color: var(--text-3); }
.form-input.mono { font-family: var(--font-num); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; font-family: var(--font-num); line-height: 1.5; }
.form-hint {
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-hint a { color: var(--teal); text-decoration: none; }
.form-hint a:hover { text-decoration: underline; }

.form-secret-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.form-secret-wrap .form-input { padding-right: 72px; }
.form-secret-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 4px;
}
.form-secret-toggle:nth-of-type(2) { right: 36px; }
.form-secret-toggle:hover { background: var(--bg); color: var(--text); }

.form-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
}
.form-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.integ-test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.integ-test-info { flex: 1; }
.integ-test-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 10px;
}
.integ-test-status.not-tested {
  background: color-mix(in oklab, var(--sig-yellow) 18%, transparent);
  color: color-mix(in oklab, var(--sig-yellow) 80%, black);
}
.integ-test-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.integ-actions {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.integ-actions-left { flex: 1; }
.integ-actions-right { display: flex; gap: 8px; }

.integ-placeholder {
  border: 1px dashed var(--border-strong);
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 12px,
      color-mix(in oklab, var(--border) 40%, transparent) 12px,
      color-mix(in oklab, var(--border) 40%, transparent) 13px
    ),
    var(--card);
  border-radius: 10px;
  padding: 48px 32px;
  text-align: center;
}
.integ-placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  margin-bottom: 16px;
}
.integ-placeholder-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.integ-placeholder-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 20px;
}
.integ-placeholder-fields {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  min-width: 320px;
}
.ph-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 24px;
}
.ph-label {
  color: var(--text-2);
  font-weight: 600;
}
.ph-value {
  color: var(--text-3);
}

/* ---------- v7.2: Toast ---------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9000;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--text);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(15, 30, 51, 0.25);
  min-width: 240px;
  max-width: 420px;
  animation: toast-in 0.2s ease-out;
  pointer-events: auto;
}
.toast-success { background: var(--sig-green); }
.toast-error   { background: var(--sig-red); }
.toast-info    { background: var(--text); }
@keyframes toast-in {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* ---------- v7.2: Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 51, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 8000;
  animation: modal-fade 0.15s ease-out;
}
@keyframes modal-fade {
  from { background: rgba(15, 30, 51, 0); }
  to   { background: rgba(15, 30, 51, 0.45); }
}
.modal {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 30, 51, 0.25);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  animation: modal-pop 0.15s ease-out;
}
@keyframes modal-pop {
  from { transform: scale(0.96); opacity: 0.5; }
  to   { transform: scale(1);    opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head-body { flex: 1; }
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.modal-sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 12px 12px;
}
.modal-foot-left { margin-right: auto; font-size: 12px; color: var(--text-3); }

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-form-grid .form-field-full { grid-column: 1 / -1; }

/* ---------- v7.2: Admin badge + locked action ---------- */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-family: var(--font-num);
}
.sidebar-admin-chip {
  margin: 0 12px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--teal) 22%, transparent);
  border: 1px solid color-mix(in oklab, var(--teal) 40%, transparent);
  border-radius: 8px;
  color: #E6F5F5;
  font-size: 12px;
  font-weight: 600;
}
.sidebar-admin-chip svg { color: #7EE0DC; }

/* v7.3: 위험 버튼 + 확인 다이얼로그 */
.btn.btn-danger {
  background: var(--sig-red);
  color: #fff;
  border: 1px solid var(--sig-red);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn.btn-danger:hover { background: #B82520; border-color: #B82520; }

.confirm-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 4px 0 8px;
}
.confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sig-red-bg);
  color: var(--sig-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.confirm-message {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
  flex: 1;
}
.confirm-message strong { color: var(--sig-red); }

/* v7.3: 행 액션 아이콘 버튼 (미니) */
.mini-btn.danger {
  color: var(--sig-red);
}
.mini-btn.danger:hover {
  background: var(--sig-red-bg);
  border-color: color-mix(in oklab, var(--sig-red) 30%, var(--border));
}

/* 관리자 전용 잠금 버튼 */
.btn.btn-locked,
.btn.btn-primary.btn-locked {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  color: var(--text-3);
}
.btn.btn-locked:hover {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--text-3);
}

/* Role permission matrix */
.perm-matrix {
  font-size: 12px;
}
.perm-matrix .pm-cell.on {
  color: var(--sig-green);
}
.perm-matrix .pm-cell.off {
  color: var(--text-muted);
}

/* Holiday calendar teaser */
.holiday-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.holiday-item:last-child { border-bottom: none; }
.holiday-date {
  font-family: var(--font-num);
  font-weight: 700;
  color: var(--text);
  width: 100px;
}
.holiday-name { font-weight: 600; flex: 1; }
.holiday-postpone {
  font-size: 12px;
  color: var(--sig-blue);
  font-family: var(--font-num);
}

/* Log rows */
.log-action-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-num);
  background: var(--bg-2);
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.log-action-badge.login { background: var(--sig-blue-bg); color: var(--sig-blue); }
.log-action-badge.failed { background: var(--sig-red-bg); color: var(--sig-red); }
.log-action-badge.system { background: var(--teal-tint); color: var(--teal-deep); }

/* ---------- Toolbar (List actions) ---------- */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.list-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}

.list-toolbar-left .count {
  color: var(--text);
  font-weight: 700;
}

.list-toolbar-right {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

/* Table wrap continuation with toolbar */
.list-toolbar + .table-wrap {
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  border-top: none;
}
.list-toolbar + .table-wrap .pagination {
  border-radius: 0;
}

/* Message screen: sender note */
.sender-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

/* Call popup — action reorder */
.call-quick-actions.reordered {
  grid-template-columns: 1fr 1fr;
}

/* Unregistered tabs */
.unreg-tabs {
  display: flex;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  margin-top: -1px;
}

.unreg-tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.unreg-tab.active {
  color: var(--teal-deep);
  border-bottom-color: var(--teal);
}

.link-search-result {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.link-search-result:hover { border-color: var(--teal); background: var(--teal-tint); }
.link-search-result .lsr-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.link-search-result .lsr-info { flex: 1; }
.link-search-result .lsr-name { font-weight: 600; font-size: 14px; }
.link-search-result .lsr-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
