:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #f7f7f5;
  color: #1a1a1a;
}
h1 { font-size: 20px; margin: 0 0 4px 0; }
h2 { font-size: 15px; margin: 24px 0 10px 0; }
a { color: #1a1a1a; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; background: #fff; border-bottom: 1px solid #e5e5e0;
  font-size: 13px;
}
.topbar-brand { font-weight: 700; text-decoration: none; font-size: 15px; }
.topbar-right a { text-decoration: none; margin-left: 4px; }
.topbar-right a:hover { text-decoration: underline; }

.page { padding: 24px; max-width: 1100px; margin: 0 auto; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar input[type="text"], .toolbar select {
  padding: 8px 10px; border: 1px solid #d8d8d4; border-radius: 6px; font-size: 13px; background: #fff;
}
.toolbar input[type="text"] { flex: 1; min-width: 180px; }

button {
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 6px; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: #1a1a1a; color: #fff; }
.btn-primary:hover { background: #333; }
.btn-secondary { background: #fff; border-color: #d8d8d4; color: #1a1a1a; }
.btn-secondary:hover { background: #f0f0ee; }

.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.column { background: #fff; border: 1px solid #e5e5e0; border-radius: 10px; padding: 12px; min-height: 140px; }
.column-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid; }
.column-header h2 { font-size: 14px; margin: 0; text-transform: uppercase; letter-spacing: 0.03em; }
.column-header .count { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.col-activo .column-header { border-color: #1a7a3e; }
.col-activo .column-header .count { background: #eaf7ee; color: #1a7a3e; }
.col-seguimiento .column-header { border-color: #c98a00; }
.col-seguimiento .column-header .count { background: #fff6e5; color: #9a6a00; }
.col-cerrado .column-header { border-color: #6b6b6b; }
.col-cerrado .column-header .count { background: #eeeeec; color: #555; }

.card { background: #fbfbfa; border: 1px solid #ececea; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.card:hover { border-color: #c8c8c2; }
.card .case-name { font-size: 13px; font-weight: 600; }
.card .meta { font-size: 11.5px; color: #7a7a75; margin-top: 4px; }
.card .tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 10.5px; padding: 1px 7px; border-radius: 8px; }
.tag-equipo { color: #4a5a8a; background: #eef0fa; }
.tag-abogado { color: #6a4a8a; background: #f4eefa; }
.empty-col { color: #a0a0a0; font-size: 12px; text-align: center; padding: 16px 0; }

.overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; }
.modal h2 { font-size: 17px; margin: 0 0 14px 0; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d8d8d4; border-radius: 6px; font-size: 13px; font-family: inherit;
}
.field textarea { resize: vertical; min-height: 60px; }
.checkbox-field label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.checkbox-field input { width: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.bitacora-list { margin-top: 8px; max-height: 180px; overflow-y: auto; border: 1px solid #ececea; border-radius: 8px; padding: 8px; }
.nota-item { padding: 6px 4px; border-bottom: 1px solid #f0f0ee; font-size: 12.5px; }
.nota-item:last-child { border-bottom: none; }
.nota-item .nota-meta { color: #9a9a95; font-size: 11px; margin-bottom: 2px; }

.loading { color: #6b6b6b; font-size: 13px; padding: 30px 0; text-align: center; }
.status-line { font-size: 12px; color: #8a8a85; margin-top: 16px; }

.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-box { background: #fff; border: 1px solid #e5e5e0; border-radius: 12px; padding: 32px; width: 100%; max-width: 380px; }
.auth-box .subtitle { color: #6b6b6b; font-size: 13px; margin-bottom: 18px; }
.auth-box button { width: 100%; padding: 10px; margin-top: 6px; }

.error-box { background: #fdeceb; border: 1px solid #f4c6c2; color: #8a231d; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.success-box { background: #eaf7ee; border: 1px solid #cdeed7; color: #1a7a3e; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e5e0; border-radius: 8px; overflow: hidden; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #ececea; }
.table th { background: #fafafa; font-size: 11.5px; text-transform: uppercase; color: #6b6b6b; }
.inline-form { background: #fff; border: 1px solid #e5e5e0; border-radius: 8px; padding: 16px; max-width: 400px; }

/* --- Ampliación: vistas, prioridad, calendario, checklist --- */
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.view-switch { display: flex; gap: 6px; margin-bottom: 14px; }
.view-btn { background: #fff; border: 1px solid #d8d8d4; color: #555; }
.view-btn.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

.tag.prio-alta { background: #fdeceb; color: #b02a1f; }
.tag.prio-media { background: #fff6e5; color: #9a6a00; }
.tag.prio-baja { background: #eaf7ee; color: #1a7a3e; }

.list-view .table { margin-top: 4px; }
.list-row { cursor: pointer; }
.list-row:hover { background: #fafaf8; }

.calendar-header { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.calendar-month-label { font-size: 14px; font-weight: 700; text-transform: capitalize; min-width: 160px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-day-header { font-size: 11px; font-weight: 700; color: #8a8a85; text-align: center; padding: 4px 0; text-transform: uppercase; }
.calendar-day { background: #fff; border: 1px solid #ececea; border-radius: 6px; min-height: 78px; padding: 4px; font-size: 11px; }
.calendar-day-empty { background: transparent; border: none; }
.calendar-day-num { font-size: 11px; color: #8a8a85; margin-bottom: 3px; }
.calendar-case-pill { background: #eef0fa; color: #33395a; border-radius: 5px; padding: 2px 5px; margin-bottom: 3px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-case-pill.prio-alta { background: #fdeceb; color: #b02a1f; }
.calendar-case-pill.prio-media { background: #fff6e5; color: #9a6a00; }
.calendar-case-pill.prio-baja { background: #eaf7ee; color: #1a7a3e; }
@media (max-width: 700px) { .calendar-day { min-height: 46px; font-size: 10px; } }

.checklist-list { margin-top: 8px; max-height: 160px; overflow-y: auto; border: 1px solid #ececea; border-radius: 8px; padding: 6px 8px; }
.checklist-item { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 12.5px; border-bottom: 1px solid #f0f0ee; }
.checklist-item:last-child { border-bottom: none; }
.checklist-item label { display: flex; align-items: center; gap: 8px; }
.checklist-item input[type="checkbox"] { width: auto; }
.checklist-done { text-decoration: line-through; color: #a0a0a0; }
.checklist-delete { background: none; border: none; color: #b0a0aa; font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.checklist-delete:hover { color: #b02a1f; }
.checklist-add { display: flex; gap: 8px; margin-top: 8px; }
.checklist-add input { flex: 1; padding: 8px 10px; border: 1px solid #d8d8d4; border-radius: 6px; font-size: 13px; }

/* --- Portal de clientes --- */
.portal-subtitle { color: #6b6b6b; font-size: 13px; margin: 0 0 20px 0; }
.portal-cases { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.portal-case-card { background: #fff; border: 1px solid #e5e5e0; border-radius: 10px; padding: 18px; }
.portal-case-name { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.portal-case-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.portal-case-actions .btn-secondary { text-decoration: none; display: inline-block; }
.portal-pending { font-size: 12.5px; color: #a0a0a0; font-style: italic; }

.topbar-logo{height:36px;width:auto;vertical-align:middle;border-radius:4px;}
.topbar-brand{display:flex;align-items:center;}

.auth-box h1{display:flex;align-items:center;justify-content:center;gap:10px;}

.portal-case-lawyer{color:#666;font-size:13px;margin-top:4px;}
