:root {
  --bg: #f5efe6;
  --bg2: #e9ddcd;
  --panel: #ffffff;
  --panel2: #f4ede1;
  --border: #e2d6c3;
  --text: #3b2f24;
  --muted: #877561;
  --accent: #9c6b3f;
  --accent2: #b98d63;
  --accent-soft: #f1e4d3;
  --danger: #b65c5c;
  --ok: #6b8552;
  --radius: 26px;
  --radius-sm: 18px;
  --shadow-sm: 0 1px 3px rgba(74, 60, 44, 0.1), 0 1px 2px rgba(74, 60, 44, 0.06);
  --shadow: 0 8px 24px rgba(74, 60, 44, 0.14);
  --shadow-lg: 0 20px 50px rgba(60, 47, 33, 0.2);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Estados del pedido: naranja, amarillo, azul, verde y rojo */
  --st-pendiente-bg: #fde7d1;
  --st-pendiente-border: #f3c59a;
  --st-pendiente-fg: #a9510f;
  --st-pendiente-dot: #e07b28;
  --st-proceso-bg: #fbf2c8;
  --st-proceso-border: #ead98a;
  --st-proceso-fg: #856603;
  --st-proceso-dot: #d3a30c;
  --st-listo-bg: #dfeafb;
  --st-listo-border: #b5cfef;
  --st-listo-fg: #1e5a9c;
  --st-listo-dot: #2f7fd1;
  --st-entregado-bg: #dbeee1;
  --st-entregado-border: #b0dabf;
  --st-entregado-fg: #1f6840;
  --st-entregado-dot: #2f9e5f;
  --st-cancelado-bg: #fbe0dd;
  --st-cancelado-border: #f1bab4;
  --st-cancelado-fg: #a33127;
  --st-cancelado-dot: #cf4438;
}

* { box-sizing: border-box; }

/* Sin destello azul ni recuadro al tocar botones en móvil */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
button,
a,
input,
select,
textarea,
label,
summary,
.tab,
.subtab,
.seg,
.btn,
.picker-item,
.connect-url {
  touch-action: manipulation;
}
:focus { outline: none; }
:focus-visible {
  outline: 2px solid rgba(156, 107, 63, 0.62);
  outline-offset: 2px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: none; }

[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.05'/%3E%3C/svg%3E"),
    radial-gradient(1100px 620px at 8% -10%, #f5efe6 0%, rgba(244, 245, 247, 0) 60%),
    radial-gradient(900px 520px at 100% 0%, #e9ddcd 0%, rgba(233, 234, 237, 0) 62%),
    radial-gradient(760px 620px at 50% 120%, #dfe1e6 0%, rgba(230, 220, 200, 0) 65%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 180px 180px, auto, auto, auto, auto;
  -webkit-font-smoothing: antialiased;
}

/* Manchas difuminadas de fondo, muy discretas */
body::before {
  content: '';
  position: fixed;
  inset: -12%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(246, 239, 228, 0.82), rgba(246, 239, 228, 0)) 8% 12% / 46vmax 46vmax no-repeat,
    radial-gradient(closest-side, rgba(185, 141, 99, 0.3), rgba(185, 141, 99, 0)) 96% 4% / 40vmax 40vmax no-repeat,
    radial-gradient(closest-side, rgba(151, 141, 100, 0.18), rgba(151, 141, 100, 0)) 84% 96% / 44vmax 44vmax no-repeat;
  filter: blur(28px);
  animation: drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

/* ---------------------------------------------------------- Encabezado */
.app-header {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px auto 22px;
  max-width: 1240px;
  padding: 12px 20px;
  border: 1px solid rgba(226, 214, 195, 0.9);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: slideDown 0.5s var(--ease) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 4px;
  border-radius: 16px;
  background: linear-gradient(150deg, #ffffff, #e9ddcd);
  border: 1px solid #e3d6c1;
  box-shadow: 0 8px 18px rgba(156, 107, 63, 0.22);
  transition: transform 0.35s var(--ease);
  overflow: hidden;
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 19px; letter-spacing: 1.2px; }
.brand-text small { color: var(--muted); font-size: 11.5px; letter-spacing: 0.3px; }

.header-actions { display: flex; align-items: center; gap: 9px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #e0d2bd;
  color: #7d5a33;
  font-size: 12px;
  font-weight: 700;
  position: relative;
}
.chip::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(107, 133, 82, 0.2);
}
.chip::after {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  margin-top: -5.5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: 0;
  animation: ripple 2.4s var(--ease) infinite;
  will-change: transform, opacity;
}

/* Aviso de nuevo dispositivo */
.device-notice {
  position: fixed;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: fit-content;
  max-width: min(560px, calc(100vw - 24px));
  margin-inline: auto;
  padding: 12px 8px 12px 14px;
  border-radius: 16px;
  background: #fffdfa;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: var(--shadow);
  animation: noticeIn 0.3s var(--ease) both;
}
.device-notice[hidden] { display: none; }
#device-notice-text {
  min-width: 0;
  overflow-wrap: anywhere;
  padding-top: 1px;
}
.device-notice-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: -8px 0 -8px 0;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.18s, color 0.18s;
}
.device-notice-close:hover { background: var(--accent-soft); color: var(--text); }
.device-notice-close:active { background: var(--accent-soft); }
.menu-wrap { position: relative; }
.menu-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid #e3d5bf;
  background: linear-gradient(160deg, #ffffff, #f4ede1);
  color: #3b2f24;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s;
}
.menu-toggle svg { width: 21px; height: 21px; }
.menu-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.menu-toggle:active { transform: scale(0.96); }
.menu-toggle.open {
  background: linear-gradient(160deg, #e9ddcd, #e2d6c3);
  box-shadow: inset 0 1px 4px rgba(122, 92, 51, 0.18);
}

.app-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 246px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 20px;
  border: 1px solid rgba(226, 214, 195, 0.95);
  background: rgba(252, 254, 255, 0.98);
  box-shadow: 0 20px 44px rgba(60, 47, 33, 0.22);
  animation: popIn 0.22s var(--ease) both;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.app-menu[hidden] { display: none; }
.menu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
}
.menu-item:hover { background: var(--accent-soft); }
.menu-item[hidden] { display: none; }
.menu-title { font-size: 14px; font-weight: 700; }
.menu-sub { font-size: 11.5px; color: var(--muted); }

/* Notificaciones */
.notif-wrap { position: relative; }
.notif-toggle { position: relative; }
.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  border: 2px solid #fdfaf5;
  box-shadow: 0 2px 6px rgba(160, 60, 60, 0.4);
}
.notif-badge[hidden] { display: none; }

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 45;
  width: min(340px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(226, 214, 195, 0.95);
  background: rgba(252, 254, 255, 0.99);
  box-shadow: 0 20px 44px rgba(60, 47, 33, 0.22);
  animation: popIn 0.22s var(--ease) both;
  overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.notif-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.notif-head-text { display: flex; flex-direction: column; gap: 2px; }
.notif-head-text strong { font-size: 14px; }
.notif-head-text small { font-size: 11px; }
.notif-mark {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3730a3;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.notif-mark:hover { background: var(--accent-soft); }
.notif-mark[disabled] { opacity: 0.45; cursor: default; }
.notif-list {
  max-height: min(52vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  display: flex;
  flex-direction: column;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 9px;
  border-radius: 12px;
}
.notif-item + .notif-item { border-top: 1px solid var(--border); border-radius: 0; }
.notif-item.unread { background: #f8f1e5; }
.notif-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #d8cbb8;
}
.notif-item.unread .notif-dot { background: var(--accent); }
.notif-item.type-success .notif-dot { background: var(--ok); }
.notif-item.type-warning .notif-dot { background: #c88a5a; }
.notif-item.type-danger .notif-dot { background: var(--danger); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.notif-title { font-size: 12.5px; font-weight: 700; }
.notif-text { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.notif-time { font-size: 10.5px; color: var(--muted); }
.notif-del {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #b3a08a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.notif-del:hover { background: #f6e3dd; color: var(--danger); }
.notif-del:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.notif-empty { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 12.5px; }
.notif-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.notif-clear {
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a35a4a;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.notif-clear:hover { background: #f6e3dd; }
.notif-clear[disabled] { opacity: 0.4; cursor: default; background: transparent; }

/* Dispositivos conectados */
.modal-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.modal-head-row h3 { margin: 0; min-width: 0; flex: 0 0 auto; font-size: 14px; line-height: 1.2; }
.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 4px;
}
.session-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fdfefe;
  box-shadow: var(--shadow-sm);
}
.session-row.is-current {
  border-color: #dcc9a8;
  background: linear-gradient(150deg, #f5efe6, #e9ddcd);
}
.session-main { flex: 1 1 210px; min-width: 0; }
.session-device {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 14px;
}
.session-meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(107, 133, 82, 0.2);
  position: relative;
}
.online-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: 0;
  animation: ripple 2.4s var(--ease) infinite;
  will-change: transform, opacity;
}
.session-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}
.pill.current { background: #f1e4d3; border-color: #dcc3a3; color: #8a5a2b; }
.pill.trusted { background: #eef2e0; border-color: #cddcb8; color: #55703c; }
.pill.suspicious { background: #fdeceb; border-color: #f3cdc9; color: #a4574f; }
.pill.user { background: #f3ede4; border-color: #ddd0bd; color: #6b5a44; }

/* Usuarios del personal */
.user-new {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.user-new h4 { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.2px; }
.user-new .login-field { margin-bottom: 10px; }
.user-new .btn { width: 100%; }

@media (max-width: 860px) {
  .app-menu { right: -4px; min-width: 232px; }
  .menu-toggle { width: 40px; height: 40px; }
  .notif-panel { right: -49px; }
  .session-row { padding: 12px 13px; }
}

@media (max-width: 560px) {
  .session-actions { width: 100%; }
  .session-actions .btn { flex: 1 1 auto; }
}

/* ---------------------------------------------------------- Pestañas */
.tabs {
  --tabs-pad: 6px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(620px, calc(100% - 24px));
  margin: 0 auto 24px;
  padding: var(--tabs-pad);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.4);
  border: 1px solid rgba(218, 202, 176, 0.95);
  box-shadow: 0 6px 16px rgba(74, 60, 44, 0.07);
  animation: fadeUp 0.5s var(--ease) both;
}
.tabs::before {
  content: '';
  position: absolute;
  top: var(--tabs-pad);
  bottom: var(--tabs-pad);
  left: var(--tabs-pad);
  z-index: 0;
  width: calc((100% - (var(--tabs-pad) * 2)) / 3);
  border-radius: 999px;
  background: linear-gradient(135deg, #b98d63, #9c6b3f);
  box-shadow: 0 8px 18px rgba(156, 107, 63, 0.3);
  transition: transform 0.45s var(--ease);
  will-change: transform;
}
.tabs[data-active="customers"]::before {
  transform: translateX(100%);
}
.tabs[data-active="finance"]::before {
  transform: translateX(200%);
}
.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #6f5c44;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: color 0.25s, transform 0.3s var(--ease);
}
.tab svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.9;
  transition: transform 0.3s var(--ease), opacity 0.25s;
}
.tab:hover { color: #3b2f24; }
.tab:hover svg { transform: translateY(-1px) scale(1.06); }
.tab:active { transform: scale(0.98); }
.tab.active { color: #fffdf9; }
.tab.active svg { opacity: 1; }

/* ---------------------------------------------------------- Contenido */
.content { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 20px 70px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}
.toolbar .row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------- Encabezado de sección */
.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 253, 249, 0.97), rgba(241, 228, 211, 0.88));
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s var(--ease) both;
}
.page-hero h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: 0.2px; }
.page-hero p { margin: 0; color: var(--muted); font-size: 13.5px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------- Calendario de entregas */
.delivery-cal {
  position: relative;
  margin-bottom: 18px;
  padding: 18px 20px 16px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 253, 249, 0.96), rgba(250, 244, 235, 0) 62%),
    linear-gradient(160deg, #fbf6ee 0%, #f2e6d5 100%);
  box-shadow: 0 10px 28px rgba(74, 60, 44, 0.1), 0 2px 6px rgba(74, 60, 44, 0.06);
  animation: fadeUp 0.5s var(--ease) both;
}

.cal-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.cal-toggle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-title { font-size: 18px; font-weight: 800; letter-spacing: 0.2px; }
.cal-sub { color: var(--muted); font-size: 12.5px; }
.cal-toggle-side { display: flex; align-items: center; gap: 10px; flex: none; }
.cal-toggle-month {
  padding: 4px 11px;
  border: 1px solid rgba(226, 214, 195, 0.95);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background 0.25s;
}
.cal-toggle:hover .cal-toggle-month { background: #fffdf9; }
.cal-chevron {
  width: 19px;
  height: 19px;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}
.cal-toggle[aria-expanded="true"] .cal-chevron { transform: rotate(180deg); }
.cal-toggle[aria-expanded="true"] .cal-toggle-month { display: none; }

.cal-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(218, 202, 176, 0.8);
}
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cal-controls { display: flex; align-items: center; gap: 6px; }
.cal-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--st-pendiente-border);
  border-radius: 50%;
  background: #fffdf9;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.cal-arrow svg { width: 16px; height: 16px; }
.cal-arrow:hover { background: var(--accent-soft); color: #6d4523; transform: translateY(-1px); }
.cal-arrow:active { transform: scale(0.94); }
.cal-month {
  min-width: 148px;
  padding: 0 6px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cal-today { padding: 7px 13px; font-size: 12.5px; }

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cal-weekdays { margin-bottom: 6px; }
.cal-weekdays span {
  padding: 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
}

.cal-cell {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-height: 58px;
  padding: 7px 8px;
  border: 1px solid rgba(226, 214, 195, 0.85);
  border-radius: 13px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s var(--ease), box-shadow 0.22s var(--ease), transform 0.22s var(--ease), border-color 0.22s;
}
.cal-cell.is-blank {
  min-height: 58px;
  border-color: transparent;
  background: transparent;
  cursor: default;
  box-shadow: none;
}
.cal-cell:not(.is-blank):hover { background: #fffdf9; border-color: var(--st-pendiente-border); transform: translateY(-1px); }
.cal-num {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cal-slot { display: flex; flex-direction: column; gap: 3px; min-height: 16px; }

.cal-cell.is-today { border-color: var(--accent2); box-shadow: inset 0 0 0 1px rgba(185, 141, 99, 0.28); }
.cal-cell.is-today .cal-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: -2px 0 0 -3px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Solo el punto lleva el estado: la celda se mantiene crema para no competir con la tabla. */
.cal-cell.has-orders { box-shadow: inset 0 0 0 1px var(--cell-border); }
.cal-cell.tone-pendiente { --cell-border: var(--st-pendiente-border); --cell-fg: var(--st-pendiente-fg); --cell-dot: var(--st-pendiente-dot); }
.cal-cell.tone-proceso { --cell-border: var(--st-proceso-border); --cell-fg: var(--st-proceso-fg); --cell-dot: var(--st-proceso-dot); }
.cal-cell.tone-listo { --cell-border: var(--st-listo-border); --cell-fg: var(--st-listo-fg); --cell-dot: var(--st-listo-dot); }
.cal-cell.tone-entregado { --cell-border: var(--st-entregado-border); --cell-fg: var(--st-entregado-fg); --cell-dot: var(--st-entregado-dot); }
.cal-cell.tone-cancelado { --cell-border: var(--st-cancelado-border); --cell-fg: var(--st-cancelado-fg); --cell-dot: var(--st-cancelado-dot); }
.cal-cell.tone-overdue { --cell-border: var(--st-cancelado-border); --cell-fg: var(--st-cancelado-fg); --cell-dot: var(--st-cancelado-dot); }

.cal-pip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  padding: 0;
  color: var(--cell-fg, var(--accent));
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.cal-pip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cell-dot, var(--accent));
  flex: none;
}
.cal-late {
  color: var(--st-cancelado-fg);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.cal-cell.has-orders.is-overdue { box-shadow: inset 0 0 0 1px var(--st-cancelado-border); }

.cal-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 214, 195, 0.9);
}
.cal-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.cal-dot { width: 9px; height: 9px; border-radius: 50%; }
.cal-dot-pendiente { background: var(--st-pendiente-dot); }
.cal-dot-proceso { background: var(--st-proceso-dot); }
.cal-dot-listo { background: var(--st-listo-dot); }
.cal-dot-entregado { background: var(--st-entregado-dot); }
.cal-dot-cancelado { background: var(--st-cancelado-dot); }
.cal-dot-overdue { background: transparent; box-shadow: inset 0 0 0 2px var(--st-cancelado-dot); }

/* ---------------------------------------------------------- Subpestañas de pedidos */
.subtabs {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  margin-bottom: 16px;
  border: 1px solid rgba(218, 202, 176, 0.95);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.5);
  box-shadow: 0 6px 16px rgba(74, 60, 44, 0.07);
  animation: fadeUp 0.55s var(--ease) both;
}
.subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.3s var(--ease), color 0.25s, transform 0.25s;
}
.subtab:hover { color: #3b2f24; transform: translateY(-1px); }
.subtab.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fffdf9;
  box-shadow: 0 8px 16px rgba(156, 107, 63, 0.22);
}
.subtab .count {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #7d6d58;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}
.subtab.active .count { background: rgba(251, 253, 255, 0.24); color: #fffdf9; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fffdf9;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(156, 107, 63, 0.22);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, filter 0.25s;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(156, 107, 63, 0.3); }
.btn:hover::after { left: 120%; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn.secondary:hover { background: #fff; }
.btn.danger { background: linear-gradient(135deg, #c47575, var(--danger)); box-shadow: 0 10px 20px rgba(182, 92, 92, 0.24); }
.btn.small { padding: 8px 15px; font-size: 12.5px; }

/* ---------------------------------------------------------- Resumen */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .stats { grid-template-columns: 1fr; }
}
.stat {
  background: rgba(255, 253, 249, 0.93);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.55s var(--ease) both;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; letter-spacing: -0.5px; color: #3b2f24; }
.stat span { color: var(--muted); font-size: 12.5px; letter-spacing: 0.3px; }
.stat:nth-child(2) { animation-delay: 0.06s; }
.stat:nth-child(3) { animation-delay: 0.12s; }
.stat:nth-child(4) { animation-delay: 0.18s; }
.stat-income b { color: var(--ok); }

/* ---------------------------------------------------------- Finanzas */
.month-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #f9f4ec;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.month-input:focus { border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(185, 141, 99, 0.16); }

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card { margin-bottom: 0; }
@media (max-width: 900px) {
  .finance-grid { grid-template-columns: 1fr; }
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head h3 { margin: 0; font-size: 16px; }
.card-head .muted { font-size: 12px; }

.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 228px;
  padding-top: 8px;
}
.bar-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}
.bar-value {
  height: 18px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(241, 228, 211, 0.2), rgba(241, 228, 211, 0.75));
  overflow: hidden;
}
.bar-fill {
  width: min(46px, 82%);
  min-height: 0;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  box-shadow: 0 6px 14px rgba(156, 107, 63, 0.18);
  transition: height 0.5s var(--ease);
}
.bar-col.current .bar-fill {
  background: linear-gradient(180deg, #8a9c5e, #6b8552);
  box-shadow: 0 6px 14px rgba(107, 133, 82, 0.24);
}
.bar-label {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text);
  text-transform: capitalize;
}
.bar-count { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.donut {
  position: relative;
  width: 158px;
  height: 158px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(#ece2d2 0deg 360deg);
  box-shadow: inset 0 0 0 1px rgba(226, 214, 195, 0.6);
}
.donut-hole {
  position: absolute;
  inset: 27px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(74, 60, 44, 0.1);
}
.donut-hole span { font-size: 15px; font-weight: 800; color: #3b2f24; }
.donut-hole small { font-size: 10.5px; color: var(--muted); }

.legend { display: flex; flex-direction: column; gap: 11px; min-width: 190px; }
.legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-name { color: var(--text); font-weight: 600; }
.legend-value { color: var(--muted); font-weight: 700; white-space: nowrap; }

.card { animation: fadeUp 0.55s var(--ease) both; }
.table-wrap.inner {
  margin-top: 4px;
  border-radius: var(--radius-sm);
  box-shadow: none;
  background: rgba(255, 253, 249, 0.7);
}
.table-wrap.inner .data-table { min-width: 640px; }
.table-wrap.inner .data-table th { top: -1px; }
.data-table tfoot td {
  padding: 14px 16px;
  border-top: 2px solid var(--border);
  font-size: 13px;
  background: rgba(241, 228, 211, 0.5);
}

/* ---------------------------------------------------------- Filtros */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(246, 239, 228, 0.82);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.6s var(--ease) both;
}
.filters input,
.filters select,
.form-row input,
.form-row textarea,
.form-row select {
  padding: 11px 15px;
  background: #f9f4ec;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.form-row textarea { border-radius: var(--radius-sm); }
.filters input { flex: 1 1 260px; min-width: 0; }
.filters select { flex: 0 1 195px; }
.filters input[type="date"] { flex: 0 1 195px; }
.filters input:focus,
.filters select:focus,
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(185, 141, 99, 0.16);
  background: #ffffff;
}
::placeholder { color: #9a8873; opacity: 1; }

/* Desplegables: sin flecha nativa, con chevron propio en cobre.
   El menú de opciones lo pinta .pmenu (ver más abajo). */
select:not(.status-select) {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23877561' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 7px;
  padding-right: 36px;
  cursor: pointer;
}
select:not(.status-select):hover { border-color: var(--accent2); }
select:not(.status-select):disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------------------------------------------------------- Tablas */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.95);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
  animation: fadeUp 0.65s var(--ease) both;
}
.data-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid #f0e7d8;
  vertical-align: middle;
  white-space: nowrap;
}
.data-table th {
  background: linear-gradient(180deg, #f4ede1, #e9ddcd);
  color: #877561;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  position: sticky;
  top: 0;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.25s; animation: rowIn 0.45s var(--ease) both; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.03s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.09s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.12s; }
.data-table tbody tr:hover { background: #f4ede0; }
.data-table .num { text-align: right; }
.data-table .folio { font-weight: 800; color: #9c6b3f; letter-spacing: 0.6px; }
.order-row.is-deleted { background: rgba(247, 227, 220, 0.22); }
.order-row.is-deleted .folio { color: #a9503f; }
.urgent-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: #c0392b;
  border-radius: 999px;
  vertical-align: middle;
}
.pill.urgent {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.12);
  border: 1px solid rgba(192, 57, 43, 0.3);
}
.order-row.is-urgent { border-left: 3px solid #c0392b; }
.deleted-tag {
  margin-top: 3px;
  max-width: 184px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: #a9503f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* La tabla de pedidos tiene 9 columnas: con el relleno general (16 px) no cabe
   en 1280 px y aparece scroll horizontal. Un poco menos de aire la deja entrar. */
#orders-table th,
#orders-table td { padding-left: 9px; padding-right: 9px; }
#orders-table th:first-child,
#orders-table td.cell-check { padding-right: 2px; }
.data-table .actions { display: flex; gap: 7px; align-items: center; }
/* En Eliminados conviven tres botones (Ver, Restaurar, Borrar): compactos para
   que la tabla no gane scroll horizontal en escritorio. */
.order-row.is-deleted .actions .btn { padding: 8px 11px; font-size: 11.5px; }
.data-table .small-text { font-size: 11px; color: var(--muted); }
.status-select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 100%;
  padding: 6px 28px 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--panel2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23877561' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 9px 6px;
  color: #877561;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, filter 0.2s;
}
.status-select:hover { filter: brightness(0.97); }
.status-select:focus-visible { box-shadow: 0 0 0 3px rgba(156, 107, 63, 0.22); }
.status-select.pendiente { background-color: var(--st-pendiente-bg); border-color: var(--st-pendiente-border); color: var(--st-pendiente-fg); }
.status-select.en_proceso { background-color: var(--st-proceso-bg); border-color: var(--st-proceso-border); color: var(--st-proceso-fg); }
.status-select.listo { background-color: var(--st-listo-bg); border-color: var(--st-listo-border); color: var(--st-listo-fg); }
.status-select.entregado { background-color: var(--st-entregado-bg); border-color: var(--st-entregado-border); color: var(--st-entregado-fg); }
.status-select.cancelado { background-color: var(--st-cancelado-bg); border-color: var(--st-cancelado-border); color: var(--st-cancelado-fg); }

.badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: #877561;
  transition: transform 0.25s var(--ease);
}
.badge:hover { transform: scale(1.05); }
.badge.pendiente { background: var(--st-pendiente-bg); border-color: var(--st-pendiente-border); color: var(--st-pendiente-fg); }
.badge.en_proceso { background: var(--st-proceso-bg); border-color: var(--st-proceso-border); color: var(--st-proceso-fg); }
.badge.listo { background: var(--st-listo-bg); border-color: var(--st-listo-border); color: var(--st-listo-fg); }
.badge.entregado { background: var(--st-entregado-bg); border-color: var(--st-entregado-border); color: var(--st-entregado-fg); }
.badge.cancelado { background: var(--st-cancelado-bg); border-color: var(--st-cancelado-border); color: var(--st-cancelado-fg); }

.wa { color: #4e8f63; text-decoration: none; font-weight: 600; white-space: nowrap; }
.wa:hover { text-decoration: underline; }
.wa-icon {
  font-size: 9.5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}

/* ---------------------------------------------------------- Modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(49, 38, 26, 0.42);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  overflow-x: hidden;
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.25s ease both; }
.modal {
  background: linear-gradient(180deg, #ffffff, #f4ede1);
  border: 1px solid var(--border);
  border-radius: 30px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.4s var(--ease) both;
}
.modal h3 { margin: 0 0 16px; font-size: 20px; }
.modal-compact { padding: 18px; }
.modal-compact h3 { margin: 0 0 10px; font-size: 18px; }
.modal-compact .form-row { margin-bottom: 9px; }
.modal-compact .form-row label { margin-bottom: 4px; font-size: 12px; }
.modal-compact .form-grid { gap: 9px; }
.modal-compact .date-group { gap: 6px; }
.modal-compact .modal-actions { margin-top: 12px; gap: 8px; }
.form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.form-row input,
.form-row textarea,
.form-row select { width: 100%; }
.form-row textarea { min-height: 82px; resize: vertical; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.date-group { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: 8px; }
.date-group select { width: 100%; min-width: 0; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel2);
  max-width: 100%;
}
.seg {
  padding: 9px 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.3s var(--ease), color 0.25s, transform 0.25s;
}
.seg:hover { transform: translateY(-1px); }
.seg.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fffdf9;
  box-shadow: 0 8px 16px rgba(156, 107, 63, 0.22);
}

/* ---------------------------------------------------------- Validación y buscador */
.field-error {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #a9503f;
}
.field-error:empty { display: none; }

/* Pista del abono en el formulario de pedido */
.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.field-hint.paid { color: #55703c; font-weight: 700; }
.data-table .cell-cost .small-text.paid { color: #55703c; font-weight: 700; }
.form-row.invalid input,
.form-row.invalid textarea,
.form-row.invalid select {
  border-color: #c4695a;
  background: #fdf1ee;
  box-shadow: 0 0 0 4px rgba(182, 92, 92, 0.15);
}
.form-alert {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #e7bdb4;
  background: #fbe8e3;
  color: #8c3c2d;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}
.form-alert[hidden] { display: none; }
.form-alert.warning {
  border-color: #ecd6ac;
  background: #fdf3dd;
  color: #8a6420;
}

.client-picker { position: relative; }
.picker-results {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f5efe6;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
}
.picker-results[hidden] { display: none; }
.picker-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s;
}
.picker-item:hover,
.picker-item.active { background: var(--accent-soft); }
.picker-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.picker-meta { font-size: 11.5px; color: var(--muted); }
.picker-empty { padding: 11px 12px; font-size: 12.5px; color: var(--muted); }
.picker-info {
  margin-top: 7px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #9c6b3f;
  font-size: 12px;
  font-weight: 600;
}
.picker-info[hidden] { display: none; }

.mini-list { display: grid; gap: 9px; }
.mini-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(250, 246, 238, 0.9);
}
.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}
.mini-head b { font-size: 14px; color: #9c6b3f; letter-spacing: 0.4px; }
.mini-meta { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.mini-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---------------------------------------------------------- Fotos */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: block;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.3s;
}
.gallery a:hover img { transform: scale(1.04) rotate(-1deg); box-shadow: var(--shadow); }

/* Visor de fotos: vista previa dentro de la app con zoom por gestos. */
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(10, 8, 6, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}
.photo-viewer[hidden] { display: none; }
body.viewer-open { overflow: hidden; }
.photo-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}
.photo-viewer .viewer-close,
.viewer-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(20, 16, 12, 0.85);
  color: #ffffff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 3001;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0,0,0,0.3);
  touch-action: manipulation;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.photo-viewer .viewer-close:hover { background: rgba(0, 0, 0, 0.95); transform: scale(1.06); }
.photo-viewer .viewer-close:active { transform: scale(0.92); }
.photo-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.file-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.photo-thumb { position: relative; animation: popIn 0.35s var(--ease) both; }
.photo-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: block;
}
.photo-remove {
  position: absolute;
  top: -7px; right: -7px;
  width: 27px; height: 27px;
  border-radius: 50%;
  border: 2px solid #fffdf9;
  background: var(--danger);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease);
}
.photo-remove:hover { transform: scale(1.12) rotate(90deg); }

/* ---------------------------------------------------------- Varios */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.card .muted { color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 14.5px;
  background: rgba(255, 253, 249, 0.8);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 14px;
  animation: fadeUp 0.5s var(--ease) both;
}
.muted { color: var(--muted); }

/* ---------------------------------------------------------- Detalle del pedido */
.detail-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.detail-status-row .badge { font-size: 12px; padding: 4px 10px; }
.detail-status-row .muted { font-size: 13px; }

.detail-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
.detail-block { min-width: 0; }
.detail-block-wide { grid-column: 1 / -1; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.detail-block-title {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-dl { display: grid; gap: 6px; margin: 0; }
.detail-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.4;
}
.detail-row dt {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  margin: 0;
}
.detail-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.detail-row dd .wa { font-size: 12px; margin-left: 6px; }

.detail-warn {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(182, 92, 92, 0.08);
  border: 1px solid rgba(182, 92, 92, 0.28);
  border-radius: 12px;
}
.detail-warn .detail-note-text { color: #8a3f3f; }

.detail-note-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail-block-wide .detail-note-text { margin-top: 4px; }

.detail-photos { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.detail-photos-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.detail-photos-head .detail-block-title { margin: 0; }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .detail-blocks { grid-template-columns: 1fr; gap: 14px; }
  .detail-actions .btn { flex: 1 1 auto; }
  .detail-row { grid-template-columns: 78px minmax(0, 1fr); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes noticeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ripple {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.6); opacity: 0; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(1.5%, -1.5%, 0); }
  100% { transform: translate3d(-1%, 1%, 0); }
}

/* ---------------------------------------------------------- Móvil y tablet vertical */
@media (max-width: 860px) {
  .app-header {
    top: 6px;
    margin: 6px 8px 12px;
    padding: 9px 12px;
    border-radius: 20px;
  }
  .brand-mark { width: 36px; height: 36px; border-radius: 12px; font-size: 11px; }
  .brand-text strong { font-size: 15.5px; }
  .brand-text small { font-size: 10px; }
  .chip { display: none; }
  .tabs { width: calc(100% - 16px); margin: 0 auto 12px; padding: 4px; --tabs-pad: 4px; }
  .tab { padding: 9px 8px; font-size: 12.5px; gap: 5px; }
  .tab svg { width: 15px; height: 15px; }
  .content { padding: 0 10px 46px; }
  .toolbar h2 { font-size: 18px; }
  .data-table { min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; }
  .page-hero { padding: 13px 14px; border-radius: 18px; margin-bottom: 12px; gap: 10px; }
  .page-hero h2 { font-size: 18.5px; margin-bottom: 2px; }
  .page-hero p { font-size: 12px; line-height: 1.4; }
  .hero-actions { width: 100%; gap: 6px; }
  .hero-actions .btn { flex: 1 1 auto; padding: 9px 11px; }
  .delivery-cal { padding: 12px 12px 12px; border-radius: 18px; margin-bottom: 12px; }
  .cal-toggle { gap: 8px; }
  .cal-title { font-size: 16px; }
  .cal-sub { font-size: 11.5px; }
  .cal-toggle-side { gap: 7px; }
  .cal-toggle-month { padding: 3px 9px; font-size: 10.5px; }
  .cal-chevron { width: 17px; height: 17px; }
  .cal-panel { margin-top: 10px; padding-top: 10px; }
  .cal-toolbar { margin-bottom: 8px; }
  .cal-controls { gap: 4px; }
  .cal-arrow { width: 30px; height: 30px; }
  .cal-arrow svg { width: 14px; height: 14px; }
  .cal-month { min-width: 116px; font-size: 12.5px; }
  .cal-today { padding: 6px 10px; font-size: 12px; }
  .cal-weekdays,
  .cal-grid { gap: 4px; }
  .cal-weekdays span { font-size: 9.5px; letter-spacing: 0.6px; }
  .cal-cell { min-height: 46px; padding: 5px 6px; border-radius: 10px; }
  .cal-cell.is-blank { min-height: 46px; }
  .cal-num { font-size: 11px; }
  .cal-pip { padding: 0; font-size: 10px; line-height: 1.3; }
  .cal-late { font-size: 8.5px; }
  .cal-legend { gap: 4px 8px; margin-top: 8px; padding-top: 8px; }
  .cal-leg { font-size: 10px; }
  .month-input { flex: 1 1 150px; padding: 9px 11px; }
  .subtabs { width: 100%; margin-bottom: 12px; padding: 4px; }
  .subtab { flex: 1; justify-content: center; gap: 5px; padding: 8px 6px; font-size: 11.5px; }
  .subtab .count { min-width: 20px; padding: 1px 6px; font-size: 10.5px; }
  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
    margin-bottom: 12px;
  }
  .filters input { min-width: 0; width: 100%; padding: 9px 12px; }
  .filters select { min-width: 0; width: 100%; padding: 9px 34px 9px 12px; grid-column: 1 / -1; }
  .filters #order-clear,
  .filters #customer-clear {
    grid-column: 2;
    grid-row: 1;
    padding: 9px 13px;
    font-size: 12.5px;
    line-height: 1;
  }

  .stats { gap: 8px; margin-bottom: 14px; }
  .stat { padding: 11px 13px; border-radius: 16px; }
  .stat b { font-size: 20px; }
  .stat span { font-size: 11px; }
  .finance-grid { gap: 10px; margin-bottom: 12px; }
  .card { padding: 14px; border-radius: 20px; margin-bottom: 12px; }
  .card-head { margin-bottom: 10px; gap: 6px; }
  .card-head h3 { font-size: 14.5px; }
  .card-head .muted { font-size: 10.5px; }
  .bars { height: 155px; gap: 3px; padding-top: 4px; }
  .bar-value { height: 14px; font-size: 7.5px; }
  .bar-label { margin-top: 5px; font-size: 10px; }
  .bar-count { font-size: 9px; }
  .bar-fill { width: min(30px, 78%); }
  .donut-wrap { flex-direction: column; gap: 12px; }
  .donut { width: 128px; height: 128px; }
  .donut-hole { inset: 22px; }
  .donut-hole span { font-size: 12.5px; }
  .legend { width: 100%; min-width: 0; gap: 8px; }
  .legend-item { grid-template-columns: 9px minmax(0, 1fr) auto; gap: 6px; font-size: 11px; }
  .legend-dot { width: 9px; height: 9px; }
  .legend-value { font-size: 10.5px; }
  .table-wrap.inner .data-table { min-width: 0; width: 100%; }
  .table-wrap.inner .data-table th,
  .table-wrap.inner .data-table td { padding: 9px 8px; font-size: 11.5px; }

  /* Tablas convertidas en tarjetas para que nada se salga del margen */
  #tab-orders .table-wrap,
  #tab-customers .table-wrap,
  .table-wrap.inner {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  #orders-table,
  #customers-table,
  #orders-table tbody,
  #customers-table tbody,
  .table-wrap.inner .data-table,
  .table-wrap.inner .data-table tbody { display: block; width: 100%; min-width: 0; }
  #orders-table thead,
  #customers-table thead,
  .table-wrap.inner .data-table thead { display: none; }

  #orders-table tr.order-row,
  #customers-table tr.customer-row,
  .table-wrap.inner .data-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    margin-bottom: 9px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
  }
  #orders-table tr.order-row:last-child,
  #customers-table tr.customer-row:last-child,
  .table-wrap.inner .data-table tbody tr:last-child { margin-bottom: 0; }
  #orders-table td,
  #customers-table td,
  .table-wrap.inner .data-table td {
    display: block;
    padding: 0;
    border: 0;
    white-space: normal;
    font-size: 12.5px;
    line-height: 1.35;
  }
  #orders-table td::before,
  #customers-table td::before,
  .table-wrap.inner .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
  }

  /* Pedidos */
  #orders-table tr.order-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 0; }
  #orders-table td.cell-check { grid-area: 1 / 1; align-self: start; }
  #orders-table td.cell-check::before { display: none; }
  #orders-table td.folio { grid-area: 1 / 2; font-size: 11.5px; }
  #orders-table td.folio::before,
  #orders-table td.cell-status::before,
  #orders-table td.cell-client::before { display: none; }
  #orders-table td.cell-status { grid-area: 1 / 3; justify-self: end; align-self: start; }
  #orders-table td.cell-status .status-select {
    padding: 4px 22px 4px 10px;
    font-size: 10.5px;
    background-position: right 8px center;
    background-size: 8px 5px;
  }
  #orders-table td.cell-client { grid-area: 2 / 1 / 3 / 4; }
  #orders-table td.cell-client b { font-size: 14.5px; }
  #orders-table td.cell-client .small-text { font-size: 10.5px; }
  #orders-table td.cell-phone { grid-area: 3 / 1 / 4 / 3; padding-top: 6px; padding-right: 12px; border-top: 1px solid var(--border); }
  #orders-table td.cell-cost { grid-area: 3 / 3; padding-top: 6px; border-top: 1px solid var(--border); text-align: right; }
  #orders-table td.cell-cost::before { text-align: right; }
  #orders-table td.cell-service { grid-area: 4 / 1; }
  #orders-table td.cell-date { grid-area: 4 / 3; text-align: right; }
  #orders-table td.cell-photos { display: none; }
  #orders-table td.actions { grid-area: 5 / 1 / 6 / 4; display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
  #orders-table td.actions .btn { flex: 1; }

  /* Pedido eliminado: no lleva casilla, así que el folio gana todo el ancho y
     la etiqueta «Eliminado …» ya no se parte en varias líneas. */
  #orders-table tr.order-row.is-deleted { grid-template-columns: minmax(0, 1fr) auto; }
  #orders-table tr.order-row.is-deleted td.cell-check { display: none; }
  #orders-table tr.order-row.is-deleted td.folio { grid-area: 1 / 1; }
  #orders-table tr.order-row.is-deleted td.cell-status { grid-area: 1 / 2; }
  #orders-table tr.order-row.is-deleted td.cell-status .badge { padding: 4px 9px; font-size: 10.5px; }
  #orders-table tr.order-row.is-deleted td.cell-client { grid-area: 2 / 1 / 3 / 3; }
  #orders-table tr.order-row.is-deleted td.cell-phone { grid-area: 3 / 1; }
  #orders-table tr.order-row.is-deleted td.cell-cost { grid-area: 3 / 2; }
  #orders-table tr.order-row.is-deleted td.cell-service { grid-area: 4 / 1; }
  #orders-table tr.order-row.is-deleted td.cell-date { grid-area: 4 / 2; }
  #orders-table tr.order-row.is-deleted td.actions { grid-area: 5 / 1 / 6 / 3; }
  #orders-table tr.order-row.is-deleted .deleted-tag {
    margin-top: 2px;
    max-width: 100%;
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Clientes */
  #customers-table td.cell-client { grid-area: 1 / 1; }
  #customers-table td.cell-client::before,
  #customers-table td.cell-phone::before,
  #customers-table td.cell-email::before { display: none; }
  #customers-table td.cell-client b { font-size: 14.5px; }
  #customers-table td.cell-count {
    grid-area: 1 / 2;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--panel2);
    font-size: 11.5px;
    font-weight: 800;
    color: #877561;
  }
  #customers-table td.cell-count::before { margin: 0; font-size: 8.5px; }
  #customers-table td.cell-phone { grid-area: 2 / 1 / 3 / 3; font-size: 12px; }
  #customers-table td.cell-email { grid-area: 3 / 1 / 4 / 3; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
  #customers-table td.actions { grid-area: 4 / 1 / 5 / 3; display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
  #customers-table td.actions .btn { flex: 1; }

  /* Estado de cuenta */
  #finance-statement-body tr td::before,
  #finance-pending-body tr td::before { display: none; }
  .table-wrap.inner .data-table tbody tr.statement-row { gap: 4px 10px; padding: 11px 13px; }
  .statement-row td.folio { grid-area: 1 / 1; font-size: 11.5px; }
  .statement-row td.cell-cost { grid-area: 1 / 2; text-align: right; font-size: 13px; font-weight: 800; color: #3b2f24; }
  .statement-row td.cell-client { grid-area: 2 / 1 / 3 / 3; font-size: 13px; font-weight: 700; }
  .statement-row td.cell-service { grid-area: 3 / 1; font-size: 11.5px; color: var(--muted); }
  .statement-row td.cell-date { grid-area: 3 / 2; text-align: right; font-size: 11.5px; color: var(--muted); }
  .table-wrap.inner .data-table tbody tr.statement-row td.cell-status { display: none; }
  .table-wrap.inner .data-table tfoot,
  .table-wrap.inner .data-table tfoot tr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(241, 228, 211, 0.55);
  }
  .table-wrap.inner .data-table tfoot td {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12.5px;
  }

  /* Saldos por cliente */
  .table-wrap.inner .data-table tbody tr.balance-row { gap: 4px 10px; padding: 11px 13px; }
  .balance-row td.cell-client { grid-area: 1 / 1; font-size: 13.5px; }
  .balance-row td.cell-cost { grid-area: 1 / 2; text-align: right; font-size: 13px; font-weight: 800; color: #9c6b3f; }
  .balance-row td.cell-phone { grid-area: 2 / 1; font-size: 11.5px; }
  .balance-row td.cell-count { grid-area: 2 / 2; text-align: right; font-size: 11px; color: var(--muted); }
  .balance-row td.actions { grid-area: 3 / 1 / 4 / 3; padding-top: 6px; }
  .table-wrap.inner .data-table tbody tr.balance-row td.actions { display: flex; }
  .balance-row td.actions .btn { width: 100%; }

  .modal { padding: 18px; border-radius: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .date-group { gap: 6px; }
  .date-group select { padding: 10px 36px 10px 10px; background-position: right 12px center; }
  .modal-actions { gap: 8px; }
  .modal-actions .btn { flex: 1; }
  .seg { padding: 8px 12px; font-size: 12.5px; }
  .picker-results { max-height: 200px; }
  .picker-name { font-size: 14px; }
  .form-alert { font-size: 12px; padding: 10px 12px; }
  #customers-table td.actions .btn { padding-left: 6px; padding-right: 6px; font-size: 11.5px; }
  .mini-item { padding: 11px 12px; border-radius: 14px; }
  input, select, textarea { font-size: 16px; } /* evita zoom en iOS */
  .btn { font-size: 13.5px; }
  .btn.small { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}

/* ---------------------------------------------------------- Login */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 26px 18px;
}
.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  animation: popIn 0.6s var(--ease) both;
}
.login-card {
  position: relative;
  background: rgba(255, 253, 249, 0.95);
  border: 1px solid var(--border);
  border-radius: 34px;
  padding: 40px 32px 32px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  text-align: center;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: -90px; right: -70px;
  width: 210px; height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 141, 99, 0.28), rgba(185, 141, 99, 0));
  animation: floaty 7s ease-in-out infinite;
}
.login-card::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -80px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(131, 141, 92, 0.18), rgba(131, 141, 92, 0));
  animation: floaty 9s ease-in-out infinite reverse;
}
.login-inner { position: relative; z-index: 1; }
.login-logo {
  display: grid;
  place-items: center;
  width: 96px; height: 96px;
  margin: 0 auto 20px;
  padding: 12px;
  border-radius: 30px;
  background: linear-gradient(150deg, #ffffff, #e9ddcd);
  border: 1px solid #e3d6c1;
  box-shadow: 0 16px 30px rgba(156, 107, 63, 0.22);
  animation: floaty 5s ease-in-out infinite;
}
.login-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-card h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: 0.4px; }
.login-card p { margin: 0 0 26px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.login-card .btn { width: 100%; padding: 14px; margin-top: 6px; }
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 7px; }
.login-field input {
  width: 100%;
  padding: 15px 20px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #f9f4ec;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.login-field select {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #f9f4ec;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.login-field select:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(185, 141, 99, 0.18);
}
.login-field input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(185, 141, 99, 0.18);
}
.login-error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  opacity: 0;
  transition: opacity 0.25s;
}
.login-error.show { opacity: 1; }
.login-foot { margin-top: 22px; font-size: 11.5px; color: #a39580; }

/* ---------------------------------------------------------- Conectar */
.connect-wrap { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 10px 20px 70px; }
.connect-card {
  background: rgba(255, 253, 249, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s var(--ease) both;
}
.connect-url {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  color: #9c6b3f;
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 14px 24px;
  border-radius: 999px;
  margin: 10px 0 6px;
  cursor: pointer;
  user-select: all;
  word-break: break-all;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.connect-url:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.qr-box {
  background: #fff;
  padding: 16px;
  border-radius: 26px;
  display: inline-block;
  margin: 20px 0 8px;
  box-shadow: var(--shadow);
  animation: popIn 0.7s var(--ease) both;
}
.qr-box img { display: block; width: min(320px, 70vw); height: auto; border-radius: 12px; }
.steps { text-align: left; max-width: 520px; margin: 24px auto 0; color: var(--text); padding-left: 22px; }
.steps li { margin: 11px 0; line-height: 1.55; }
.tiny { color: var(--muted); font-size: 13px; line-height: 1.55; }
.copied { color: var(--ok); font-size: 13px; min-height: 18px; font-weight: 600; }

/* ---------------------------------------------------------- Móvil: Conectar */
@media (max-width: 860px) {
  .connect-wrap { padding: 0 10px 46px; }
  .connect-card { padding: 22px 16px; border-radius: 20px; }
  .connect-url {
    max-width: 100%;
    font-size: 19px;
    padding: 12px 18px;
    gap: 8px;
    word-break: normal;
    overflow-wrap: anywhere;
  }
}

/* ---------------------------------------------------------- Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  body::before { animation: none; }
  .tabs::before { transition: none; }
}

/* ---------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--panel);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 4000;
  max-width: min(420px, calc(100vw - 24px));
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success {
  background: rgba(107, 133, 82, 0.15);
  border: 1px solid var(--ok);
  color: var(--ok);
}
.toast.error {
  background: rgba(182, 92, 92, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}
.toast.warning {
  background: rgba(200, 138, 90, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent2);
}

/* ---------------------------------------------------------- Estados vacíos */
.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.empty h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}
.empty p {
  font-size: 14px;
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}
.empty .btn {
  margin-top: 20px;
}

/* ---------------------------------------------------------- Galería: reordenar y favoritas */
.gallery-item {
  position: relative;
}
.gallery-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}
.gallery-item.drag-over {
  border: 2px dashed var(--accent);
}
.gallery-item.favorite::before {
  content: '⭐';
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 18px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ---------------------------------------------------------- Banner deshacer */
/* Aviso de servidor caído: el service worker pinta la app desde la caché,
   así que sin este banner una app sin servidor parece que sigue encendida. */
.offline-banner {
  position: relative;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-bottom: 1px solid #ecd6ac;
  background: #fdf3dd;
  color: var(--accent2);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.offline-banner[hidden] { display: none; }

.offline-banner strong { font-size: 13.5px; }
.offline-banner code {
  font-family: inherit;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(200, 138, 90, 0.18);
}
.offline-banner .btn {
  font-size: 12px;
  padding: 4px 12px;
}

@media (max-width: 520px) {
  .offline-banner { gap: 6px; padding: 8px 10px; font-size: 12.5px; }
  .offline-banner span { flex-basis: 100%; }
}

.undo-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 4001;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.undo-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.undo-banner-text {
  color: var(--text);
  font-size: 14px;
}
.undo-banner .btn {
  font-size: 13px;
  padding: 6px 16px;
}

/* ---------------------------------------------------------- Menú de <select> */
.pmenu {
  position: fixed;
  z-index: 4000;
  padding: 6px;
  border-radius: 16px;
  background: #fffdfa;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(74, 60, 44, 0.18), 0 2px 6px rgba(74, 60, 44, 0.08);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: pmenuIn 0.16s var(--ease) both;
}
@keyframes pmenuIn {
  from { opacity: 0; transform: translateY(-5px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pmenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.pmenu-item + .pmenu-item { margin-top: 1px; }
.pmenu-item:hover,
.pmenu-item.is-active { background: var(--accent-soft); }
.pmenu-item.is-selected { color: var(--accent); font-weight: 700; }
.pmenu-item.is-selected .pmenu-check { opacity: 1; }
.pmenu-item:disabled { opacity: 0.45; cursor: not-allowed; }
.pmenu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pmenu-check {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.12s;
}

/* Vista previa del color de cada estado dentro del menú */
.pmenu-item[data-status] { font-weight: 600; }
.pmenu-item[data-status] .pmenu-label { color: var(--st-fg); }
.pmenu-item[data-status] .pmenu-check { color: var(--st-fg); }
.pmenu-item[data-status]:hover,
.pmenu-item[data-status].is-active { background: var(--st-tint); }
.pmenu-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--st-dot);
  box-shadow: 0 0 0 3px var(--st-tint);
}
.pmenu-item[data-status="pendiente"] {
  --st-fg: var(--st-pendiente-fg);
  --st-dot: var(--st-pendiente-dot);
  --st-tint: rgba(224, 123, 40, 0.15);
}
.pmenu-item[data-status="en_proceso"] {
  --st-fg: var(--st-proceso-fg);
  --st-dot: var(--st-proceso-dot);
  --st-tint: rgba(211, 163, 12, 0.17);
}
.pmenu-item[data-status="listo"] {
  --st-fg: var(--st-listo-fg);
  --st-dot: var(--st-listo-dot);
  --st-tint: rgba(47, 127, 209, 0.13);
}
.pmenu-item[data-status="entregado"] {
  --st-fg: var(--st-entregado-fg);
  --st-dot: var(--st-entregado-dot);
  --st-tint: rgba(47, 158, 95, 0.14);
}
.pmenu-item[data-status="cancelado"] {
  --st-fg: var(--st-cancelado-fg);
  --st-dot: var(--st-cancelado-dot);
  --st-tint: rgba(207, 68, 56, 0.13);
}
.pmenu::-webkit-scrollbar { width: 8px; }
.pmenu::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}
@media (max-width: 640px) {
  .pmenu { border-radius: 18px; }
  .pmenu-item { padding: 12px 12px; font-size: 14.5px; }
}

/* ---------------------------------------------------------- Utilidades (migradas de style="...") */
.menu-foot {
  padding: 8px 14px;
  font-size: 11px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.modal-w-420 { max-width: 420px; }
.modal-w-480 { max-width: 480px; }
.modal-w-560 { max-width: 560px; }
.modal-w-680 { max-width: 680px; }
.modal-w-700 { max-width: 700px; }
.modal-w-760 { max-width: 760px; }
.modal-scroll { max-height: 80vh; }
.mt-8 { margin-top: 8px; }
.mb-20 { margin-bottom: 20px; }
.note-tight { margin-top: -4px; }
.summary-note { margin: -6px 0 14px; }
.viewer-download { right: 52px; }
.empty.padded { padding: 20px; }
.empty.padded-sm { padding: 16px; }
.connect-title { margin: 0; font-size: 22px; }
.connect-note { margin-top: 24px; }

/* Caja de la guía de instalación (antes con estilos inline) */
.guide-box {
  text-align: left;
  margin: 20px 0;
  padding: 16px;
  background: var(--panel2);
  border-radius: var(--radius-sm);
}
.guide-box h4 { margin: 0 0 12px; font-size: 15px; }
.guide-box ol {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

/* Contenido del changelog convertido desde Markdown */
.changelog-body { line-height: 1.8; font-size: 14px; }
.changelog-body h2 { margin: 28px 0 14px; }
.changelog-body h3 { margin: 24px 0 12px; color: var(--text); }
.changelog-body h4 { margin: 20px 0 10px; color: var(--accent); }
.changelog-body ul { margin: 12px 0; padding-left: 24px; }
.changelog-body code {
  background: var(--panel2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
}

/* Ojo de la contraseña (movido del <style> de login.html) */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s, background 0.2s;
}
.password-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.password-toggle svg { width: 18px; height: 18px; }

/* Puntos de leyenda por servicio (antes con background inline) */
.legend-dot.mantenimiento { background: #c28e4b; }
.legend-dot.reparacion { background: #7d8f52; }
.legend-dot.fabricacion { background: #a56a4c; }

/* ---------------------------------------------------------- Selección múltiple de pedidos */
.cell-check { width: 36px; text-align: center; }
.cell-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  animation: fadeUp 0.3s var(--ease) both;
}
.bulk-count { font-size: 13px; font-weight: 700; color: var(--text); }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------- Paginador */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.pager-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.pager .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------------------------------------------------------- Reporte anual compacto */
.hero-inline-actions { display: inline-flex; gap: 8px; align-items: center; }
.year-input {
  width: 92px;
  padding: 9px 12px;
  background: #f9f4ec;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  text-align: center;
}
.year-input:focus { border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(185, 141, 99, 0.16); }

.year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.year-tile {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  min-width: 0;
}
.year-tile-month { font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.year-tile-income { font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.year-tile-meta { font-size: 10.5px; color: var(--muted); }
.year-tile.inactive { opacity: 0.5; }
.year-tile.current { border-color: var(--accent2); background: var(--accent-soft); }
.year-tile.current .year-tile-month { color: var(--accent); }
.year-tile.total {
  background: #efe3d2;
  border-color: var(--accent2);
  /* El total abarca todo el ancho de la tarjeta */
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.year-tile.total .year-tile-month { color: var(--accent); font-size: 12.5px; }
.year-tile.total .year-tile-income { color: var(--accent); font-size: 19px; }
.year-tile.total .year-tile-meta { font-size: 12px; }

/* Notas del cliente bajo el nombre en la tabla */
.customer-notes {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Botón de favorita sobre cada foto */
.photo-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.92);
  color: #b3a48c;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(74, 60, 44, 0.25);
  transition: transform 0.15s var(--ease), color 0.15s;
}
.photo-fav:hover { transform: scale(1.12); }
.photo-fav[aria-pressed="true"] { color: #d3a30c; }
.photo-share {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.92);
  color: #6b7c5e;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(74, 60, 44, 0.25);
  transition: transform 0.15s var(--ease);
}
.photo-share:hover { transform: scale(1.12); }

/* Pasos ‹ › para reordenar en pantallas táctiles (también útiles con ratón) */
.photo-step-group {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
}
.photo-step {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.92);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(74, 60, 44, 0.25);
  transition: transform 0.15s var(--ease);
}
.photo-step:hover { transform: scale(1.12); background: #fff; }
.photo-tile { position: relative; }
.photo-tile.dragging { opacity: 0.5; transform: scale(0.95); }
.photo-tile.drag-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.gallery-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }

/* Meses sin actividad: las fichas usan .year-tile.inactive; la fila quedó sin uso. */

@media (max-width: 640px) {
  /* Resumen anual: 13 fichas en 2 columnas en móvil */
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------- Interruptor de avisos (campanita) */
.notif-push-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 12px 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel2);
  cursor: pointer;
  user-select: none;
}
.notif-push-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.notif-push-text b { font-size: 12.5px; color: var(--text); }
.notif-push-text small { font-size: 11px; color: var(--muted); }
.notif-push-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.notif-switch {
  flex: 0 0 auto;
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: #d8cbb6;
  position: relative;
  transition: background 0.2s;
}
.notif-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(74, 60, 44, 0.3);
  transition: transform 0.2s var(--ease);
}
.notif-push-row input:checked + .notif-switch { background: var(--accent); }
.notif-push-row input:checked + .notif-switch::after { transform: translateX(19px); }
.notif-push-row input:focus-visible + .notif-switch {
  outline: 2px solid rgba(156, 107, 63, 0.62);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .bulk-bar { align-items: stretch; flex-direction: column; }
  .bulk-actions .btn { flex: 1; }
  .cell-check { width: 30px; }
}
