/* ============================================================
   painel.css — Painel Comercial AmericanFarma
   Paleta: azul #1565c0, escuro #1a1a2e, cinza/branco
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: #1565c0;
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {
    background: #1a1a2e;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

    .topbar-brand:hover {
        text-decoration: none;
    }

.topbar-brand-icon {
    width: 30px;
    height: 30px;
    background: #1565c0;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .topbar-brand-icon img {
        width: 18px;
        height: 18px;
        filter: brightness(0) invert(1);
    }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aab4c8;
    font-size: 13px;
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    background: #1565c0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */

.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

    .page-header h1 {
        font-size: 20px;
        font-weight: 600;
        color: #1a1a2e;
    }

    .page-header p {
        font-size: 13px;
        color: #666;
        margin-top: 2px;
    }

.back-btn {
    width: 34px;
    height: 34px;
    background: #fff;
    border: 0.5px solid #d0d5dd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

    .back-btn img {
        width: 16px;
        height: 16px;
    }

    .back-btn:hover {
        background: #f5f7fb;
        text-decoration: none;
    }

/* ============================================================
   LOGIN
   ============================================================ */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    border: 0.5px solid #e0e4ea;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 40px;
    height: 40px;
    background: #1565c0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .login-logo-icon img {
        width: 22px;
        height: 22px;
        filter: brightness(0) invert(1);
    }

.login-logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.login-logo-sub {
    font-size: 12px;
    color: #888;
    margin-top: 1px;
}

.login-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 2rem;
}

.login-error {
    background: #fff0f0;
    border: 0.5px solid #f5c6c6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #c0392b;
    margin-bottom: 1.25rem;
}

/* ============================================================
   FORMULÁRIO
   ============================================================ */

.field {
    margin-bottom: 1.1rem;
}

    .field label {
        display: block;
        font-size: 12px;
        font-weight: 500;
        color: #444;
        margin-bottom: 6px;
        letter-spacing: 0.2px;
    }

    .field input[type="text"],
    .field input[type="password"],
    .field select,
    .field textarea {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid #d0d5dd;
        border-radius: 8px;
        font-size: 14px;
        color: #1a1a2e;
        background: #fff;
        outline: none;
        transition: border-color 0.15s, box-shadow 0.15s;
    }

        .field input:focus,
        .field select:focus {
            border-color: #1565c0;
            box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
        }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: #1565c0;
    color: #fff;
    width: 100%;
}

    .btn-primary:hover {
        background: #0d47a1;
        color: #fff;
        text-decoration: none;
    }

.btn-secondary {
    background: #fff;
    color: #555;
    border: 0.5px solid #d0d5dd;
}

    .btn-secondary:hover {
        background: #f5f7fb;
    }

.btn-excel {
    background: #1565c0;
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    height: 36px;
}

    .btn-excel:hover {
        background: #0d47a1;
    }

/* ============================================================
   MENU PRINCIPAL
   ============================================================ */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.menu-card {
    background: #fff;
    border: 0.5px solid #e0e4ea;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .menu-card:hover {
        border-color: #1565c0;
        box-shadow: 0 2px 12px rgba(21,101,192,0.08);
    }

.menu-card-icon {
    width: 36px;
    height: 36px;
    background: #e8f0fe;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

    .menu-card-icon img {
        width: 18px;
        height: 18px;
    }

.menu-card-title {
    font-size: 11px;
    font-weight: 600;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.menu-card-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .menu-card-links a {
        font-size: 13px;
        color: #1565c0;
        padding: 4px 0;
        border-bottom: 0.5px solid #f0f2f5;
        display: block;
    }

        .menu-card-links a:last-child {
            border-bottom: none;
        }

        .menu-card-links a:hover {
            color: #0d47a1;
        }

/* ============================================================
   FILTROS (2 linhas)
   ============================================================ */

.filter-box {
    background: #fff;
    border: 0.5px solid #e0e4ea;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
}

.filter-row {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

    .filter-row:last-child {
        margin-bottom: 0;
    }

.filter-row-1 {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.filter-row-2 {
    grid-template-columns: repeat(3, 1fr);
}

.filter-group label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    margin-bottom: 5px;
    letter-spacing: 0.2px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    font-size: 13px;
    color: #1a1a2e;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    height: 36px;
}

    .filter-group input:focus,
    .filter-group select:focus {
        border-color: #1565c0;
        box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    }

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-clear {
    padding: 0 14px;
    height: 36px;
    background: #fff;
    color: #666;
    border: 0.5px solid #d0d5dd;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

    .btn-clear:hover {
        background: #f5f7fb;
    }

/* ============================================================
   TABELA DE DADOS
   ============================================================ */

.table-wrap {
    background: #fff;
    border: 0.5px solid #e0e4ea;
    border-radius: 10px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table thead {
        background: #1a1a2e;
    }

        .data-table thead th {
            padding: 11px 14px;
            font-size: 11px;
            font-weight: 500;
            color: #aab4c8;
            text-align: left;
            letter-spacing: 0.4px;
            white-space: nowrap;
        }

    .data-table tbody tr {
        border-bottom: 0.5px solid #f0f2f5;
        transition: background 0.1s;
    }

        .data-table tbody tr:last-child {
            border-bottom: none;
        }

        .data-table tbody tr:hover {
            background: #f8faff;
        }

    .data-table td {
        padding: 10px 14px;
        font-size: 13px;
        color: #333;
        vertical-align: middle;
    }

        .data-table td a {
            color: #1565c0;
            font-weight: 500;
        }

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-blue {
    background: #e8f0fe;
    color: #1565c0;
}

.badge-gray {
    background: #f0f2f5;
    color: #555;
}

.badge-green {
    background: #e6f4ea;
    color: #1e7e34;
}

.badge-red {
    background: #fce8e6;
    color: #c0392b;
}

@media (max-width: 768px) {
    .page-wrapper {
        padding: 1rem;
    }

    .menu-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-row-1 {
        grid-template-columns: 1fr;
    }

    .filter-row-2 {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        justify-content: flex-end;
    }

    .topbar {
        padding: 0 1rem;
    }

    .topbar-user span {
        display: none;
    }
}

@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
}
