/* ===== Bridge con el tema global (light/dark) ===== */
:root{
  --page-bg: var(--card, #ffffff);
  --text: var(--ink-1, #0f172a);
  --muted: var(--ink-2, #64748b);
  --line: rgba(0,0,0,.08);
  --hover: rgba(0,0,0,.03);
  --accent: var(--primary, #3b82f6);
  --accent-600: var(--primary-700, #2563eb);
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 6px 16px rgba(16,24,40,.06);
}

[data-theme="dark"]{
  --line: rgba(255,255,255,.08);
  --hover: rgba(255,255,255,.04);
}

/* ===== Layout Notion-like (respetando bg de la app) ===== */
.notion-page{ max-width:1100px; margin:28px auto 40px; padding:0 22px; }
.btn-text-right{ text-align:right; }

/* ===== Header ===== */
.notion-header{
  padding:20px; background:var(--page-bg);
  border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow);
}
.notion-title{ font-size:26px; font-weight:700; line-height:1.2; margin:0; letter-spacing:.2px; color:var(--text); }
.notion-sub{ color:var(--muted); font-size:13px; margin-top:6px; }

/* ===== Property chips ===== */
.notion-props{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.prop-chip{
  display:inline-flex; align-items:center; gap:6px;
  border:1px solid var(--line); background:var(--page-bg); border-radius:999px;
  padding:6px 10px; font-size:12px; color:var(--text); cursor:pointer; transition:.15s background;
}
.prop-chip:hover{ background:var(--hover); }
.prop-dot{ width:8px; height:8px; border-radius:999px; background:#d1d5db; display:inline-block; }

/* ===== Database container ===== */
.notion-db{
  margin-top:16px; background:var(--page-bg);
  border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow);
}

/* ===== Toolbar ===== */
.db-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-bottom:1px solid var(--line); }
.db-left,.db-right{ display:flex; align-items:center; gap:8px; }

/* Buttons */
/* Botón “suave” pero visible */
.btn-ghost{
  display:inline-flex; align-items:center; gap:.25rem;
  padding:.25rem .5rem;                 /* mismo alto que btn-sm */
  background: rgba(79,70,229,.08);      /* indigo muy suave */
  border: 1px solid rgba(79,70,229,.35);
  color:#99afb9;                        /* indigo */
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.btn-ghost:hover{
  background: rgba(79,70,229,.15);
  border-color:#99afb9; color:#99afb9;
}
.btn-ghost:focus{
  outline:0; box-shadow:0 0 0 .18rem rgba(79,70,229,.25);
}

/* Tema oscuro */
html.dark .btn-ghost{
  background: rgba(213, 214, 252, 0.16);
  border-color: rgba(241, 239, 99, 0.45);
  color:#a5b4fc;
}
html.dark .btn-ghost:hover{
  background: rgba(99,102,241,.24);
  border-color:#a5b4fc; color:#c7d2fe;
}
html.dark .btn-ghost:focus{
  box-shadow:0 0 0 .18rem rgba(165,180,252,.25);
}
/* Search */
.db-search{ display:flex; align-items:center; gap:8px; background:var(--page-bg); border:1px solid var(--line); border-radius:10px; padding:6px 10px; min-width:240px; }
.db-search i{ color:#9aa0a6; font-size:14px; }
.db-search input{ border:none; outline:none; width:100%; font-size:13px; color:var(--text); background:transparent; }

/* ===== Tabla estilo Notion ===== */
.table.notion-table{
  width:100%; border-collapse:separate; border-spacing:0;
  border:1px solid var(--line); border-radius:var(--radius); background:var(--page-bg); box-shadow:var(--shadow); font-size:.85rem;
}
.notion-table thead{ background:var(--page-bg); }
.notion-table th{
  text-transform:uppercase; font-size:.7rem; font-weight:600; color:var(--muted);
  padding:8px 10px; border-bottom:1px solid var(--line);
}
.notion-table td{ padding:10px; vertical-align:middle; border-bottom:1px solid var(--line); color:var(--text); }
.notion-table tbody tr:hover{ background:var(--hover); }

/* DataTables borders en dark */
[data-theme="dark"] table.dataTable.no-footer{ border-bottom:1px solid var(--line)!important; }
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button{ border-color:var(--line)!important; }

/* Action mini buttons */
.icon-btn,.notion-action-btn{
  width:28px; height:28px; display:grid; place-items:center;
  border:1px solid var(--line); border-radius:8px; background:var(--page-bg); color:var(--text); transition:background .15s;
}
.icon-btn:hover,.notion-action-btn:hover{ background:var(--hover); }
.notion-action-btn.danger{ border-color:var(--danger); color:var(--danger); }
.notion-action-btn.danger:hover{ background:rgba(239,68,68,.1); }

/* Oculto controles nativos grandes */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length{ display:none; }
.dataTables_wrapper .dataTables_info{ font-size:12px; color:var(--muted); padding:8px 10px; }
.dataTables_wrapper{ padding:4px 8px; }

/* ===== Badges Estado / Prioridad (tints) ===== */
.badge-pill-custom{ border-radius:20px; padding:.4em .8em; display:inline-flex; align-items:center; font-weight:500; font-size:.7em; border:1px solid var(--line); }
.badge-backlog{ background:rgba(250,204,21,.16); color:#a16207; }
.badge-bau{ background:rgba(148,163,184,.18); color:#334155; }
.badge-default{ background:rgba(59,130,246,.16); color:var(--accent); }
.badge-prioridad{ border-radius:20px; padding:.4em .8em; display:inline-flex; align-items:center; font-weight:500; font-size:.7em; border:1px solid var(--line); }
.prioridad-alta{ background:rgba(239,68,68,.14); color:#b91c1c; }
.prioridad-media{ background:rgba(250,204,21,.18); color:#854d0e; }
.prioridad-baja{ background:rgba(34,197,94,.16); color:#166534; }

/* Icons */
.icon-grey{ width:18px; height:18px; stroke:#6e6e6e; stroke-width:1.6; }

/* ===== Offcanvas ===== */
.offcanvas-custom{
  position:fixed; top:0; right:-100%; width:900px; max-width:100%; height:100%;
  background:var(--page-bg); border-left:1px solid var(--line);
  box-shadow: -4px 0 16px rgba(0,0,0,.12); overflow-y:auto; transition:right .3s ease-in-out; z-index:1050;
}
.offcanvas-custom.show{ right:0; }
.offcanvas-header{ padding:24px; border-bottom:1px solid var(--line); }
.offcanvas-header h5{ font-size:2rem; font-weight:700; color:var(--text); margin:0; }
.offcanvas-props{ display:grid; grid-template-columns:140px auto; row-gap:18px; padding:24px; font-size:.9rem; }
.offcanvas-props label{ color:var(--muted); font-weight:500; }
.offcanvas-props .prop-value{ display:flex; align-items:center; }
.offcanvas-props select,
.offcanvas-props input,
.offcanvas-props textarea{
  width:100%; font-size:.85rem; border:1px solid var(--line); border-radius:6px; background:var(--page-bg); color:var(--text); padding:5px 8px;
}
.comments{ padding:24px; margin-top:16px; }
.comment{ display:flex; gap:10px; margin-bottom:14px; }
.comment .avatar, .comment-avatar{
  width:32px; height:32px; border-radius:50%; background:var(--line); display:flex; align-items:center; justify-content:center;
  font-weight:600; font-size:.8rem; color:var(--muted);
}
.comment-body{ background:rgba(0,0,0,.03); border-radius:6px; padding:8px 12px; font-size:.85rem; }
[data-theme="dark"] .comment-body{ background:rgba(255,255,255,.05); }
.offcanvas-footer{ padding:20px 24px; border-top:1px solid var(--line); }
.offcanvas-footer .btn-dark, .offcanvas-footer .btn-primary{
  background:var(--accent); border:none; border-radius:8px; font-size:.85rem; padding:8px 16px;
}
.offcanvas-footer .btn-dark:hover, .offcanvas-footer .btn-primary:hover{ background:var(--accent-600); }

.offcanvas-backdrop{
  position: fixed; inset:0; background: rgba(0,0,0,.35);
  z-index: 1049; display:none;
}
.offcanvas-backdrop.show{ display:block; }

/* Título editable */
.titulo-editable{ border:none; outline:none; background:transparent; font-size:1.25rem; font-weight:600; width:100%; color:var(--text); }
.titulo-editable::placeholder{ color:#9aa0a6; }
.titulo-editable:focus{ border-bottom:2px solid var(--accent); }

/* Chips estado activos / inactivos */
.prop-chip.active{ background:var(--hover); color:var(--text); font-weight:600; }
.prop-chip.inactive{ opacity:.45; }

/* SweetAlert compact (coherente) */
.swal-compact{ width:320px!important; padding:1rem!important; border-radius:12px!important; font-family: ui-sans-serif, "Segoe UI", Roboto, sans-serif; }
.swal-title{ font-size:1.1rem!important; font-weight:600!important; color:var(--text)!important; margin-bottom:.5rem!important; }
.swal-html{ font-size:.9rem!important; color:var(--muted)!important; }
.swal-ticket{ display:block; font-weight:600; color:var(--text); margin-top:4px; }
.swal-confirm{ background:#e11d48; color:#fff; border:none; border-radius:6px; padding:6px 14px; font-size:.85rem; font-weight:500; cursor:pointer; }
.swal-cancel{ background:#f3f4f6; color:#111; border:1px solid #ddd; border-radius:6px; padding:6px 14px; font-size:.85rem; font-weight:500; margin-right:8px; cursor:pointer; }
.swal-confirm:hover{ background:#be123c; }
.swal-cancel:hover{ background:#e5e7eb; }

/* Menú contextual fila */
.row-menu{
  position:absolute; background:var(--page-bg); border:1px solid var(--line);
  border-radius:6px; box-shadow:var(--shadow); padding:6px 0; font-size:13px; z-index:2000; display:none;
}
.row-menu-item{ padding:6px 14px; cursor:pointer; color:var(--text); }
.row-menu-item:hover{ background:var(--hover); }

/* Placeholders / focus */
input::placeholder, textarea::placeholder{ color:#8b8f94; font-style:italic; }
input:focus, textarea:focus{ outline:none; box-shadow:none; border-color:var(--accent); }

/* Responsive */
@media (max-width: 768px){
  .notion-page{ padding:0 14px; }
  .db-toolbar{ flex-direction:column; align-items:stretch; gap:10px; }
  .db-right{ justify-content:space-between; }
  .prop-chip{ font-size:11.5px; }
  .db-search{ min-width:unset; width:100%; }
}


/* Modal uniforme con el resto del sitio */
.modal-content { background: var(--page-bg); color: var(--text); border: 1px solid var(--line); }
.modal-header .btn-close { background: transparent; border: 0; opacity: .6; }
.modal-header .btn-close:hover { opacity: 1; }
.form-label { color: var(--muted); }