/* Termometria - Certificados MIT EXACTA — Estilo global */
:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #0f766e;
    --primary-hover: #115e59;
    --danger: #b91c1c;
    --danger-hover: #7f1d1d;
    --warn-bg: #fef3c7;
    --warn-border: #f59e0b;
    --ok-bg: #dcfce7;
    --ok-border: #16a34a;
    --err-bg: #fee2e2;
    --err-border: #dc2626;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef2f7; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

.muted { color: var(--muted); font-size: 14px; }

/* ==== Auth (login/reset) ==== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0f766e11, #0284c711);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 32px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 22px; }
.auth-card .brand { font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }

/* ==== Form fields ==== */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #334155; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=file], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,118,110,.15);
}
.field { margin-bottom: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

/* ==== Buttons ==== */
.btn {
    display: inline-block;
    padding: 9px 16px;
    background: #e2e8f0;
    color: #0f172a;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, transform .05s;
}
.btn:hover { background: #cbd5e1; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ==== Layout: topbar + container ==== */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; font-size: 18px; color: var(--primary); }
.topbar .company { font-weight: 600; font-size: 16px; }
.topbar .userbox { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.nav-menu { display: flex; gap: 18px; align-items: center; }
.nav-menu a { color: #334155; font-weight: 500; }
.nav-menu a.active { color: var(--primary); border-bottom: 2px solid var(--primary); padding-bottom: 2px; }

.container { max-width: 1120px; margin: 24px auto; padding: 0 24px; }
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 14px; font-size: 18px; }

/* ==== Toolbar / actions row ==== */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar form { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 0; }

/* ==== Tables ==== */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { background: #f8fafc; font-weight: 600; color: #334155; font-size: 13px; text-transform: uppercase; letter-spacing: .3px; }
.table tr:hover td { background: #f8fafc; }

/* ==== Alerts ==== */
.alert { padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-size: 14px; border: 1px solid; }
.alert-ok    { background: var(--ok-bg);   border-color: var(--ok-border);   color: #14532d; }
.alert-error { background: var(--err-bg);  border-color: var(--err-border);  color: #7f1d1d; }
.alert-warn  { background: var(--warn-bg); border-color: var(--warn-border); color: #78350f; }
.alert-info  { background: #dbeafe; border-color: #3b82f6; color: #1e3a8a; }

/* ==== Pagination ==== */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pagination a, .pagination span {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px;
    color: #334155; font-size: 14px; background: #fff;
}
.pagination a:hover { background: #f1f5f9; text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { color: #cbd5e1; cursor: not-allowed; }

/* ==== Modal ==== */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,.55);
    display: none; align-items: center; justify-content: center; z-index: 999; padding: 16px;
}
.modal-backdrop.active { display: flex; }
.modal {
    background: #fff; border-radius: 12px; padding: 24px; max-width: 480px; width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,.15); animation: pop .18s ease-out;
}
.modal h3 { margin: 0 0 12px; font-size: 17px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ==== Utilities ==== */
.flex { display: flex; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.tar { text-align: right; } .tac { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; color: var(--muted); }

.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 640px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .container { padding: 0 12px; margin: 12px auto; }
    .table th, .table td { padding: 8px 6px; font-size: 13px; }
}
