:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --border: #e9eaf5;
  --text: #1c1f2e;
  --text-muted: #8890a3;
  --primary: #4b5fed;
  --primary-dark: #333fc7;
  --primary-soft: #e9ebfe;
  --accent-purple: #8b5cf6;
  --accent-purple-soft: #f1ebfe;
  --success: #17a673;
  --success-soft: #e4f8ef;
  --danger: #f0506e;
  --danger-soft: #fde9ee;
  --warning: #f5a524;
  --warning-soft: #fef3e2;
  --info: #3ab7e8;
  --info-soft: #e6f7fd;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(30, 34, 60, 0.04);
  --shadow: 0 1px 2px rgba(30, 34, 60, 0.03), 0 10px 30px -8px rgba(60, 66, 110, 0.12);
  --shadow-lg: 0 20px 45px -14px rgba(60, 66, 110, 0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 4px; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 23px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; color: var(--text-muted); }

/* ---------- Layout ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}
.sidebar-nav .icon {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
  transition: background 0.15s ease;
}
.sidebar-nav a.active .icon { background: rgba(255, 255, 255, 0.2); }
.sidebar-nav a:hover .icon { background: var(--surface); }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip strong { display: block; font-size: 13.5px; }
.user-chip a { font-size: 12px; color: var(--text-muted); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--surface), 0 2px 6px rgba(30, 34, 60, 0.16);
}

.main-content {
  flex: 1;
  padding: 30px 36px;
  max-width: 1200px;
  min-width: 0;
}

.content-narrow { max-width: 520px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: box-shadow 0.15s ease;
}

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

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

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

/* ---------- Mobile layout ---------- */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; min-height: auto; }

  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 20;
  }
  .sidebar-brand { padding: 14px 16px; }
  .sidebar-nav {
    flex-direction: row; padding: 8px 10px; gap: 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar-nav a { flex-shrink: 0; padding: 8px 12px; }
  .sidebar-footer {
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 10px 16px; gap: 10px;
  }
  .sidebar-footer .btn-block { width: auto; }

  .main-content { padding: 18px 16px; max-width: 100%; }
}

@media (max-width: 560px) {
  .card { padding: 16px; }
  .project-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .project-item-badges { margin-left: 0; flex-wrap: wrap; }
  .form-row { flex-direction: column; }
  .form-row > label { min-width: 0; }
}

/* ---------- Stat tiles ---------- */
.stat-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 18px 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat-tile::before {
  content: '';
  position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
}
.stat-tile:nth-child(2)::before { background: linear-gradient(180deg, var(--success), #34d399); }
.stat-tile:nth-child(3)::before { background: linear-gradient(180deg, var(--warning), #fbbf24); }
.stat-tile .stat-value { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; }
.stat-tile .stat-label { color: var(--text-muted); font-size: 12.5px; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  transition: filter 0.1s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:hover { filter: brightness(0.97); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--primary) 65%, transparent);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--text); }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; min-height: 70px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > label { flex: 1; min-width: 160px; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* ---------- Formularios de dos columnas (nuevo/editar proyecto) ---------- */
.content-form { max-width: 780px; }

/* Grupo de campos con titulillo; separa "que es" de "cuando/cuanto". */
.form-sections { margin-top: 18px; }
.form-section + .form-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-section-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid > .span-2 { grid-column: 1 / -1; }

/* Nota bajo un campo (ej. moneda del costo). */
.field-hint { font-weight: 400; font-size: 12px; color: var(--text-muted); }

/* Barra de acciones al pie del formulario. */
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.form-actions .push-right { margin-left: auto; }

/* Zona de borrado: presente pero sin competir con el formulario. */
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px solid var(--danger-soft);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.danger-zone h3 { font-size: 14px; margin: 0 0 2px; }
.danger-zone p { margin: 0; font-size: 12.5px; }
.danger-zone form { margin: 0; }

/* ---------- Card "Información del proyecto" (detalle) ---------- */
.info-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Descripción con su propio bloque, en vez de un <p> suelto bajo el título. */
.info-description {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 2px 0 18px;
}
.info-description .info-field-label { margin-bottom: 6px; }
.info-description p { margin: 0; color: var(--text); line-height: 1.6; }

.info-meta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.info-field-value { margin-top: 4px; font-size: 14px; font-weight: 600; }

/* Costo estimado como componente propio, destacado en vez de fila de tabla. */
.cost-card {
  position: relative;
  background: linear-gradient(135deg, var(--success-soft) 0%, var(--surface) 100%);
  border: 1px solid var(--success-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px 16px 20px;
  overflow: hidden;
}
.cost-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--success);
}
.cost-card-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cost-card-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cost-card-value { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.cost-card-desc { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid rgba(23, 166, 115, 0.18); font-size: 13px; line-height: 1.55; color: var(--text-muted); }
.cost-card-empty {
  background: var(--bg);
  border-color: var(--border);
}
.cost-card-empty::before { background: var(--border); }
.cost-card-empty .cost-card-value { color: var(--text-muted); font-weight: 700; }
.cost-card-empty .cost-card-desc { border-top-color: var(--border); }

@media (max-width: 640px) {
  .info-meta-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions .push-right { margin-left: 0; }
}

/* ---------- Alerts ---------- */
.alert { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; font-size: 13.5px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 100px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-activo, .badge-media { background: var(--info-soft); color: #1b8bb8; }
.badge-pausado, .badge-baja { background: var(--warning-soft); color: #b5790f; }
.badge-terminado { background: var(--success-soft); color: var(--success); }
.badge-alta { background: var(--danger-soft); color: var(--danger); }

/* ---------- Tables & lists ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { color: var(--text-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
.row-link { color: var(--text); font-weight: 600; }

.project-list { display: flex; flex-direction: column; gap: 10px; }
.project-item-row { display: flex; align-items: center; gap: 8px; }
.project-item-row.dragging { opacity: 0.45; }
.project-item-row.completado .project-item strong { text-decoration: line-through; color: var(--text-muted); }
.project-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  flex: 1; min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.project-item:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.project-item .meta { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.project-item-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; margin-left: 12px; }
.badge-area { background: var(--accent-purple-soft); color: var(--accent-purple); }

.drag-handle {
  display: grid; grid-template-columns: repeat(2, 4px); grid-template-rows: repeat(3, 4px);
  gap: 3px; padding: 6px 4px; cursor: grab; flex-shrink: 0;
}
.drag-handle span { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); }
.drag-handle:active { cursor: grabbing; }

.proyecto-completado-checkbox { width: 18px; height: 18px; accent-color: var(--success); cursor: pointer; flex-shrink: 0; }

/* ---------- Pendientes ---------- */
.pendiente-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.pendiente-item:last-child { border-bottom: none; }
.pendiente-item.done .pendiente-title { text-decoration: line-through; color: var(--text-muted); }
.pendiente-item input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--success); cursor: pointer; }
.pendiente-title { font-weight: 600; }
.pendiente-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.pendiente-actions { margin-left: auto; }
.empty-state { color: var(--text-muted); font-size: 13.5px; padding: 18px 0; text-align: center; }

/* ---------- Timeline (avances) ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before { content: ''; position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-header { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--text-muted); margin-bottom: 3px; }
.timeline-header strong { color: var(--text); }
.timeline-text { color: var(--text); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; font-size: 13.5px; border-radius: 8px 8px 0 0; transition: background 0.15s ease, color 0.15s ease; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-soft); }
.tabs a:hover { text-decoration: none; color: var(--primary); }

/* ---------- Files ---------- */
.file-item { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.file-item:last-child { border-bottom: none; }
.file-thumb {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border);
}
.file-thumb-img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.file-thumb-icon { font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--text-muted); text-align: center; }
.file-thumb-icon-pdf { color: var(--danger); cursor: pointer; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; }
.file-name a { color: inherit; }
.file-meta { font-size: 12px; color: var(--text-muted); }
.file-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ---------- File preview modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 28, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 90vw; max-height: 90vh; width: min(900px, 90vw);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 2px 6px; }
.modal-close:hover { color: var(--text); }
.modal-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; background: var(--bg); min-height: 200px; }
.modal-body img { max-width: 100%; max-height: 80vh; display: block; }
.modal-body iframe { width: 100%; height: 80vh; border: none; display: block; }

/* ---------- Panel lateral: proyecto en Markdown ---------- */
.md-panel-overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 28, 0.5);
  display: flex; justify-content: flex-end;
  z-index: 2100;
}
.md-panel-overlay.hidden { display: none; }
.md-panel-box {
  background: var(--surface); box-shadow: var(--shadow);
  width: min(1100px, 96vw); height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.md-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.md-panel-header-actions { display: flex; align-items: center; gap: 8px; }
.md-panel-body { flex: 1; display: flex; gap: 1px; background: var(--border); overflow: hidden; }
.md-editor, .md-preview { flex: 1 1 50%; min-width: 0; height: 100%; overflow: auto; background: var(--surface); }
.md-editor {
  border: none; resize: none; padding: 16px; font: 12.5px/1.6 "Cascadia Code", Consolas, monospace;
  color: var(--text); outline: none;
}
.md-preview { padding: 16px 20px; font-size: 13.5px; line-height: 1.6; }
.md-preview h1, .md-preview h2, .md-preview h3 { margin-top: 18px; }
.md-preview h1:first-child, .md-preview h2:first-child, .md-preview h3:first-child { margin-top: 0; }
.md-preview ul { padding-left: 22px; margin: 0 0 10px; }
.md-preview li { margin-bottom: 4px; }
.md-preview code { background: var(--primary-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.md-panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }

@media (max-width: 900px) {
  .md-panel-box { width: 100vw; }
  .md-panel-body { flex-direction: column; overflow: auto; }
  .md-editor, .md-preview { flex: none; height: 50%; }
}

/* ---------- Login ---------- */
.login-body { margin: 0; min-height: 100vh; background: var(--bg); }
.login-split { display: flex; min-height: 100vh; }

.login-logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
  margin: 0 auto 14px;
}
.login-logo.small { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }

/* Left panel: brand / pitch */
@keyframes loginDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.06); }
}
@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-left {
  flex: 1 1 55%;
  background: linear-gradient(155deg, var(--primary-dark) 0%, var(--primary) 62%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(480px circle at 12% 15%, rgba(255, 255, 255, 0.16), transparent 60%),
    radial-gradient(420px circle at 88% 20%, rgba(255, 255, 255, 0.10), transparent 55%),
    radial-gradient(560px circle at 75% 90%, var(--accent-purple) 0%, transparent 45%);
  opacity: 0.35;
  animation: loginDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
.login-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(155deg, rgba(0, 0, 0, 0.6), transparent 65%);
  mask-image: linear-gradient(155deg, rgba(0, 0, 0, 0.6), transparent 65%);
  pointer-events: none;
}
.login-left-inner { position: relative; z-index: 1; max-width: 520px; animation: loginFadeUp 0.6s ease both; }

.login-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.login-left-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  flex-shrink: 0;
}
.login-logo-row strong { display: block; font-size: 14px; }
.login-logo-row span { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }

.login-left-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 100px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  color: #a5b4fc;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 22px;
}
.login-left-badge svg { flex-shrink: 0; }

.login-left-title { font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 16px; }
.login-left-title .highlight {
  background: linear-gradient(90deg, #67e8f9 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-left-desc { color: rgba(255, 255, 255, 0.85); font-size: 15px; line-height: 1.55; max-width: 440px; margin-bottom: 34px; }

.login-feature-list {
  list-style: none; margin: 0 0 40px; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px;
}
.login-feature-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; transition: transform 0.2s ease; }
.login-feature-list li:hover { transform: translateX(2px); }
.login-feature-icon {
  width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.login-left-footer { position: relative; font-size: 12px; color: rgba(255, 255, 255, 0.6); border-top: 1px solid rgba(255, 255, 255, 0.18); padding-top: 18px; }

/* Right panel: form */
.login-right { flex: 1 1 45%; display: flex; align-items: center; justify-content: center; background: var(--surface); padding: 40px; }
.login-right-inner { width: 100%; max-width: 380px; animation: loginFadeUp 0.6s ease 0.08s both; }

.login-badge-secure {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  margin-bottom: 18px;
}
.login-right-inner h2 { font-size: 27px; margin-bottom: 6px; }
.login-subtitle { margin-bottom: 26px; }

.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.login-field { display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }

.input-icon-group { position: relative; display: flex; align-items: center; }
.input-icon-group .input-icon {
  position: absolute; left: 13px; display: flex; color: var(--text-muted); opacity: 0.65;
  pointer-events: none; transition: color 0.15s ease, opacity 0.15s ease;
}
.input-icon-group input {
  width: 100%; padding: 11px 38px 11px 38px; font-size: 14px; font-weight: 400; text-transform: none;
  border-radius: 10px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-icon-group input:focus ~ .input-icon,
.input-icon-group:focus-within .input-icon { color: var(--primary); opacity: 1; }
.input-icon-group input:focus { box-shadow: 0 0 0 4px var(--primary-soft); }
.input-icon-toggle {
  position: absolute; right: 6px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  opacity: 0.6; padding: 7px; line-height: 1; border-radius: 6px; transition: opacity 0.15s ease, background 0.15s ease;
}
.input-icon-toggle:hover { opacity: 1; background: var(--bg); }

.btn-login {
  margin-top: 6px; padding: 12px 16px; font-size: 14.5px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 1px 2px rgba(20, 24, 38, 0.06), 0 10px 20px -8px color-mix(in srgb, var(--primary) 55%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-login:hover {
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(20, 24, 38, 0.08), 0 14px 26px -8px color-mix(in srgb, var(--primary) 60%, transparent);
}
.btn-login:active { transform: translateY(0); }
.login-right-footer { text-align: center; margin-top: 28px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 860px) {
  .login-split { flex-direction: column; }
  .login-left, .login-right { flex: none; width: 100%; }
  .login-left { padding: 44px 28px; }
  .login-left-title { font-size: 30px; }
  .login-feature-list { grid-template-columns: 1fr; margin-bottom: 28px; }
  .login-right { padding: 36px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-left::before { animation: none; }
  .login-left-inner, .login-right-inner { animation: none; }
}

.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--primary-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.toast-error { background: var(--danger); }
