/* MurphFin — components.css */

/* ═══════ 6. CARDS (unified) ═══════ */

.card-fisit {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
  min-width: 0;
}
.card-fisit:hover { box-shadow: none; }
.card-fisit .card-header {
  background: transparent;
  border-bottom: 1px solid var(--brand-border-light);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 16px 20px;
}
.card-fisit .card-body { padding: 20px; }

/* Empty state card */
.card-fisit.p-5.text-center {
  padding: 3.5rem !important;
  border: 1.5px dashed var(--brand-border);
  background: var(--brand-bg);
  box-shadow: none;
}
.card-fisit.p-5.text-center h4,
.card-fisit.p-5.text-center h5 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.card-fisit.p-5.text-center i.fa-3x { font-size: 2rem !important; opacity: 0.35; }

/* KPI cards inside card-fisit */
.card-fisit.p-3.text-center .fs-2 {
  font-size: 1.75rem !important;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.card-fisit.p-3.text-center .small,
.card-fisit.p-3.text-center .text-muted.small {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
  margin-bottom: 4px;
}

/* Legacy compat: adm-card, crm-card map to card-fisit */
.adm-card, .crm-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border-light);
  border-radius: var(--radius);
  box-shadow: none;
  margin-bottom: 1rem;
}
.crm-card { padding: 18px; }
.adm-card-header { /* DEPRECATED — kept for CRM compat */
  padding: 16px 20px;
  border-bottom: 1px solid var(--brand-gray-100);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--brand-text);
}
.adm-card-header .title { display: flex; align-items: center; gap: 6px; }
.adm-card-body { padding: 20px; }


/* ═══════ 7. BUTTONS ═══════ */

.btn-fisit {
  background: var(--brand-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.15s;
}
.btn-fisit:hover {
  background: #152548;
  color: #fff;
}
/* Area autenticata: bottoni più leggeri */
.app-auth .btn-fisit {
  background: var(--brand-navy);
  padding: 7px 16px;
  font-weight: 500;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.app-auth .btn-fisit:hover {
  transform: none;
  box-shadow: none;
}
.btn-fisit-outline {
  border: 1.5px solid var(--brand-navy);
  color: var(--brand-navy);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  background: transparent;
  transition: all 0.15s;
}
.btn-fisit-outline:hover {
  background: var(--brand-navy);
  color: #fff;
}
.btn-check:checked + .btn-fisit-outline,
.btn-check:active + .btn-fisit-outline {
  background: var(--brand-navy);
  color: #fff;
  border-color: var(--brand-navy);
}
.btn-check:focus + .btn-fisit-outline {
  box-shadow: 0 0 0 2px rgba(26,47,94,0.2);
}
.app-auth .btn-fisit-outline {
  border-width: 1px;
  padding: 6px 14px;
  font-weight: 500;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.app-auth .btn-fisit-outline:hover {
  transform: none;
  box-shadow: none;
}

.btn-adm-primary {
  background: var(--brand-blue); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-weight: 600; font-size: 0.88rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.btn-adm-primary:hover { background: #2563eb; color: #fff; }

.btn-adm-success {
  background: var(--brand-success); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-weight: 600; font-size: 0.88rem; cursor: pointer;
  transition: all 0.15s;
}
.btn-adm-success:hover { background: #15803d; color: #fff; }
.btn-icon-sm { padding: 3px 8px; font-size: 0.75rem; line-height: 1.2; border-radius: var(--radius-sm); }

.btn-adm-danger {
  background: var(--brand-danger); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-weight: 600; font-size: 0.88rem; cursor: pointer;
  transition: all 0.15s;
}
.btn-adm-danger:hover { background: #dc2626; color: #fff; }

.btn-adm-accent { background: var(--brand-blue); color: #fff; border: none; border-radius: var(--radius-sm); padding: 10px 20px; font-weight: 600; font-size: 0.88rem; cursor: pointer; }

.btn-adm-ghost {
  background: transparent; border: 1px solid var(--brand-gray-200);
  color: var(--brand-gray-500); padding: 6px 12px; cursor: pointer;
  border-radius: var(--radius-sm); font-size: 0.85rem; transition: all 0.15s;
}
.btn-adm-ghost:hover { background: var(--brand-gray-50); border-color: var(--brand-gray-300); color: var(--brand-text); }


/* ── Table action buttons (uniform icon buttons) ── */
.tbl-actions { white-space: nowrap; width: 1%; }
.tbl-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 1px solid var(--brand-gray-200);
  border-radius: var(--radius-sm); background: transparent; color: var(--brand-gray-500);
  font-size: 0.75rem; cursor: pointer; transition: all 0.15s;
  vertical-align: middle;
}
.tbl-act:hover { background: var(--brand-gray-100); border-color: var(--brand-gray-300); color: var(--brand-text); }
.tbl-act--success { color: var(--brand-success); border-color: var(--brand-success); }
.tbl-act--success:hover { background: var(--brand-success); color: #fff; }
.tbl-act--danger { color: var(--brand-danger); border-color: transparent; }
.tbl-act--danger:hover { background: var(--brand-danger-bg); color: var(--brand-danger); border-color: var(--brand-danger); }

/* ── Document checklist ── */
.doc-checklist-item { border-bottom: 1px solid var(--brand-border); }
.doc-checklist-item:last-child { border-bottom: none; }
.doc-badge-obbl { font-size: 0.6rem; }
.doc-modulo-link { color: var(--brand-danger); text-decoration: none; font-weight: 500; transition: color 0.15s; }
.doc-modulo-link:hover { color: var(--brand-danger); text-decoration: underline; }

/* ═══════ 8. TABLES (Notion-style) ═══════ */

.table { font-size: 0.88rem; width: 100%; table-layout: auto; }
.table.table-fixed { table-layout: fixed; }
.table-responsive { overflow-x: auto; min-width: 0; }
.table thead th {
  white-space: nowrap;
  background: transparent;
  border-bottom: 1.5px solid var(--brand-gray-200);
  color: var(--brand-muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px;
}
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--brand-gray-100);
  color: var(--brand-text);
}
.table tbody td.text-truncate { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tbody tr:hover { background: var(--brand-gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* Legacy adm-table */
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.adm-table th { background: transparent; padding: 8px 14px; font-weight: 600; border-bottom: 1.5px solid var(--brand-gray-200); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand-muted); }
.adm-table td { padding: 12px 14px; border-bottom: 1px solid var(--brand-gray-100); vertical-align: middle; }
.adm-table tbody tr:hover { background: var(--brand-gray-50); }


/* ═══════ 9. FORMS (Notion-style) ═══════ */

.form-control, .form-select {
  border: 1.5px solid var(--brand-gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--brand-text);
  transition: border-color 0.15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: none;
}
.form-control::placeholder { color: var(--brand-gray-300); }
.form-control-sm, .form-select-sm,
.input-group-sm > .form-control,
.input-group-sm > .input-group-text {
  padding: 5px 10px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-gray-500);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
textarea.form-control { min-height: 100px; line-height: 1.65; }

/* Legacy */
.adm-form-label { font-weight: 600; font-size: 0.82rem; color: var(--brand-gray-500); margin-bottom: 6px; }
.adm-form-control { border: 1.5px solid var(--brand-gray-200); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.9rem; width: 100%; }
.adm-form-control:focus { border-color: var(--brand-blue); box-shadow: none; outline: none; }
.adm-inline-form { display: flex; gap: 8px; align-items: end; }


/* ═══════ 10. KPI ═══════ */

.crm-kpi-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; }
.crm-kpi-row--3 .crm-kpi { flex: 1 1 30%; min-width: 180px; }
.crm-kpi {
  background: var(--brand-surface);
  border: none;
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: none;
}
.crm-kpi:hover { box-shadow: none; }
.crm-kpi__label { font-size: 0.75rem; color: var(--brand-muted); margin-bottom: 2px; }
.crm-kpi__value { font-size: 1.3rem; font-weight: 700; color: var(--brand-text); }
.crm-kpi__sub { font-size: 0.7rem; color: var(--brand-muted); margin-top: 2px; }


/* ═══════ 11. ALERTS & INFO BOX (Notion callout) ═══════ */

.alert {
  border: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  padding: 14px 20px;
}
.alert-warning { background: var(--brand-warning-bg); color: var(--brand-warning); border-left: 3px solid var(--brand-warning); }
.alert-success { background: var(--brand-success-bg); color: var(--brand-success-dark); border-left: 3px solid var(--brand-success); }
.alert-danger  { background: var(--brand-danger-bg); color: var(--brand-danger-dark); border-left: 3px solid var(--brand-danger); }
.alert-info    { background: var(--brand-info-bg); color: var(--brand-blue); border-left: 3px solid var(--brand-blue); }

.bp-info-box {
  background: var(--brand-surface-alt);
  border: 1px solid var(--brand-border);
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 13px;
  font-family: var(--font-mono, inherit);
  line-height: 1.65;
  color: var(--brand-text);
}
.bp-info-box strong { color: var(--brand-text); }
.bp-info-box .text-muted { color: var(--brand-muted); }

/* Info box collassabile (G1) */
[data-step-infobox] {
  position: relative;
}
.bp-infobox-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--brand-muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  z-index: 2;
}
.bp-infobox-toggle:hover {
  background: rgba(0,0,0,0.06);
  color: var(--brand-text);
}
.bp-infobox-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  max-height: 600px;
  opacity: 1;
}
.bp-infobox-body.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.bp-infobox-reopen {
  display: inline;
  font-size: 0.78rem;
  color: var(--brand-muted);
  text-decoration: none;
  margin-left: 12px;
  opacity: 0.8;
}
.bp-infobox-reopen:hover { color: var(--brand-text); opacity: 1; }

/* ═══════ 12. BADGES (soft Notion-style) ═══════ */

.badge {
  font-weight: 600;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
}
.badge.bg-primary   { background: var(--brand-info-bg); color: var(--brand-blue); }
.badge.bg-success   { background: var(--brand-success-bg); color: var(--brand-success-dark); }
.badge.bg-warning   { background: var(--brand-warning-bg); color: var(--brand-warning); }
.badge.bg-danger    { background: var(--brand-danger-bg); color: var(--brand-danger-dark); }
.badge.bg-secondary { background: var(--brand-surface-alt); color: var(--brand-muted); }
.badge.bg-info      { background: var(--brand-info-bg); color: var(--brand-blue); }
.badge.adm-closed   { background: var(--brand-surface-alt); color: var(--brand-muted); }
.badge-sm { padding: 2px 6px; font-size: .75rem; }
