/* ==========================================================================
   Valrom Leads — stiluri aplicație
   Brand: navy #003865 · blue #00A3E0 · light #EAF3F7
   ========================================================================== */

:root {
  --navy: #003865;
  --navy-700: #00294b;
  --navy-500: #0a4a80;
  --blue: #00A3E0;
  --blue-600: #0088bd;
  --blue-100: #d6f0fa;
  --blue-50: #ebf7fc;
  --bg: #EAF3F7;
  --white: #ffffff;
  --text: #14283a;
  --muted: #5b7083;
  --muted-2: #8aa0b1;
  --border: #d5e3ec;
  --border-2: #e6eef4;
  --success: #1d9a6c;
  --success-bg: #e3f6ee;
  --danger: #d64545;
  --danger-bg: #fdeaea;
  --warning: #e3a008;
  --warning-bg: #fff6df;
  --wa: #25D366;
  --wa-dark: #1eb257;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 56, 101, .06), 0 4px 16px rgba(0, 56, 101, .06);
  --shadow-lg: 0 12px 40px rgba(0, 56, 101, .18);
  --sidebar-w: 264px;
  --topbar-h: 60px;
  --bottom-h: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--navy); font-weight: 700; }
p { margin: 0 0 .75rem; }
button { font-family: inherit; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --------------------------------------------------------------------------
   Layout aplicație
   -------------------------------------------------------------------------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transform: translateX(-100%);
  transition: transform .25s ease;
  overflow-y: auto;
}
.sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 25, 46, .5); z-index: 39; display: none; }
.sidebar-backdrop.is-open { display: block; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; }
.brand-logo { height: 30px; width: auto; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .1px; white-space: nowrap; }
.sidebar-close { color: #fff; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 12px 18px 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.sidebar-user-name { font-weight: 600; font-size: 14px; }
.sidebar-user-role { font-size: 12px; color: rgba(255, 255, 255, .65); }
.sidebar-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255, 255, 255, .8); font-weight: 500; font-size: 14.5px;
  text-decoration: none !important; transition: background .15s, color .15s;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.is-active { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(0, 163, 224, .35); }
.nav-item .ico { opacity: .9; }
.sidebar-footer { margin-top: auto; padding: 14px 10px 18px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 10px; }
.sidebar-links { display: flex; flex-direction: column; gap: 2px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.topbar-brand img { height: 26px; }
.topbar-title { font-weight: 700; color: var(--navy); font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-scan span { display: none; }
.content { padding: 20px 16px calc(var(--bottom-h) + 24px); max-width: 1240px; width: 100%; margin: 0 auto; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 35;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none !important;
}
.bottom-nav a.is-active { color: var(--blue-600); }
.bottom-nav .ico { width: 22px; height: 22px; }
.bottom-nav-fab {
  width: 56px; height: 56px; border-radius: 50%; margin-top: -28px;
  background: var(--blue); color: #fff !important; box-shadow: 0 8px 20px rgba(0, 163, 224, .45);
  justify-self: center; display: flex; align-items: center; justify-content: center;
  border: 4px solid var(--bg);
}
.bottom-nav-fab .ico { width: 26px; height: 26px; }

@media (min-width: 1024px) {
  .sidebar { transform: none; box-shadow: none; }
  .sidebar-close, .sidebar-backdrop { display: none !important; }
  .main { margin-left: var(--sidebar-w); }
  .topbar .topbar-menu, .topbar .topbar-brand { display: none; }
  .topbar { padding: 0 28px; }
  .topbar-title { font-size: 18px; }
  .topbar-scan span { display: inline; }
  .content { padding: 28px 28px 40px; }
  .bottom-nav { display: none; }
}

/* --------------------------------------------------------------------------
   Butoane
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none !important;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-500); }
.btn-accent { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(0, 163, 224, .3); }
.btn-accent:hover { background: var(--blue-600); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-secondary:hover { background: var(--blue-50); border-color: #bcd3e1; }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: rgba(0, 56, 101, .06); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b93b3b; }
.btn-danger-outline { background: #fff; color: var(--danger); border-color: #f1c3c3; }
.btn-danger-outline:hover { background: var(--danger-bg); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-lg { padding: 13px 20px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-xl { padding: 18px 20px; font-size: 16px; border-radius: 14px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.icon-btn {
  background: transparent; border: 0; padding: 8px; border-radius: 10px; cursor: pointer; color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(0, 56, 101, .07); }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }
.action-icons { display: inline-flex; gap: 4px; }
.action-icons .icon-btn { padding: 7px; }
.action-icons .icon-btn .ico { width: 18px; height: 18px; }
.icon-btn.wa { color: var(--wa-dark); }
.icon-btn.danger { color: var(--danger); }

/* --------------------------------------------------------------------------
   Carduri / pagini
   -------------------------------------------------------------------------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { font-size: 24px; letter-spacing: -.2px; }
.page-header .sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { font-size: 16px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border-2); }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid > *, .grid-main > *, .card { min-width: 0; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.grid-main { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .grid-main { grid-template-columns: 2fr 1fr; align-items: start; } }

.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
}
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--blue-50); color: var(--blue-600); flex: none; }
.stat-icon.navy { background: rgba(0, 56, 101, .08); color: var(--navy); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.1; letter-spacing: -.5px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge-blue { background: var(--blue-100); color: var(--blue-600); }
.badge-navy { background: rgba(0, 56, 101, .1); color: var(--navy); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-orange { background: var(--warning-bg); color: #a56f00; }
.badge-gray { background: #eef2f5; color: var(--muted); }
.badge-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 14px; flex: none; text-decoration: none !important;
}
.avatar-sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-navy { background: var(--navy); }
.avatar-soft { background: var(--blue-100); color: var(--navy); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h2, .empty-state h3 { margin-bottom: 6px; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--blue-50); color: var(--blue-600); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty-icon .ico { width: 30px; height: 30px; }
.empty-state-page { padding: 80px 20px; }

/* --------------------------------------------------------------------------
   Formulare
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-group label, .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--navy); }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.label-row label { margin: 0; }
.link-sm { font-size: 13px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: 15px; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 163, 224, .18); }
.input.is-invalid { border-color: var(--danger); }
.textarea { min-height: 96px; resize: vertical; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b7083' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 18px; height: 18px; pointer-events: none; }
.input.has-icon { padding-left: 40px; }
.input.has-toggle { padding-right: 44px; }
.input-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--muted); cursor: pointer; display: inline-flex; }
.input-toggle:hover { color: var(--navy); background: var(--blue-50); }
.input-toggle .ico-hide { display: none; }
.input-toggle.is-visible .ico-show { display: none; }
.input-toggle.is-visible .ico-hide { display: block; }
.form-hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.form-row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; flex: none; }
.form-group label.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; margin: 0; color: var(--text); }
.form-group label.check input { margin-top: 2px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.form-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .form-actions .btn { flex: 0 0 auto; } }
.form-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 8px 0 12px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: #f5f9fb; gap: 3px; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: inline-flex; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.segmented input:checked + span { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.segmented.rating input:checked + span.hot { color: #c62828; }
.segmented.rating input:checked + span.warm { color: #a56f00; }
.segmented.rating input:checked + span.cold { color: var(--blue-600); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert .ico { margin-top: 1px; }
.alert-success { background: var(--success-bg); color: #13704d; border-color: #bfe8d4; }
.alert-error { background: var(--danger-bg); color: #9b2c2c; border-color: #f3c6c6; }
.alert-info { background: var(--blue-50); color: var(--navy); border-color: #bfe3f3; }
.alert-warning { background: var(--warning-bg); color: #7a5200; border-color: #f2dfae; }

/* --------------------------------------------------------------------------
   Tabele / liste
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #f7fafc; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table tbody tr:hover { background: #f9fcfe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .td-actions { text-align: right; white-space: nowrap; }
.table a.row-link { color: var(--navy); font-weight: 600; }
.cell-primary { font-weight: 600; color: var(--navy); }
.cell-sub { font-size: 12.5px; color: var(--muted); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); color: inherit; text-decoration: none !important; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #f9fcfe; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Contacte pe mobil — carduri */
.contact-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .contact-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .contact-cards { grid-template-columns: repeat(3, 1fr); } }
.contact-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.contact-card-head { display: flex; gap: 12px; align-items: flex-start; }
.contact-card-head .grow { flex: 1; min-width: 0; }
.contact-card-name { font-weight: 700; color: var(--navy); font-size: 15px; }
.contact-card-name a { color: inherit; }
.contact-card-meta { font-size: 13px; color: var(--muted); }
.contact-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.contact-card-actions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--border-2); padding-top: 10px; margin-top: auto; }
.contact-card-actions .btn { flex: 1 1 auto; min-width: 0; padding: 8px 6px; font-size: 12.5px; }
.contact-card-actions .btn-icon-only { flex: 0 0 auto; padding: 8px 10px; }
.contact-card-actions .btn .ico { width: 16px; height: 16px; }
.contact-thumb { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: #f3f7fa; flex: none; }

.only-desktop { display: none; }
@media (min-width: 900px) { .only-desktop { display: block; } .only-mobile { display: none !important; } }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input, .filters .select { width: auto; min-width: 150px; padding: 9px 12px; font-size: 14px; }
.filters .search { flex: 1 1 220px; }
.filters .search .input { width: 100%; }
.filters .input.has-icon { padding-left: 40px; }
.filters .select { padding-right: 34px; }
.view-toggle { margin-left: auto; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 13px; font-weight: 600; color: var(--navy); }
.pagination .is-current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* --------------------------------------------------------------------------
   Grafice simple (bare)
   -------------------------------------------------------------------------- */
.bars-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; min-width: 100%; }
.bars.bars-14 { min-width: 520px; }
@media (min-width: 720px) { .bars.bars-14 { min-width: 0; } }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-fill { width: 100%; max-width: 38px; background: linear-gradient(180deg, var(--blue) 0%, var(--blue-600) 100%); border-radius: 6px 6px 3px 3px; min-height: 3px; position: relative; transition: height .4s ease; }
.bar-fill.is-zero { background: var(--border); }
.bar-value { font-size: 11px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.bar-label { font-size: 10.5px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.hbar-list { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.hbar .hbar-label { font-size: 13.5px; font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .hbar-value { font-size: 13px; font-weight: 700; color: var(--navy); }
.hbar .hbar-track { grid-column: 1 / -1; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.hbar .hbar-fill { height: 100%; background: var(--blue); border-radius: 999px; }
.hbar .hbar-fill.navy { background: var(--navy); }

/* --------------------------------------------------------------------------
   Scanare carte de vizită
   -------------------------------------------------------------------------- */
.scan-hero { text-align: center; padding: 8px 0 4px; }
.dropzone {
  border: 2px dashed #b9d2e2; border-radius: 18px; padding: 28px 18px; text-align: center; background: #fff;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--blue); background: var(--blue-50); }
.dropzone .empty-icon { margin-bottom: 10px; }
.dropzone h3 { font-size: 17px; margin-bottom: 4px; }
.dropzone p { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.scan-preview { position: relative; border-radius: 16px; overflow: hidden; background: #0b1c2a; border: 1px solid var(--border); }
.scan-preview img { width: 100%; max-height: 360px; object-fit: contain; margin: 0 auto; }
.scan-overlay { position: absolute; inset: 0; background: rgba(0, 25, 46, .55); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-weight: 600; }
.scan-line { position: absolute; left: 6%; right: 6%; height: 3px; background: var(--blue); box-shadow: 0 0 18px var(--blue); animation: scan 1.6s ease-in-out infinite; border-radius: 3px; }
@keyframes scan { 0% { top: 8%; } 50% { top: 90%; } 100% { top: 8%; } }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.dark { border-color: rgba(0, 56, 101, .2); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-result-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--success-bg); color: #13704d; font-weight: 600; font-size: 14px; margin-top: 12px; }
.scan-result-bar.warn { background: var(--warning-bg); color: #7a5200; }
.card-image-preview { border-radius: 12px; border: 1px solid var(--border); overflow: hidden; background: #f3f7fa; }
.card-image-preview img { width: 100%; object-fit: contain; max-height: 320px; }
.field-filled { animation: fieldflash 1.2s ease; }
@keyframes fieldflash { 0% { background: #d6f0fa; } 100% { background: #fff; } }

.nfc-row { display: flex; flex-direction: column; gap: 10px; }
.nfc-or { text-align: center; color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.nfc-link { display: flex; gap: 8px; }
.nfc-link .input-wrap { flex: 1; min-width: 0; }
.nfc-link .btn { flex: none; padding-left: 12px; padding-right: 12px; }
@media (min-width: 720px) { .nfc-row { flex-direction: row; align-items: center; } .nfc-link { flex: 1; } }
.nfc-wave { width: 120px; height: 120px; border-radius: 50%; margin: 10px auto 16px; background: var(--blue-50); color: var(--blue-600); display: flex; align-items: center; justify-content: center; position: relative; }
.nfc-wave .ico { width: 48px; height: 48px; }
.nfc-wave::before, .nfc-wave::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue); animation: nfcpulse 1.8s ease-out infinite; opacity: 0; }
.nfc-wave::after { animation-delay: .9s; }
@keyframes nfcpulse { 0% { transform: scale(.8); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }

/* Instalare aplicație */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(var(--bottom-h) + 12px + env(safe-area-inset-bottom)); z-index: 34; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 12px 12px 14px; display: none; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); }
.install-banner.is-visible { display: flex; }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-banner .grow { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; }
.install-banner .grow strong { display: block; font-size: 14px; }
.install-banner .btn { padding: 8px 12px; font-size: 13px; }
.install-banner .icon-btn { color: #fff; }
@media (min-width: 1024px) { .install-banner { display: none !important; } }
.install-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.install-steps .n { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; font-size: 13px; }
.platform-card { border: 2px solid var(--border); border-radius: var(--radius); }
.platform-card.is-current { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 163, 224, .12); }
.install-only { display: none; }
body.can-install .install-only { display: flex; }

/* --------------------------------------------------------------------------
   Detaliu contact
   -------------------------------------------------------------------------- */
.contact-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.contact-hero h1 { font-size: 22px; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.detail-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-2); font-size: 14.5px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row .k { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.detail-row .v { color: var(--text); word-break: break-word; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 720px) { .quick-actions { grid-template-columns: repeat(4, 1fr); } }
.quick-actions .btn { padding: 12px 10px; flex-direction: column; gap: 6px; font-size: 12.5px; }
.quick-actions .btn .ico { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Eveniment
   -------------------------------------------------------------------------- */
.event-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; color: inherit; text-decoration: none !important; }
.event-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--ev-color, var(--blue)); }
.event-card h3 { font-size: 16.5px; }
.event-card .meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.event-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.event-card .meta .ico { width: 15px; height: 15px; }
.event-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { width: 28px; height: 28px; font-size: 11px; border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-actions .btn { flex-direction: column; gap: 6px; padding: 16px 10px; font-size: 13.5px; white-space: normal; text-align: center; }
.big-actions .btn .ico { width: 24px; height: 24px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--navy); }
.user-chip .avatar { width: 24px; height: 24px; font-size: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.checklist { display: grid; gap: 6px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .checklist { grid-template-columns: 1fr 1fr; } }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 500; background: #fff; }
.checklist label:hover { background: var(--blue-50); }
.checklist input { accent-color: var(--blue); width: 17px; height: 17px; }
.color-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dots label { cursor: pointer; }
.color-dots input { position: absolute; opacity: 0; }
.color-dots span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.color-dots input:checked + span { box-shadow: 0 0 0 2px var(--navy); }

/* --------------------------------------------------------------------------
   Tab-uri
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.tab.is-active { color: var(--navy); border-bottom-color: var(--blue); }
.tab-panel[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Toast / Modal
   -------------------------------------------------------------------------- */
.toasts { position: fixed; top: 12px; right: 12px; left: 12px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 640px) { .toasts { left: auto; width: 380px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); border-left: 4px solid var(--blue); font-size: 14px; font-weight: 500; animation: toastin .25s ease; }
.toast span { flex: 1; }
.toast-success { border-left-color: var(--success); }
.toast-success .ico:first-child { color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error .ico:first-child { color: var(--danger); }
.toast-info .ico:first-child { color: var(--blue-600); }
.toast-close { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; display: inline-flex; }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 25, 46, .55); }
.modal-dialog { position: relative; background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); animation: toastin .2s ease; }
.modal-dialog.wide { max-width: 640px; }
.modal-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; background: var(--blue-50); color: var(--blue-600); }
.modal-icon.danger { background: var(--danger-bg); color: var(--danger); }
.modal-title { font-size: 18px; margin-bottom: 6px; }
.modal-text { color: var(--muted); font-size: 14.5px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-close { position: absolute; top: 12px; right: 12px; }

/* --------------------------------------------------------------------------
   QR
   -------------------------------------------------------------------------- */
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr-frame { background: #fff; padding: 18px; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.qr-frame canvas { display: block; width: 260px; height: 260px; }
@media (min-width: 640px) { .qr-frame canvas { width: 320px; height: 320px; } }
.qr-link { font-size: 13px; color: var(--muted); word-break: break-all; text-align: center; }
.qr-display { min-height: 100vh; background: linear-gradient(160deg, var(--navy) 0%, #00538f 60%, var(--blue) 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; text-align: center; }
.qr-display .qr-frame { padding: 26px; border-radius: 28px; border: 0; }
.qr-display .qr-frame canvas { width: min(70vw, 440px); height: min(70vw, 440px); }
.qr-display h1 { color: #fff; font-size: clamp(24px, 4vw, 40px); margin: 26px 0 8px; }
.qr-display p { font-size: clamp(15px, 2vw, 20px); color: rgba(255, 255, 255, .85); max-width: 640px; }
.qr-display .logo { height: 54px; margin-bottom: 20px; }
.qr-display .exit { position: fixed; top: 14px; right: 14px; color: #fff; opacity: .7; }

/* --------------------------------------------------------------------------
   Autentificare
   -------------------------------------------------------------------------- */
.auth-body { background: var(--bg); }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { display: none; background: linear-gradient(160deg, var(--navy) 0%, #00538f 70%, var(--blue) 130%); color: #fff; position: relative; overflow: hidden; }
.auth-hero-inner { position: relative; z-index: 1; padding: 56px 56px; max-width: 560px; display: flex; flex-direction: column; justify-content: center; height: 100%; }
.auth-logo { height: 64px; width: auto; margin-bottom: 28px; }
.auth-hero h1 { color: #fff; font-size: 34px; letter-spacing: -.5px; margin-bottom: 12px; }
.auth-tagline { font-size: 17px; color: rgba(255, 255, 255, .85); line-height: 1.55; margin-bottom: 28px; }
.auth-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-features li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.auth-features .ico { width: 22px; height: 22px; color: var(--blue); background: rgba(255, 255, 255, .12); border-radius: 8px; padding: 6px; box-sizing: content-box; }
.auth-hero-decor { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 163, 224, .55) 0%, rgba(0, 163, 224, 0) 70%); }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.auth-card { background: #fff; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 28px 22px; width: 100%; max-width: 420px; }
.auth-logo-mobile { height: 44px; width: auto; margin: 0 auto 20px; }
.auth-title { font-size: 24px; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-footer { font-size: 12.5px; color: var(--muted); margin-top: 18px; text-align: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.back-link .ico { width: 16px; height: 16px; }
@media (min-width: 900px) {
  .auth-page { grid-template-columns: 1.1fr 1fr; }
  .auth-hero { display: block; }
  .auth-logo-mobile { display: none; }
  .auth-card { padding: 36px 34px; }
}

/* --------------------------------------------------------------------------
   Diverse
   -------------------------------------------------------------------------- */
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.kv .v { font-weight: 600; color: var(--navy); }
.divider { height: 1px; background: var(--border-2); margin: 16px 0; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-2); font-size: 14px; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-50); color: var(--blue-600); display: flex; align-items: center; justify-content: center; flex: none; }
.timeline-dot .ico { width: 16px; height: 16px; }
.timeline-time { font-size: 12px; color: var(--muted); }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; }
.share-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .share-actions { grid-template-columns: repeat(3, 1fr); } }
.help-box { background: var(--blue-50); border: 1px solid #bfe3f3; border-radius: 12px; padding: 14px 16px; font-size: 13.5px; color: var(--navy); }
.help-box h4 { font-size: 14px; margin-bottom: 6px; }
.help-box ol { margin: 0; padding-left: 18px; }
.printable { display: none; }
@media print {
  .sidebar, .topbar, .bottom-nav, .toasts, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0; }
  body { background: #fff; }
}
