@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --dark: #061423;
    --dark2: #0a1d32;
    --red: #e9312b;
    --red2: #ff4a2f;
    --blue: #2f80ed;
    --green: #27ae60;
    --orange: #ff8a34;
    --purple: #7b43e6;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #0d1525;
    --muted: #607089;
    --line: #e6ebf2;
    --shadow: 0 8px 26px rgba(18, 38, 63, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 255px;
    background: linear-gradient(180deg, #061423, #081a2d);
    color: white;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-icon {
    font-size: 40px;
}

.brand h1 {
    font-size: 25px;
    margin: 0;
    letter-spacing: .5px;
}

.brand span {
    color: #ff4a2f;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 3px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu a {
    color: #eef5ff;
    text-decoration: none;
    padding: 14px 15px;
    border-radius: 8px;
    font-weight: 600;
    transition: .2s;
}

.menu a:hover,
.menu a.active {
    background: linear-gradient(135deg, var(--red), var(--red2));
    box-shadow: 0 8px 20px rgba(233, 49, 43, .35);
}

.user-box {
    margin-top: auto;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .08);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 42px;
    height: 42px;
    background: white;
    color: var(--dark);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.user-box small {
    display: block;
    color: #b8c6d8;
    margin-top: 4px;
}

.main {
    margin-left: 255px;
    width: calc(100% - 255px);
}

.topbar {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 22px;
}

.hamburger {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.topbar h2 {
    margin: 0;
    font-size: 22px;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
}

.live-dot {
    width: 9px;
    height: 9px;
    background: #27ae60;
    border-radius: 50%;
}

.topbar-right input,
.export-form select {
    border: 1px solid var(--line);
    background: white;
    border-radius: 8px;
    height: 42px;
    padding: 0 14px;
    color: var(--text);
}

.content {
    padding: 20px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 112px;
    position: relative;
}

.stat-icon {
    width: 66px;
    height: 66px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 31px;
}

.stat-icon.blue {
    background: #eaf2ff;
}

.stat-icon.green {
    background: #e8f8ef;
}

.stat-icon.orange {
    background: #fff0e3;
}

.stat-icon.purple {
    background: #f0e8ff;
}

.stat-card span {
    color: #45546b;
    font-size: 14px;
}

.stat-card h3 {
    margin: 8px 0 4px;
    font-size: 24px;
}

.stat-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.up {
    margin-left: auto;
    color: #139c4a;
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1.1fr 1.15fr;
    gap: 16px;
    margin-bottom: 18px;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.panel h3 {
    margin: 0 0 16px;
    font-size: 18px;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-text {
    color: #1ca851;
    font-size: 14px;
}

.chart-panel {
    min-height: 345px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: #40506a;
    font-size: 13px;
    font-weight: 700;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
}

.badge.Efectivo {
    background: #dff7e8;
    color: #168d45;
}

.badge.Tarjeta {
    background: #dceaff;
    color: #1b68c9;
}

.badge.Transferencia {
    background: #ffe9d7;
    color: #de5f00;
}

.badge.MercadoPago {
    background: #e8e1ff;
    color: #6738d8;
}

.panel-link {
    display: block;
    color: var(--red);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    margin-top: 16px;
    font-size: 14px;
}

.low-stock-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.low-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px;
}

.low-item strong {
    display: block;
    font-size: 14px;
}

.low-item small {
    color: red;
    font-weight: 700;
}

.low-item span {
    color: var(--muted);
    font-size: 13px;
}

.movements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.move-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.move-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-size: 15px;
}

.move-icon.sale {
    background: var(--red);
}

.move-icon.in {
    background: var(--blue);
}

.move-icon.adjust {
    background: #4fc3a1;
}

.move-info {
    flex: 1;
}

.move-info strong {
    display: block;
    font-size: 14px;
}

.move-info small {
    color: var(--muted);
}

.move-qty.negative {
    color: red;
    font-weight: 700;
}

.move-qty.positive {
    color: #0b9f47;
    font-weight: 700;
}

.export-panel {
    margin-bottom: 25px;
}

.export-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1.5fr auto;
    gap: 10px;
}

.export-form button {
    border: none;
    background: linear-gradient(135deg, var(--red), var(--red2));
    color: white;
    padding: 0 28px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(233, 49, 43, .25);
}

.page-title {
    margin-bottom: 18px;
}

.page-title h2 {
    margin: 0;
}

.page-title p {
    color: var(--muted);
    margin: 5px 0 0;
}

@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .export-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .app {
        flex-direction: column;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 16px;
        gap: 12px;
    }

    .export-form {
        grid-template-columns: 1fr;
    }

    .export-form button {
        height: 44px;
    }
}