/* Reset y estilos globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}


/* Header */
header {
    background: #1e293b;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 1.2rem;
    color: #38bdf8;
}


/* Contenedor */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}


/* Cards */
.card {
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

h2 {
    font-size: 1rem;
    margin-bottom: 14px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* Formulario */
form {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

input,
select,
button {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.95rem;
}

input:focus,
select:focus {
    outline: 2px solid #38bdf8;
    border-color: transparent;
}


/* Botones */
button {
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.85;
}

.btn-primary {
    background: #0ea5e9;
    color: #fff;
    grid-column: 1 / -1;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.btn-edit {
    background: #f59e0b;
    color: #fff;
    padding: 6px 10px;
    font-size: 0.8rem;
}


/* Estadísticas */
.stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat {
    flex: 1;
    min-width: 120px;
    background: #1e293b;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.stat .num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #38bdf8;
}

.stat .lbl {
    font-size: 0.75rem;
    color: #64748b;
}


/* Búsqueda */
.search-bar {
    margin-bottom: 14px;
}

.search-bar input {
    width: 100%;
}


/* Tabla */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #334155;
}

th {
    color: #38bdf8;
    font-weight: 600;
}

tr:hover td {
    background: #16203a;
}


/* Estados */
.status-badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ok {
    background: #064e3b;
    color: #34d399;
}

.low {
    background: #78350f;
    color: #fbbf24;
}

.empty {
    background: #7f1d1d;
    color: #f87171;
}

.empty-msg {
    text-align: center;
    color: #64748b;
    padding: 20px;
}


/* Estado de sincronización */
#sync-status {
    font-size: 0.8rem;
    color: #64748b;
}


/* Responsive */
@media (max-width: 600px) {
    table {
        font-size: 0.8rem;
    }

    th:nth-child(3),
    td:nth-child(3) {
        display: none;
    }
}
