/* Proformas GT - página pública. Todo va dentro de .cgt-front para no chocar con el tema. */
.cgt-front { --cgt-c: #1f4e79; --cgt-bg: #f5f7fa; --cgt-bd: #d9dee5; --cgt-tx: #1d2327; max-width: 1000px; margin: 0 auto; color: var(--cgt-tx); font-size: 15px; line-height: 1.5; }
.cgt-front *, .cgt-front *::before, .cgt-front *::after { box-sizing: border-box; }
.cgt-front a { color: var(--cgt-c); }
.cgt-front h2 { margin: 0; font-size: 1.5em; }

/* Barra superior */
.cgt-topbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--cgt-c); margin-bottom: 20px; }
.cgt-nav a { display: inline-block; padding: 10px 16px; text-decoration: none; font-weight: 600; border-radius: 6px 6px 0 0; }
.cgt-nav a.is-active { background: var(--cgt-c); color: #fff; }
.cgt-user { font-size: .9em; color: #555; }

/* Botones */
.cgt-front .cgt-btn { display: inline-block; padding: 8px 16px; border: 1px solid var(--cgt-bd); border-radius: 6px; background: #fff; color: var(--cgt-tx); text-decoration: none; font-size: .95em; cursor: pointer; line-height: 1.4; }
.cgt-front .cgt-btn:hover { border-color: var(--cgt-c); color: var(--cgt-c); }
.cgt-front .cgt-btn-primary { background: var(--cgt-c); border-color: var(--cgt-c); color: #fff; }
.cgt-front .cgt-btn-primary:hover { opacity: .9; color: #fff; }
.cgt-front .cgt-btn-sm { padding: 4px 10px; font-size: .85em; }
.cgt-front .cgt-btn-lg { padding: 12px 28px; font-size: 1.05em; }

/* Mensajes */
.cgt-msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.cgt-msg-ok { background: #e6f4ea; border: 1px solid #a8d5b5; color: #1e5b2e; }
.cgt-msg-error { background: #fdecea; border: 1px solid #f1aeb5; color: #8a1f2b; }

/* Cabecera de sección y búsqueda */
.cgt-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cgt-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.cgt-search input[type=search] { flex: 1 1 240px; }
.cgt-small { font-size: .85em; color: #666; }
.cgt-empty { padding: 30px; text-align: center; background: var(--cgt-bg); border-radius: 8px; color: #666; }

/* Campos */
.cgt-front input[type=text], .cgt-front input[type=email], .cgt-front input[type=password], .cgt-front input[type=search],
.cgt-front input[type=number], .cgt-front input[type=date], .cgt-front select, .cgt-front textarea {
	width: 100%; padding: 8px 10px; border: 1px solid #b8c0cc; border-radius: 6px; background: #fff; font: inherit; color: inherit; margin: 0;
}
.cgt-front input:focus, .cgt-front select:focus, .cgt-front textarea:focus { outline: 2px solid var(--cgt-c); outline-offset: 0; border-color: var(--cgt-c); }
.cgt-field { margin-bottom: 14px; }
.cgt-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.cgt-field select { margin-top: 6px; }
.cgt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.cgt-grid .cgt-full { grid-column: 1 / -1; }
.cgt-card { border: 1px solid var(--cgt-bd); border-radius: 8px; padding: 16px 18px; margin: 0 0 18px; background: #fff; min-width: 0; }
.cgt-card legend { font-weight: 700; padding: 0 8px; color: var(--cgt-c); }
.cgt-info { margin-top: 8px; padding: 8px 12px; background: var(--cgt-bg); border-left: 3px solid var(--cgt-c); border-radius: 4px; line-height: 1.6; }
.cgt-info:empty { display: none; }

/* Listados */
.cgt-scroll { overflow-x: auto; }
.cgt-list { width: 100%; border-collapse: collapse; background: #fff; }
.cgt-list th { text-align: left; background: var(--cgt-c); color: #fff; padding: 9px 10px; font-size: .85em; white-space: nowrap; }
.cgt-list td { padding: 9px 10px; border-bottom: 1px solid #e6e9ee; vertical-align: middle; }
.cgt-list tbody tr:hover { background: var(--cgt-bg); }
.cgt-list .r { text-align: right; }
.cgt-actions { white-space: nowrap; text-align: right; }
.cgt-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8em; font-weight: 600; background: #e5e8ec; color: #444; }
.cgt-badge-enviada { background: #dbeafe; color: #1e40af; }
.cgt-badge-aprobada { background: #dcfce7; color: #166534; }
.cgt-badge-rechazada { background: #fee2e2; color: #991b1b; }
.cgt-pagination { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 4px; }
.cgt-pagination .page-numbers { padding: 5px 11px; border: 1px solid var(--cgt-bd); border-radius: 6px; text-decoration: none; }
.cgt-pagination .current { background: var(--cgt-c); border-color: var(--cgt-c); color: #fff; }

/* Rubros y totales (usa el mismo HTML que el panel de WordPress) */
.cgt-front .cgt-modo { padding: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cgt-front .cgt-modo label { font-weight: 400; display: inline; }
.cgt-front .cgt-items { width: 100%; border-collapse: collapse; }
.cgt-front .cgt-items th { text-align: left; background: var(--cgt-bg); padding: 8px; font-size: .85em; border-bottom: 1px solid var(--cgt-bd); }
.cgt-front .cgt-items td { padding: 6px; vertical-align: top; border-bottom: 1px solid #eef0f3; }
.cgt-front .cgt-items .cgt-line { font-weight: 600; white-space: nowrap; padding-top: 14px; }
.cgt-front .cgt-del { background: none; border: 0; color: #b32d2e; cursor: pointer; font-size: 18px; padding: 8px; }
.cgt-front #cgt-add-row { margin-top: 12px; padding: 6px 14px; border: 1px dashed var(--cgt-c); background: #fff; color: var(--cgt-c); border-radius: 6px; cursor: pointer; font: inherit; }
.cgt-front .cgt-totales { margin: 12px 0 0 auto; min-width: 280px; border-collapse: collapse; }
.cgt-front .cgt-totales td { padding: 6px 10px; }
.cgt-front .cgt-totales td + td { text-align: right; font-weight: 600; }
.cgt-front .cgt-totales .total td { font-size: 1.2em; border-top: 2px solid var(--cgt-tx); }
.cgt-front .description { font-size: .85em; color: #666; margin: 4px 0 0; }

/* Login */
.cgt-login { max-width: 380px; margin: 30px auto; padding: 24px; border: 1px solid var(--cgt-bd); border-radius: 10px; background: #fff; }
.cgt-login h2 { text-align: center; margin-bottom: 18px; }
.cgt-login label { display: block; font-weight: 600; margin-bottom: 4px; }
.cgt-login .cgt-check label { font-weight: 400; }
.cgt-login .cgt-btn { width: 100%; text-align: center; }
.cgt-login .cgt-small { text-align: center; }

/* Móvil: las tablas de listado se convierten en tarjetas */
@media (max-width: 640px) {
	.cgt-list thead { display: none; }
	.cgt-list, .cgt-list tbody, .cgt-list tr, .cgt-list td { display: block; width: 100%; }
	.cgt-list tr { border: 1px solid var(--cgt-bd); border-radius: 8px; margin-bottom: 10px; padding: 6px 4px; }
	.cgt-list td { border: 0; padding: 4px 10px; text-align: left !important; }
	.cgt-list td[data-label]::before { content: attr(data-label) ": "; color: #777; font-size: .85em; }
	.cgt-actions { padding-top: 8px !important; }
	.cgt-front .cgt-items thead { display: none; }
	.cgt-front .cgt-items, .cgt-front .cgt-items tbody, .cgt-front .cgt-items tr, .cgt-front .cgt-items td { display: block; width: 100%; }
	.cgt-front .cgt-items tr { border: 1px solid var(--cgt-bd); border-radius: 8px; margin-bottom: 10px; padding: 6px; }
	.cgt-front .cgt-items td { border: 0; }
	.cgt-front .cgt-items .cgt-line { padding-top: 6px; }
	.cgt-front .cgt-totales { min-width: 0; width: 100%; }
}

/* Excel de clientes */
.cgt-excel h3 { margin: 0 0 10px; font-size: 1.1em; color: var(--cgt-c); }
.cgt-excel hr { border: 0; border-top: 1px solid var(--cgt-bd); }
.cgt-excel input[type=file] { width: 100%; padding: 8px; border: 1px dashed #b8c0cc; border-radius: 6px; background: var(--cgt-bg); }
.cgt-excel p { margin: 0 0 10px; }
.cgt-msg ul { margin: 6px 0 0 18px; list-style: disc; }

.cgt-excel summary { cursor: pointer; color: var(--cgt-c); }
.cgt-excel[open] summary { margin-bottom: 12px; }

/* Eliminar */
.cgt-front .cgt-btn-danger { color: #b32d2e; border-color: #e5b3b4; background: #fff; }
.cgt-front .cgt-btn-danger:hover { background: #b32d2e; border-color: #b32d2e; color: #fff; }
.cgt-front .cgt-btn-danger:disabled { opacity: .45; cursor: not-allowed; background: #fff; color: #b32d2e; border-color: #e5b3b4; }
.cgt-inline { display: inline; margin: 0; }
.cgt-list .cgt-chk { width: 34px; text-align: center; }
.cgt-list th.cgt-chk { background: var(--cgt-c); }
.cgt-list .cgt-chk input { width: 16px; height: 16px; cursor: pointer; margin: 0; }
.cgt-bulkbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.cgt-msg a { color: inherit; }
@media (max-width: 640px) {
	.cgt-list td.cgt-chk { text-align: left; }
}

/* Catálogo de productos dentro de cada rubro */
.cgt-front .cgt-prod { position: relative; margin-bottom: 6px; }
.cgt-front .cgt-prod-buscar { width: 100%; }
.cgt-front .cgt-prod-res { display: none; position: absolute; z-index: 30; left: 0; right: 0; top: 100%; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #8c8f94; border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.cgt-front .cgt-prod-res.cgt-open { display: block; }
.cgt-front .cgt-prod-op { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; cursor: pointer; border-bottom: 1px solid #f0f0f1; }
.cgt-front .cgt-prod-op.is-active { background: #e8f0fe; }
.cgt-front .cgt-prod-txt { flex: 1; min-width: 0; }
.cgt-front .cgt-prod-pr { margin-left: auto; white-space: nowrap; font-weight: 600; }
.cgt-front .cgt-prod-none { padding: 8px 10px; color: #666; }
.cgt-front .cgt-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; padding: 2px 4px 2px 10px; background: #eef2f7; border-radius: 999px; font-size: 12px; color: #444; }
.cgt-front .cgt-prod-unlink { border: 0; background: none; cursor: pointer; color: #777; font-size: 13px; padding: 2px 6px; line-height: 1; }
.cgt-front .cgt-prod-unlink:hover { color: #b32d2e; }
