/* Accounting Automation OS — BlackSquare Demo (tema albă, accente roșii) */

:root {
  --bg: #ffffff;
  --bg-subtle: rgba(0, 0, 0, 0.03);
  --bg-muted: rgba(0, 0, 0, 0.045);
  --surface: #ffffff;
  --line: rgba(0, 0, 0, 0.10);
  --line-strong: rgba(0, 0, 0, 0.16);
  --text: rgba(0, 0, 0, 0.92);
  --muted: rgba(0, 0, 0, 0.58);
  --text-dim: rgba(0, 0, 0, 0.46);
  --accent: #e11d48;
  --accent-soft: rgba(225, 29, 72, 0.12);
  --accent-hover: #be123c;
  --sidebar-bg: #f8f9fb;
  --sidebar-text: rgba(0, 0, 0, 0.78);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --err: #e11d48;
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.1);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 60px rgba(15, 23, 42, 0.10);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 268px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Start screen — fundal alb */
.start-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}
.start-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--surface);
}
.start-brand { display: flex; align-items: center; gap: 0.75rem; }
.start-brand strong { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.start-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.75rem;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.start-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.badge-demo {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.3rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-subtle); color: var(--muted);
}
.badge-demo:first-child {
  border-color: rgba(225, 29, 72, 0.25);
  background: var(--accent-soft);
  color: var(--accent);
}
.start-hero {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-muted) 100%);
}
.start-card {
  width: min(720px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-md);
}
.start-card h1 {
  margin: 0 0 0.5rem; font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800; letter-spacing: -0.03em;
}
.start-card .sub {
  margin: 0 0 1.25rem; color: var(--muted); font-size: 1rem; line-height: 1.6;
}
.start-actions { display: flex; flex-direction: column; gap: 0.65rem; }
.start-disclaimer {
  margin: 0 clamp(1rem, 4vw, 2.5rem) 1.5rem;
  padding: 1rem 1.15rem; border-radius: var(--radius-sm);
  background: var(--bg-subtle); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  font-size: 0.875rem; color: var(--muted); line-height: 1.6;
}
.start-top .sidebar-sub { color: var(--muted); font-size: 0.8125rem; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; background: var(--bg-muted); }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-head { padding: 1.25rem 1rem 1rem; border-bottom: 1px solid var(--line); }
.sidebar-brand { font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em; color: var(--text); }
.sidebar-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.sidebar-nav { padding: 0.75rem 0.5rem; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 0.55rem;
  width: 100%; padding: 0.65rem 0.75rem; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--sidebar-text); cursor: pointer;
  text-align: left; font-size: 0.875rem; transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text); }
.nav-item.is-active {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; border: 1px solid rgba(225, 29, 72, 0.15);
}
.nav-ico { width: 1.25rem; text-align: center; opacity: 0.85; }
.sidebar-foot { padding: 1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 0.9rem 1.25rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.topbar select {
  padding: 0.45rem 0.65rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff;
}
.topbar-alert { color: var(--accent); font-weight: 700; }

/* Notificări */
.notif-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.notif-btn:hover { border-color: rgba(225, 29, 72, 0.35); box-shadow: 0 0 0 3px var(--accent-soft); }
.notif-ico { font-size: 1rem; line-height: 1; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 0.625rem; font-weight: 800; display: grid; place-items: center;
  border: 2px solid #fff;
}
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list.compact .notif-item { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.notif-item {
  padding: 0.85rem 0; border-bottom: 1px solid var(--line);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread {
  background: var(--accent-soft); margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem;
  border-radius: var(--radius-sm); border-left: 3px solid var(--accent);
}
.notif-item-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.35rem; }
.notif-time { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.notif-item-msg { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.5rem; }
.panel-highlight { border-color: rgba(225, 29, 72, 0.2); box-shadow: 0 0 0 1px var(--accent-soft); }
.invoice-amount { color: var(--accent); font-weight: 700; }
.invoice-total-row td { background: var(--bg-subtle); border-top: 2px solid var(--line-strong); }

.content { padding: 1.25rem; flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.55rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 0.8125rem; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { box-shadow: 0 8px 20px var(--accent-soft); background: var(--accent-hover); }
.btn-secondary { background: var(--text); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn-danger { background: #fff; color: var(--err); border-color: rgba(225, 29, 72, 0.3); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }
.btn-start {
  width: 100%; padding: 0.9rem 1.25rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 700; font-size: 0.9375rem; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-start:hover { transform: translateY(-1px); }
.btn-start-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px var(--accent-soft); }
.btn-start-primary:hover { background: var(--accent-hover); }
.btn-start-secondary {
  background: var(--surface); color: var(--text);
  border-color: var(--line-strong);
}
.btn-start-guided {
  background: var(--bg-subtle); color: var(--text);
  border: 1px dashed var(--line-strong);
}

/* Cards & KPI */
.kpi-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.25rem;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.kpi-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 0.25rem; }
.kpi-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem 1.25rem;
  margin-bottom: 1rem; box-shadow: var(--shadow);
}
.panel-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1rem;
}
.panel-title { margin: 0; font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.data-table th, .data-table td {
  padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table th {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 700; background: var(--bg-subtle);
}
.data-table tr:hover td { background: var(--accent-soft); }
.data-table .actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* Status badges */
.status {
  display: inline-flex; align-items: center; padding: 0.2rem 0.5rem;
  border-radius: 999px; font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid transparent;
}
.status-noua { background: var(--blue-soft); color: var(--blue); }
.status-alocata { background: #f3e8ff; color: #7c3aed; }
.status-lucru { background: var(--warn-soft); color: var(--warn); }
.status-asteapta { background: #fef3c7; color: #b45309; }
.status-finalizata { background: var(--ok-soft); color: var(--ok); }
.status-anulata { background: var(--accent-soft); color: var(--accent); }
.status-disponibil { background: var(--ok-soft); color: var(--ok); }
.status-lucru-doc { background: var(--warn-soft); color: var(--warn); }
.status-validare { background: var(--blue-soft); color: var(--blue); }
.prio-normal { color: var(--muted); }
.prio-urgent { color: var(--warn); font-weight: 700; }
.prio-blocant { color: var(--accent); font-weight: 700; }

/* Forms */
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-grid.two { grid-template-columns: 1fr; } }
.field { display: block; margin-bottom: 0.85rem; }
.field label, .field-label {
  display: block; font-size: 0.75rem; font-weight: 700;
  color: var(--muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.field textarea { min-height: 80px; resize: vertical; }
.service-preview {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid rgba(225, 29, 72, 0.15);
  margin-bottom: 1rem; font-size: 0.875rem;
}
.service-preview strong { color: var(--accent); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding-left: 1.5rem; padding-bottom: 0.85rem;
  font-size: 0.8125rem; color: var(--muted);
}
.timeline li::before {
  content: ""; position: absolute; left: 0.35rem; top: 0.35rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: 0.68rem; top: 1rem; bottom: 0;
  width: 2px; background: var(--line);
}

/* Folder tree */
.folder-tree { font-size: 0.8125rem; }
.folder-group { margin-bottom: 0.75rem; }
.folder-name {
  font-weight: 700; padding: 0.45rem 0.6rem; background: var(--bg-subtle);
  border-radius: var(--radius-sm); margin-bottom: 0.35rem;
  border-left: 3px solid var(--accent);
}
.doc-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.5rem 0.45rem 1rem; border-bottom: 1px solid var(--line);
}
.doc-row:last-child { border-bottom: none; }

/* Charts */
.chart-bars { display: flex; align-items: flex-end; gap: 0.5rem; height: 140px; padding-top: 0.5rem; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%; max-width: 48px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-hover)); min-height: 4px;
}
.chart-label { font-size: 0.625rem; color: var(--muted); text-align: center; }

/* Toast */
.toast-root {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 1000;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: 360px;
}
.toast {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  background: var(--text); color: #fff; font-size: 0.875rem;
  box-shadow: var(--shadow-md); border-left: 3px solid var(--accent);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-root { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 1rem; }
.modal-root[hidden] { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.modal-box {
  position: relative; width: min(520px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow-md); border: 1px solid var(--line);
}
.modal-title { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 800; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* Guided demo */
.guided-root { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }
.guided-root.is-hidden, .guided-root[hidden] { display: none !important; }
.guided-root:not(.is-hidden):not([hidden]) { pointer-events: auto; display: block; }
.guided-spotlight {
  position: absolute; border: 2px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  transition: all 0.3s ease; pointer-events: none;
}
.guided-panel {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100% - 2rem)); background: #fff;
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow-md); border: 1px solid var(--line);
  pointer-events: auto;
}
.guided-step { font-size: 0.75rem; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.guided-text { margin: 0.5rem 0 1rem; font-size: 0.9375rem; line-height: 1.55; }
.guided-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Integrations */
.int-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.int-card {
  padding: 0.85rem; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--bg-subtle); font-size: 0.8125rem;
}
.int-card strong { display: block; margin-bottom: 0.25rem; }

/* Banners */
.micro-banner {
  padding: 0.65rem 0.85rem; border-radius: var(--radius-sm);
  background: var(--bg-subtle); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  font-size: 0.8125rem; color: var(--muted); margin-bottom: 1rem;
}
.warn-banner { border-left-color: var(--warn); background: var(--warn-soft); }

.filter-row {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
}
.filter-field { margin: 0; min-width: 10rem; }
.field-span { grid-column: 1 / -1; }
.collab-block {
  margin-bottom: 1.25rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.collab-block:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.collab-title { font-size: 0.9375rem; margin: 0 0 0.75rem; font-weight: 600; }
.badge-count {
  display: inline-block; font-size: 0.75rem; font-weight: 500;
  padding: 0.125rem 0.5rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.collab-empty { padding: 0.5rem 0; text-align: left; border: 0; background: transparent; }
.data-table-compact td, .data-table-compact th { padding: 0.5rem 0.75rem; }

.price-cell { color: var(--accent); white-space: nowrap; }
.doc-catalog-table td { vertical-align: middle; }

/* Empty */
.empty {
  padding: 2rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg-subtle);
}

/* Responsive */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: relative;
    flex-direction: row; flex-wrap: wrap; align-items: center;
  }
  .sidebar-nav { display: flex; flex-wrap: wrap; padding: 0.5rem; flex: 1; }
  .nav-item { width: auto; }
  .sidebar-foot { width: 100%; flex-direction: row; flex-wrap: wrap; }
}

@media print {
  .sidebar, .topbar, .btn, .guided-root { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
}
