/* ============================================================
   Punto de Venta adnode360 — Hoja de estilo base (referencia de UI)
   Estética de software de gestión empresarial: limpia, corporativa
   y orientada a productividad. Código 100% original.
   ============================================================ */

:root {
  --brand:        #714B67;   /* acento corporativo púrpura-grisáceo */
  --brand-dark:   #5c3b53;
  --brand-light:  #e8e1e6;
  --text:         #34495e;
  --text-soft:    #7f8c8d;
  --bg:           #f6f7f9;    /* gris muy claro tipo "área de trabajo" */
  --card:         #ffffff;
  --line:         #e4e9ee;
  --line-strong:  #d5dbe2;
  --ok:           #21a366;
  --warn:         #c9971c;
  --danger:       #c0392b;
  --table-head:   #f8f9fa;
  --radius:       10px;
  --shadow:       0 1px 2px rgba(23,26,31,.04), 0 2px 6px rgba(23,26,31,.05);
  --shadow-pop:   0 4px 16px rgba(23,26,31,.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Barra superior (navegación) ---------- */
.topbar {
  height: 46px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .menubtn {
  background: none; border: none; color: #fff; font-size: 18px;
  cursor: pointer; margin-right: 10px; width: 34px; height: 34px;
  border-radius: 6px; line-height: 1;
}
.topbar .menubtn:hover { background: rgba(255,255,255,.15); }
.topbar .brand {
  font-weight: 600; letter-spacing: .2px; white-space: nowrap;
}
.topbar .spacer { flex: 1; }

/* migas de pan (control del "modalidad / lista / formulario") */
.o-breadcrumb { display: flex; align-items: center; color: rgba(255,255,255,.85); gap: 6px; }
.o-breadcrumb .crumb.mod { font-weight: 600; color: #fff; }
.o-breadcrumb .sep { opacity: .6; }

.topbar .userbox {
  display: flex; align-items: center; gap: 8px; padding-left: 12px;
}
.topbar .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.25); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600;
}
.topbar .userbox .chev { margin-left: 2px; opacity: .7; }

/* ---------- Contenedor y barra lateral ---------- */
.app { display: flex; min-height: calc(100vh - 46px); }
.sidebar {
  width: 220px; background: var(--card); border-right: 1px solid var(--line);
  padding: 12px 10px; position: sticky; top: 46px; height: calc(100vh - 46px);
  overflow-y: auto;
}
.side-group { margin-bottom: 16px; }
.side-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-soft); padding: 6px 10px;
}
.side-link {
  display: block; padding: 8px 10px; border-radius: 7px; color: var(--text);
  margin-bottom: 1px; font-weight: 500;
}
.side-link:hover { background: var(--bg); text-decoration: none; }
.side-link.active { background: var(--brand); color: #fff; }

.content { flex: 1; padding: 18px 22px; min-width: 0; }

/* ---------- Títulos y acciones de la vista ---------- */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.page-head h1 {
  font-size: 20px; margin: 0; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.page-head .count { color: var(--text-soft); font-weight: 400; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: #f1f2f4; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ---------- Icons (sombrados Unicode / georigen) ---------- */
.btn i, .btn .i { font-style: normal; }

/* ---------- Barras de búsqueda / filtros ---------- */
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.searchbar {
  position: relative; flex: 1; min-width: 220px; max-width: 420px;
}
.searchbar .icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-soft); font-size: 14px; pointer-events: none;
}
.searchbar input {
  width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line-strong);
  border-radius: 8px; outline: none; font-size: 13px; background: var(--card);
}
.searchbar input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand); }
.fgroup { display: flex; align-items: center; gap: 6px; }
.fgroup select {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px;
  background: var(--card); font-size: 13px; outline: none;
}
.fgroup .fbtn {
  border: 1px solid var(--line-strong); background: var(--card);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px;
}
.fgroup .fbtn:hover { background: #f1f2f4; }

/* ---------- Tabla (vista lista) ---------- */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.o { width: 100%; border-collapse: collapse; }
table.o thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-soft); background: var(--table-head);
  padding: 9px 14px; border-bottom: 1px solid var(--line); font-weight: 600;
}
table.o tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.o tbody tr:last-child td { border-bottom: none; }
table.o tbody tr:hover { background: #fbfcfe; }
table.o .num { text-align: right; font-variant-numeric: tabular-nums; }
table.o .money { font-variant-numeric: tabular-nums; font-weight: 600; }

/* estados / badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 500;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.draft    { background: #fdf3e0; color: #9a6b00; }
.badge.confirm  { background: #e8f6ee; color: #158a4b; }
.badge.done     { background: #e8f6ee; color: #158a4b; }
.badge.cancel   { background: #fdf0ef; color: #b83c32; }
.badge.void     { background: #f2f3f5; color: #6b7280; }

/* ---------- Tarjetas / panel de acciones ---------- */
.cards-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.kan-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer;
  transition: box-shadow .12s, border-color .12s;
}
.kan-card:hover { border-color: var(--brand); box-shadow: var(--shadow-pop); }
.kan-card .t { font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.kan-card .sub { color: var(--text-soft); font-size: 12px; margin-top: 2px; }
.kan-card .izq { margin-top: 10px; color: var(--text-soft); font-size: 12px; }
.kan-card .ico { font-size: 16px; opacity: .8; }

/* ---------- Vistas formulario ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.panel .panel-title {
  font-size: 13px; font-weight: 600; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .5px; margin: 0 0 12px;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; font-size: 13px; outline: none; background: var(--card); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(178,49,103,.12); }
.field .step { font-size: 11px; color: var(--text-soft); margin-top: 3px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.side-panel .stat { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.side-panel .stat:last-child { border-bottom: none; }
.side-panel .stat .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Notificaciones / mensajes ---------- */
.alert-error {
  background: #fce4e4;
  border: 1px solid #e57373;
  color: #c62828;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ok);
  border-radius: 8px; box-shadow: var(--shadow-pop); padding: 12px 16px;
  min-width: 260px;
}
.toast.error { border-left-color: var(--danger); }
.toast .msg { font-weight: 500; }
.toast .sub { color: var(--text-soft); font-size: 12px; margin-top: 2px; }

/* ---------- Responsivo básico ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
}