:root {
    --glass-primary: #0d6efd;
    --glass-dark: #1b2a3c;
    --glass-accent: #63c7d6;
}

body {
    background-color: #f4f7f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---------- NAVBAR ---------- */
.app-navbar {
    background: linear-gradient(90deg, var(--glass-dark), #24405e);
    display: flex;
    align-items: center;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* ---------- LAYOUT ---------- */
.app-wrapper {
    display: flex;
    min-height: calc(100vh - 60px);
}

.app-sidebar {
    width: 240px;
    background-color: var(--glass-dark);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.app-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.65rem 1.25rem;
    border-left: 3px solid transparent;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: var(--glass-accent);
}

.app-content {
    flex-grow: 1;
    min-width: 0;
}

/* ---------- LOGIN ---------- */
:root {
    --diamante-navy: #071b34;
    --diamante-blue-900: #0d3a66;
    --diamante-blue-600: #1f6fb2;
    --diamante-blue-400: #4fa8d8;
    --diamante-ice: #f7fbfd;
    --diamante-glint: #bdeaf5;
}

body.login-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(-45deg, var(--diamante-navy), var(--diamante-blue-900), var(--diamante-blue-600), var(--diamante-blue-900));
    background-size: 400% 400%;
    animation: loginGradient 16s ease infinite;
}

@keyframes loginGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* -- Formas de vidrio flotando de fondo -- */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.login-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: loginFloat 16s ease-in-out infinite;
}

.shape-1 {
    width: 380px;
    height: 380px;
    top: -100px;
    left: -80px;
    background: radial-gradient(circle, var(--diamante-blue-400), transparent 70%);
    animation-duration: 15s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    bottom: -90px;
    right: -60px;
    background: radial-gradient(circle, var(--diamante-glint), transparent 70%);
    animation-duration: 19s;
    animation-delay: -4s;
}

.shape-3 {
    width: 220px;
    height: 220px;
    top: 55%;
    right: 12%;
    background: radial-gradient(circle, var(--diamante-blue-600), transparent 70%);
    animation-duration: 12s;
    animation-delay: -2s;
}

@keyframes loginFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(30px, -26px) scale(1.06); }
}

/* -- Tarjeta central -- */
.login-center {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 2.5rem 2.25rem 2.25rem;
    text-align: center;
    box-shadow: 0 25px 60px rgba(3, 15, 32, 0.45);
    animation: loginCardIn 0.65s cubic-bezier(.21,1.02,.73,1) both;
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.brand-icon-wrap {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--diamante-blue-600), var(--diamante-blue-900));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(13, 58, 102, 0.4);
}

.brand-icon-wrap::after {
    content: "";
    position: absolute;
    top: -60%;
    left: -60%;
    width: 45%;
    height: 220%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.65), transparent);
    transform: rotate(20deg);
    animation: loginShine 3.4s ease-in-out infinite;
}

@keyframes loginShine {
    0%   { left: -60%; }
    35%  { left: 130%; }
    100% { left: 130%; }
}

.brand-icon {
    width: 42px;
    height: 42px;
    position: relative;
    z-index: 1;
}

.brand-title {
    font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: 0.5px;
    color: var(--diamante-navy);
    margin-bottom: 0.15rem;
}

.brand-tagline {
    color: #5b6b7a;
    font-size: 0.88rem;
    margin-bottom: 1.4rem;
}

.login-heading {
    padding-top: 1.1rem;
    border-top: 1px solid rgba(13, 58, 102, 0.12);
}

.login-heading h2 {
    font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--diamante-navy);
    margin-bottom: 0.2rem;
}

.login-heading p {
    color: #5b6b7a;
    font-size: 0.88rem;
    margin-bottom: 1.4rem;
}

.login-card .form-label {
    font-size: 0.85rem;
    color: #33455a;
    text-align: left;
    display: block;
}

.login-card .form-control {
    border-radius: 10px;
    border: 1px solid #d7e2ea;
    padding: 0.6rem 0.85rem;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.login-card .form-control:focus {
    border-color: var(--diamante-blue-400);
    box-shadow: 0 0 0 0.2rem rgba(79, 168, 216, 0.22);
    transform: translateY(-1px);
}

.login-submit {
    background: linear-gradient(135deg, var(--diamante-blue-600), var(--diamante-blue-900));
    background-size: 160% 160%;
    background-position: 0% 50%;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-weight: 600;
    margin-top: 0.3rem;
    transition: background-position 0.35s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 10px 22px rgba(13, 58, 102, 0.3);
}

.login-submit:hover {
    background-position: 100% 50%;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(13, 58, 102, 0.4);
}

.login-submit:active {
    transform: translateY(0);
}

@media (max-width: 420px) {
    .login-card {
        padding: 2rem 1.5rem 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.login-body,
    .login-shape,
    .login-card,
    .brand-icon-wrap::after,
    .login-submit {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- DASHBOARD CARDS ---------- */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

/* ---------- RESPONSIVE SIDEBAR ---------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 60px;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        z-index: 1020;
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
}

/* ---------- VENTAS: STEPPER DE CANTIDAD ---------- */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dfe6ec;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background-color: #f4f7f9;
    color: var(--glass-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    transition: background-color 0.15s ease;
}

.qty-btn:hover {
    background-color: var(--glass-primary);
    color: #fff;
}

.qty-btn:active {
    background-color: #0a58ca;
}

.qty-input {
    width: 42px;
    height: 30px;
    border: none;
    border-left: 1px solid #dfe6ec;
    border-right: 1px solid #dfe6ec;
    text-align: center;
    font-weight: 700;
    color: var(--glass-dark);
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input:focus {
    outline: none;
    background-color: #eef5ff;
}

.qty-stepper-sm .qty-btn {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
}

.qty-stepper-sm .qty-input {
    width: 38px;
    height: 26px;
    font-size: 0.9rem;
}

/* ---------- VENTAS: MONTO RECIBIDO / VUELTO ---------- */
.monto-recibido-group .input-group-text {
    background-color: var(--glass-dark);
    color: #fff;
    font-weight: 600;
    border: none;
}

.monto-recibido-input {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: right;
    border: 2px solid #dfe6ec;
}

.monto-recibido-input:focus {
    border-color: var(--glass-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.vuelto-box {
    background-color: #f4f7f9;
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    border: 1px solid #e5eaef;
}

.vuelto-monto {
    font-size: 1.15rem;
    font-weight: 700;
    color: #495057;
}

.vuelto-box.vuelto-ok .vuelto-monto {
    color: #198754;
}

.vuelto-box.vuelto-falta .vuelto-monto {
    color: #dc3545;
}

/* ---------- IMPRESION DE REPORTES/COMPROBANTES ---------- */
@media print {
    .no-print, .app-navbar, .app-sidebar {
        display: none !important;
    }
    .app-content {
        padding: 0 !important;
    }
}
