/* ============================================================
   VAPOR AUSTRAL - Sistema de Compras
   app.css
============================================================ */

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

:root {
    --azul:       #1a4f7a;
    --azul-light: #2471a3;
    --azul-bg:    #eaf3fb;
    --verde:      #1e8449;
    --verde-bg:   #eafaf1;
    --rojo:       #a93226;
    --rojo-bg:    #fdedec;
    --naranja:    #b9770e;
    --naranja-bg: #fef9e7;
    --gris:       #5d6d7e;
    --gris-light: #f4f6f8;
    --borde:      #dde1e7;
    --texto:      #2c3e50;
    --texto-muted:#7f8c8d;
    --blanco:     #ffffff;
    --sombra:     0 1px 3px rgba(0,0,0,.08);
    --radio:      6px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--texto);
    background: var(--gris-light);
    line-height: 1.5;
}

/* ── NAVBAR ── */
.navbar {
    background: var(--azul);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 54px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 24px;
    white-space: nowrap;
    font-size: 15px;
    color: #fff;
}
.navbar-brand img { height: 32px; }
.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}
.nav-link {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radio);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.nav-link:hover { background: rgba(255,255,255,.15); color: #fff; }

.nav-dropdown { position: relative; }
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    min-width: 190px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    z-index: 200;
}
.dropdown-content a {
    display: block;
    padding: 9px 16px;
    color: var(--texto);
    text-decoration: none;
    font-size: 13px;
    transition: background .1s;
}
.dropdown-content a:hover { background: var(--azul-bg); color: var(--azul); }
.nav-dropdown:hover .dropdown-content { display: block; }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    font-size: 13px;
    color: rgba(255,255,255,.85);
}
.navbar-user span { font-weight: 500; }
.navbar-user small { font-size: 11px; color: rgba(255,255,255,.6); }

/* ── LAYOUT ── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px;
}
.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}
.page-header h2 { font-size: 20px; font-weight: 600; }

/* ── CARDS ── */
.card {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }
.p-0 { padding: 0 !important; }
.mb-4 { margin-bottom: 20px; }

/* ── STATS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 16px 18px;
    box-shadow: var(--sombra);
}
.stat-card.stat-warning { border-left: 4px solid var(--naranja); }
.stat-card.stat-success  { border-left: 4px solid var(--verde); }
.stat-label { font-size: 12px; color: var(--texto-muted); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--azul); }

/* ── TABLE ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--gris);
    background: var(--gris-light);
    border-bottom: 1px solid var(--borde);
    white-space: nowrap;
}
.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--borde);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--azul-bg); }

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-borrador  { background: var(--naranja-bg); color: var(--naranja); }
.badge-aprobada  { background: var(--verde-bg);   color: var(--verde);   }
.badge-cerrada   { background: var(--gris-light);  color: var(--gris);   }
.badge-anulada   { background: var(--rojo-bg);     color: var(--rojo);   }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: var(--radio);
    border: 1px solid var(--borde);
    background: var(--blanco);
    color: var(--texto);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    font-weight: 500;
    white-space: nowrap;
}
.btn:hover { background: var(--gris-light); }
.btn-primary { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-light); }
.btn-success { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-success:hover { opacity: .9; }
.btn-danger  { background: var(--rojo);  border-color: var(--rojo);  color: #fff; }
.btn-danger:hover  { opacity: .9; }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.15); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--texto);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    font-size: 13px;
    color: var(--texto);
    background: var(--blanco);
    transition: border .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--azul-light);
    box-shadow: 0 0 0 3px rgba(36,113,163,.15);
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.form-section {
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 16px;
    margin-bottom: 18px;
}
.form-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--azul);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--borde);
}

/* ── ALERTS ── */
.alert {
    padding: 11px 16px;
    border-radius: var(--radio);
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-danger  { background: var(--rojo-bg);    color: var(--rojo);    border: 1px solid #f5b7b1; }
.alert-success { background: var(--verde-bg);   color: var(--verde);   border: 1px solid #a9dfbf; }
.alert-warning { background: var(--naranja-bg); color: var(--naranja); border: 1px solid #f9e4b7; }
.alert a { color: inherit; font-weight: 600; }

/* ── LOGIN ── */
.login-body { background: var(--azul); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 380px; padding: 20px; }
.login-card { background: var(--blanco); border-radius: 10px; padding: 36px; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 60px; margin-bottom: 10px; }
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--azul); }
.login-logo p  { font-size: 13px; color: var(--texto-muted); }
.login-footer  { text-align: center; color: rgba(255,255,255,.5); font-size: 12px; margin-top: 16px; }

/* ── UTILS ── */
.text-muted  { color: var(--texto-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-bold   { font-weight: 600; }
.text-danger { color: var(--rojo); }
.text-success{ color: var(--verde); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; align-items: center; }

/* ── FOOTER ── */
.footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--texto-muted);
    border-top: 1px solid var(--borde);
    margin-top: 30px;
}

/* ── FIX HASH URL ── */
.nav-fix { margin-top: 54px; }
