:root {
  --black: #050505;
  --black-soft: #121212;
  --white: #ffffff;
  --bg: #f6f6f4;
  --line: #e5e5e2;
  --muted: #6d6d6a;
  --danger: #a11220;
  --success: #146c43;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--black);
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

img {
  max-width: 100%;
  display: block;
}

/* =============================
   AUTH / LOGIN
============================ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--white);
}

.auth-brand {
  background: linear-gradient(180deg, #000 0%, #121212 100%);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.brand-badge {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.auth-hero {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.auth-hero h2 {
  font-size: 2.4rem;
  line-height: 1.08;
  margin-bottom: 16px;
  font-weight: 800;
}

.auth-hero p {
  color: rgba(255, 255, 255, .72);
  font-size: 1.05rem;
}

.auth-foot {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .55);
  font-size: .92rem;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 28px;
}

.auth-card {
  width: min(480px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--muted);
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.form-group label {
  display: block;
  font-size: .95rem;
  font-weight: 650;
  margin-bottom: 8px;
}

.input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8d8d5;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input:focus {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .07);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: .18s ease;
}

.btn-black {
  background: #000;
  color: #fff;
}

.btn-black:hover {
  background: #1d1d1d;
  transform: translateY(-1px);
}

.btn-white {
  background: #fff;
  border-color: #d9d9d6;
  color: #000;
}

.btn-white:hover {
  border-color: #000;
}

.auth-switch {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
}

.auth-switch a {
  font-weight: 700;
  text-decoration: underline;
}

.alert {
  padding: 13px 15px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-error {
  background: #fff4f4;
  border-color: #f1c6c9;
  color: var(--danger);
}

.alert-success {
  background: #f1faf4;
  border-color: #cdeeda;
  color: var(--success);
}

/* =============================
   APP LAYOUT
============================ */

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--black);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 24px;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fff;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, .78);
  font-weight: 700;
  transition: .18s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.sidebar-link.active {
  background: #fff;
  color: #000;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-logout {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  text-align: center;
  font-weight: 700;
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, .08);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
}

.topbar-title {
  font-size: 1.4rem;
  font-weight: 800;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-user-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.topbar-user-meta small {
  color: var(--muted);
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content {
  padding: 28px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.section-head p,
.meta {
  color: var(--muted);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 26px;
}

.metric-card,
.panel-card,
.card,
.empty-state {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 24px;
}

.metric-label {
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.panel-card {
  padding: 26px;
  display: block;
  transition: .18s ease;
}

.panel-card:hover {
  transform: translateY(-2px);
  border-color: #000;
}

.panel-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-state {
  border-style: dashed;
  border-color: #cfceca;
  padding: 56px 30px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  color: var(--black);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  padding: 22px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1f1ef;
  color: #000;
  font-size: 12px;
  font-weight: 800;
}

.badge-dark {
  background: #000;
  color: #fff;
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
}

.card .meta div {
  margin-bottom: 4px;
}

@media (max-width: 980px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 220px;
    padding: 34px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .metrics-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================
   SCO KEY CARDS
============================ */

.sco-key-card {
  position: relative;
  background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #fff;
  border-radius: 20px;
  padding: 24px;
  min-height: 200px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  transition: all .3s ease;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid transparent;
}

.sco-key-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

.sco-key-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.sco-key-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}

.sco-key-ref {
  font-size: .75rem;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.sco-key-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 8px 0;
  line-height: 1.3;
}

.sco-key-entity {
  font-size: .85rem;
  opacity: .8;
  margin-bottom: 16px;
}

.sco-key-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sco-spec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sco-spec-label {
  font-size: .7rem;
  opacity: .5;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.sco-spec-value {
  font-size: .9rem;
  font-weight: 700;
}

.sco-key-status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.sco-key-status.disponible {
  background: rgba(20, 108, 67, 0.2);
  color: #4ade80;
}

.sco-key-status.asignada {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.sco-key-status.cerrada {
  background: rgba(161, 18, 32, 0.2);
  color: #f87171;
}

.sco-detail-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.sco-detail-section h3 {
  font-size: 1.2rem;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-label {
  font-size: .8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}

.detail-value {
  font-size: 1rem;
  font-weight: 600;
}

.form-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.form-section h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--black);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.file-upload {
  border: 2px dashed #d8d8d5;
  border-radius: 14px;
  padding: 30px;
  text-align: center;
  transition: .18s ease;
  cursor: pointer;
}

.file-upload:hover {
  border-color: #000;
  background: #f9f9f7;
}

.file-upload input[type="file"] {
  display: none;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.file-upload-icon {
  font-size: 2.5rem;
  opacity: .4;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.sco-key-status.archivada {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.sco-key-card.archivada {
  opacity: 0.6;
}

/* =============================
   TIMELINE
============================ */

.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -33px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #d1d5db;
  background: #fff;
}

.timeline-item.completado .timeline-dot {
  border-color: #16a34a;
  background: #16a34a;
}

.timeline-item.pendiente .timeline-dot {
  border-color: #d1d5db;
  background: #fff;
}

.timeline-item.en_proceso .timeline-dot {
  border-color: #f59e0b;
  background: #f59e0b;
}

.timeline-content {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timeline-title {
  font-weight: 700;
  font-size: 1rem;
}

.timeline-status {
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.timeline-status.completado {
  background: #dcfce7;
  color: #16a34a;
}

.timeline-status.pendiente {
  background: #f3f4f6;
  color: #6b7280;
}

.timeline-status.en_proceso {
  background: #fef3c7;
  color: #d97706;
}

.timeline-description {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 12px;
}

.timeline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm {
  min-height: 36px;
  padding: 8px 14px;
  font-size: .85rem;
  border-radius: 10px;
}

/* =============================
   ASIGNACIÓN DE SCOS
============================ */

.sco-slot {
  position: relative;
  border: 2px dashed #d1d5db;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  transition: .2s ease;
}

.sco-slot:hover {
  border-color: #000;
  color: #000;
}

.sco-slot-occupied {
  position: relative;
}

.sco-slot-occupied .sco-key-card {
  cursor: default;
}

.sco-slot-occupied::after {
  content: "✓ Insertada";
  position: absolute;
  top: -10px;
  right: 16px;
  background: #16a34a;
  color: #fff;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: .75rem;
  font-weight: 700;
}

.sco-available-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.sco-select-card {
  background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #fff;
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: .2s ease;
  border: 2px solid transparent;
}

.sco-select-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.sco-select-card.selected {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.sco-select-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.sco-select-ref {
  font-size: .8rem;
  opacity: .6;
}

/* =============================
   DOCUMENTOS
============================ */

.doc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 10px;
}

.doc-icon {
  font-size: 1.5rem;
}

.doc-info {
  flex: 1;
}

.doc-name {
  font-weight: 600;
}

.doc-meta {
  font-size: .8rem;
  color: var(--muted);
}

.doc-actions {
  display: flex;
  gap: 8px;
}

/* =============================
   PROYECTO DETAIL
============================ */

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.project-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
}

.project-tab {
  padding: 12px 20px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: .15s ease;
  cursor: pointer;
}

.project-tab:hover {
  color: var(--black);
}

.project-tab.active {
  color: var(--black);
  border-bottom-color: var(--black);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* =============================
   AVATAR / PERFIL
============================ */

.avatar-clickable {
  cursor: pointer;
  transition: .18s ease;
  position: relative;
}

.avatar-clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .1);
}

.avatar-clickable::after {
  content: "📷";
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  font-size: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  opacity: 0;
  transition: .18s ease;
}

.avatar-clickable:hover::after {
  opacity: 1;
}

/* Modal genérico */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  width: min(420px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s ease;
}

.modal-close:hover {
  background: #e5e7eb;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 24px;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  overflow: hidden;
  border: 4px solid #f3f4f6;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: .18s ease;
  margin-bottom: 20px;
}

.avatar-upload-area:hover {
  border-color: #000;
  background: #f9f9f7;
}

.avatar-upload-area input[type="file"] {
  display: none;
}

.avatar-actions {
  display: flex;
  gap: 12px;
}

.avatar-actions .btn {
  flex: 1;
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: none;
}

.btn-danger:hover {
  background: #fecaca;
}

/* Menú dropdown del usuario */
.user-dropdown {
  position: relative;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .12);
  min-width: 220px;
  z-index: 100;
  overflow: hidden;
}

.user-dropdown-menu.active {
  display: block;
  animation: modalIn .15s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-size: .9rem;
  font-weight: 600;
  transition: .12s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: #f6f6f4;
}

.dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.dropdown-item.danger {
  color: #dc2626;
}

/* Logo único centrado en la barra lateral */
.brand {
  justify-content: center;
}

.brand img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: transparent;
}

/* Login: logo grande y centrado */
.auth-logo {
  width: 190px;
  height: 190px;
  object-fit: contain;
}

.brand-center {
  justify-content: center;
}

/* =============================
   CALCULADORA
============================ */

.price-banner {
  background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #fff;
  border-radius: 24px;
  padding: 26px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .2);
}

.price-main {
  font-size: 2.2rem;
  font-weight: 800;
}

.price-sub {
  color: rgba(255, 255, 255, .65);
  font-size: .9rem;
}

.price-refresh {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: .15s ease;
  white-space: nowrap;
}

.price-refresh:hover {
  background: rgba(255, 255, 255, .22);
}

.price-refresh:disabled {
  opacity: .5;
  cursor: wait;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 22px;
  margin-bottom: 24px;
}

.calc-result-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.calc-result-label {
  color: var(--muted);
}

.calc-result-value {
  font-weight: 800;
}

.calc-highlight {
  background: #0a0a0a;
  color: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.split-head,
.split-row {
  display: grid;
  grid-template-columns: 1fr 150px 190px 44px;
  gap: 10px;
  align-items: center;
}

.split-head {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.split-row {
  margin-bottom: 10px;
}

.split-importe {
  font-weight: 800;
  text-align: right;
  padding-right: 6px;
}

.split-del {
  border: none;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 10px;
  height: 40px;
  cursor: pointer;
  font-weight: 700;
}

.split-del:hover {
  background: #fecaca;
}

.split-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
  font-weight: 700;
  flex-wrap: wrap;
}

.split-warn {
  color: #dc2626;
}

.split-ok {
  color: #16a34a;
}

@media (max-width: 900px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }

  .split-head,
  .split-row {
    grid-template-columns: 1fr 90px 120px 40px;
  }

  .price-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Doble moneda en calculadora */
.price-duo {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}

.imp-eur,
.res-eur {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.split-importe {
  text-align: right;
}

/* =============================
   DASHBOARD MEJORADO
============================ */

:root {
  --gold: #c9a227;
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.chart-source {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 4px;
}

.chart-stats {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chart-stat-label {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.chart-stat-value {
  font-weight: 800;
  font-size: 1rem;
}

.up { color: #16a34a; }
.down { color: #dc2626; }

.chart-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.range-btn,
.cur-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  transition: .15s ease;
}

.range-btn.active,
.cur-btn.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.chart-wrap {
  position: relative;
  height: 300px;
}

.chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0a0a0a;
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .8rem;
  display: none;
  z-index: 5;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

.cambio-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .9rem;
}

.cambio-badge.up {
  background: rgba(22, 163, 74, .15);
}

.cambio-badge.down {
  background: rgba(220, 38, 38, .12);
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f9fafb;
  align-items: center;
  margin-bottom: 10px;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-meta {
  font-size: .78rem;
  color: var(--muted);
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 10px;
  transition: .15s ease;
}

.list-item:hover {
  background: #f3f4f6;
}

/* Chips de filtro instantáneo */
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  transition: .15s ease;
}

.chip:hover {
  border-color: #000;
}

.chip.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.chip .chip-count {
  opacity: .6;
  margin-left: 4px;
}

/* Símbolos de la barra lateral en dorado */
.sidebar-link > span:first-child {
  color: var(--gold);
  font-size: 1.1rem;
  line-height: 1;
}

/* Estados de proyecto con color */
.estado-abierto { background: #dcfce7; color: #16a34a; }
.estado-en_negociacion { background: #fef3c7; color: #d97706; }
.estado-en_ejecucion { background: #dbeafe; color: #2563eb; }
.estado-cerrado { background: #e5e7eb; color: #4b5563; }
.estado-cancelado { background: #fee2e2; color: #dc2626; }

/* Botón eliminar rojo sólido */
.btn-danger-solid {
  background: #dc2626;
  color: #fff;
  border: none;
}

.btn-danger-solid:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* Botones de edición de pasos del timeline */
.paso-edit {
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: .85rem;
  transition: .15s ease;
}

.paso-edit:hover {
  background: #e5e7eb;
}

/* Reordenar timeline arrastrando desde el circulito */
.timeline-dot {
  cursor: grab;
}

.timeline-dot::before {
  content: "";
  position: absolute;
  inset: -8px;
}

.timeline-dot:hover {
  transform: scale(1.3);
  border-color: var(--gold);
}

.timeline-item.dragging {
  opacity: .35;
}

.timeline-item.dragging .timeline-dot {
  cursor: grabbing;
}

.timeline-item.drop-top .timeline-content {
  box-shadow: 0 -4px 0 -1px var(--gold);
}

.timeline-item.drop-bottom .timeline-content {
  box-shadow: 0 4px 0 -1px var(--gold);
}

/* Selector de SCOs en proyecto: tarjetas más anchas y completas */
.sco-available-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.sco-select-card .sco-spec-value {
  font-size: .8rem;
}

/* Badge de proyecto recurrente (negro con dorado) */
.badge-rec {
  background: #000;
  color: var(--gold);
}

/* =============================
   NOTIFICACIONES (campana y panel)
============================ */

.topbar-notif-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f3f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: .15s ease;
}

.topbar-notif-btn:hover {
  background: #e5e7eb;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold);
  color: #000;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: .72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.notif-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 14px;
  margin-bottom: 10px;
  align-items: center;
  transition: .15s ease;
}

.notif-item.no-leida {
  background: #fffdf5;
  border-left: 4px solid var(--gold);
}

.notif-item.leida {
  opacity: .8;
}

/* =============================
   ANOTACIONES
============================ */

.anot-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 14px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.anot-item .avatar {
  flex-shrink: 0;
}

/* Enlaces del pie de la barra lateral */
.sidebar-footer .sidebar-link {
  margin-bottom: 8px;
}

/* Contador de notificaciones en la barra lateral, en dorado */
.notif-sidebar {
  color: var(--gold);
  font-weight: 800;
}
