﻿:root {
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface-soft: #faf9f6;

    --primary: #173f38;
    --primary-hover: #0f302b;
    --primary-soft: #e5efec;

    --gold: #b89352;
    --gold-soft: #f3ead9;

    --text: #202522;
    --text-soft: #747c77;
    --border: #e8e6df;

    --danger: #ba4a4a;
    --warning: #c58b31;
    --success: #397b63;

    --sidebar-width: 250px;
    --radius: 16px;

    --shadow:
        0 2px 4px rgba(24, 37, 32, 0.03),
        0 10px 28px rgba(24, 37, 32, 0.05);
}

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

html {
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

button,
a {
    font: inherit;
}

button {
    cursor: pointer;
}

.app {
    min-height: 100vh;
    display: flex;
}

.mobile-menu-toggle,
.mobile-header,
.mobile-menu-close,
.mobile-menu-overlay {
    display: none;
}

/* =========================
   MENU LATERAL
========================= */

.sidebar {
    width: var(--sidebar-width);
    background:
        linear-gradient(
            180deg,
            #173f38 0%,
            #12362f 100%
        );
    color: white;
    padding: 28px 18px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--gold);
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
}

.brand strong {
    display: block;
    font-size: 18px;
    letter-spacing: 0.2px;
}

.brand span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 24px;
}

.menu a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.72);
    min-height: 46px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 500;
    transition: 0.18s ease;
}

.menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.menu a.active {
    background: rgba(255, 255, 255, 0.13);
    color: white;
    box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 12px 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-footer span {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.sidebar-footer small {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.52);
}

.sidebar-footer form {
    margin-top: 12px;
}

.logout-button {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 700;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.11);
    color: white;
}

/* =========================
   CONTEÚDO
========================= */

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 34px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.topbar h1 {
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar p {
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 14px;
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    border-radius: 10px;
    padding: 11px 17px;
    font-weight: 600;
    font-size: 13px;
    transition: 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
}

.btn-secondary:hover {
    border-color: #cfcac0;
    background: var(--surface-soft);
}

.messages {
    margin-bottom: 20px;
}

.message {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 16px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    font-size: 13px;
}

.message.success {
    border-color: #c9dfd5;
    background: #edf7f2;
    color: #285e49;
}

.message.warning {
    border-color: #e7d7b9;
    background: #fff8ea;
    color: #76561f;
}

.message.error {
    border-color: #e5caca;
    background: #fbefef;
    color: #8b3737;
}

/* =========================
   CARDS
========================= */

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 21px;
    min-height: 135px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 3px 6px rgba(24, 37, 32, 0.04),
        0 14px 32px rgba(24, 37, 32, 0.07);
}

.card-label {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card strong {
    display: block;
    margin-top: 10px;
    font-size: 25px;
    line-height: 1;
    color: var(--primary);
}

.card small {
    color: var(--text-soft);
    margin-top: 9px;
    font-size: 12px;
}

/* =========================
   PAINÉIS
========================= */

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
    gap: 20px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 365px;
    padding: 23px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 17px;
    font-weight: 700;
}

.panel-header p {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 12px;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px;
    text-decoration: none;
}

.link-button:hover {
    text-decoration: underline;
}

/* =========================
   ESTADO VAZIO
========================= */

.empty-state {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 30px;
}

.empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 21px;
}

.empty-state h3 {
    font-size: 14px;
    font-weight: 700;
}

.empty-state p {
    margin-top: 7px;
    max-width: 370px;
    color: var(--text-soft);
    line-height: 1.5;
    font-size: 12px;
}

/* =========================
   ESTOQUE
========================= */

.stock-list {
    padding-top: 9px;
}

.stock-list > div {
    min-height: 48px;
    display: grid;
    grid-template-columns: 13px 1fr auto;
    align-items: center;
    column-gap: 10px;
    border-bottom: 1px solid #f0eee8;
    color: #4f5752;
    font-size: 13px;
}

.stock-list > div:last-child {
    border-bottom: 0;
}

.stock-list strong {
    color: var(--text);
    font-size: 14px;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.central {
    background: #367360;
}

.maleta {
    background: #b89352;
}

.vendida {
    background: #4f85a4;
}

.reservada {
    background: #9470a8;
}

.devolvida {
    background: #8e9892;
}

.avariada {
    background: #ba4a4a;
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 1180px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 76px;
    }

    .sidebar {
        padding-left: 10px;
        padding-right: 10px;
    }

    .brand {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .brand > div:not(.brand-icon),
    .menu span,
    .sidebar-footer {
        display: none;
    }

    .menu a {
        justify-content: center;
        padding: 0;
        font-size: 17px;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    :root {
        --sidebar-width: 0px;
    }

    .mobile-menu-toggle {
        position: fixed;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    .sidebar {
        display: flex;
        width: min(82vw, 290px);
        padding: 24px 18px 20px;
        z-index: 40;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: 18px 0 45px rgba(10, 28, 24, 0.2);
        overflow-y: auto;
    }

    .mobile-menu-toggle:checked + .app .sidebar {
        transform: translateX(0);
    }

    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(15, 35, 30, 0.45);
        backdrop-filter: blur(2px);
    }

    .mobile-menu-toggle:checked + .app .mobile-menu-overlay {
        display: block;
    }

    .mobile-menu-close {
        position: absolute;
        top: 16px;
        right: 14px;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        display: grid;
        place-items: center;
        background: rgba(255, 255, 255, 0.08);
        color: white;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
    }

    .brand {
        justify-content: flex-start;
        padding-left: 10px;
        padding-right: 42px;
    }

    .brand > div:not(.brand-icon),
    .menu span,
    .sidebar-footer {
        display: block;
    }

    .menu a {
        justify-content: flex-start;
        padding: 0 14px;
        font-size: 14px;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin: -20px -15px 24px;
        padding: 13px 15px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 18px rgba(24, 37, 32, 0.05);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--text);
        text-decoration: none;
    }

    .mobile-brand-icon {
        width: 36px;
        height: 36px;
        border-radius: 11px;
        display: grid;
        place-items: center;
        background: var(--gold);
        color: white;
        font-weight: 800;
    }

    .mobile-brand strong,
    .mobile-brand small {
        display: block;
    }

    .mobile-brand strong {
        font-size: 14px;
    }

    .mobile-brand small {
        margin-top: 1px;
        color: var(--text-soft);
        font-size: 10px;
    }

    .mobile-menu-button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 0 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface-soft);
        color: var(--primary);
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }

    .content {
        margin-left: 0;
        padding: 20px 15px 30px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        flex: 1;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card {
        min-height: 115px;
    }

    .main-grid {
        gap: 14px;
    }

    .panel {
        min-height: auto;
    }
}
