/* SoftPrim LiveChat, stiluri platformă */
:root {
  --brand: #f0b90b;
  --brand-dark: #d5a409;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --border: #e3e6ea;
  --text: #1e2530;
  --muted: #8a93a0;
  --danger: #e74c3c;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container-fluid { width: 100%; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

/* topbar */
.topbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 800; font-size: 19px; text-decoration: none; }
.brand span { color: var(--brand); }

/* butoane */
.btn { display: inline-block; border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; background: #eef0f3; color: var(--text); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }

/* landing */
.hero { text-align: center; padding: 70px 20px 50px; }
.hero h1 { font-size: 44px; line-height: 1.15; margin-bottom: 18px; }
.lead { font-size: 18px; color: var(--muted); max-width: 720px; margin: 0 auto 28px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 60px; text-align: left; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.feature h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.icon { width: 22px; height: 22px; fill: none; stroke: var(--brand-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn .icon { width: 16px; height: 16px; stroke: currentColor; vertical-align: -3px; margin-right: 6px; }
.feature p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.footer { padding: 30px 20px; color: var(--muted); font-size: 13px; text-align: center; }

/* footer legal */
.site-footer { background: var(--panel); border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { padding: 26px 20px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; font-size: 13px; color: var(--muted); }
.footer-meta { line-height: 1.8; }
.footer-legal, .footer-anpc { display: flex; flex-direction: column; gap: 6px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* pagini legale */
.legal-page { padding: 40px 20px 20px; max-width: 820px; }
.legal-page h1 { font-size: 30px; margin-bottom: 6px; }
.legal-page h2 { font-size: 18px; margin: 26px 0 8px; }
.legal-page p { line-height: 1.7; margin: 8px 0; color: #3c4552; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 10px 0; }
.legal-table th, .legal-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-table th { background: #fafbfc; }

/* banner cookies */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.15); padding: 16px 18px; z-index: 1000; }
.cookie-banner p { font-size: 13.5px; line-height: 1.55; margin-bottom: 12px; }
.cookie-actions { display: flex; gap: 10px; }

/* auth */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; padding: 20px 20px 0; }
.auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 34px; width: 100%; max-width: 440px; margin: auto; }
.terms-check { font-weight: 500; align-items: flex-start; line-height: 1.45; }
.terms-check input { margin-top: 3px; }
.auth-card h1 { font-size: 24px; margin: 14px 0 6px; }
.auth-card form { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
input, select, textarea { border: 1px solid #d6dae0; border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; }
input:focus, textarea:focus { border-color: var(--brand); }
.alert { background: #fdecea; color: #b03a2e; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 12px 0; }
.alert.success { background: #eafaf1; color: #1e8449; }

/* app layout */
.app-body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.app-layout { flex: 1; display: grid; grid-template-columns: 300px 1fr 320px; min-height: 0; }
.conv-list-panel { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.panel-head { padding: 14px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 16px; margin-bottom: 10px; }
.tabs { display: flex; gap: 6px; }
.tab { flex: 1; border: 1px solid var(--border); background: none; border-radius: 8px; padding: 6px; font-size: 13px; cursor: pointer; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.conv-list { overflow-y: auto; flex: 1; }
.conv-item { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border); padding: 12px 14px; cursor: pointer; font-family: inherit; font-size: 14px; }
.conv-item:hover { background: #fafbfc; }
.conv-item.active { background: #fff8e1; }
.conv-item-top { display: flex; justify-content: space-between; align-items: center; }
.conv-last { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 2px 7px; }

/* chat panel */
.chat-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-empty { flex: 1; overflow-y: auto; padding: 22px; }

/* statistici */
.stats-panel { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.stats-head h2 { font-size: 20px; margin-bottom: 2px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-tile { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 13px; font-weight: 600; margin-top: 2px; }
.stat-sub { margin-top: 2px; }
.stats-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.stats-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stats-card h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 12px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-value { font-size: 11px; color: var(--text); margin-bottom: 2px; }
.bar { width: 100%; max-width: 26px; background: #b45309; border-radius: 4px 4px 0 0; }
.bar-col:hover .bar { background: #92400e; }
.bar-day { font-size: 10px; margin-top: 4px; white-space: nowrap; }
.rating-dist { display: flex; flex-direction: column; gap: 8px; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dist-label { width: 34px; font-weight: 600; }
.dist-track { flex: 1; height: 12px; background: #f1f3f5; border-radius: 6px; overflow: hidden; }
.dist-fill { height: 100%; background: #b45309; border-radius: 6px; }
.dist-count { width: 26px; text-align: right; }
.feedback-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.feedback-list li { display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--border); padding-bottom: 8px; font-size: 14px; }
.feedback-list li:last-child { border-bottom: none; padding-bottom: 0; }
.fb-stars { color: #b45309; letter-spacing: 2px; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr; } }

/* navigație principală dashboard */
.main-nav { display: flex; gap: 4px; margin-left: 18px; }
.main-nav a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted); padding: 8px 14px; border-radius: 8px; display: flex; align-items: center; gap: 6px; }
.main-nav a:hover { background: #f1f3f5; color: var(--text); }
.main-nav a.active { background: #fff8e1; color: var(--text); }

/* pagina vizitatori */
.visitors-layout { flex: 1; display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.visitors-list-panel { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.visitor-search { width: 100%; margin-top: 10px; border: 1px solid #d6dae0; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; margin-right: 6px; box-shadow: 0 0 6px rgba(46,204,113,.7); }
.visitor-profile-panel { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
.profile-view { padding: 22px; display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.profile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.profile-head h2 { font-size: 20px; word-break: break-all; }
.live-badge { color: #2ecc71; font-weight: 700; font-size: 13px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-convs { max-height: 320px; overflow-y: auto; }
.profile-convs li { display: block; }
.conv-link { display: block; text-decoration: none; color: var(--text); font-size: 13.5px; padding: 8px; border-radius: 8px; }
.conv-link:hover { background: #fafbfc; }
.conv-link .conv-last { display: block; }
.pages-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pages-head h3 { margin-bottom: 0; }
.pages-list { list-style: none; display: flex; flex-direction: column; }
.pages-list li { display: flex; align-items: baseline; gap: 12px; padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px; min-width: 0; }
.pages-list li:last-child { border-bottom: none; }
.page-time { flex-shrink: 0; font-size: 12px; }
.page-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } .visitors-layout { grid-template-columns: 280px 1fr; } }

/* onboarding get started */
.start-page { flex: 1; overflow-y: auto; padding: 40px 20px 60px; max-width: 900px; margin: 0 auto; width: 100%; }
.start-page h1 { font-size: 26px; margin-bottom: 6px; }
.start-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.start-step { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; }
.start-step.on { background: #fff8e1; border-color: #f3df9a; color: var(--text); }
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 20px; align-items: start; }
.start-form { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.start-actions { display: flex; gap: 12px; margin-top: 18px; align-items: center; }
@media (max-width: 800px) { .start-grid { grid-template-columns: 1fr; } }

/* inbox */
.inbox-page { flex: 1; overflow-y: auto; padding: 30px 20px 50px; max-width: 860px; margin: 0 auto; width: 100%; }
.inbox-page h1 { font-size: 24px; margin-bottom: 6px; }
.inbox-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.inbox-item { display: block; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.inbox-item:hover { border-color: var(--brand); }
.inbox-msg { margin: 6px 0 4px; font-size: 14px; }
.badge-soft { background: #fff8e1; border: 1px solid #f3df9a; color: #8a6d00; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 2px 8px; }
.badge-soft.warn { background: #fdecea; border-color: #f5c1ba; color: #b03a2e; }

/* panou admin platformă */
.admin-page { padding: 30px 20px 50px; }
.admin-page h1 { font-size: 24px; }
.admin-company { margin-bottom: 16px; }
.admin-company-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--border); }
.chat-actions { display: flex; gap: 8px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 70%; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg.theirs { align-self: flex-start; }
.msg.system { align-self: center; color: var(--muted); font-size: 12px; }
.msg-body { display: inline-block; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; text-align: left; white-space: pre-wrap; word-break: break-word; }
.msg.mine .msg-body { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs .msg-body { background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-meta { margin-top: 3px; }
.typing { padding: 0 18px 6px; }
.typing .peek { background: #fff8e1; border: 1px dashed #f3df9a; border-radius: 8px; padding: 2px 8px; font-style: normal; color: var(--text); }
.chat-compose { background: var(--panel); border-top: 1px solid var(--border); padding: 10px 14px; }
.quick-replies-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.qr-chip { background: #fff8e1; border: 1px solid #f3df9a; border-radius: 14px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.qr-chip:hover { background: #ffefc0; }
.chat-compose form { display: flex; gap: 10px; align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: none; }
.chat-compose textarea:disabled { background: #f1f3f5; cursor: not-allowed; }
.compose-hint { background: #fff8e1; border: 1px dashed #f3df9a; color: #8a6d00; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 8px; }
.transfer-select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; max-width: 180px; }
.msg-body a { color: inherit; text-decoration: underline; }

/* side panel */
.side-panel { background: var(--panel); border-left: 1px solid var(--border); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 22px; }
.side-panel h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; }
.team-list, .simple-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.team-list li, .simple-list li { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.team-list form, .simple-list form { margin-left: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; position: relative; overflow: visible; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar::after { content: ''; position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: #b7bec7; }
.avatar[data-online="1"]::after { background: #2ecc71; }
/* conectat, dar invizibil pentru vizitatori: inel gol, nu bulină verde */
.avatar[data-online="1"][data-invisible="1"]::after { background: #fff; border-color: #8a93a0; }
.avatar[data-online="0"][data-invisible="1"]::after { background: #b7bec7; }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 13px; }
details { font-size: 14px; }
details summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; padding: 4px 0; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.inline-add { display: flex; gap: 6px; }
.inline-add input { flex: 1; }

/* settings */
.settings-layout { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 30px; max-width: 1100px; margin: 0 auto; width: 100%; }
.settings-form h1 { font-size: 24px; margin-bottom: 14px; }
.settings-form h2 { font-size: 18px; margin: 26px 0 8px; }
.settings-form form { display: flex; flex-direction: column; gap: 14px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
input[type=range] { padding: 0; }
input[type=color] { padding: 2px; height: 42px; cursor: pointer; }
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-preview { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--border); padding: 4px; }
.schedule-grid { display: flex; flex-direction: column; gap: 8px; }
.schedule-row { display: flex; align-items: center; gap: 8px; }
.schedule-row input[type=time] { padding: 6px 8px; }
.code-block { background: #1e2530; color: #9fe8a8; border-radius: 10px; padding: 14px; font-size: 12.5px; overflow-x: auto; margin-bottom: 10px; }
.settings-preview h2 { font-size: 18px; margin-bottom: 10px; }
.preview-stage { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 14px; height: 380px; overflow: hidden; }
.fake-site { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.fake-line { height: 13px; border-radius: 6px; background: #eef0f3; }
.w60 { width: 60%; } .w75 { width: 75%; } .w80 { width: 80%; } .w90 { width: 90%; }
.preview-btn { position: absolute; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.25); transition: all .1s; }

@media (max-width: 1000px) {
  .app-layout { grid-template-columns: 260px 1fr; }
  .side-panel { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
}
