/* BURVAL Minimal UI (inspired by owner dashboard mock) */
:root{
  --bg:#eef2f6; --surface:#ffffff; --surface-2:#f1f5f9; --surface-3:#e7edf4;
  /* Texto más oscuro para mejor legibilidad en fondos claros */
  --text:#111827; --muted:#374151; --muted-2:#4b5563;
  --border:rgba(15,23,42,.18);
  --border-strong:rgba(15,23,42,.28);
  --primary:#111827; --accent:#2563eb;
  --success:#16a34a; --warning:#d97706; --danger:#dc2626;

  --shadow-sm: 0 1px 3px rgba(15,23,42,.12), 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 10px 30px rgba(15,23,42,.18);

  --radius:16px;
  --sidebar:270px; --topbar:64px; --gap:16px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New";
}

body.bv-min.theme-dark{
  --bg:#0b0f14; --surface:#0f1620; --surface-2:#0c121a;
  --text:#e5e7eb; --muted:#9ca3af; --muted-2:#6b7280;
  --border:rgba(229,231,235,.10);
  --primary:#e5e7eb; --accent:#60a5fa;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow-md: 0 12px 34px rgba(0,0,0,.55);
}

*{box-sizing:border-box}
html,body{height:100%}
body.bv-min{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  line-height:1.35;
}
a{color:inherit; text-decoration:none}
.bv-muted{color:var(--muted) !important;}

/* Layout */
.bv-app{
  display:grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height:100vh;
}
.bv-sidebar{
  background:var(--surface-2);
  border-right:1px solid var(--border);
  padding:18px 14px;
  position:sticky;
  top:0;
  height:100vh;
}
.bv-main{
  padding:18px;
  color:var(--text);
}

/* Sidebar pieces */
.bv-brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px 14px;
  border-bottom:1px solid var(--border);
  margin-bottom:12px;
}
.bv-brand .logo{
  width:36px;height:36px;border-radius:12px;
  background:var(--primary);
  display:grid; place-items:center;
  color:var(--bg);
  box-shadow:var(--shadow-sm);
  font-weight:900;
  letter-spacing:.5px;
}
.bv-usercard, .bv-userline{
  padding:10px 10px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:var(--shadow-sm);
  margin-bottom:10px;
}
.bv-userline .u2{ color:var(--muted) !important; }

/* Quick search (sidebar) */
.bv-search{ padding:0 6px; margin:0 0 8px; }
.bv-search input{
  width:100%;
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:12px;
  padding:10px 10px;
  font-size:14px;
  color:var(--text);
  box-shadow:var(--shadow-sm);
}
.bv-search input::placeholder{ color:var(--muted-2); }
.bv-search input:focus{
  outline:none;
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 3px rgba(37,99,235,.15);
}
.bv-search-hint{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  padding-left:2px;
}

/* Nav */
.bv-nav{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:8px 6px;
}
.bv-nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  color:var(--muted);
  border:1px solid transparent;
}
.bv-nav a:hover{
  background:rgba(15,23,42,.06);
  color:var(--text);
  border-color:var(--border);
}
body.bv-min.theme-dark .bv-nav a:hover{ background:rgba(229,231,235,.05); }
.bv-nav a.active, .bv-nav a[aria-current="page"]{
  background:rgba(15,23,42,.08);
  color:var(--text);
  border-color:var(--border);
  box-shadow:var(--shadow-sm);
}
body.bv-min.theme-dark .bv-nav a.active{ background:rgba(229,231,235,.06); }

/* Top row / headers */
.bv-toprow{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}
.bv-toprow h3{ margin:0; font-weight:950; letter-spacing:.2px; }


/* Sticky page header per module */
.bv-pagehead{
  position:sticky;
  top:0;
  z-index:30;
  background:var(--bg);
  margin:-18px -18px 16px;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  box-shadow:var(--shadow-sm);
}
.bv-pagehead .bv-toprow{ margin-bottom:0; }
.bv-pagehead-title{ font-size:1.1rem; font-weight:950; letter-spacing:.2px; }
.bv-pagehead-sub{ color:var(--muted); font-size:.92rem; }

/* Filter panels */
.bv-filterbar .form-label{
  font-size:.86rem;
  font-weight:900;
  color:var(--text);
  letter-spacing:.2px;
}
.bv-filterbar .form-text{ color:var(--muted-2) !important; }

/* Cards */
.bv-card, .card{
  background:var(--surface) !important;
  border:1px solid var(--border) !important;
  border-radius:var(--radius) !important;
  box-shadow:var(--shadow-sm) !important;
}

/* Cards: más separación visual */
.bv-card:hover, .card:hover{
  box-shadow:var(--shadow-md) !important;
  border-color:var(--border-strong) !important;
}


/* Buttons */
.btn{
  border:1px solid var(--border) !important;
  background:var(--surface) !important;
  color:var(--text) !important;
  border-radius:14px !important;
  font-weight:700 !important;
  box-shadow:var(--shadow-sm) !important;
}
.btn:hover{ filter:brightness(.98); }
.btn-bv, .btn.primary{
  background:var(--primary) !important;
  color:var(--bg) !important;
  border-color:transparent !important;
}
.btn-outline-primary{
  border-color:var(--border) !important;
  color:var(--muted) !important;
  background:transparent !important;
  box-shadow:none !important;
}
.btn-outline-primary:hover{
  background:rgba(17,24,39,.05) !important;
  color:var(--text) !important;
  box-shadow:var(--shadow-sm) !important;
}
.btn-outline-secondary{
  border-color:transparent !important;
  background:transparent !important;
  color:var(--muted) !important;
  box-shadow:none !important;
}
.btn-outline-secondary:hover{
  background:rgba(17,24,39,.05) !important;
  border-color:var(--border) !important;
  color:var(--text) !important;
  box-shadow:var(--shadow-sm) !important;
}

/* Forms */
.form-control, .form-select{
  border-radius:14px !important;
  border:1px solid var(--border) !important;
  background:var(--surface) !important;
  color:var(--text) !important;
  box-shadow:none !important;
}
.form-text, .text-muted{ color:var(--muted) !important; }

/*
  Contraste extra (tema claro):
  - Títulos de recuadros/KPIs suelen venir como .text-muted (primer renglón dentro de .bv-card)
  - Etiquetas de métricas (.bv-metric .label)
  - Subtítulos tipo .bv-section-title
*/
body.bv-min.theme-light .bv-card > .text-muted:first-child,
body.bv-min.theme-light .bv-card > .small.text-muted:first-child{
  color: var(--text) !important;
  font-weight: 900 !important;
}
body.bv-min.theme-light .bv-metric .label{
  color: var(--text) !important;
  font-weight: 900 !important;
}
body.bv-min.theme-light .bv-section-title{
  color: var(--text) !important;
}
body.bv-min.theme-light .bv-choice-card .title,
body.bv-min.theme-light .card-title{
  color: var(--text) !important;
}


/* Table wrapper: que la tabla se vea como "recuadro" */
.table-responsive{
  background:var(--surface);
  border:1px solid var(--border) !important;
  border-radius:var(--radius) !important;
  box-shadow:var(--shadow-sm) !important;
  overflow:hidden;
}
.table{
  background:var(--surface);
}

/* Tables */
.table{
  --bs-table-bg: var(--surface);
  color:var(--text);
}
.table thead th{
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:900;
  background:var(--surface-2);
  border-bottom:1px solid var(--border-strong) !important;
}
.table td, .table th{
  border-color:var(--border) !important;
}
.table-hover tbody tr:hover{
  background:rgba(15,23,42,.04) !important;
}


/* Separadores y menús */
hr{ border-color: var(--border) !important; opacity:1; }
.dropdown-menu{
  border-radius:14px !important;
  border:1px solid var(--border) !important;
  box-shadow:var(--shadow-md) !important;
}
.list-group{
  border-radius:var(--radius) !important;
  overflow:hidden;
  border:1px solid var(--border) !important;
  box-shadow:var(--shadow-sm) !important;
}
.list-group-item{
  border-color:var(--border) !important;
  color:var(--text) !important;
}

/* Alerts */
.alert{
  border-radius:16px !important;
  border:1px solid var(--border) !important;
  background:var(--surface) !important;
  color:var(--text) !important;
}

/* Inventory: compact action select */
.bv-actionbar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}
.bv-actionbar .form-select{ min-width: 240px; }

@media (max-width: 900px){
  .bv-app{ grid-template-columns:1fr; }
  .bv-sidebar{ position:relative; height:auto; }
}

body.bv-min .bv-brand,
body.bv-min .bv-userline .u1{
  color: var(--text) !important;
}
