* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #222;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container { max-width: 800px; margin: 0 auto; }

header { text-align: center; margin-bottom: 2rem; }
header h1 { font-size: 2rem; color: #1a1a1a; margin-bottom: .5rem; }
header p { color: #666; font-size: .95rem; }

.buscador {
    display: flex; gap: .5rem; margin-bottom: 1.5rem;
    background: white; padding: .5rem; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.buscador input {
    flex: 1; padding: .9rem 1rem; font-size: 1rem;
    border: none; border-radius: 8px; outline: none; background: #f5f7fa;
}
.buscador input:focus { background: #eef2f7; }
.buscador button {
    padding: .9rem 1.5rem; font-size: 1rem;
    background: #0066cc; color: white; border: none; border-radius: 8px;
    cursor: pointer; font-weight: 500;
}
.buscador button:hover { background: #0055aa; }
.buscador button:disabled { background: #999; }

.aviso {
    background: #fff3cd; border-left: 4px solid #ffc107;
    padding: .8rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem;
}

.resultado {
    background: white; padding: 1.2rem; border-radius: 10px;
    margin-bottom: .8rem; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.resultado .nombre { font-size: 1.1rem; font-weight: 600; margin-bottom: .4rem; }
.resultado .meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.badge {
    display: inline-block; padding: .2rem .6rem; background: #eef2f7;
    color: #555; border-radius: 4px; font-size: .8rem;
}
.badge.curso { background: #e3f2fd; color: #1565c0; }
.badge.fecha { background: #f3e5f5; color: #6a1b9a; }
.resultado a {
    display: inline-block; padding: .6rem 1.2rem; background: #28a745;
    color: white; text-decoration: none; border-radius: 6px;
    font-size: .9rem; font-weight: 500;
}
.resultado a:hover { background: #218838; }

.error { color: #c00; background: #ffe6e6; padding: .8rem 1rem; border-radius: 6px; }
.loader { color: #666; text-align: center; padding: 2rem; }
.info { text-align: center; color: #888; font-size: .85rem; margin-top: 2rem; }

.login-card {
    background: white; padding: 2.5rem; border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%; max-width: 400px;
}

.header-admin {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; background: white; padding: 1rem 1.5rem;
    border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.header-admin h1 { font-size: 1.3rem; }
.btn-logout {
    padding: .5rem 1rem; background: #dc3545; color: white;
    border: none; border-radius: 6px; cursor: pointer; font-size: .9rem;
}
.btn-logout:hover { background: #c82333; }

.admin-card {
    background: white; padding: 2rem; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}
.stat { background: #f5f7fa; padding: 1rem; border-radius: 8px; text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 700; color: #0066cc; }
.stat .label { font-size: .8rem; color: #666; }

.curso-item {
    background: #fafbfc; padding: 1rem 1.2rem; border-radius: 10px;
    margin-bottom: .8rem; border: 1px solid #eef2f7;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.curso-info { flex: 1; min-width: 0; }
.curso-info h3 { font-size: 1rem; margin-bottom: .3rem; word-break: break-word; }
.curso-info .detalles { font-size: .85rem; color: #666; display: flex; flex-wrap: wrap; gap: .5rem; }
.curso-acciones { display: flex; gap: .5rem; flex-shrink: 0; }
.btn-icono { padding: .5rem .8rem; border: none; border-radius: 6px; cursor: pointer; font-size: .85rem; }
.btn-editar { background: #17a2b8; color: white; }
.btn-eliminar { background: #dc3545; color: white; }

.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay.activo { display: flex; }
.modal { background: white; padding: 2rem; border-radius: 12px; max-width: 500px; width: 90%; }
.modal-botones { display: flex; gap: .5rem; margin-top: 1.5rem; justify-content: flex-end; }
.modal-botones button { padding: .7rem 1.5rem; border: none; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.btn-cancelar { background: #e0e0e0; color: #333; }
.btn-guardar { background: #0066cc; color: white; }