/* ============================================================================ Structura aplicatiei: meniu lateral + bara de sus */
:root {
  --sidebar-latime: 250px;
  --sidebar-latime-strans: 68px;
  --topbar-inaltime: 56px;
  --sidebar-fundal: #1e293b;
  --sidebar-fundal-hover: rgba(255, 255, 255, .07);
  --sidebar-fundal-activ: rgba(59, 130, 246, .22);
  --sidebar-text: #cbd5e1;
  --sidebar-text-slab: #94a3b8;
  --sidebar-accent: #60a5fa;
  --continut-fundal: #f4f6f9;
}
html, body { height: 100%; }
body { background: var(--continut-fundal); min-height: 100vh; display: flex; flex-direction: column; }
.app { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-continut { flex: 1 0 auto; padding: 1rem 1.25rem; }
main.pagina-publica { flex: 1 0 auto; }
@media (max-width: 767.98px) { .app-continut { padding: .75rem; } }

/* ---- meniul lateral (desktop: fix; sub 992px devine offcanvas Bootstrap) */
/* !important: peste 992px Bootstrap (.offcanvas-lg) forteaza fundal transparent */
.app-sidebar { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--sidebar-fundal); --bs-offcanvas-color: var(--sidebar-text);
  background: var(--sidebar-fundal) !important; color: var(--sidebar-text) !important; display: flex; flex-direction: column; }
@media (min-width: 992px) {
  .app-sidebar { position: sticky; top: 0; height: 100vh; flex: 0 0 var(--sidebar-latime); width: var(--sidebar-latime); overflow-y: auto; overflow-x: hidden;
    transition: width .18s ease, flex-basis .18s ease; }
  html.sidebar-strans .app-sidebar { flex-basis: var(--sidebar-latime-strans); width: var(--sidebar-latime-strans); }
  html.sidebar-strans .app-sidebar .eticheta { display: none !important; }
  html.sidebar-strans .app-sidebar .nav-link, html.sidebar-strans .app-sidebar .context-btn, html.sidebar-strans .app-sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  html.sidebar-strans .app-sidebar .nav-link i { margin: 0; }
  html.sidebar-strans .app-sidebar .context-icon { margin: 0; }
  html.sidebar-strans .app-sidebar .nav-sectiune { height: 1px; margin: .5rem 1rem; background: rgba(255,255,255,.08); padding: 0; display: block !important; font-size: 0; }
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-inaltime); padding: 0 .9rem; border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.sidebar-brand .brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .3px; font-size: 1.05rem; min-width: 0; }
.brand-icon { display: inline-flex; width: 36px; height: 36px; border-radius: .6rem; background: #fff; color: #fff; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; overflow: hidden; }
.brand-icon img { width: 32px; height: 32px; object-fit: contain; display: block; }
.brand-text img { height: 34px; width: auto; max-width: 150px; display: block; object-fit: contain; }
.sidebar-context { padding: .6rem .6rem .2rem; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: .25rem; }
.context-btn { width: 100%; display: flex; align-items: center; gap: .6rem; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); color: var(--sidebar-text);
  border-radius: .5rem; padding: .4rem .55rem; text-align: left; min-width: 0; }
.context-btn:hover { background: var(--sidebar-fundal-hover); color: #fff; }
.context-btn .eticheta { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.15; }
.context-btn .eticheta small { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: var(--sidebar-text-slab); }
.context-btn .eticheta strong { font-size: .86rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context-btn .bi-chevron-expand { color: var(--sidebar-text-slab); font-size: .9rem; }
.context-icon { display: inline-flex; width: 28px; height: 28px; border-radius: .45rem; background: rgba(255,255,255,.08); align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.culoare { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); }
.sidebar-nav { padding: .5rem .6rem; flex: 1 1 auto; }
.sidebar-jos { padding: .5rem .6rem .8rem; border-top: 1px solid rgba(255,255,255,.08); }
.nav-sectiune { font-size: .68rem; text-transform: uppercase; letter-spacing: .6px; color: var(--sidebar-text-slab); padding: .7rem .6rem .3rem; }
.app-sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: var(--sidebar-text); padding: .5rem .7rem; border-radius: .5rem; font-size: .9rem; white-space: nowrap; margin-bottom: 2px; }
.app-sidebar .nav-link i { font-size: 1.05rem; width: 1.3rem; text-align: center; flex-shrink: 0; }
.app-sidebar .nav-link:hover { background: var(--sidebar-fundal-hover); color: #fff; }
.app-sidebar .nav-link.active { background: var(--sidebar-fundal-activ); color: #fff; box-shadow: inset 3px 0 0 var(--sidebar-accent); }
.app-sidebar .nav-link .versiune { color: var(--sidebar-text-slab); font-size: .78rem; }
.app-sidebar .dropdown-menu { min-width: 240px; font-size: .9rem; }
.app-sidebar .dropdown-item.active { background: #e7f0ff; color: #0b3d91; }

/* ---- bara de sus */
.app-topbar { position: sticky; top: 0; z-index: 1020; height: var(--topbar-inaltime); background: #fff; border-bottom: 1px solid #e3e6ea; display: flex; align-items: center; gap: .5rem; padding: 0 1rem; }
.topbar-titlu { font-weight: 600; color: #334155; font-size: .95rem; min-width: 0; margin-right: auto; }
.topbar-titlu .sep { color: #94a3b8; margin: 0 .4rem; }
.topbar-titlu .panou { color: #0f172a; }
.topbar-cautare { position: relative; width: clamp(180px, 28vw, 380px); }
.topbar-cautare .bi-search { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .85rem; }
.topbar-cautare .form-control { padding-left: 1.9rem; border-radius: 999px; background: #f1f5f9; border-color: transparent; }
.topbar-cautare .form-control:focus { background: #fff; border-color: #86b7fe; }
.topbar-actiuni { display: flex; align-items: center; gap: .35rem; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: .6rem; color: #475569; border: 0; background: transparent; font-size: 1.15rem; padding: 0; }
.btn-icon:hover { background: #f1f5f9; color: #0f172a; }
.badge-notificari { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #dc3545; color: #fff; font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center; }
.btn-utilizator .avatar { width: 32px; height: 32px; font-size: .78rem; background: linear-gradient(135deg, #3b82f6, #6366f1); }
.dropdown-header small { color: #64748b; }
@media (max-width: 575.98px) { .topbar-cautare { display: none; } .topbar-titlu { font-size: .85rem; } }
@media print { .app-sidebar, .app-topbar, .app-footer { display: none !important; } .app-continut { padding: 0; } }

/* ---- subsolul */
.app-footer { flex-shrink: 0; padding: .6rem 1rem; font-size: .78rem; color: #6c757d; border-top: 1px solid #dee2e6; background: #fff; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.app-footer a { color: #0d6efd; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.app-footer .sep { color: #adb5bd; }

/* ============================================================================ Hinturi de utilizare (popover la prima folosire) */
.popover-hint { --bs-popover-max-width: 330px; --bs-popover-border-color: #93c5fd; --bs-popover-header-bg: #eff6ff; --bs-popover-header-color: #1e3a8a;
  --bs-popover-font-size: .86rem; box-shadow: 0 12px 32px rgba(15, 23, 42, .2); z-index: 1080; }
.popover-hint .popover-header { font-weight: 600; }
.popover-hint .hint-text { color: #334155; line-height: 1.45; }
.popover-hint .hint-footer { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .65rem; }
.popover-hint .hint-footer .btn-link { text-decoration: none; padding-left: .25rem; padding-right: .25rem; }
.hint-tinta { position: relative; z-index: 1035; border-radius: .5rem; animation: hint-puls 1.6s ease-in-out infinite; }
@keyframes hint-puls {
  0%, 100% { box-shadow: 0 0 0 3px rgba(59, 130, 246, .6), 0 0 0 8px rgba(59, 130, 246, .15); }
  50% { box-shadow: 0 0 0 3px rgba(59, 130, 246, .9), 0 0 0 12px rgba(59, 130, 246, .06); }
}
/* Ghidul rolurilor (Administrare organizatie) */
.tabel-roluri th { white-space: nowrap; }
.tabel-roluri td, .tabel-roluri th { vertical-align: top; }
.ajutor-inline { color: #64748b; cursor: help; }
.ajutor-inline:hover { color: #0d6efd; }

/* ============================================================================ Componente */
/* Fereastra de editare (clienti / imobile / administrare): <form> intre .modal-content si .modal-body - corpul deruleaza, footerul cu „Salveaza” ramane vizibil */
#modal-editare .modal-content > form, #modal-editare .modal-content > .modal-corp { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#modal-editare .modal-content > form > .modal-body, #modal-editare .modal-content > .modal-corp > .modal-body { overflow-y: auto; }
/* Tabel „eticheta: valoare” (administrare) */
.tabel-date th { width: 190px; font-weight: 500; color: #64748b; white-space: nowrap; }
/* Panou: etapele pe randuri orizontale, cardurile de la stanga la dreapta */
.kanban-rows { display: flex; flex-direction: column; gap: .75rem; }
.kanban-row { display: grid; grid-template-columns: 200px 1fr 44px; background: #fff; border: 1px solid #e3e6ea; border-left: 5px solid var(--culoare, #6c757d); border-radius: .5rem; min-height: 104px; }
.kanban-row-header { padding: .8rem .9rem; display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.kanban-row-header .nume { font-weight: 600; font-size: .95rem; }
.kanban-row-header .contor { background: #343a40; color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 600; min-width: 1.4rem; height: 1.4rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 .4rem; }
.kanban-row-cards { display: flex; flex-wrap: wrap; gap: .6rem; padding: .6rem; align-content: flex-start; min-height: 88px; position: relative; }
.kanban-row-menu { display: flex; align-items: flex-start; justify-content: center; padding-top: .45rem; }
.kanban-gol { display: none; width: 100%; align-self: center; text-align: center; padding: 1.6rem 0; }
.kanban-row.goala .kanban-gol { display: block; }
.kanban-card { width: 300px; max-width: 100%; background: #fff; border: 1px solid #e3e6ea; border-radius: .5rem; padding: .6rem .75rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); cursor: grab; font-size: .86rem; }
.kanban-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); border-color: #cfd4da; }
.kanban-card .numar { font-weight: 700; color: #0d6efd; text-decoration: none; }
.kanban-card .client { font-weight: 600; margin-top: .15rem; }
.kanban-card .meta { color: #6c757d; font-size: .78rem; }
.kanban-card.intarziat { border-color: #dc3545; }
.sortable-ghost { opacity: .4; }
@media (max-width: 767px) {
  .kanban-row { grid-template-columns: 1fr; }
  .kanban-row-menu { display: none; }
  .kanban-card { width: 100%; }
}
.avatar { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: #0d6efd; color: #fff; font-size: .7rem; align-items: center; justify-content: center; font-weight: 600; }
.conf-high { background: #d1e7dd; }
.conf-mid { background: #fff3cd; }
.conf-low { background: #f8d7da; }
.preview-doc { max-width: 100%; max-height: 75vh; border: 1px solid #dee2e6; border-radius: .4rem; }
.activitate .item { border-left: 2px solid #dee2e6; padding: .25rem 0 .25rem .75rem; margin-left: .5rem; }
.tab-content { background: #fff; border: 1px solid #dee2e6; border-top: 0; padding: 1rem; border-radius: 0 0 .5rem .5rem; }
.nav-tabs .nav-link { color: #495057; }
.card { border-color: #e3e6ea; }
h4, h5 { color: #0f172a; }
