* { box-sizing: border-box; }
body {
    font-family: Segoe UI, Arial, sans-serif;
    margin: 0;
    background: #f4f6f8;
    color: #222;
}
.topbar {
    position: relative;
    background: #1f3a5f;
    color: white;
    padding: 16px 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.view-toggle-btn {
    position: absolute;
    top: 12px;
    left: 16px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.view-toggle-btn:hover { background: rgba(255, 255, 255, 0.25); }

.topbar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}
.logo {
    height: 64px;
    width: 64px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 4px;
}
.topbar-title {
    margin: 0;
    text-align: center;
    line-height: 1.3;
}
.topbar-title a {
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.topbar-title span {
    display: block;
    font-size: 15px;
    font-weight: 400;
    opacity: 0.9;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.nav-btn {
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.btn-rojo { background: #c0392b; color: white; }
.btn-rojo:hover { background: #a5311f; }
.btn-verde { background: #27ae60; color: white; }
.btn-verde:hover { background: #219150; }
.btn-amarillo { background: #f1c40f; color: #222; }
.btn-amarillo:hover { background: #d4ac0d; }
.btn-negro { background: #111111; color: white; }
.btn-negro:hover { background: #333333; }

/* Vista forzada: Computador vs Movil (independiente del tamano real de pantalla) */
html.vista-movil .container { max-width: 480px; }
html.vista-movil .nav-buttons { flex-direction: column; width: 100%; }
html.vista-movil .nav-btn { text-align: center; }
html.vista-movil .topbar-brand { gap: 10px; }
html.vista-movil .logo { height: 44px; width: 44px; }
html.vista-movil .topbar-title a { font-size: 17px; }
html.vista-movil .topbar-title span { font-size: 12px; }
html.vista-movil .resumen { flex-direction: column; }
html.vista-movil table, html.vista-movil thead, html.vista-movil tbody, html.vista-movil th, html.vista-movil td, html.vista-movil tr {
    display: block;
}
html.vista-movil thead { display: none; }
html.vista-movil tr { margin-bottom: 12px; border: 1px solid #e5e5e5; border-radius: 6px; padding: 8px; }
html.vista-movil td { border: none; padding: 4px 6px; }
html.vista-movil td::before {
    content: attr(data-label);
    font-weight: 600;
    display: inline-block;
    min-width: 130px;
    color: #555;
}

html.vista-computador .container { max-width: 1200px; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

.flashes { margin-bottom: 16px; }
.flash {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }

.resumen {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.tarjeta {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-width: 160px;
    flex: 1;
}
.tarjeta h3 { margin: 0 0 8px 0; font-size: 14px; color: #555; text-transform: uppercase; }
.tarjeta .monto { margin: 0; font-size: 24px; font-weight: bold; }
.tarjeta.alerta .monto { color: #c0392b; }

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    font-size: 14px;
}
th { background: #eef2f6; }
.fila-saldo { background: #fff8e1; }

.acciones { display: flex; gap: 8px; }
.acciones form { display: inline; }
.acciones button {
    background: #c0392b;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.acciones a {
    background: #2980b9;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
}

.formulario {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.formulario label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    color: #444;
    gap: 4px;
}
.formulario input, .formulario select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
.formulario button {
    background: #1f3a5f;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}
.formulario .boton-secundario {
    text-align: center;
    color: #555;
    text-decoration: none;
    padding: 8px;
}
.ayuda { font-size: 13px; color: #777; }

.grupo-tickera {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.grupo-tickera legend {
    font-size: 13px;
    color: #444;
    padding: 0 4px;
}
