* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --azul: #003366; --rojo: #CC0000; --fondo: #f0f2f5; --gris: #555; --borde: #cfd4dc; --claro: #E8EAF6; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--fondo); color: #222; font-size: 16px; line-height: 1.35; }
button { font: inherit; }

.header { background: var(--azul); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.header h1 { font-size: 18px; }
.header .sub { font-size: 15px; opacity: .85; }
.header button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 8px; padding: 8px 12px; font-size: 15px; cursor: pointer; min-height: 44px; }

.total-sticky { position: sticky; top: 68px; z-index: 99; background: var(--rojo); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-weight: bold; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.total-sticky .lbl { font-size: 15px; }
.total-sticky .amt { font-size: 22px; }

.content { max-width: 620px; margin: 0 auto; padding: 12px 16px 24px; }
.section { background: #fff; border-radius: 10px; margin-bottom: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.section-title { background: var(--azul); color: #fff; padding: 10px 14px; font-size: 15px; font-weight: bold; text-transform: uppercase; letter-spacing: .3px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-group { padding: 14px; }
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label, .lbl-campo { display: block; font-size: 15px; color: var(--gris); font-weight: bold; margin-bottom: 5px; }
input[type=text], input[type=tel], input[type=number], input[type=email], input[type=date], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--borde); border-radius: 8px; font-size: 16px; background: #fafafa; color: #222; min-height: 46px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul); outline-offset: 0; background: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; font-size: 16px; min-height: 44px; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.slider { position: absolute; inset: 0; background: #bbb; border-radius: 28px; transition: .2s; pointer-events: none; }
.slider:before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--azul); }
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--azul); outline-offset: 2px; }

.tag-nuevo { background: var(--rojo); color: #fff; font-size: 15px; font-weight: bold; border-radius: 6px; padding: 2px 8px; }
.search-wrap { position: relative; }
.cliente-dropdown { position: absolute; left: 0; right: 0; background: #fff; border: 1px solid var(--azul); border-radius: 0 0 8px 8px; max-height: 280px; overflow-y: auto; z-index: 200; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.cliente-opt { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #eee; padding: 11px 12px; cursor: pointer; }
.cliente-opt:hover, .cliente-opt:focus { background: var(--claro); outline: none; }
.cliente-opt strong { display: block; font-size: 16px; color: var(--azul); }
.cliente-opt span { font-size: 15px; color: #666; }
.elegido { margin-top: 8px; font-size: 15px; color: var(--azul); font-weight: bold; }

.svc-item { border-top: 1px solid #eee; }
.svc-item:first-child { border-top: 0; }
.svc-header { display: flex; align-items: center; padding: 12px 14px; gap: 12px; cursor: pointer; min-height: 52px; }
.svc-chk { width: 24px; height: 24px; accent-color: var(--azul); flex-shrink: 0; cursor: pointer; }
.svc-name { flex: 1; font-size: 15px; line-height: 1.3; }
.svc-sub { font-weight: bold; font-size: 15px; color: var(--azul); white-space: nowrap; }
.svc-detail { display: none; padding: 0 14px 14px 50px; }
.svc-detail.open { display: block; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; padding: 14px 18px; font-size: 16px; font-weight: bold; cursor: pointer; text-decoration: none; min-height: 50px; }
.btn-primario { width: 100%; background: var(--azul); color: #fff; border: 0; font-size: 17px; }
.btn-primario:disabled { background: #888; cursor: not-allowed; }
.btn-borde { background: #fff; color: var(--azul); border: 2px solid var(--azul); }
.btn-lleno { background: var(--azul); color: #fff; border: 2px solid var(--azul); }

.aviso { display: none; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 15px; }
.aviso.error { background: #FDECEA; border: 1px solid var(--rojo); color: #7a1a14; }
.aviso.ok { background: #E8F5E9; border: 1px solid #2E7D32; color: #1B5E20; }
.aviso ul { padding-left: 20px; margin-top: 4px; }
.aviso strong { display: block; }

.exito { text-align: center; background: #fff; border-radius: 12px; padding: 30px 18px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.exito h2 { color: var(--azul); font-size: 22px; margin-bottom: 6px; }
.exito p { color: var(--gris); font-size: 16px; margin-bottom: 18px; }
.exito .botones { display: flex; flex-direction: column; gap: 10px; }

.lista-ordenes a { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid #eee; color: #222; text-decoration: none; font-size: 15px; min-height: 48px; align-items: center; }
.lista-ordenes a:first-child { border-top: 0; }
.lista-ordenes a:hover { background: var(--claro); }
.lista-ordenes .num { color: var(--azul); font-weight: bold; }
.vacio { padding: 14px; color: var(--gris); font-size: 15px; }

.login { max-width: 420px; margin: 0 auto; padding: 28px 16px; }
.login .logo { display: block; width: 220px; height: 120px; object-fit: cover; margin: 0 auto 16px; border-radius: 12px; }
.login h1 { color: var(--azul); font-size: 22px; text-align: center; margin-bottom: 6px; }
.login p { color: var(--gris); font-size: 16px; text-align: center; margin-bottom: 18px; }
.enlace { background: none; border: 0; color: var(--azul); text-decoration: underline; font-size: 16px; cursor: pointer; padding: 12px; min-height: 44px; }
[hidden] { display: none !important; }
