/* ═══════════════════════════════════════════════════════
   spvcontab.ro — Stiluri principale
   Adaptat din mockup-urile Tabler.io
   ═══════════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #f1f5f9; font-family: 'Calibri', system-ui, sans-serif; font-size: 14px; color: #334155; }
a { color: #2563eb; }

/* ── NAVBAR TOP ── */
.navbar-top {
  background: #1a2942; padding: 0 1.25rem; height: 52px;
  display: flex; align-items: center; gap: 1rem;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.logo-area { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; font-size: 15px; flex-shrink: 0; }
.logo-icon { width: 28px; height: 28px; background: #2f6fcf; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; font-weight: 700; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.luna-chip { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 5px; padding: 3px 10px; color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.top-icon-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; color: rgba(255,255,255,.7); font-size: 15px; position: relative; text-decoration: none; }
.top-icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.notif-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; background: #ef4444; color: #fff; border-radius: 8px; font-size: 10px; font-weight: 700; display: none; align-items: center; justify-content: center; line-height: 1; }
.notif-badge.show { display: flex; }
.theme-dark .notif-badge { background: #f87171; }

/* Firma button */
.firma-btn { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border-radius: 7px; cursor: pointer; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: #fff; position: relative; user-select: none; }
.firma-btn:hover { background: rgba(255,255,255,.13); }
.fb-dot { width: 8px; height: 8px; border-radius: 50%; background: #44cc88; flex-shrink: 0; }
.fb-name { font-size: 13px; font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-chevron { font-size: 10px; color: rgba(255,255,255,.45); margin-left: 2px; transition: transform .15s; }
.firma-btn.open .fb-chevron { transform: rotate(180deg); }

/* User dropdown */
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; width: 260px; box-shadow: 0 8px 28px rgba(0,0,0,.13); z-index: 999; display: none; overflow: hidden; }
.firma-btn.open .user-dropdown { display: block; }
.ud-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #f1f5f9; }
.ud-avatar { width: 36px; height: 36px; border-radius: 50%; background: #2f6fcf; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.ud-name { font-size: 13px; font-weight: 600; color: #0f172a; }
.ud-action { display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; font-size: 13px; color: #334155; }
.ud-action:hover { background: #f8fafc; }
.ud-ico { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.ud-action.deconectare { color: #dc2626; border-top: 1px solid #f1f5f9; }
.ud-action.deconectare:hover { background: #fff5f5; }

/* Notification dropdown */
.notif-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; width: 280px; box-shadow: 0 8px 28px rgba(0,0,0,.13); z-index: 1000; overflow: hidden; font-size: 13px; }
.notif-dropdown-header { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-weight: 600; color: #0f172a; }
.notif-dropdown-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; color: #334155; }
.notif-dropdown-row:not(:last-child) { border-bottom: 1px solid #f8fafc; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; margin-right: 8px; flex-shrink: 0; }
.notif-dot.connected { background: #22c55e; }
.notif-dot.disconnected { background: #ef4444; }
.notif-label { color: #64748b; }
.notif-value { font-weight: 600; color: #0f172a; }
.notif-reconnect { background: #fef2f2; color: #dc2626; justify-content: flex-start; gap: 6px; font-weight: 500; }
.notif-dropdown-footer { padding: 10px 14px; border-top: 1px solid #f1f5f9; text-align: right; }
.notif-dropdown-footer a { color: #2563eb; text-decoration: none; font-weight: 500; font-size: 13px; }
.notif-dropdown-footer a:hover { text-decoration: underline; }

.theme-dark .notif-dropdown { background: #1e293b; border-color: #2d3f55; }
.theme-dark .notif-dropdown-header { color: #e2e8f0; border-bottom-color: #2d3f55; }
.theme-dark .notif-dropdown-row { color: #cbd5e1; }
.theme-dark .notif-dropdown-row:not(:last-child) { border-bottom-color: #263348; }
.theme-dark .notif-label { color: #94a3b8; }
.theme-dark .notif-value { color: #e2e8f0; }
.theme-dark .notif-dropdown-footer { border-top-color: #2d3f55; }
.theme-dark .notif-dropdown-footer a { color: #60a5fa; }
.theme-dark .notif-reconnect { background: #450a0a; color: #fca5a5; }

/* ── NAVBAR SECONDARY ── */
.navbar-sec { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0 1.25rem; height: 44px; display: flex; align-items: stretch; justify-content: center; position: fixed; top: 52px; left: 0; right: 0; z-index: 99; }
.ni { display: flex; align-items: center; gap: 4px; padding: 0 13px; font-size: 13px; font-weight: 500; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; position: relative; }
.ni a { color: inherit; text-decoration: none; }
.ni:hover { color: #1e293b; }
.ni.active { color: #2563eb; }
.ni .caret { font-size: 10px; color: #94a3b8; }
.ni .ndrop { position: absolute; top: calc(100% + 1px); left: 0; min-width: 200px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.1); z-index: 200; padding: 6px 0; display: none; }
.ni:hover .ndrop { display: block; }
.ni .ndrop a { display: block; padding: 7px 16px; font-size: 13px; color: #334155; text-decoration: none; }
.ni .ndrop a:hover { background: #f8fafc; }
.ni .ndrop a.cur { font-weight: 600; color: #2563eb; }

/* Nivel 3 dropdown — fly-out la dreapta */
.ndrop .ni-sub { position: relative; }
.ndrop .ni-sub > span { display: flex; align-items: center; justify-content: space-between; padding: 7px 16px; font-size: 13px; color: #334155; cursor: default; white-space: nowrap; user-select: none; }
.ndrop .ni-sub > span:hover { background: #f8fafc; }
.ndrop .ni-sub .ndrop2 { display: none; position: absolute; left: 100%; top: -6px; min-width: 210px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.1); z-index: 201; padding: 6px 0; }
.ndrop .ni-sub:hover .ndrop2 { display: block; }
.ndrop .ni-sub .ndrop2 a { display: block; padding: 7px 16px; font-size: 13px; color: #334155; text-decoration: none; }
.ndrop .ni-sub .ndrop2 a:hover { background: #f8fafc; }

/* ── LOGIN PAGE ── */
.login-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; min-height: 100vh; }
.login-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; width: 100%; max-width: 420px; padding: 2.5rem; box-shadow: 0 4px 24px rgba(0,0,0,.07); }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 2rem; }
.login-logo-icon { width: 36px; height: 36px; background: #1a2942; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: #fff; }
.login-logo-text { font-size: 20px; font-weight: 700; color: #0f172a; }
.login-logo-sub { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.login-title { font-size: 22px; font-weight: 700; color: #0f172a; margin: 0 0 4px; }
.login-sub { font-size: 13px; color: #64748b; margin: 0 0 1.75rem; }
.form-field { margin-bottom: 1rem; }
.form-label { font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 5px; display: block; }
.form-inp { width: 100%; border: 1px solid #e2e8f0; border-radius: 7px; padding: 9px 12px; font-size: 13px; color: #0f172a; outline: none; background: #f8fafc; box-sizing: border-box; transition: border-color .15s; }
.form-inp:focus { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.pass-wrap { position: relative; }
.pass-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #94a3b8; font-size: 13px; user-select: none; }
.remember-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.remember-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #374151; cursor: pointer; }
.remember-label input { accent-color: #2563eb; }
.forgot-link { font-size: 12px; color: #2563eb; text-decoration: none; }
.btn-login { width: 100%; padding: 11px; font-size: 14px; font-weight: 600; color: #fff; background: #2563eb; border: none; border-radius: 7px; cursor: pointer; transition: background .15s; margin-bottom: 1rem; }
.btn-login:hover { background: #1d4ed8; }
.login-footer { margin-top: 1.75rem; text-align: center; font-size: 12px; color: #94a3b8; }
.login-footer a { color: #2563eb; text-decoration: none; }
.error-banner { background: #fee2e2; border: 1px solid #fecaca; border-radius: 7px; padding: 10px 14px; font-size: 13px; color: #dc2626; margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.info-banner { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 7px; padding: 10px 14px; font-size: 13px; color: #1d4ed8; margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }

/* ── DARK MODE ── */
.theme-dark body { background: #0f172a; color: #cbd5e1; }
.theme-dark .navbar-sec { background: #162032; border-bottom-color: #2d3f55; }
.theme-dark .ni { color: #64748b; }
.theme-dark .ni:hover { color: #e2e8f0; }
.theme-dark .ni.active { color: #60a5fa; }
.theme-dark .ni .ndrop { background: #1e293b; border-color: #2d3f55; }
.theme-dark .ni .ndrop a { color: #cbd5e1; }
.theme-dark .ni .ndrop a:hover { background: #263348; }
.theme-dark .ndrop .ni-sub > span { color: #cbd5e1; }
.theme-dark .ndrop .ni-sub > span:hover { background: #263348; }
.theme-dark .ndrop .ni-sub .ndrop2 { background: #1e293b; border-color: #2d3f55; }
.theme-dark .ndrop .ni-sub .ndrop2 a { color: #cbd5e1; }
.theme-dark .ndrop .ni-sub .ndrop2 a:hover { background: #263348; }
.theme-dark .user-dropdown { background: #1e293b; border-color: #2d3f55; }
.theme-dark .ud-user { border-bottom-color: #2d3f55; }
.theme-dark .ud-name { color: #e2e8f0; }
.theme-dark .ud-action { color: #cbd5e1; }
.theme-dark .ud-action:hover { background: #263348; }
.theme-dark .ud-action.deconectare { color: #fca5a5; border-top-color: #2d3f55; }
.theme-dark .ud-action.deconectare:hover { background: #450a0a; }
.theme-dark .login-card { background: #1e293b; border-color: #2d3f55; }
.theme-dark .login-title { color: #e2e8f0; }
.theme-dark .login-sub { color: #64748b; }
.theme-dark .form-label { color: #94a3b8; }
.theme-dark .form-inp { background: #1a2942; border-color: #2d3f55; color: #e2e8f0; }
.theme-dark .form-inp:focus { background: #162844; border-color: #3b82f6; }
.theme-dark .remember-label { color: #94a3b8; }

/* ── DARK MODE: page-wrap global overrides ── */

/* Clasa card-box — inlocuieste background:#fff;border:1px solid #e2e8f0 din inline styles */
.card-box { background: #fff; border: 1px solid #e2e8f0; }
.theme-dark .card-box { background: #1e293b !important; border-color: #2d3f55 !important; }

/* Headings si text */
.theme-dark .page-wrap h1,
.theme-dark .page-wrap h2 { color: #e2e8f0 !important; }
.theme-dark .page-wrap p  { color: #94a3b8 !important; }

/* Tabele */
.theme-dark table thead tr { background: #162032 !important; }
.theme-dark table thead th { color: #64748b !important; border-bottom-color: #2d3f55 !important; }
.theme-dark table tbody tr { border-bottom-color: #1e3050 !important; background-color: transparent !important; }
.theme-dark table tfoot tr { background: #162032 !important; border-top-color: #2d3f55 !important; }
.theme-dark table tfoot td { color: #94a3b8 !important; border-top-color: #2d3f55 !important; }

/* Inputs, selects, textareas din pagini interioare */
.theme-dark .page-wrap input,
.theme-dark .page-wrap select,
.theme-dark .page-wrap textarea {
  background: #1a2942 !important;
  border-color: #2d3f55 !important;
  color: #e2e8f0 !important;
}

/* Autocomplete dropdown din note/conturi */
.theme-dark .ac-drop { background: #1e293b !important; border-color: #2d3f55 !important; }
.theme-dark .ac-drop > div { color: #cbd5e1 !important; }
.theme-dark .ac-drop > div:hover { background: #263348 !important; }

/* Modal nota noua */
.theme-dark .modal-panel { background: #1e293b !important; border-color: #2d3f55 !important; }

/* Labels din formulare */
.theme-dark .page-wrap label { color: #94a3b8 !important; }

/* Card-header: bare de titlu gri (LINII CONTABILE, toolbar plan conturi etc.) */
.card-header { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.theme-dark .card-header { background: #162032 !important; border-bottom-color: #2d3f55 !important; }

/* Balanta de verificare — dark mode */
.theme-dark .balanta-table thead tr { background: #0d1829 !important; }
.theme-dark .balanta-table tfoot tr { background: #0d1829 !important; }
.theme-dark .balanta-table td,
.theme-dark .balanta-table th { border-color: #2d3f55 !important; }
.theme-dark .balanta-subtotal { background: #162032 !important; border-top-color: #2d3f55 !important; border-bottom-color: #2d3f55 !important; }

/* Plan conturi - denumire cont (inline color override) */
.cont-denumire { color: #0f172a; }
.theme-dark .cont-denumire { color: #e2e8f0 !important; }
.theme-dark .cont-inactiv-text { color: #475569 !important; }

/* Dashboard */
.dash-label { color: #64748b; }
.dash-link { color: #64748b; text-decoration: none; }
.dash-section-title { color: #475569; }
.dash-nota-desc { color: #0f172a; }
.dash-nota-badge { background: #eff6ff; }
.dash-separator { border-top: 1px solid #f1f5f9; }
.dash-action-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  border: 1px solid #e2e8f0; text-decoration: none;
  color: #334155; font-size: 13px; font-weight: 500;
}
.dash-action-btn:hover { background: #f8fafc; }

.theme-dark .dash-label { color: #64748b !important; }
.theme-dark .dash-link { color: #64748b !important; }
.theme-dark .dash-section-title { color: #94a3b8 !important; }
.theme-dark .dash-nota-desc { color: #e2e8f0 !important; }
.theme-dark .dash-nota-badge { background: #1a3356 !important; }
.theme-dark .dash-separator { border-top-color: #2d3f55 !important; }
.theme-dark .dash-action-btn { color: #cbd5e1 !important; border-color: #2d3f55 !important; }
.theme-dark .dash-action-btn:hover { background: #1a2942 !important; }

.luna-chip { cursor: pointer; user-select: none; }
.luna-picker { position: absolute; right: 0; top: calc(100% + 8px); background: #1a2942; border: 1px solid #2d3f55; border-radius: 8px; padding: 8px 10px; align-items: center; gap: 6px; z-index: 2000; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.luna-picker-btn { background: rgba(255,255,255,.1); border: none; color: #e2e8f0; border-radius: 5px; width: 26px; height: 26px; cursor: pointer; font-size: 11px; padding: 0; }
.luna-picker-btn:hover { background: rgba(255,255,255,.2); }
.luna-picker-text { font-size: 13px; font-weight: 600; color: #fff; min-width: 110px; text-align: center; }
.luna-picker-ok { background: #2563eb; border: none; color: #fff; border-radius: 5px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; margin-left: 4px; }
.luna-picker-ok:hover { background: #1d4ed8; }

/* tbody td body text — override dark/medium colors invisible on dark backgrounds */
.theme-dark .page-wrap table tbody td[style*="color:#0f172a"],
.theme-dark .page-wrap table tbody td[style*="color:#1e293b"],
.theme-dark .page-wrap table tbody td[style*="color:#475569"],
.theme-dark .page-wrap table tbody td[style*="color:#374151"],
.theme-dark .page-wrap table tbody td[style*="color:#64748b"] { color: #cbd5e1 !important; }

.bilant-section-title { color: #475569; }
.bilant-rezultat { border: 1px solid #e2e8f0; }
.bilant-rez-label { color: #64748b; }
.theme-dark .bilant-section-title { color: #94a3b8 !important; }
.theme-dark .bilant-rezultat { border-color: #2d3f55 !important; }
.theme-dark .bilant-rez-label { color: #94a3b8 !important; }

/* ── NAVBAR UNIFICAT — meniul integrat in bara de sus (2026-08) ── */
.navbar-top .navbar-sec {
  position: static; flex: 1; min-width: 0;
  background: transparent; border-bottom: none;
  height: 100%; padding: 0; justify-content: center;
}
.theme-dark .navbar-top .navbar-sec { background: transparent; border-bottom: none; }
.navbar-top .ni { color: rgba(255,255,255,.72); border-bottom: 2px solid transparent; }
.navbar-top .ni:hover { color: #fff; }
.navbar-top .ni.active { color: #7cb8ff; border-bottom-color: #7cb8ff; }
.navbar-top .ni .caret { color: rgba(255,255,255,.4); }
.theme-dark .navbar-top .ni { color: rgba(255,255,255,.65); }
.theme-dark .navbar-top .ni:hover { color: #fff; }
.theme-dark .navbar-top .ni.active { color: #7cb8ff; }

/* Sub 1100px meniul coboara pe randul doi al barei */
.nav-spacer { height: 52px; }
@media (max-width: 1100px) {
  .navbar-top { flex-wrap: wrap; height: auto; min-height: 52px; row-gap: 0; }
  .navbar-top .logo-area { height: 52px; }
  .navbar-top .top-right { height: 52px; }
  .navbar-top .navbar-sec {
    order: 3; flex-basis: 100%; height: 44px;
    border-top: 1px solid rgba(255,255,255,.08);
    justify-content: flex-start;
  }
  .nav-spacer { height: 96px; }
}

/* ── Contabilizare: panou PDF in modal (ascuns pe ecrane inguste) ── */
@media (max-width: 991px) {
  .ctb-pdf-pane { display: none; }
}

/* Credit (galben-amber) mai luminos pe tema dark */
.theme-dark td[style*="#a16207"] { color: #fbbf24 !important; }
