/* /public_html/assets/style.css - Responsive minimalista */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
    --success: #166534;
    --warning: #92400e;
    --danger: #991b1b;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* Layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1rem; }
header { background: #1e293b; color: white; padding: 1rem; position: sticky; top: 0; z-index: 100; }
header .nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
header .nav a { color: #cbd5e1; text-decoration: none; padding: 0.5rem; border-radius: 4px; }
header .nav a:hover { background: #334155; color: white; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

/* Forms */
form { display: grid; gap: 1rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 0.5rem; }
label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
input, select, textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: 4px; font-size: 1rem; background: white; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
textarea { resize: vertical; min-height: 80px; }
button, .btn { background: var(--primary); color: white; padding: 0.75rem 1.5rem; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; text-decoration: none; display: inline-block; text-align: center; }
button:hover, .btn:hover { background: var(--primary-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Tables */
.table-wrapper { overflow-x: auto; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f1f5f9; font-weight: 600; position: sticky; top: 0; }
tr:hover { background: #f8fafc; }

/* Status badges */
.status { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 500; }
.status.pending { background: #fef3c7; color: var(--warning); }
.status.in_diagnosis { background: #dbeafe; color: #1e40af; }
.status.repaired { background: #dcfce7; color: var(--success); }
.status.repaired_notes { background: #fef3c7; color: var(--warning); }
.status.not_repaired { background: #fee2e2; color: var(--danger); }
.status.ready_delivery { background: #ede9fe; color: #6d28d9; }
.status.delivered { background: #e2e8f0; color: #475569; }

/* Photos grid */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.5rem; }
.photos img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }

/* Utilities */
.required::after { content: " *"; color: var(--danger); }
.text-right { text-align: right; }
.mt-1 { margin-top: 1rem; }
.hidden { display: none !important; }

/* Responsive breakpoints */
@media (max-width: 768px) {
    .container { padding: 0.75rem; }
    header .nav { flex-direction: column; align-items: flex-start; }
    header .nav a { width: 100%; }
    form { gap: 0.75rem; }
    fieldset { padding: 0.75rem; }
    table { font-size: 0.875rem; }
    th, td { padding: 0.5rem; }
    .btn { width: 100%; }
}

@media (max-width: 480px) {
    body { font-size: 0.95rem; }
    input, select, textarea { padding: 0.6rem; font-size: 0.95rem; }
    .photos { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
    .photos img { height: 60px; }
}

/* Print */
@media print {
    header, .no-print { display: none !important; }
    body { background: white; color: black; }
    .card { border: 1px solid #000; box-shadow: none; }
}

.checkbox-row { display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0; }
.checkbox-row input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: 0; cursor: pointer; accent-color: var(--primary); flex-shrink: 0; }
.checkbox-row label { margin: 0; cursor: pointer; user-select: none; }
.breakdown { display: grid; gap: 0.5rem; background: #f8fafc; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 1rem; }
.breakdown .line { display: flex; justify-content: space-between; }
.breakdown .total { font-weight: 700; border-top: 2px solid var(--border); padding-top: 0.5rem; margin-top: 0.25rem; color: var(--primary); }
.notes-card { background: #fef3c7; border-left: 4px solid #f59e0b; padding: 1rem; margin: 1rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
/* ─── Checkbox con label alineado ───────────────────────────── */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.checkbox-row input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
    vertical-align: middle;
}

.checkbox-row label {
    margin: 0;
    cursor: pointer;
    user-select: none;
    line-height: 1.25rem;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* ─── Campo condicional (monto diagnóstico) ────────────────── */
#diag_amount_field {
    margin-left: 2rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: grid;
    gap: 0.5rem;
}

#diag_amount_field.hidden {
    display: none !important;
}

/* ─── Ajuste para móviles ─────────────────────────────────── */
@media (max-width: 480px) {
    .checkbox-row {
        gap: 0.5rem;
    }
    .checkbox-row input[type="checkbox"] {
        width: 1.5rem;
        height: 1.5rem;
        min-width: 1.5rem;
        min-height: 1.5rem;
    }
    #diag_amount_field {
        margin-left: 0;
        margin-top: 0.75rem;
    }
}
