/* ===== NovaCRM — ported from NovaCRM.dc.html (accent green, comfortable density) ===== */
:root {
  --accent: #0E7C63;
  --accent-soft: rgba(14, 124, 99, .13);
  --rowpad: 14px;
  --bg: #F4F3EF;
  --ink: #1A2420;
  --border: #E7E5DE;
  --line: #F1EFE9;
  --muted: #6B7670;
  --muted2: #97a099;
  --muted3: #4a544d;
}

* { box-sizing: border-box; }
body { margin: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6d3ca; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
input, select, textarea, button { font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mono { font-family: 'IBM Plex Mono', monospace; }
.accent-text { color: var(--accent); font-weight: 600; }
.right { text-align: right; }

.app {
  display: flex; height: 100vh; width: 100%; overflow: hidden;
  font-family: 'Anuphan', sans-serif; background: var(--bg); color: var(--ink);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 258px; flex-shrink: 0; background: #16211C;
  display: flex; flex-direction: column; padding: 22px 16px; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 17px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; }
.brand-sub { color: #6f8378; font-size: 11px; font-family: 'IBM Plex Mono', monospace; letter-spacing: .04em; }
.nav-label { color: #55665d; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; padding: 4px 10px; font-family: 'IBM Plex Mono', monospace; }

.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px;
  border: none; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: left; transition: background .15s, color .15s;
  background: transparent; color: #9fb0a8;
}
.nav-item.active { background: rgba(255, 255, 255, .10); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item:hover:not(.active) { background: rgba(255, 255, 255, .05); }
.nav-en { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 10px; opacity: .5; }

.sidebar-user { margin-top: auto; border-top: 1px solid #26332c; padding-top: 14px; display: flex; align-items: center; gap: 11px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #B4791F;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 14px;
}
.user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-name { color: #fff; font-size: 13.5px; font-weight: 600; }
.user-role { color: #6f8378; font-size: 11.5px; }

/* ===== MAIN + HEADER ===== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header {
  height: 66px; flex-shrink: 0; background: rgba(244, 243, 239, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 18px; padding: 0 28px;
}
.search { position: relative; flex: 1; max-width: 420px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); }
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; font-size: 14px; color: var(--ink);
}
.search.sm { flex: initial; max-width: 300px; }
.search.sm svg { left: 12px; }
.search.sm input { height: 37px; padding: 0 12px 0 35px; border-radius: 9px; font-size: 13.5px; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn-primary {
  height: 40px; padding: 0 16px; border-radius: 10px; border: none; background: var(--accent);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-primary.lg { padding: 0 20px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative;
}
.icon-btn.plain { border: 1px solid var(--border); color: var(--muted3); }
.badge-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: #C0473B; border: 1.5px solid #fff; }

.content { flex: 1; overflow-y: auto; padding: 28px 32px 40px; }

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: block; animation: fadeUp .3s ease; }

/* ===== SHARED ===== */
.card { background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: 22px 24px; }
.card.no-pad { padding: 0; overflow: hidden; }
.card.center { text-align: center; }
.card + .card, .form-col .card + .card { margin-top: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-title { margin: 0; font-size: 26px; font-weight: 700; }
.page-sub { margin: 5px 0 0; color: var(--muted); font-size: 14.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title { margin: 0; font-size: 16px; font-weight: 600; }
.card-title.mb14 { margin-bottom: 14px; }
.card-note { font-size: 12.5px; color: var(--muted); }

.btn-outline {
  height: 38px; padding: 0 15px; border: 1px solid var(--border); background: #fff; border-radius: 9px;
  font-size: 13.5px; color: var(--muted3); cursor: pointer; display: flex; align-items: center; gap: 7px;
}
.btn-outline.lg { height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.btn-outline.push { margin-left: auto; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.btn-row { display: flex; gap: 9px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 16px; width: fit-content; }
.pill.accent { color: var(--accent); background: var(--accent-soft); }
.pill.blue { color: #1D6FB8; background: #E2EDF6; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 20px; width: fit-content; }
.status .dot { width: 6px; height: 6px; border-radius: 50%; }

/* ===== DASHBOARD ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: 18px 19px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.kpi-value { font-size: 27px; font-weight: 700; margin: 9px 0 3px; letter-spacing: -.01em; }
.kpi-delta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.kpi-delta b { font-weight: 600; font-family: 'IBM Plex Mono', monospace; }
.kpi-delta span { color: var(--muted2); }

.dash-2col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 18px; }
.funnel { display: flex; flex-direction: column; gap: 16px; }
.funnel-labels { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.funnel-stage { font-size: 13.5px; font-weight: 500; }
.funnel-stage em { color: var(--muted2); font-size: 12px; font-weight: 400; font-style: normal; }
.funnel-meta { font-size: 13px; color: var(--muted3); font-family: 'IBM Plex Mono', monospace; }
.funnel-track { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 6px; }

.tasks { display: flex; flex-direction: column; gap: 4px; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.task-check { width: 18px; height: 18px; border-radius: 6px; border: 2px solid; flex-shrink: 0; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13.5px; font-weight: 500; }
.task-who { font-size: 12px; color: var(--muted2); }
.task-time { font-size: 12px; color: var(--muted3); font-family: 'IBM Plex Mono', monospace; }

.recent-row { display: grid; grid-template-columns: 2.2fr 1.6fr 1.2fr 1fr; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.recent-row:hover { background: #FAFAF7; }
.cell-name { display: flex; align-items: center; gap: 11px; }
.avatar { width: 34px; height: 34px; border-radius: 9px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.cell-name .info { min-width: 0; }
.cell-name .info .n { font-size: 14px; font-weight: 500; }
.cell-name .info .c { font-size: 12px; color: var(--muted2); }
.cell-email { font-size: 13px; color: var(--muted3); }
.cell-value { font-size: 13px; text-align: right; font-family: 'IBM Plex Mono', monospace; font-weight: 500; }

/* ===== CUSTOMERS ===== */
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 10px; }
.chip { height: 37px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--muted); }
.chip.active { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); }

.table-head { padding: 11px 18px; background: #FAFAF7; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--muted2); letter-spacing: .04em; font-family: 'IBM Plex Mono', monospace; }
.cust-grid { display: grid; grid-template-columns: 2.3fr 1.8fr 1.3fr 1.2fr 1fr 40px; gap: 12px; align-items: center; }
.cust-row { padding: var(--rowpad) 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cust-row:hover { background: #FAFAF7; }
.cust-row .avatar { width: 36px; height: 36px; border-radius: 9px; }
.cell-contact { min-width: 0; }
.cell-contact .e { font-size: 13px; color: var(--muted3); }
.cell-contact .p { font-size: 12px; color: var(--muted2); font-family: 'IBM Plex Mono', monospace; }
.cell-owner { display: flex; align-items: center; gap: 8px; }
.owner-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--border); color: var(--muted3); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.cell-owner span { font-size: 13px; color: var(--muted3); }
.cust-value { font-size: 13.5px; text-align: right; font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.kebab { width: 30px; height: 30px; border: none; background: none; border-radius: 7px; cursor: pointer; color: var(--muted2); display: flex; align-items: center; justify-content: center; }
.kebab:hover { background: var(--line); }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; font-size: 12.5px; color: var(--muted); }
.pages { display: flex; gap: 6px; }
.pg { width: 32px; height: 32px; border: 1px solid var(--border); background: #fff; border-radius: 8px; color: var(--muted3); cursor: pointer; font-family: 'IBM Plex Mono', monospace; }
.pg.current { border: 1px solid var(--accent); background: var(--accent); color: #fff; }

/* ===== FORM ===== */
.form-wrap { max-width: 1080px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 13px; color: var(--muted2); }
.form-wrap .breadcrumb { margin-bottom: 4px; }
.breadcrumb span[data-nav], .breadcrumb .cur { cursor: default; }
.breadcrumb span[data-nav] { cursor: pointer; }
.breadcrumb .cur { color: var(--muted3); }

.form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.form-col { display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.section-num { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
.section-title { margin: 0; font-size: 15.5px; font-weight: 600; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span2 { grid-column: span 2; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted3); }
.field input, .field select { height: 42px; padding: 0 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; background: #fff; color: var(--ink); }
.field select { padding: 0 12px; }
.field textarea { padding: 10px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; resize: vertical; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 5px 11px; border-radius: 20px; }
.tag.gold { color: #B4791F; background: #F6ECD9; }
.tag.add { color: var(--muted2); background: none; border: 1px dashed #d6d3ca; cursor: pointer; }
.tag.sm { padding: 4px 10px; font-size: 12px; border-radius: 16px; }
.tag-x { cursor: pointer; opacity: .6; }

.form-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 16px; }
.preview-card { padding: 20px; }
.preview-label { font-size: 11.5px; font-weight: 600; color: var(--muted2); letter-spacing: .08em; }
.preview-avatar { width: 66px; height: 66px; border-radius: 16px; background: #2E6D5B; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; margin: 12px auto; }
.preview-name { font-size: 17px; font-weight: 700; }
.preview-role { font-size: 13px; color: var(--muted); margin-top: 2px; }
.preview-comp { font-size: 13px; color: var(--muted2); }
.preview-tags { display: flex; justify-content: center; gap: 7px; margin-top: 12px; }
.completion { background: #F0F5F2; border: 1px solid #d9e6df; border-radius: 15px; padding: 16px 18px; }
.completion-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: #2E6D5B; }
.completion-track { height: 8px; background: #d9e6df; border-radius: 5px; overflow: hidden; margin-bottom: 7px; }
.completion-bar { height: 100%; background: var(--accent); border-radius: 5px; }
.completion-note { font-size: 12.5px; color: var(--muted3); }

/* ===== PROFILE ===== */
.profile-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.profile-col { display: flex; flex-direction: column; gap: 16px; }
.profile-avatar { width: 82px; height: 82px; border-radius: 20px; background: #2E6D5B; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; margin: 0 auto 14px; }
.profile-name { margin: 0; font-size: 20px; font-weight: 700; }
.profile-role { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.profile-pills { display: flex; justify-content: center; gap: 7px; margin: 14px 0; }
.profile-actions { display: flex; gap: 8px; margin-top: 6px; }
.profile-actions .btn-primary, .profile-actions .btn-outline { flex: 1; height: 40px; font-size: 13.5px; font-weight: 600; }
.profile-actions .icon-btn { flex: initial; }
.contact-list { display: flex; flex-direction: column; gap: 13px; }
.contact-row { display: flex; align-items: flex-start; gap: 11px; }
.contact-row .ic { color: var(--muted2); margin-top: 1px; }
.contact-row .l { font-size: 11.5px; color: var(--muted2); }
.contact-row .v { font-size: 14px; color: var(--ink); word-break: break-word; }

.profile-main { display: flex; flex-direction: column; gap: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: 18px 20px; }
.stat .l { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { padding-bottom: 12px; font-size: 14px; font-weight: 500; color: var(--muted2); cursor: pointer; margin-bottom: -1px; }
.tab.active { font-weight: 600; color: var(--accent); border-bottom: 2px solid var(--accent); }
.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; gap: 14px; }
.tl-marker { display: flex; flex-direction: column; align-items: center; }
.tl-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tl-line { width: 2px; flex: 1; background: var(--line); margin: 4px 0; }
.tl-body { padding-bottom: 20px; flex: 1; }
.tl-body .t { font-size: 14px; font-weight: 500; }
.tl-body .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tl-body .m { font-size: 12px; color: #b0b8b1; margin-top: 4px; font-family: 'IBM Plex Mono', monospace; }
.tl-row:last-child .tl-line { display: none; }
.tl-row:last-child .tl-body { padding-bottom: 0; }

/* ===== PIPELINE ===== */
.pipeline-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: start; }
.stage-col { background: #EFEEE9; border-radius: 14px; padding: 12px; min-height: 200px; }
.stage-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; }
.stage-name { font-size: 13.5px; font-weight: 600; }
.stage-count { margin-left: auto; font-size: 11.5px; color: var(--muted2); background: #fff; padding: 2px 8px; border-radius: 12px; font-family: 'IBM Plex Mono', monospace; }
.stage-total { font-size: 11.5px; color: var(--muted); padding: 0 6px 10px; font-family: 'IBM Plex Mono', monospace; }
.deal-list { display: flex; flex-direction: column; gap: 10px; }
.deal { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 13px 14px; cursor: grab; transition: box-shadow .15s; }
.deal:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }
.deal-title { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.deal-comp { font-size: 12px; color: var(--muted2); margin-bottom: 10px; }
.deal-foot { display: flex; align-items: center; justify-content: space-between; }
.deal-value { font-size: 13px; font-weight: 600; color: var(--accent); font-family: 'IBM Plex Mono', monospace; }
.deal-avatar { width: 24px; height: 24px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; }

/* ===== ACTIVITIES ===== */
.act-wrap { max-width: 860px; }
.mb18 { margin-bottom: 18px; }
.act-card { padding: 8px 24px; }
.act-row { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.act-row:last-child { border-bottom: none; }
.act-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act-body { flex: 1; min-width: 0; }
.act-body .head { display: flex; align-items: baseline; gap: 8px; }
.act-body .t { font-size: 14px; font-weight: 500; }
.act-body .who { font-size: 12px; color: var(--accent); font-weight: 500; }
.act-body .d { font-size: 13px; color: var(--muted); margin-top: 3px; }
.act-time { font-size: 12px; color: #b0b8b1; white-space: nowrap; font-family: 'IBM Plex Mono', monospace; }
