/* ===========================================
   estilos.css — HDD Inventario
   AI: DeepSeek V4 Pro | v1 | 2026-08-04
   Compacto, responsive, ancho max 600px
   =========================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #e8eaf0;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 10px;
}

/* ===== APP CONTAINER ===== */
.app-container {
    max-width: 500px;
    width: 100%;
}

/* ===========================================
   RECUADRO 1: ENCABEZADO
   =========================================== */
.header-box {
    background: #c5e3f6;
    text-align: center;
    padding: 20px 15px 15px;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Título:  */
.app-title {
    font-size: 28px;
    font-weight: 700;
    color: #1565c0;
    line-height: 1.2;
    margin-bottom: 4px;
}

.ai-line {
    font-size: 12px;
    color: #546e7a;
    margin-bottom: 2px;
}

.author-line {
    font-size: 20px;
    font-weight: 600;
    color: #0d47a1;
    margin-bottom: 14px;
}

/* ===== ICONOS OVALADOS ===== */
.icon-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    align-items: center;
}

.oval-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    line-height: 1;
}
.oval-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}
.oval-green  { background: #43a047; }
.oval-orange { background: #ef6c00; }
.oval-blue   { background: #1e88e5; }

/* ===========================================
   RECUADRO 2: LISTA DE DISPOSITIVOS
   Línea 1: nombre | tipo → fecha ✏️ (al final)
   Línea 2: contenido
   =========================================== */
.device-list {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 8px 12px;
    min-height: 80px;
}

.empty-msg {
    text-align: center;
    color: #999;
    padding: 30px 10px;
    font-size: 16px;
}

.device-card {
    border-bottom: 1px solid #f0f0f0;
    padding: 6px 0;
}
.device-card:last-child {
    border-bottom: none;
}

.card-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-row-top {
    margin-bottom: 1px;
}

.card-nombre {
    font-weight: 700;
    font-size: 15px;
    color: #1a237e;
    min-width: 45px;
    white-space: nowrap;
}

.card-tipo {
    font-size: 13px;
    color: #546e7a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85px;
}

/* margin-left: auto empuja fecha + ✏️ al extremo derecho */
.card-date {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    margin-left: auto;
}

.card-contenido {
    font-size: 13px;
    color: #444;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ícono de editar (siempre al final de la línea) */
.icon-action {
    text-decoration: none;
    font-size: 18px;
    flex-shrink: 0;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.15s;
    line-height: 1;
}
.icon-edit:hover { background: #e3f2fd; }

/* ===========================================
   FORMULARIOS
   =========================================== */
.form-container {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 20px 18px;
}

.form-title {
    font-size: 20px;
    color: #1565c0;
    margin-bottom: 16px;
    font-weight: 700;
}

.device-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 3px;
    margin-top: 12px;
}
.device-form label:first-of-type { margin-top: 0; }

.device-form input[type="text"],
.device-form input[type="date"],
.device-form textarea {
    width: 100%;
    padding: 9px 11px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.15s;
}
.device-form input:focus,
.device-form textarea:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21,101,192,0.12);
}
.device-form textarea {
    resize: vertical;
}

/* Divider entre editar y eliminar */
.divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 16px 0;
}

/* ===========================================
   BOTONES
   =========================================== */
.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s;
}
.btn:hover { transform: translateY(-1px); }

.btn-save { background: #1565c0; color: #fff; }
.btn-save:hover { background: #0d47a1; }

.btn-cancel { background: #eee; color: #555; }
.btn-cancel:hover { background: #ddd; }

.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #b71c1c; }

.btn-block { width: 100%; text-align: center; }

/* ===========================================
   MENSAJES
   =========================================== */
.msg {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 14px;
}
.msg-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}
.msg-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 620px) {
    .app-title   { font-size: 24px; }   /* 33→24 */
    .author-line { font-size: 16px; }
    .oval-btn    { width: 48px; height: 38px; font-size: 18px; }
    .icon-row    { gap: 10px; }
    .card-nombre   { font-size: 13px; min-width: 38px; }
    .card-tipo     { font-size: 11px; max-width: 60px; }
    .card-contenido{ font-size: 12px; }
    .card-date     { font-size: 10px; }
    .icon-action   { font-size: 16px; }
}

@media (max-width: 400px) {
    .app-title   { font-size: 20px; }   /* 33→20 */
    .author-line { font-size: 14px; }
    .oval-btn    { width: 42px; height: 34px; font-size: 16px; }
    .icon-row    { gap: 8px; }
    .form-buttons { flex-direction: column; }
    .btn         { text-align: center; }
}
