/* ============================================================
   HDD App - Estilos
   AI: DeepSeek V4 Pro | v1 | 2026-08-03
   by Salomon Rizek
   Ancho APP: 600px
   ============================================================ */

:root {
    --primary: #1565c0;
    --primary-light: #1e88e5;
    --header-bg: #c5e3f6;
    --danger: #d32f2f;
    --success: #43a047;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --border: #cfd8dc;
    --text: #202124;
    --text-secondary: #5f6368;
    --radius: 8px;
    --app-width: 600px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
    padding: 20px 12px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: var(--app-width);
}

/* ===========================================
   RECUADRO 1: ENCABEZADO
   =========================================== */
.header-box {
    background: var(--header-bg);
    border-radius: var(--radius);
    padding: 18px 20px 14px;
    margin-bottom: 14px;
    border: 1px solid #bbdefb;
}

.header-title {
    font-size: 35px;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.header-ai-line {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.header-by {
    text-align: center;
    font-size: 20px;
    color: #0d47a1;
    font-weight: 600;
    margin-bottom: 10px;
}

/* 3 iconos circulares */
.header-icons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.circle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.circle-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.circle-icon:active {
    transform: scale(0.95);
}

.icon-add    { background: #43a047; }
.icon-srdo   { background: #1e88e5; }
.icon-refresh { background: #fb8c00; }

/* ===========================================
   RECUADRO 2: DETALLES / LISTADO
   =========================================== */
.details-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--header-bg);
}

/* Acciones arriba */
.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.count-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Dispositivos - compacto */
.device-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e8edf0;
    border-radius: 6px;
    transition: background 0.15s, border-color 0.15s;
}

.device-item:hover {
    background: #eef3f7;
    border-color: #bbdefb;
}

.device-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.device-body {
    flex: 1;
    min-width: 0;
}

.device-tipo {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}

.device-contenido {
    font-size: 13px;
    color: var(--text);
    margin: 2px 0;
    word-break: break-word;
}

.device-fecha {
    font-size: 11px;
    color: var(--text-secondary);
}

.device-actions {
    flex-shrink: 0;
    display: flex;
    gap: 5px;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    color: #fff;
    background: #90a4ae;
}

.btn-action:hover { transform: scale(1.05); }
.btn-action:active { transform: scale(0.92); }

.btn-edit   { background: var(--primary-light); }
.btn-delete { background: var(--danger); }

/* BOTONES GENERALES */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    line-height: 1.3;
    color: #fff;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: #0d47a1; }

.btn-success { background: var(--success); }
.btn-success:hover { background: #2e7d32; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b71c1c; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover { background: #f0f0f0; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* FORMULARIOS */
.form-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.form-container h2 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--header-bg);
}

.form-group { margin-bottom: 12px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(21,101,192,0.12);
}

.form-group textarea { min-height: 70px; resize: vertical; }

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* MENSAJES FLASH */
.alert {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
    border: 1px solid transparent;
}

.alert-success { background: #e8f5e9; border-color: #c8e6c9; color: #2e7d32; }
.alert-danger  { background: #ffebee; border-color: #ffcdd2; color: #c62828; }
.alert-warning { background: #fff3e0; border-color: #ffe0b2; color: #e65100; }

/* DELETE CONFIRM */
.delete-info {
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
}

.delete-info strong { color: var(--danger); }

/* RESPONSIVE */
@media (max-width: 640px) {
    body { padding: 10px 6px; }
    .header-title { font-size: 26px; }
    .header-by { font-size: 16px; }
    .header-box { padding: 14px 12px; }
    .details-box { padding: 10px 10px; }
    .device-item { padding: 8px 10px; gap: 8px; }
    .device-number { width: 28px; height: 28px; font-size: 12px; }
    .form-container { padding: 14px 16px; }
    .circle-icon { width: 38px; height: 38px; font-size: 12px; }
}

@media (max-width: 480px) {
    .header-title { font-size: 22px; }
    .header-icons { gap: 10px; }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: #b0bec5; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
