* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f4f6f9; color: #1f2937; }
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #111827, #374151); }
.auth-card { width: 100%; max-width: 420px; background: #fff; padding: 28px; border-radius: 16px; box-shadow: 0 12px 35px rgba(0,0,0,.18); }
.auth-card h1 { margin-top: 0; }
label { display: block; margin-top: 14px; margin-bottom: 6px; font-weight: bold; }
input { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 15px; }
button, .btn { display: inline-block; width: 100%; margin-top: 18px; padding: 12px; border: 0; border-radius: 10px; background: #2563eb; color: #fff; font-weight: bold; text-align: center; text-decoration: none; cursor: pointer; }
.alert { padding: 12px; border-radius: 10px; background: #fee2e2; color: #991b1b; margin: 12px 0; }
.test-users { margin-top: 18px; display: grid; gap: 6px; font-size: 13px; color: #4b5563; }
.topbar { background: #111827; color: #fff; padding: 14px 24px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; margin-left: 14px; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.hero, .card { background: #fff; padding: 24px; border-radius: 16px; margin-bottom: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.badge { display: inline-block; padding: 6px 10px; border-radius: 999px; background: #dbeafe; color: #1e40af; font-weight: bold; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.card strong { font-size: 34px; }
.footer { text-align: center; padding: 20px; color: #6b7280; }
@media (max-width: 800px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .topbar nav { width: 100%; } .topbar a { display: inline-block; margin: 8px 12px 0 0; } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } .container { padding: 14px; } }

select { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 15px; background: #fff; }
input:focus, select:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
button:disabled, .disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.hero-compact { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.grid-two { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid label { margin: 0 0 -6px; }
.form-grid .form-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions button, .form-actions .btn { width: auto; }
.btn-inline { width: auto; margin-top: 0; padding: 11px 14px; }
.btn-muted { background: #6b7280; }
.btn-secondary { background: #374151; }
.btn-success { background: #059669; }
.btn-danger { background: #dc2626; }
.btn-warning { background: #d97706; }
.btn-small { display: inline-block; width: auto; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px; color: #fff; font-weight: bold; text-decoration: none; cursor: pointer; font-size: 13px; }
.alert ul { margin: 8px 0 0; padding-left: 22px; }
.alert-success { background: #dcfce7; color: #166534; }
.help-card p { color: #4b5563; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chips span { padding: 7px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-weight: bold; font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { margin-top: 0; color: #6b7280; }
.export-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 160px auto; gap: 12px; align-items: end; margin: 10px 0 18px; }
.toolbar label { margin-top: 0; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: middle; }
.data-table th { background: #f9fafb; color: #374151; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.data-table tbody tr:hover { background: #f9fafb; }
.empty-state { text-align: center; color: #6b7280; padding: 24px !important; }
.badge-neutral { background: #f3f4f6; color: #374151; }
.status { display: inline-block; padding: 6px 9px; border-radius: 999px; font-weight: bold; font-size: 12px; }
.status-on { background: #dcfce7; color: #166534; }
.status-off { background: #fee2e2; color: #991b1b; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; }
.page-link, .page-ellipsis { display: inline-block; padding: 8px 11px; border-radius: 8px; border: 1px solid #d1d5db; text-decoration: none; color: #1f2937; background: #fff; }
.page-link.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.quick-actions { margin-top: 18px; }
@media (max-width: 900px) { .grid-two, .toolbar { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } .section-head { align-items: stretch; } .export-actions, .toolbar-actions { width: 100%; } }
@media (max-width: 700px) { .table-responsive { overflow: visible; } .data-table { min-width: 0; } .data-table thead { display: none; } .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; } .data-table tr { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; margin-bottom: 12px; } .data-table td { border: 0; padding: 8px 0; } .data-table td::before { content: attr(data-label); display: block; font-weight: bold; color: #6b7280; font-size: 12px; margin-bottom: 3px; } .pagination { justify-content: flex-start; } }


.form-note { align-self: center; color: #6b7280; font-size: 13px; line-height: 1.45; }
.company-preview-card form { margin-top: 16px; }
.company-logo-preview { width: 100%; min-height: 150px; border: 1px dashed #d1d5db; border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: 18px; background: #f9fafb; margin: 14px 0; }
.company-logo-preview img { max-width: 100%; max-height: 170px; object-fit: contain; display: block; }
.company-logo-empty { min-height: 150px; border: 1px dashed #d1d5db; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: #f9fafb; color: #6b7280; font-weight: bold; margin: 14px 0; }
.company-data-list { display: grid; gap: 10px; margin-top: 12px; }
.company-data-list div { border: 1px solid #e5e7eb; border-radius: 12px; padding: 11px 12px; background: #fff; }
.company-data-list span { display: block; color: #6b7280; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.company-data-list strong { display: block; font-size: 15px; color: #1f2937; word-break: break-word; }

textarea { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 15px; font-family: Arial, Helvetica, sans-serif; resize: vertical; }
textarea:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
.image-preview-form { grid-column: 1 / -1; border: 1px dashed #d1d5db; border-radius: 12px; padding: 12px; background: #f9fafb; }
.image-preview-form span { display: block; color: #6b7280; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; font-weight: bold; }
.image-preview-form img { max-width: 220px; max-height: 150px; object-fit: contain; border-radius: 10px; display: block; background: #fff; }
.table-thumb { width: 70px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid #e5e7eb; background: #f9fafb; display: block; }
.table-title { display: block; font-size: 14px; }
.table-subtitle { display: block; color: #6b7280; font-size: 12px; margin-top: 4px; line-height: 1.35; }
.sorteos-table { min-width: 1120px; }
@media (max-width: 700px) { .table-thumb { width: 100%; max-width: 180px; height: auto; max-height: 130px; } .sorteos-table { min-width: 0; } }

.premios-table { min-width: 980px; }
@media (max-width: 700px) { .premios-table { min-width: 0; } }

.table-image-preview { width: 72px; height: 54px; object-fit: cover; border-radius: 10px; border: 1px solid #e5e7eb; background: #f9fafb; display: block; }

.boletos-table { min-width: 1260px; }
.ticket-helper { border: 1px dashed #d1d5db; border-radius: 12px; padding: 12px; background: #f9fafb; }
.ticket-helper strong { font-size: 14px; }
.ticket-helper p { margin: 6px 0; color: #4b5563; font-size: 13px; line-height: 1.4; }
@media (max-width: 700px) { .boletos-table { min-width: 0; } }

.ticket-picker-field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ticket-picker-field input { flex: 1 1 220px; background: #fff; cursor: pointer; }
.ticket-picker-field .btn-inline { margin-top: 0; }
.ticket-selected-summary { flex: 1 1 100%; color: #4b5563; font-size: 13px; line-height: 1.35; }
body.modal-open { overflow: hidden; }
.ticket-modal-backdrop { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(17, 24, 39, .65); }
.ticket-modal-backdrop[hidden] { display: none; }
.ticket-modal { width: min(980px, 100%); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 25px 80px rgba(0,0,0,.35); }
.ticket-modal-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid #e5e7eb; }
.ticket-modal-header h2 { margin: 0 0 4px; }
.ticket-modal-header p { margin: 0; color: #6b7280; font-size: 13px; }
.ticket-modal-close { width: auto; margin: 0; padding: 6px 11px; border-radius: 999px; background: #f3f4f6; color: #111827; font-size: 24px; line-height: 1; }
.ticket-modal-toolbar { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 14px; align-items: end; padding: 16px 20px; border-bottom: 1px solid #e5e7eb; }
.ticket-modal-toolbar label { margin: 0 0 6px; }
.ticket-modal-summary { padding: 12px; border-radius: 12px; background: #f9fafb; color: #374151; font-weight: bold; font-size: 13px; line-height: 1.35; }
.ticket-grid { padding: 18px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; overflow-y: auto; min-height: 220px; max-height: 52vh; background: #f9fafb; }
.ticket-number-button { width: 100%; margin: 0; padding: 10px 6px; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: #1f2937; font-size: 14px; font-weight: bold; }
.ticket-number-button:hover { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.ticket-number-button.is-selected { border-color: #059669; background: #dcfce7; color: #166534; }
.ticket-modal-footer { padding: 14px 20px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .ticket-modal { max-height: 94vh; } .ticket-modal-toolbar { grid-template-columns: 1fr; } .ticket-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); max-height: 50vh; } .ticket-modal-footer .btn-inline { width: 100%; } }
.ticket-image-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ticket-image-links .btn-small { margin-top: 0; }
