:root {
  --dbon-bg: #f6f8fc;
  --dbon-surface: #ffffff;
  --dbon-surface-muted: #f1f5f9;
  --dbon-border: #e2e8f0;
  --dbon-text: #0f172a;
  --dbon-text-sub: #475569;
  --dbon-text-muted: #64748b;
  --dbon-primary: #425cfb;
  --dbon-primary-dark: #2f46db;
  --dbon-lime: #bddf70;
  --dbon-sidebar-bg: #0f172a;
  --dbon-radius: 12px;
  --dbon-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dbon-bg);
  color: var(--dbon-text);
  line-height: 1.5;
  font-size: 14px;
}

a { color: var(--dbon-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.text-muted { color: var(--dbon-text-muted); }
.text-success { color: #059669; }
.text-danger { color: #dc2626; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 10px; }

/* Login Split Page */
.dbon-login-shell {
  min-height: 100vh;
  background: radial-gradient(circle at 18% 20%, rgba(66, 92, 251, 0.25), transparent 45%),
              linear-gradient(135deg, #0b1120 0%, #111b3a 55%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}
.dbon-login-grid {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
}
.dbon-login-hero { color: #f8fafc; }
.dbon-logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.dbon-login-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.24;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.dbon-login-hero h1 span { color: var(--dbon-lime); }
.dbon-login-hero p {
  margin: 0 0 20px;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.65;
}
.dbon-login-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  font-size: 14px;
  color: #e2e8f0;
}
.dbon-login-points li { display: flex; align-items: center; gap: 8px; }
.dbon-login-points li::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(189, 223, 112, 0.18);
  color: var(--dbon-lime);
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.dbon-login-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.4);
}
.dbon-login-card h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; }
.dbon-login-card .sub { margin: 0 0 18px; color: var(--dbon-text-muted); font-size: 13px; }

/* App Shell */
.dbon-shell { display: flex; min-height: 100vh; }
.dbon-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 40;
}
.dbon-backdrop.is-open { display: block; }
.dbon-sidebar {
  width: 248px;
  background: var(--dbon-sidebar-bg);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.dbon-sidebar-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dbon-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 16px; }
.dbon-brand small { display: block; font-size: 11px; font-weight: 500; color: #94a3b8; }
.dbon-sidebar-close {
  display: none;
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-size: 22px;
  cursor: pointer;
}
.dbon-nav { padding: 14px 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.dbon-nav-group {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  padding: 10px 10px 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dbon-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}
.dbon-nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.dbon-nav-link.is-active { background: var(--dbon-primary); color: #fff; }
.dbon-nav-badge {
  margin-left: auto;
  background: #f59e0b;
  color: #111827;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 800;
}

.dbon-sidebar-foot {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.dbon-user-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.dbon-user-box .name { font-weight: 700; font-size: 13.5px; color: #fff; }
.dbon-user-box .meta { font-size: 11.5px; color: #94a3b8; margin-top: 2px; word-break: break-all; }

.dbon-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dbon-topbar {
  background: var(--dbon-surface);
  border-bottom: 1px solid var(--dbon-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.dbon-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dbon-menu-btn {
  display: none;
  border: 1px solid var(--dbon-border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}
.dbon-page-title { margin: 0; font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbon-topbar-quota { font-size: 12.5px; color: var(--dbon-text-sub); white-space: nowrap; }
.dbon-content { padding: 20px; max-width: 1380px; width: 100%; }

/* Cards, Stats, Forms, Buttons */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--dbon-surface);
  border: 1px solid var(--dbon-border);
  border-radius: var(--dbon-radius);
  padding: 16px;
  box-shadow: var(--dbon-shadow);
}
.stat-card.is-highlight { border-color: #93c5fd; background: linear-gradient(180deg, #eff6ff 0%, #fff 100%); }
.stat-label { font-size: 12px; font-weight: 700; color: var(--dbon-text-muted); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--dbon-text); line-height: 1.2; }
.stat-card.is-highlight .stat-value { color: var(--dbon-primary); }
.stat-sub { font-size: 12px; color: var(--dbon-text-sub); margin-top: 6px; }

.panel-card {
  background: var(--dbon-surface);
  border: 1px solid var(--dbon-border);
  border-radius: var(--dbon-radius);
  box-shadow: var(--dbon-shadow);
  margin-bottom: 18px;
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--dbon-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-title { margin: 0; font-size: 16px; font-weight: 800; }
.panel-desc { margin: 3px 0 0; font-size: 12.5px; color: var(--dbon-text-muted); }
.panel-body { padding: 18px 20px; }

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-label { font-size: 12.5px; font-weight: 700; color: var(--dbon-text-sub); }
.form-control {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--dbon-text);
}
.form-control:focus { outline: none; border-color: var(--dbon-primary); box-shadow: 0 0 0 3px rgba(66, 92, 251, 0.14); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 11px 18px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--dbon-primary); color: #fff; }
.btn-primary:hover { background: var(--dbon-primary-dark); }
.btn-secondary { background: #e2e8f0; color: #1e293b; }
.btn-outline { background: #fff; color: var(--dbon-text); border-color: #cbd5e1; }
.btn-outline:hover { background: #f8fafc; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-neutral { background: #e2e8f0; color: #334155; }
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error, .alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--dbon-border);
  text-align: left;
  vertical-align: top;
}
.data-table th { background: #f8fafc; font-weight: 700; color: var(--dbon-text-sub); white-space: nowrap; }
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sub-line { display: block; font-size: 12px; color: var(--dbon-text-muted); margin-top: 2px; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--dbon-text-muted); font-size: 13.5px; }

.summary-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--dbon-border);
  background: #fff;
  color: var(--dbon-text);
  font-size: 12px;
  font-weight: 600;
}
.date-chip.is-active { background: var(--dbon-primary); color: #fff; border-color: var(--dbon-primary); }

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 60;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
}
.modal-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--dbon-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { margin: 0; font-size: 16px; font-weight: 800; }
.modal-close { background: transparent; border: 0; font-size: 22px; cursor: pointer; color: var(--dbon-text-muted); }
.modal-body { padding: 18px; }
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--dbon-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 900px) {
  .dbon-login-grid { grid-template-columns: 1fr; gap: 22px; }
  .dbon-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .dbon-sidebar.is-open { transform: translateX(0); }
  .dbon-sidebar-close { display: block; }
  .dbon-menu-btn { display: inline-flex; }
  .dbon-content { padding: 14px; }
  .dbon-topbar { padding: 10px 14px; }
  .dbon-topbar-quota { display: none; }
}

.lead-inline-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.4;
}
.lead-inline-name {
  font-weight: 800;
  color: #0f172a;
}
.lead-inline-phone {
  font-weight: 600;
  color: #1e293b;
}
.lead-inline-sep {
  color: #94a3b8;
}
.lead-inline-item {
  color: #475569;
}
.lead-inline-prem {
  color: #0f766e;
  font-weight: 700;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11.5px;
}
.lead-inline-region {
  font-size: 12.5px;
  color: #475569;
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.acc-summary-row {
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.acc-summary-row:hover td {
  background: #f8fafc;
}
.acc-summary-row.is-open td {
  background: #eff6ff;
  border-bottom-color: #dbeafe;
}
.acc-detail-row > td {
  padding: 0 !important;
  background: #f8fafc;
}
.acc-detail-box {
  padding: 14px 18px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acc-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  color: #334155;
}
.acc-detail-meta strong {
  color: #0f172a;
}
.acc-detail-as {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: #334155;
  padding: 8px 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--dbon-border);
}
.acc-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.acc-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.as-one-line-clip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
