/* =========================================================
   🌊 SISTEMA POS FARMACIA - ESTILO FRESCO MÉDICO MARINO
   Inspirado en clínicas modernas + tonos océano
   ========================================================= */


/* =========================================================
   1. RESET GENERAL
   ========================================================= */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:'Segoe UI', sans-serif;
    background:
        linear-gradient(135deg,#e6f7ff 0%, #f5fffd 40%, #dff6f0 100%);
    color:#164863;
    padding:20px;
    min-height:100vh;
}


/* =========================================================
   2. TIPOGRAFÍA
   ========================================================= */
h1,h2,h3{
    color:#0b4f6c;
    margin-bottom:15px;
    font-weight:700;
}

p{
    color:#4a6572;
}


/* =========================================================
   3. NAVBAR MARINA
   ========================================================= */
nav{
    background:linear-gradient(135deg,#0b4f6c,#1b6b93,#34a0a4);
    padding:16px;
    border-radius:20px;
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-bottom:25px;
    box-shadow:0 10px 25px rgba(0,0,0,0.12);
}

nav a{
    color:white;
    text-decoration:none;
    padding:10px 16px;
    border-radius:12px;
    transition:0.3s;
    font-weight:500;
}

nav a:hover{
    background:rgba(255,255,255,0.15);
    transform:translateY(-2px);
}


/* =========================================================
   4. FORMULARIOS
   ========================================================= */
input,
select,
textarea{
    width:100%;
    padding:12px 14px;
    border:none;
    border-radius:14px;
    background:#ffffff;
    font-size:14px;
    color:#164863;
    box-shadow:
        inset 0 1px 2px rgba(0,0,0,0.05),
        0 4px 10px rgba(0,0,0,0.04);
    transition:0.3s;
}

input:focus,
select:focus,
textarea:focus{
    outline:none;
    transform:scale(1.01);
    box-shadow:
        0 0 0 4px rgba(52,160,164,0.20),
        0 8px 20px rgba(0,0,0,0.08);
}

textarea{
    resize:vertical;
    min-height:90px;
}


/* =========================================================
   5. BOTONES
   ========================================================= */
button{
    border:none;
    padding:12px 20px;
    border-radius:14px;
    cursor:pointer;
    font-weight:600;
    background:linear-gradient(135deg,#34a0a4,#168aad);
    color:white;
    transition:0.3s;
    box-shadow:0 8px 18px rgba(22,138,173,0.25);
}

button:hover{
    transform:translateY(-3px);
    background:linear-gradient(135deg,#168aad,#0b4f6c);
}


/* =========================================================
   6. TARJETAS
   ========================================================= */
.card{
    background:rgba(255,255,255,0.85);
    backdrop-filter:blur(10px);
    border-radius:24px;
    padding:22px;
    margin-bottom:25px;
    border:1px solid rgba(255,255,255,0.6);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.08);
}


/* =========================================================
   7. TABLAS
   ========================================================= */
table{
    width:100%;
    border-collapse:collapse;
    overflow:hidden;
    border-radius:18px;
    background:white;
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
}

th{
    background:linear-gradient(135deg,#0b4f6c,#168aad);
    color:white;
    padding:14px;
    text-align:left;
    font-weight:600;
}

td{
    padding:14px;
    border-bottom:1px solid #eef4f7;
}

tr{
    transition:0.2s;
}

tr:hover{
    background:#f0fbff;
}


/* =========================================================
   8. LOGIN MODERNO MARINO
   ========================================================= */
.login-page{
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    background:
        linear-gradient(135deg,#0b4f6c 0%, #168aad 50%, #52b69a 100%);
}

.login-container{
    width:100%;
    max-width:420px;
}

.login-card{
    background:rgba(255,255,255,0.95);
    border-radius:28px;
    padding:35px;
    box-shadow:
        0 20px 50px rgba(0,0,0,0.20);
}

.login-header{
    text-align:center;
    margin-bottom:25px;
}

.login-header h2{
    font-size:28px;
    color:#0b4f6c;
}

.btn-login{
    width:100%;
    margin-top:10px;
}

.mensaje-error{
    margin-top:12px;
    text-align:center;
    color:#d90429;
    font-size:14px;
}


/* =========================================================
   9. DASHBOARD
   ========================================================= */
.dashboard-page{
    display:flex;
    min-height:100vh;
    gap:20px;
}


/* =========================
   SIDEBAR
========================= */
.sidebar{
    width:260px;
    background:
        linear-gradient(180deg,#0b4f6c,#168aad);
    border-radius:25px;
    padding:25px;
    color:white;
    box-shadow:0 15px 35px rgba(0,0,0,0.15);
}

.sidebar h2{
    color:white;
    margin-bottom:25px;
}

.sidebar nav{
    background:none;
    box-shadow:none;
    padding:0;
    margin:0;
    display:flex;
    flex-direction:column;
}

.sidebar nav a{
    border-radius:14px;
}

.sidebar nav a:hover,
.sidebar nav a.active{
    background:rgba(255,255,255,0.18);
}


/* =========================
   CONTENIDO
========================= */
.dashboard-content{
    flex:1;
    overflow-x:auto;
}


/* =========================================================
   10. TARJETAS DASHBOARD
   ========================================================= */
.dashboard-cards{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-bottom:25px;
}

.dashboard-card{
    background:
        linear-gradient(135deg,#ffffff,#f0fcff);
    padding:25px;
    border-radius:24px;
    position:relative;
    overflow:hidden;
    box-shadow:0 12px 30px rgba(0,0,0,0.08);
    transition:0.3s;
}

.dashboard-card::before{
    content:"";
    position:absolute;
    width:120px;
    height:120px;
    background:rgba(52,160,164,0.12);
    border-radius:50%;
    top:-40px;
    right:-40px;
}

.dashboard-card:hover{
    transform:translateY(-6px);
}

.card-number{
    font-size:32px;
    font-weight:bold;
    color:#168aad;
    margin-top:10px;
}


/* =========================================================
   11. ALERTAS
   ========================================================= */
.dashboard-alerts{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(250px,1fr));
    gap:15px;
    margin-bottom:25px;
}

.alert-card{
    padding:18px;
    border-radius:18px;
    font-weight:600;
    box-shadow:0 8px 18px rgba(0,0,0,0.06);
}

.alert-stock{
    background:#fff3cd;
    color:#856404;
}

.alert-vencido{
    background:#ffd6d6;
    color:#a4133c;
}

.alert-ok{
    background:#d8f3dc;
    color:#1b4332;
}


/* =========================================================
   12. BOTONES ESPECIALES
   ========================================================= */
.btn-cobrar{
    background:linear-gradient(135deg,#52b69a,#2d6a4f);
}

.btn-cobrar:hover{
    background:linear-gradient(135deg,#40916c,#1b4332);
}

.btn-guardar{
    background:linear-gradient(135deg,#34a0a4,#168aad);
}

.btn-eliminar{
    background:linear-gradient(135deg,#ef476f,#d90429);
}

.btn-secundario{
    background:linear-gradient(135deg,#8d99ae,#5c677d);
}


/* =========================================================
   13. INVENTARIO Y ESTADOS
   ========================================================= */
.stock-normal{
    background:#edfdfb;
}

.stock-bajo{
    background:#ffe8b6;
}

.sin-stock{
    background:#ffccd5;
    color:#7f0000;
}

.vencido{
    background:#ffb3c1;
}

.por-vencer{
    background:#fff3bf;
}


/* =========================================================
   14. LEYENDA
   ========================================================= */
.leyenda{
    background:rgba(255,255,255,0.9);
    border-radius:18px;
    padding:15px;
    border:1px solid rgba(0,0,0,0.05);
}


/* =========================================================
   15. FORMULARIOS GRID
   ========================================================= */
.form-grid,
.factura-datos,
.pago-grid{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(220px,1fr));
    gap:15px;
}

.acciones-producto{
    display:flex;
    gap:10px;
    margin-bottom:15px;
}


/* =========================================================
   16. GRÁFICAS
   ========================================================= */
.dashboard-charts{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

.chart-card{
    background:white;
    border-radius:24px;
    padding:20px;
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
}

.chart-card canvas{
    width:100% !important;
    height:300px !important;
}


/* =========================================================
   17. RESPONSIVE
   ========================================================= */
@media(max-width:900px){

    .dashboard-page{
        flex-direction:column;
    }

    .sidebar{
        width:100%;
    }

    .dashboard-charts{
        grid-template-columns:1fr;
    }
}

@media(max-width:768px){

    nav{
        flex-direction:column;
    }

    .acciones-producto{
        flex-direction:column;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr{
        display:block;
    }

    th{
        display:none;
    }

    td{
        border:none;
        padding:12px;
    }
}