  :root {
    --bg: #0b1220;
    --surface: #111a2b;
    --surface2: #162238;
    --border: #24324a;
    --accent: #00b7d9;
    --accent2: #2f7df6;
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --text: #e8eef8;
    --text-muted: #8fa1ba;
    --text-dim: #c2d0e4;
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Syne', sans-serif;
    --border-accent: #32507a;
    --accent-dim: rgba(0,183,217,0.14);
    --gradient-primary: linear-gradient(135deg, #00b7d9, #2f7df6);
  }
  body[data-theme="v2"] {
    --bg: #0f141c;
    --surface: #171f2b;
    --surface2: #1f2a39;
    --border: #304156;
    --accent: #33c3a5;
    --accent2: #2d6cdf;
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
    --text: #f1f5f9;
    --text-muted: #9baec6;
    --text-dim: #d2dde9;
    --border-accent: #43617e;
    --accent-dim: rgba(51,195,165,0.14);
    --gradient-primary: linear-gradient(135deg, #33c3a5, #2d6cdf);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  *:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 75%, #ffffff);
    outline-offset: 2px;
  }

  /* Touch optimizations */
  button, a, [onclick], [role="button"], label, select, input {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    height: 100vh;
    display: flex;
    overflow: hidden;
  }

  /* ── SIDEBAR ── */
  #sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(.4,0,.2,1), width 0.25s cubic-bezier(.4,0,.2,1);
    z-index: 100;
    overflow: hidden;
  }

  #sidebar.collapsed {
    width: 56px;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
  }

  .sidebar-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s;
  }

  #sidebar.collapsed .sidebar-title { opacity: 0; pointer-events: none; }

  #sidebarToggle {
    margin-left: auto;
    width: 28px; height: 28px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
  }
  #sidebarToggle:hover { border-color: var(--accent); color: var(--accent); }

  /* Cand e colapsata, centram logo-ul si mutam toggle-ul sub el */
  #sidebar.collapsed .sidebar-header {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
  }
  #sidebar.collapsed #sidebarToggle {
    margin-left: 0;
    transform: rotate(180deg);
  }

  /* ── SIDEBAR USER INFO ── */
  .sidebar-user {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden;
  }

  .sidebar-user-inner {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .user-avatar {
    width: 32px; height: 32px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    flex-shrink: 0;
  }

  .user-info { overflow: hidden; }
  .user-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-company { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

  .status-dot {
    width: 7px; height: 7px;
    background: var(--green);
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 0 6px var(--green);
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }
  .company-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
  }
  .company-action-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
  }
  .company-action-btn:hover { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); }
  .company-action-btn:disabled { opacity: 0.5; cursor: default; }
  .company-action-btn .btn-icon { font-size: 14px; flex-shrink: 0; }
  .company-action-btn .btn-label { font-weight: 600; }
  @keyframes riskBarGrow {
    from { width: 0; }
  }
  @keyframes ai-pulse {
    0%, 100% { border-color: #00d4ff; box-shadow: 0 0 8px rgba(0,212,255,0.4); }
    50%       { border-color: #3b82f6; box-shadow: 0 0 12px rgba(59,130,246,0.4); }
  }
  .ai-btn {
    background: transparent; color: #00d4ff;
    border: 2px solid #00d4ff; border-radius: 6px;
    padding: 5px 12px; font-size: 11px; cursor: pointer; white-space: nowrap;
    font-family: var(--font-mono);
    animation: ai-pulse 2s ease-in-out infinite;
  }
  .ai-btn.loading { animation-duration: 0.8s; cursor: wait; }
  .ai-btn.done    { animation: none; border-color: #00d4ff; box-shadow: none; }

  #sidebar.collapsed .user-info { display: none; }

  /* ── SIDEBAR NAV SCROLL ── */
  .sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-accent) transparent;
    -webkit-overflow-scrolling: touch;
  }

  .nav-group { padding: 10px 8px 6px; }

  .nav-group-label {
    font-family: var(--font-display);
    font-size: 8.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.4;
    padding: 0 6px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s, height 0.2s, margin 0.2s;
  }
  #sidebar.collapsed .nav-group-label { opacity: 0; height: 0; margin: 0; }

  .nav-sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2px 10px;
    transition: opacity 0.2s;
  }
  #sidebar.collapsed .nav-sep { opacity: 0; margin: 2px 4px; }

  .nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: 7px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
  }
  .nav-btn:hover { background: var(--surface2); color: var(--text); }
  .nav-btn.active { background: var(--accent-dim); border-left: 3px solid var(--accent); color: var(--accent); }

  .nav-icon {
    position: relative;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }

  .nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
  }
  #sidebar.collapsed .nav-text { opacity: 0; pointer-events: none; }

  /* ── HELP PILLS ── */
  .help-pill {
    display: inline-block;
    padding: 3px 8px;
    margin: 2px 3px 2px 0;
    background: rgba(0,212,255,0.08);
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: 20px;
    font-size: 11px;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: var(--font-mono);
  }
  .help-pill:hover { background: rgba(0,212,255,0.2); border-color: rgba(0,212,255,0.45); }

  /* ── NAV INFO BUTTON ── */
  .nav-info-btn {
    margin-left: auto;
    flex-shrink: 0;
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    cursor: pointer;
    line-height: 1;
  }
  .nav-btn:hover .nav-info-btn { opacity: 0.55; }
  .nav-info-btn:hover { opacity: 1 !important; background: var(--surface2); color: var(--accent); }
  #sidebar.collapsed .nav-info-btn { display: none; }

  /* ── NAV POPOVER ── */
  .nav-popover {
    position: fixed;
    z-index: 9999;
    background: #141820;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    max-width: 230px;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45);
    font-size: 11px;
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
  }
  .nav-popover.visible { opacity: 1; pointer-events: auto; }
  .nav-popover-desc { color: var(--text-muted); margin-bottom: 7px; line-height: 1.4; }
  .nav-popover-label { font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted); opacity: 0.5; margin-bottom: 4px; }

  /* ── BADGE-URI ── */
  .nav-badge {
    position: absolute;
    top: -5px; right: -8px;
    border-radius: 20px;
    padding: 2px 5px;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
    pointer-events: none;
  }
  .badge-red    { background: #7f1d1d; color: #fca5a5; }
  .badge-blue   { background: #1e3a5f; color: #60a5fa; }
  .badge-green  { background: #14532d; color: #86efac; }
  .badge-yellow { background: #422006; color: #fbbf24; }

  /* ── PERIOD PICKER ── */
  .period-pill {
    border-radius: 20px;
    padding: 5px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .period-pill:hover  { background: var(--surface2); border-color: var(--accent); color: var(--text); }
  .period-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .period-group-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 2px; color: var(--text-muted); margin-bottom: 6px;
  }

  /* ── SIDEBAR BOTTOM ── */
  .sidebar-bottom {
    margin-top: auto;
    padding: 10px 8px;
    border-top: 1px solid var(--border);
  }

  /* ── MAIN AREA ── */
  #mainArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
  }

  /* ── HEADER (top of main) ── */
  header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  #mobileMenuBtn {
    display: none;
    width: 32px; height: 32px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    cursor: pointer;
    align-items: center; justify-content: center;
    flex-shrink: 0;
  }

  .header-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-title span { color: var(--text); }

  #newChatBtn {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
  }
  #newChatBtn:hover { border-color: var(--accent); color: var(--accent); }
  #clearScreenBtn {
    padding: 6px 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  #clearScreenBtn:hover { border-color: var(--accent); color: var(--accent); }
  #themeToggleBtn {
    padding: 6px 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  #themeToggleBtn:hover { border-color: var(--accent); color: var(--accent); }
  #quickGuideBtn {
    padding: 6px 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  #quickGuideBtn:hover { border-color: var(--accent); color: var(--accent); }
  #densityToggleBtn {
    padding: 6px 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  #densityToggleBtn:hover { border-color: var(--accent); color: var(--accent); }

  /* Meniu „⋯” — doar pe mobil (vezi @media 768px) */
  #headerMore { display: none; position: relative; flex-shrink: 0; }
  #headerMoreBtn {
    width: 40px; height: 40px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 20px; line-height: 1;
    cursor: pointer;
  }
  #headerMoreBtn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
  #headerMoreMenu {
    display: none;
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 210px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
    z-index: 900;
  }
  #headerMoreMenu.open { display: flex; flex-direction: column; }
  #headerMoreMenu button {
    min-height: 44px;
    padding: 0 12px;
    background: none; border: none; border-radius: 7px;
    color: var(--text);
    font-family: var(--font-mono); font-size: 13px;
    text-align: left;
    cursor: pointer;
  }
  #headerMoreMenu button:active, #headerMoreMenu button:hover { background: var(--surface2); }

  /* ── MESSAGES ── */
  #messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-accent) transparent;
  }

  #messages::-webkit-scrollbar { width: 4px; }
  #messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: slideIn 0.2s ease;
  }

  .msg.msg-wide {
    align-self: stretch;
    max-width: 100%;
    width: 100%;
    margin-left: 0;
  }
  /* Bubble trebuie sa umple latimea msg-wide si sa permita overflow-x:auto pe tabele interioare */
  .msg.msg-wide > .msg-bubble {
    flex: 1;
    min-width: 0;
  }
  .msg.msg-wide .msg-avatar { display: none; }

  @keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .msg.user { align-self: flex-end; flex-direction: row-reverse; }
  .msg.bot  { align-self: flex-start; }

  .msg-avatar {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
  }

  .msg.bot .msg-avatar  { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
  .msg.user .msg-avatar { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); }

  .msg-bubble {
    min-width: 0; /* altfel textele nowrap lățesc balonul peste ecran (mobil) */
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
  }

  .msg.bot .msg-bubble {
    background: color-mix(in srgb, var(--surface2) 88%, #0a1324);
    border: 1px solid color-mix(in srgb, var(--border) 90%, #4d6a95);
    border-top-left-radius: 2px;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  }

  .msg.user .msg-bubble {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-top-right-radius: 2px;
    color: #fff;
  }

  /* status cards inside bot messages */
  .card {
    margin-top: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .card-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid var(--border);
  }
  .card-row:last-child { border-bottom: none; }

  .card-label { color: var(--text-muted); }
  .card-value { color: var(--text); text-align: right; }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
  }

  .badge.success { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
  .badge.error   { background: rgba(239,68,68,.15);  color: var(--red);   border: 1px solid rgba(239,68,68,.3); }
  .badge.warning { background: rgba(245,158,11,.15); color: var(--yellow); border: 1px solid rgba(245,158,11,.3); }
  .badge.info    { background: rgba(0,212,255,.1); color: var(--accent); border: 1px solid rgba(0,212,255,.25); }

  .toast-root {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: min(92vw, 520px);
  }
  .toast {
    pointer-events: auto;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    animation: toastIn .18s ease-out;
  }
  .toast.error   { background: rgba(239,68,68,.95); color: #fff; border-color: rgba(255,255,255,.18); }
  .toast.warning { background: rgba(245,158,11,.95); color: #111; border-color: rgba(255,255,255,.22); }
  .toast.success { background: rgba(34,197,94,.95); color: #fff; border-color: rgba(255,255,255,.18); }
  .toast.info    { background: rgba(0,212,255,.92); color: #021016; border-color: rgba(255,255,255,.22); }
  .toast.fade-out { opacity: 0; transform: translateY(-5px); transition: opacity .2s ease, transform .2s ease; }
  @keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

  /* ── ANAF STATUS ── */
  .anaf-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  @media (max-width: 520px) { .anaf-status-grid { grid-template-columns: 1fr; } }

  .anaf-svc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .anaf-svc-card.ok     { border-left: 3px solid var(--green); }
  .anaf-svc-card.degradat { border-left: 3px solid var(--yellow); }
  .anaf-svc-card.down   { border-left: 3px solid var(--red); }

  .anaf-svc-header { display: flex; align-items: center; gap: 7px; }
  .anaf-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  }
  .anaf-dot.ok      { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
  .anaf-dot.degradat{ background: var(--yellow); box-shadow: 0 0 5px var(--yellow); animation: pulse 3s infinite; }
  .anaf-dot.down    { background: var(--red); }

  .anaf-svc-name { font-size: 12px; font-weight: 600; color: var(--text); }
  .anaf-svc-url  { font-size: 10px; color: var(--text-muted); }
  .anaf-svc-ms   { font-size: 11px; color: var(--text-muted); }
  .anaf-svc-msg  { font-size: 11px; }
  .anaf-svc-msg.ok      { color: var(--green); }
  .anaf-svc-msg.degradat{ color: var(--yellow); }
  .anaf-svc-msg.down    { color: var(--red); }

  /* typing indicator */
  .typing { display: flex; gap: 4px; align-items: center; padding: 6px 0; }
  .typing span {
    width: 6px; height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: blink 1.2s infinite;
  }
  .typing span:nth-child(2) { animation-delay: .2s; }
  .typing span:nth-child(3) { animation-delay: .4s; }
  @keyframes blink { 0%,80%,100% { opacity:.2; } 40% { opacity:1; } }

  /* ── AUTOCOMPLETE DROPDOWN ── */
  #acDropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    z-index: 500;
    box-shadow: 0 -4px 16px rgba(0,0,0,.4);
    max-height: 220px;
    overflow-y: auto;
  }
  #acDropdown.ac-visible { display: block; }
  .ac-item {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .ac-item:last-child { border-bottom: none; }
  .ac-item:hover, .ac-item.ac-focused { background: rgba(0,183,217,0.12); color: var(--accent); }
  .ac-item-name { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ac-item-type { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
  .ac-loading { padding: 8px 12px; font-size: 11px; color: var(--text-muted); }

  /* ── INPUT AREA ── */
  .input-area {
    padding: 12px 20px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }

  #taskTimerPill {
    display: none; align-items: center; gap: 10px;
    width: fit-content; max-width: 100%; margin: 0 0 8px; padding: 5px 8px 5px 12px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface2);
    font-family: var(--font-mono); font-size: 12px; color: var(--text);
  }
  #taskTimerPill.is-on { display: flex; }
  #taskTimerPill.is-stopped { border-color: var(--accent); }
  #taskTimerPill button {
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    border-radius: 999px; padding: 2px 10px; font-size: 11px; cursor: pointer;
  }
  #taskTimerPill .tt-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: ttPulse 1.2s infinite; }
  @keyframes ttPulse { 50% { opacity: .3; } }

  .input-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    position: relative;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color .2s;
  }

  .input-wrap:focus-within { border-color: var(--accent); }

  #userInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    min-height: 20px;
    max-height: 120px;
  }

  #userInput::placeholder { color: var(--text-muted); }

  #sendBtn {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 7px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: opacity .2s, transform .1s;
  }

  #sendBtn:hover  { opacity: .85; }
  #sendBtn:active { transform: scale(.94); }
  #sendBtn:disabled { opacity: .35; cursor: not-allowed; }
  #sendBtn svg { width: 15px; height: 15px; fill: #fff; }

  #micBtn {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
  }
  #micBtn:hover { border-color: var(--accent); color: var(--accent); }
  #micBtn.recording {
    background: #ff4444; border-color: #ff4444; color: #fff;
    animation: recPulse 1s infinite;
  }
  @keyframes recPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,68,68,.4); }
    50%       { box-shadow: 0 0 0 6px rgba(255,68,68,0); }
  }
  #micBtn svg { width: 14px; height: 14px; }
  #mic-unsupported { display:none; font-size:11px; color:var(--text-muted); text-align:center; margin-top:4px; }

  .hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
  }
  .hint span { color: var(--accent); }

  .examples {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
  }

  .example-chip {
    font-size: 11px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    cursor: pointer;
    background: var(--bg);
    transition: border-color .2s, color .2s;
  }
  .example-chip:hover { border-color: var(--accent); color: var(--accent); }

  /* ── MOBILE OVERLAY ── */
  #sidebarOverlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
  }

  /* ── LOGIN ── */
  #loginScreen {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; flex-direction: column;
  }
  #loginScreen.hidden { display: none; }
  .login-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 380px;
    display: flex; flex-direction: column; gap: 16px;
  }
  .login-logo { text-align: center; margin-bottom: 8px; }
  .login-logo .logo { margin: 0 auto 8px; width: 40px; height: 40px; font-size: 15px; }
  .login-logo h2 { font-family: var(--font-display); font-size: 18px; color: var(--text); }
  .login-logo p  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
  .login-legal { margin: 18px 0 0; font-size: 10.5px; line-height: 1.4; color: var(--text-muted); text-align: center; opacity: .8; }
  .login-field label {
    display: block; font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
  }
  .login-field input, .login-field select {
    width: 100%; padding: 10px 14px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: var(--font-mono); font-size: 13px;
    outline: none; transition: border-color .2s; box-sizing: border-box;
  }
  .login-field input:focus, .login-field select:focus { border-color: var(--accent); }
  .login-field select option { background: var(--surface); }
  .login-btn {
    padding: 11px; background: var(--accent); color: #fff;
    border: none; border-radius: 8px; font-family: var(--font-mono);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: opacity .2s; margin-top: 4px;
  }
  .login-btn:hover { opacity: 0.85; }
  .login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .login-error { color: #ff6b6b; font-size: 12px; text-align: center; min-height: 18px; margin-top: -8px; }
  .login-company-list { display: flex; flex-direction: column; gap: 8px; }
  .login-company-btn {
    padding: 10px 14px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: var(--font-mono); font-size: 12px;
    cursor: pointer; text-align: left; transition: border-color .2s;
  }
  .login-company-btn:hover { border-color: var(--accent); color: var(--accent); }

  /* ── DAILY SUMMARY CARD ── */
  .daily-card {
    background: var(--surface2);
    border: 1px solid color-mix(in srgb, var(--border) 88%, #46628a);
    border-radius: 12px;
    overflow: hidden;
    font-size: 12px;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
  }

  .daily-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0,183,217,.12), rgba(47,125,246,.10));
    border-bottom: 1px solid var(--border);
  }

  .daily-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .daily-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
  }
  .daily-title-short { display: none; }
  .daily-title-full  { display: inline; }

  .daily-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
  }

  .daily-refresh {
    padding: 4px 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    transition: all .15s;
  }
  .daily-refresh:hover { border-color: var(--accent); color: var(--accent); }
  .daily-refresh.spinning svg { animation: spin .6s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .daily-sections {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    divide: 1px solid var(--border);
  }

  .daily-section {
    padding: 12px 14px;
    border-right: 1px solid var(--border);
  }
  .daily-section:last-child { border-right: none; }

  .daily-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .daily-kpi {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
    font-variant-numeric: tabular-nums;
  }
  .daily-kpi.red    { color: var(--red); }
  .daily-kpi.yellow { color: var(--yellow); }
  .daily-kpi.blue   { color: var(--accent); }
  .daily-kpi.orange { color: #e07b00; }
  .daily-row-val.orange { color: #e07b00; }
  .daily-zile { font-size: 11px; opacity: 0.75; font-weight: 400; margin-left: 2px; }
  .daily-fact-badge {
    display: inline-block; margin-left: 6px;
    font-size: 11px; font-weight: 600;
    color: var(--red); opacity: 0.85;
    vertical-align: middle;
  }
  .daily-scadente-header {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    padding: 8px 16px 4px; border-top: 1px solid var(--border);
    margin-top: 4px; letter-spacing: 0.02em;
  }
  .aging-drill { cursor: pointer; }
  .aging-drill:hover td { background: #ffffff08; }
  .aging-arrow { font-size: 10px; margin-left: 4px; display: inline-block; transition: transform .2s; color: var(--text-muted); }
  .aging-sub { padding: 4px 8px 6px; background: #0c0e12; border-top: 1px solid var(--border); }
  .aging-sub-row { display:flex; align-items:center; padding: 4px 8px; font-size:11px;
    background:#15181e; border:1px solid #ffffff10; border-radius:4px; margin-bottom:2px; }
  .aging-sub-row:hover { border-color: rgba(0,212,255,0.45); background: #1a1e27; }

  .aging-table {
    width: 100%; border-collapse: collapse; font-size: 11px;
  }
  .aging-table th {
    text-align: left; color: var(--text-muted); font-weight: 500;
    padding: 3px 8px 5px; border-bottom: 1px solid var(--border);
  }
  .aging-table th:nth-child(n+4) { text-align: right; }
  .aging-table td {
    padding: 4px 8px; border-bottom: 1px solid #ffffff08;
  }
  .aging-table tr:last-child td { border-bottom: none; }
  .aging-table tr:hover td { background: #ffffff06; }

  /* ── EMAIL MODAL ── */
  .email-modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 2000;
    align-items: center; justify-content: center;
  }
  .email-modal-overlay.open { display: flex; }
  .email-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: min(820px, 96vw);
    height: min(560px, 92vh);
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .email-modal-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .email-modal-title {
    font-size: 13px; font-weight: 700; color: var(--text);
    flex: 1;
  }
  .email-modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 18px; cursor: pointer; padding: 2px 6px;
    border-radius: 4px; transition: all .15s;
  }
  .email-modal-close:hover { background: var(--surface2); color: var(--text); }
  .email-modal-body {
    padding: 14px 18px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    flex: 1; min-height: 0;
  }
  .email-field label {
    display: block; font-size: 10px; font-weight: 600;
    color: var(--text-muted); margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: .04em;
  }
  .email-field select {
    width: 100%; background: var(--surface2);
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); font-family: var(--font-mono);
    font-size: 12px; padding: 8px 10px;
    outline: none; cursor: pointer;
    transition: border-color .15s;
  }
  .email-field select:focus { border-color: var(--accent); }
  .email-field input, .email-field textarea {
    width: 100%; background: var(--surface2);
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); font-family: var(--font-mono);
    font-size: 12px; padding: 8px 10px;
    outline: none; resize: vertical;
    transition: border-color .15s;
  }
  .email-field input:focus, .email-field textarea:focus {
    border-color: var(--accent);
  }
  .email-field textarea { min-height: 120px; }
  .email-preview {
    background: #fff; border-radius: 6px;
    padding: 12px; font-size: 12px;
    color: #222; min-height: 80px;
    font-family: Arial, sans-serif;
    max-height: 180px; overflow-y: auto;
  }
  .email-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .email-btn-cancel {
    padding: 7px 16px; border-radius: 6px; font-size: 12px;
    background: none; border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer; transition: all .15s;
    font-family: var(--font-mono);
  }
  .email-btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }
  .email-btn-send {
    padding: 7px 20px; border-radius: 6px; font-size: 12px;
    background: var(--accent); border: none;
    color: #fff; cursor: pointer; font-weight: 600;
    font-family: var(--font-mono); transition: opacity .15s;
  }
  .email-btn-send:hover { opacity: .85; }
  .email-btn-send:disabled { opacity: .5; cursor: not-allowed; }

  /* ── GRID FACTURI SCADENTE ── */
  .notif-table {
    width: 100%; border-collapse: collapse; font-size: 11px;
    margin-top: 8px;
  }
  .notif-table th {
    text-align: left; color: var(--text-dim); font-weight: 600;
    padding: 4px 8px 6px; border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .notif-table th:nth-child(n+3) { text-align: right; }
  .notif-table th:last-child { text-align: center; }
  .notif-table td {
    padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,0.10); vertical-align: middle;
  }
  .notif-table td:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
  .notif-table td:last-child { text-align: center; }
  .notif-table tr:hover td { background: rgba(255,255,255,0.08); }
  .notif-btn {
    padding: 3px 10px; border-radius: 4px; font-size: 10px;
    background: none; border: 1px solid var(--accent);
    color: var(--accent); cursor: pointer; font-family: var(--font-mono);
    transition: all .15s; white-space: nowrap;
  }
  .notif-btn:hover { background: var(--accent); color: #fff; }
  .notif-zile-red    { color: var(--red); font-weight: 600; }
  .notif-zile-orange { color: var(--yellow); font-weight: 600; }
  .notif-zile-green  { color: var(--green); }

  .notif-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 2px 8px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border); margin-bottom: 4px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    border-radius: 8px;
  }
  .notif-sticky-zone {
    position: sticky;
    top: 0;
    z-index: 4;
    background: color-mix(in srgb, var(--surface2) 92%, #0b1220);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 6px 0;
    margin-bottom: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  }
  /* Filtrele sold nu sunt în container cu scroll — nu trebuie sticky */
  .sold-filter-zone {
    position: relative !important;
    top: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
  }
  .notif-filters {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 2px 8px; flex-wrap: wrap;
    border-bottom: 1px dashed rgba(255,255,255,0.18); margin-bottom: 6px;
    background: color-mix(in srgb, var(--surface2) 78%, transparent);
    border-radius: 8px;
  }
  .notif-filter-btn {
    padding: 3px 9px; border-radius: 999px; font-size: 10px;
    border: 1px solid color-mix(in srgb, var(--border) 88%, #476286);
    background: color-mix(in srgb, var(--surface) 86%, #0a1324);
    color: var(--text-dim); cursor: pointer; font-family: var(--font-mono);
    transition: all .15s; white-space: nowrap;
  }
  .notif-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
  .notif-filter-btn.active {
    border-color: var(--accent); color: #eaf9ff;
    background: color-mix(in srgb, var(--accent) 28%, #0f1d33);
  }
  .notif-min-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; color: var(--text-muted); margin-left: 4px;
  }
  .notif-min-input {
    width: 78px; padding: 3px 7px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 10px; font-family: var(--font-mono);
  }
  .notif-min-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,183,217,0.22); }
  .notif-sel-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--text-muted); cursor: pointer;
    user-select: none;
  }
  .notif-check { cursor: pointer; accent-color: var(--accent); width: 13px; height: 13px; }
  .notif-check:disabled { opacity: .35; cursor: not-allowed; }
  .notif-bulk-btn {
    padding: 4px 14px; border-radius: 5px; font-size: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; color: #fff;
    cursor: pointer; font-family: var(--font-mono); font-weight: 600;
    transition: opacity .15s; white-space: nowrap;
  }
  .notif-bulk-btn:hover { opacity: .85; }
  .notif-bulk-btn:disabled { opacity: .45; cursor: not-allowed; }
  .notif-chips {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 0 2px 8px;
  }
  .notif-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--border) 86%, #4a658d);
    background: color-mix(in srgb, var(--surface) 84%, #0b1220);
    color: var(--text-dim); font-size: 10px;
  }
  .notif-chip button {
    border: none; background: none; color: var(--text-muted);
    font-size: 11px; cursor: pointer; line-height: 1;
  }
  .notif-chip button:hover { color: var(--accent); }
  .notif-legend {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    padding: 0 2px 8px; font-size: 10px; color: var(--text-muted);
  }
  .notif-dot {
    width: 8px; height: 8px; border-radius: 999px; display: inline-block; margin-right: 4px;
  }
  .notif-preview {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 82%, #0a1322);
    padding: 8px 10px;
    margin-bottom: 6px;
  }
  .notif-preview-title { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
  .notif-preview-sub { font-size: 10px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }

  /* eFactura import uses the same compact operations pattern as notifications */
  .ef-card { background: var(--surface2); }
  .ef-header-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  .ef-date-controls {
    display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px;
  }
  .ef-field { display: flex; flex-direction: column; gap: 4px; min-width: 138px; }
  .ef-field label {
    font-size: 10px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: .04em; font-weight: 700;
  }
  .ef-input, .ef-select {
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 11px;
  }
  .ef-input:focus, .ef-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0,183,217,0.22);
  }
  .ef-primary-btn {
    min-height: 30px;
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
  }
  .ef-primary-btn:hover { opacity: .86; }
  .ef-primary-btn:active { transform: translateY(1px); }
  .ef-primary-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
  .ef-status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 82%, #0b1220);
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
  }
  .ef-status-badge.ok {
    border-color: rgba(34,197,94,.38);
    background: rgba(34,197,94,.12);
    color: var(--green);
  }
  .ef-status-badge.warn {
    border-color: rgba(245,158,11,.38);
    background: rgba(245,158,11,.12);
    color: var(--yellow);
  }
  .ef-status-badge.info {
    border-color: rgba(0,183,217,.35);
    background: rgba(0,183,217,.10);
    color: var(--accent);
  }
  .ef-status-badge.muted { opacity: .58; }
  .ef-table-wrap {
    overflow-x: auto;
    max-height: 280px;
    overflow-y: auto;
    padding: 0 6px 6px;
  }
  .ef-table { margin-top: 0; }
  .ef-table th:first-child,
  .ef-table td:first-child,
  .ef-table th:nth-child(2),
  .ef-table td:nth-child(2),
  .ef-table th:nth-child(3),
  .ef-table td:nth-child(3),
  .ef-table th:nth-child(4),
  .ef-table td:nth-child(4),
  .ef-table th:nth-child(5),
  .ef-table td:nth-child(5) { text-align: left; }
  .ef-table th:nth-child(7),
  .ef-table td:nth-child(7),
  .ef-table th:last-child,
  .ef-table td:last-child { text-align: center; }
  .efactura-row { cursor: pointer; }
  .efactura-row.is-active td {
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    box-shadow: inset 2px 0 0 var(--accent);
  }
  .ef-empty-workspace {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface2) 84%, #0b1220);
  }
  .ef-workspace-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .ef-workspace-content {
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface2) 88%, #0b1220);
    min-height: 120px;
  }
  .ef-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
  }
  .ef-map-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .ef-map-title strong {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ef-map-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 10px;
  }
  .ef-map-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  .ef-config-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
  }
  .ef-config-row .notif-min-label { margin-left: 0; }
  .ef-supplier-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface2) 78%, transparent);
  }
  .ef-supplier-search { width: min(260px, 100%); }
  .ef-lines-wrap {
    overflow-x: auto;
    max-height: 340px;
    overflow-y: auto;
    padding: 0 6px 6px;
  }
  .ef-lines-table th:first-child,
  .ef-lines-table td:first-child { text-align: left; }
  .ef-lines-table th:nth-child(2),
  .ef-lines-table td:nth-child(2) { text-align: left; }
  .ef-lines-table th:nth-child(4),
  .ef-lines-table td:nth-child(4),
  .ef-lines-table th:nth-child(7),
  .ef-lines-table td:nth-child(7) { text-align: center; }
  .ef-lines-table td:last-child { text-align: left; }
  .ef-line-muted { color: var(--text-muted); font-size: 10px; }
  .ef-line-search-cell { min-width: 300px; position: relative; }
  .ef-line-search-stack { display: flex; flex-direction: column; gap: 4px; }
  .ef-result-menu {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0,0,0,.34);
    background: var(--surface);
    overflow: hidden;
  }
  .ef-result-item {
    padding: 7px 10px;
    cursor: pointer;
    font-size: 11px;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .ef-result-item:last-child { border-bottom: none; }
  .ef-result-item:hover { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
  .ef-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 9px 10px 10px;
    border-top: 1px solid var(--border);
  }
  .ef-anaf-card {
    width: min(560px, 100%);
    background: color-mix(in srgb, var(--surface) 86%, #0a1324);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    font-size: 11px;
  }

  @media (max-width: 768px) {
    .ef-date-controls { gap: 8px; }
    .ef-field { min-width: 0; width: 100%; }
    .ef-header-actions { width: 100%; justify-content: flex-start; }
    .ef-map-header { align-items: flex-start; flex-direction: column; }
    .ef-map-actions { justify-content: flex-start; }
    .ef-supplier-search { width: 100%; }
  }

  /* Density mode (tables/lists only) */
  body[data-density="dense"] .sold-row {
    padding: 3px 8px !important;
    font-size: 10px !important;
    margin-bottom: 1px !important;
  }
  body[data-density="dense"] .sold-row .daily-row-main {
    font-size: 10px !important;
  }
  body[data-density="dense"] .notif-table th,
  body[data-density="dense"] .notif-table td {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    font-size: 11px !important;
  }
  body[data-density="dense"] .notif-filter-btn,
  body[data-density="dense"] .notif-bulk-btn,
  body[data-density="dense"] .notif-min-input,
  body[data-density="dense"] .notif-filter-select {
    font-size: 10px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
  body[data-density="dense"] .notif-chip {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    font-size: 10px !important;
  }

  body[data-density="comfort"] .sold-row {
    padding: 7px 12px !important;
    font-size: 11px !important;
    margin-bottom: 3px !important;
  }
  body[data-density="comfort"] .sold-row .daily-row-main {
    font-size: 12px !important;
  }
  body[data-density="comfort"] .notif-table th,
  body[data-density="comfort"] .notif-table td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    font-size: 12px !important;
  }

  .daily-breakdown {
    display: flex; flex-direction: column; gap: 2px;
    margin: 4px 0 6px; font-size: 10px;
  }
  .breakdown-ok  { color: #4caf50; }
  .breakdown-bad { color: var(--red); font-weight: 600; }

  .daily-kpi-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .daily-rows { display: flex; flex-direction: column; gap: 3px; }

  .daily-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    transition: background .15s;
  }
  .daily-row:hover { background: var(--surface); }

  .daily-row-name {
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    font-size: 11px;
  }

  .daily-row-val {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
  }
  .daily-row-val.red    { color: var(--red); }
  .daily-row-val.yellow { color: var(--yellow); }
  .daily-row-val.blue   { color: var(--accent); }


  .daily-empty {
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
    padding: 4px 0;
  }

  @media (max-width: 600px) {
    .daily-sections { grid-template-columns: minmax(0, 1fr); } /* minmax: numele nowrap nu lățesc coloana */
    .daily-section  { border-right: none; border-bottom: 1px solid var(--border); }
    .daily-section:last-child { border-bottom: none; }
  }

  @media (max-width: 768px) {
    /* Daily header compact */
    .daily-header { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; }
    .daily-header-left { gap: 6px; min-width: 0; flex: 1; }
    .daily-title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .daily-title-full  { display: none; }
    .daily-title-short { display: inline; }
    .daily-date  { font-size: 10px; white-space: nowrap; }
    .daily-refresh { padding: 5px 8px; font-size: 10px; flex-shrink: 0; min-height: 32px; }
    .daily-refresh span { display: none; } /* ascunde textul "Actualizează", lasă doar iconița */
    .daily-refresh:has(svg) { min-width: 36px; min-height: 36px; justify-content: center; }
    /* Titlu + subtitlu se scurtează cu „…” în loc să intre peste butoane */
    .daily-header-left > div { min-width: 0; }
    .daily-date { overflow: hidden; text-overflow: ellipsis; }
    /* eFactura: butoanele (Setup, Fullscreen…) trec pe rândul de sub titlu */
    .daily-header:has(.ef-header-actions) { flex-wrap: wrap; }

    /* Fără balon-în-balon: pe telefon avatarul și chenarul mesajului bot mănâncă ~60px.
       Panourile cu card propriu (.daily-card) stau direct pe fundal. */
    .msg.bot { max-width: 100%; }
    .msg.bot .msg-avatar { display: none; }
    .msg.bot .msg-bubble:has(> .daily-card) { flex: 1; padding: 0; background: none; border: none; box-shadow: none; }
    .msg.bot:has(> .msg-bubble > .daily-card) { width: 100%; }
    .daily-row-name { max-width: none; flex: 1; min-width: 0; }
    .ai-usage { margin-left: 4px; }
    /* Lista clienți/furnizori — scrollabilă pe mobil, nu ascunsă */
    .daily-rows { max-height: 220px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .sold-row { padding: 8px 10px !important; min-height: 44px; }
    /* Sold clienți/furnizori — ascunde graficul și preview-ul pe mobil */
    .sold-preview { display: none !important; }
    .sold-chart-canvas { display: none !important; }
    /* Filtre sold — stivuite vertical pe mobil */
    .notif-filters { flex-wrap: wrap; gap: 6px; }
    .notif-filters .notif-filter-select { max-width: 100% !important; width: 100%; font-size: 13px !important; }
    .notif-legend { display: none; }
    /* Aging table: ascunde col Facturi(2), Clienți(3), Acțiuni(6) — rămân Interval, Valoare, % */
    .aging-table th:nth-child(2), .aging-table td:nth-child(2),
    .aging-table th:nth-child(3), .aging-table td:nth-child(3),
    .aging-table th:nth-child(6), .aging-table td:nth-child(6) { display: none; }
    .aging-table { font-size: 12px; }
    .aging-table td, .aging-table th { padding: 5px 6px; }
    /* Notif restante (8 col): ascunde Email(3), Fact.(5), Ultima notif.(7) — rămân checkbox, Client, Restanță, Zile, Acțiune */
    .notif-table-restante th:nth-child(3), .notif-table-restante td:nth-child(3),
    .notif-table-restante th:nth-child(5), .notif-table-restante td:nth-child(5),
    .notif-table-restante th:nth-child(7), .notif-table-restante td:nth-child(7) { display: none; }
    /* Notif pre-scadenta (9 col): ascunde Email(3), Fact.(5), Scadenta(7), Ultima notif.(8) — rămân checkbox, Client, Sold, Zile, Actiune */
    .notif-table-prescadenta th:nth-child(3), .notif-table-prescadenta td:nth-child(3),
    .notif-table-prescadenta th:nth-child(5), .notif-table-prescadenta td:nth-child(5),
    .notif-table-prescadenta th:nth-child(7), .notif-table-prescadenta td:nth-child(7),
    .notif-table-prescadenta th:nth-child(8), .notif-table-prescadenta td:nth-child(8) { display: none; }
    /* Elimină min-width fix pe mobil — permite layout fluid */
    .notif-table-restante, .notif-table-prescadenta { min-width: 0 !important; font-size: 12px; }
    .notif-table td, .notif-table th { padding: 5px 6px; }
    /* Tabele notificări încap în 360px: antete pe 2 rânduri (inline nowrap → !important),
       client mai îngust, buton „Notifică” compact */
    .notif-table-restante th, .notif-table-prescadenta th { white-space: normal !important; line-height: 1.3; }
    .notif-table-restante td:nth-child(2), .notif-table-prescadenta td:nth-child(2) { max-width: 110px !important; }
    .notif-table .notif-btn { padding: 0 8px; white-space: nowrap; }

    /* Ținte de atingere ≥36px pentru butoanele din panouri */
    .notif-filter-btn, .notif-bulk-btn, .notif-btn, .ai-btn, .ef-primary-btn, .c360-btn {
      min-height: 36px; font-size: 12px;
    }
    .notif-filter-btn { padding: 0 12px; }
    button[id$="-fs-btn"], .panel-ibtn { min-width: 36px; min-height: 36px; }
    /* Pe mobil, deconectare e in nav-scroll — ascunde duplicatul din sidebar-bottom */
    .sidebar-bottom { display: none !important; }
    .sidebar-nav-scroll { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }

    #sidebar {
      position: fixed;
      top: 0; left: 0; bottom: 0;
      transform: translateX(-100%);
      width: 260px !important;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    #sidebar.mobile-open {
      transform: translateX(0);
    }
    #sidebar.collapsed {
      transform: translateX(-100%);
    }
    #sidebarOverlay.visible { display: block; }
    #mobileMenuBtn { display: flex; width: 40px; height: 40px; }
    #sidebarToggle { display: none; }
    /* Header: hamburger + titlu + „+” + „⋯”; restul butoanelor sunt în meniul „⋯” */
    header { padding: 8px 12px; gap: 8px; }
    #clearScreenBtn, #quickGuideBtn, #densityToggleBtn, #themeToggleBtn { display: none; }
    #headerMore { display: block; }
    #newChatBtn { width: 40px; height: 40px; padding: 0; justify-content: center; flex-shrink: 0; }
    #newChatBtn svg { width: 16px; height: 16px; }
    #newChatBtn .hdr-btn-text { display: none; }
    /* Placeholder pe un singur rând */
    #userInput::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #messages { padding: 16px; }
    .input-area { padding: 10px 14px 14px; }
    .msg { max-width: 95%; }
    /* Butoane touch */
    #sendBtn { width: 44px; height: 44px; border-radius: 10px; }
    #sendBtn svg { width: 18px; height: 18px; }
    #micBtn  { width: 44px; height: 44px; border-radius: 10px; }
    #micBtn svg { width: 17px; height: 17px; }
    /* Login padding */
    .login-box { padding: 28px 20px; }
    /* Notif filters mai mari pe touch */
    .notif-filter-select { font-size: 13px !important; padding: 6px 8px !important; max-width: 100% !important; }
    /* Font sizes lizibile */
    .hint        { font-size: 12px; }
    .example-chip { font-size: 12px; padding: 5px 11px; }
    .help-pill   { font-size: 12px; padding: 4px 10px; }
    /* Ascunde exemplele și hint-ul de tastatură — ocupă loc inutil pe mobil */
    .examples, .hint { display: none !important; }
  }

  /* Sidebar full-screen pe telefoane foarte mici */
  @media (max-width: 480px) {
    #sidebar { width: 100vw !important; }
    .login-box { padding: 24px 16px; border-radius: 12px; }
  }

  /* ── Pull-to-refresh indicator ── */
  #pullIndicator {
    display: none;
    position: fixed;
    top: 0; left: 50%;
    transform: translateX(-50%) translateY(-60px);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.2s ease;
    white-space: nowrap;
  }
  #pullIndicator.ptr-visible {
    display: block;
  }
  #pullIndicator.ptr-ready {
    color: var(--accent);
    border-color: var(--accent);
  }
  @media (prefers-reduced-motion: no-preference) {
    #pullIndicator.ptr-spinning::before {
      content: '';
      display: inline-block;
      width: 10px; height: 10px;
      border: 2px solid var(--accent);
      border-top-color: transparent;
      border-radius: 50%;
      animation: ptr-spin 0.6s linear infinite;
      margin-right: 6px;
      vertical-align: middle;
    }
    @keyframes ptr-spin { to { transform: rotate(360deg); } }
  }

  /* ── Bottom navigation bar (mobile only) ── */
  .bottom-nav.bn-hidden { display: none !important; }
  .bottom-nav {
    display: none; /* hidden on desktop */
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 900;
    align-items: stretch;
  }
  .bn-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px 2px 0;
    font-family: var(--font-mono);
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    min-width: 0;
    position: relative;
  }
  .bn-btn.bn-active { color: var(--accent); }
  .bn-btn:active { opacity: 0.7; }
  .bn-icon {
    font-size: 20px;
    line-height: 1;
    position: relative;
    display: inline-block;
  }
  .bn-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
  }
  .bn-dot {
    position: absolute;
    top: -3px; right: -6px;
    min-width: 16px; height: 16px;
    background: var(--red);
    color: #fff;
    border-radius: 8px;
    font-size: 9px;
    font-family: var(--font-mono);
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    font-weight: 700;
    border: 2px solid var(--surface);
  }
  @media (max-width: 768px) {
    .bottom-nav { display: flex; }
    /* push content above bottom nav — activ doar când nav-ul e vizibil (via JS) */
    #mainArea.has-bottom-nav { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
    /* Previne auto-zoom iOS (se declanșează la font-size < 16px pe input) */
    .login-field input, .login-field select,
    #userInput, input[type="text"], input[type="password"],
    input[type="number"], input[type="date"], textarea, select {
      font-size: 16px !important;
    }
  }

  /* Reduced motion — respect system preference */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

/* ── Fișă client 360 ── */
.c360 { font-family: var(--font-mono); font-size: 12px; color: var(--text); max-width: 900px; }
.c360-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.c360-score { text-align: center; min-width: 86px; }
.c360-score div { font-size: 30px; font-weight: 800; line-height: 1.1; }
.c360-score span { font-size: 10px; color: var(--text-muted); }
.c360-id { flex: 1; min-width: 0; }
.c360-name { font-size: 15px; font-weight: 800; }
.c360-meta { font-size: 10px; color: var(--text-muted); margin: 2px 0 6px; }
.c360-verdict { font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.c360-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.c360-step { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 11px; line-height: 1.45; }
.c360-btn { margin-top: 6px; padding: 3px 9px; border-radius: 6px; font-size: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--text); border: 1px solid var(--border); }
.c360-btn:disabled { opacity: 0.5; cursor: default; }
.c360-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.c360-box { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.c360-lbl { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; }
.c360-aging { margin-bottom: 10px; }
.c360-bar { height: 8px; border-radius: 4px; overflow: hidden; display: flex; background: var(--border); }
.c360-note { font-size: 10px; color: var(--text-muted); margin-top: 5px; }
.c360-det { margin-top: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; }
.c360-det summary { cursor: pointer; color: var(--text-muted); }
.c360-det ul { margin: 6px 0 0; padding-left: 18px; }
.jur { margin-top: 10px; border-left: 3px solid var(--border); padding: 4px 0 2px 10px; }
.jur-head { font-size: 12px; color: var(--text); margin-bottom: 4px; }
.jur-main { font-size: 12px; color: var(--text); margin-bottom: 4px; }
.jur-tbl { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 6px; }
.jur-tbl td, .jur-tbl th { padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.jur-tbl a { color: var(--accent); }
.jur-row { cursor: pointer; }
.jur-row:hover { background: var(--surface2); }
.c360-factori { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
.c360-factori td, .c360-factori th { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.c360-factori th { color: var(--text-muted); font-weight: 600; }
.c360-pick { display: block; width: 100%; text-align: left; padding: 7px 12px; margin: 3px 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 12px; cursor: pointer; }
.cost-badge { padding: 1px 7px; border-radius: 9px; font-weight: 700; }
.cost-ok   { background: color-mix(in srgb, #22c55e 18%, transparent); color: #22c55e; }
.cost-warn { background: color-mix(in srgb, #f97316 18%, transparent); color: #f97316; }
.cost-err  { background: color-mix(in srgb, #ef4444 18%, transparent); color: #ef4444; }
.cost-cauze { margin: 8px 0; padding-left: 18px; line-height: 1.5; }
.cost-cauze li { margin-bottom: 4px; }
.cost-cauze li.cost-orig::marker { color: #ef4444; }
.cost-actions { display: flex; gap: 6px; margin: 6px 0; }
.cost-expl { font-size: 12px; line-height: 1.55; white-space: pre-wrap; margin: 6px 0 8px; }
.cost-wrap { overflow-x: auto; }
.cost-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.cost-tbl td, .cost-tbl th { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.cost-tbl td:first-child, .cost-tbl th:first-child { text-align: left; }
.cost-tbl th { color: var(--text-muted); font-weight: 600; }
.cost-row[onclick] { cursor: pointer; }
.cost-row:hover { background: var(--surface2); }
.cost-ascuns { display: none; }
.cost-anom td { color: #ef4444; }
.cost-nerec td { color: #f97316; }
.cost-abat td:last-child { color: #ef4444; font-weight: 700; }
tr.cost-orig td:first-child { font-weight: 800; }
.cost-docs > td { text-align: left; white-space: normal; background: var(--surface2); }
.cost-anulat td { text-decoration: line-through; color: var(--text-muted); }
@media (max-width: 600px) {
  .c360-head { flex-direction: column; gap: 6px; }
  .c360-steps, .c360-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .c360-steps, .c360-kpis { grid-template-columns: 1fr; }
}

/* ── Indicator consum AI sub mesaj ── */
.ai-usage { align-self: flex-start; margin: -6px 0 4px 38px; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); opacity: .8; }

/* ── Dashboard manager ── */
.mgr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 4px; }
.mgr-kpi { min-width: 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.mgr-kpi-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.mgr-kpi-val { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-kpi-sub { font-size: 11px; color: var(--text-muted); }
.mgr-kpi.mgr-neg .mgr-kpi-val  { color: var(--red); }
.mgr-kpi.mgr-warn .mgr-kpi-val { color: var(--yellow); }
.mgr-alerts { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 14px; }
.mgr-alert { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-left-width: 3px; border-radius: 8px; }
.mgr-sev-critic  { border-left-color: var(--red); }
.mgr-sev-atentie { border-left-color: var(--yellow); }
.mgr-sev-info    { border-left-color: var(--accent); }
.mgr-alert-ico  { flex-shrink: 0; }
.mgr-alert-body { flex: 1; min-width: 0; }
.mgr-alert-title  { font-size: 13px; font-weight: 600; color: var(--text); }
.mgr-alert-detail { margin-top: 2px; font-size: 11px; color: var(--text-muted); overflow-wrap: anywhere; }
.mgr-alert-btn { flex-shrink: 0; min-height: 32px; padding: 0 10px; background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--accent); font-family: var(--font-mono); font-size: 12px; cursor: pointer; }
.mgr-alert-btn:hover { border-color: var(--accent); }
.mgr-ok { padding: 12px; text-align: center; font-size: 13px; color: #4caf50; }
.mgr-unavail { padding: 6px 10px; font-size: 12px; color: var(--yellow); }
@media (max-width: 768px) {
  .mgr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 12px 4px; }
  .mgr-alerts { padding: 8px 12px 12px; }
  .mgr-alert-btn { min-height: 36px; }
}

/* ── Interpretare AI ca mesaj în chat (aiInterpretInChat) ── */
.ai-interp-title { font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.ai-interp-body  { font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ── Discuție pe interpretarea AI ── */
.ai-continue-btn { margin-top: 8px; min-height: 32px; padding: 6px 12px; background: none; border: 1px solid var(--accent); border-radius: 6px; color: var(--accent); font-family: var(--font-mono); font-size: 12px; cursor: pointer; }
.ai-continue-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.disc-cmds { display: flex; flex-wrap: wrap; gap: 6px; }
.disc-cmd-btn { margin-top: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disc-note { color: var(--text-muted); font-size: 12px; }
#discPill { display: none; align-items: center; gap: 10px; width: fit-content; max-width: 100%; margin: 0 0 8px; padding: 5px 8px 5px 12px; border: 1px solid var(--accent); border-radius: 999px; background: var(--surface2); font-family: var(--font-mono); font-size: 12px; color: var(--text); }
#discPill.on { display: flex; }
#discPill span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#discPill button { flex-shrink: 0; min-width: 28px; min-height: 28px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
