/* =========================================
   ITEMIZA - ESTILO GERAL
   Arquivo: wwwroot/css/site.css
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #16a085;
    --primary-dark: #11836d;
    --primary-light: #e5f6f1;
    --background: #f7f9fc;
    --surface: #ffffff;
    --text: #202b3c;
    --text-muted: #778195;
    --border: #e5eaf0;
    --sidebar-width: 255px;
}

html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

    a:hover {
        color: var(--primary-dark);
    }

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================
   ESTRUTURA PRINCIPAL
========================================= */

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 38px 42px;
    margin-left: var(--sidebar-width);
}

/* =========================================
   MENU LATERAL
========================================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 28px 18px 20px;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 42px 5px;
    color: var(--text);
    text-decoration: none;
}

    .brand:hover {
        color: var(--text);
    }

.brand-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: var(--primary);
    color: white;
    font-size: 30px;
    font-weight: 700;
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

    .brand-text small {
        margin-top: 5px;
        color: var(--text-muted);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 1.3px;
    }

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #647084;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

    .side-link:hover {
        background: #f3f8f7;
        color: var(--primary-dark);
    }

    .side-link.active {
        background: var(--primary-light);
        color: var(--primary-dark);
        font-weight: 700;
    }

.menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    font-size: 21px;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 18px 4px 0;
    border-top: 1px solid var(--border);
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #dff4ed;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.profile-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

    .profile-details strong {
        font-size: 12px;
    }

    .profile-details span {
        color: var(--text-muted);
        font-size: 10px;
    }

.profile-settings {
    color: var(--text-muted);
    font-size: 18px;
}

/* =========================================
   CABEÇALHOS
========================================= */

.page-heading {
    margin-bottom: 30px;
}

    .page-heading h1 {
        margin: 0 0 10px;
        color: var(--text);
        font-size: 30px;
        font-weight: 800;
        letter-spacing: -0.8px;
    }

    .page-heading p {
        max-width: 720px;
        margin: 0;
        color: var(--text-muted);
        font-size: 14px;
        line-height: 1.7;
    }

/* =========================================
   BOTÕES
========================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 43px;
    padding: 11px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.btn-primary {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
}

    .btn-primary:hover {
        border-color: var(--primary-dark);
        background: var(--primary-dark);
        color: #fff;
    }

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* =========================================
   PÁGINA DE ENVIO DE NOTA FISCAL
========================================= */

.scan-page {
    width: 100%;
    max-width: 1450px;
    margin: 0 auto;
}

.scan-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    align-items: start;
    gap: 24px;
}

.upload-panel,
.ai-panel,
.home-welcome-card,
.home-info-card,
.home-bottom-card {
    min-width: 0;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: 0 3px 12px rgba(30, 45, 65, 0.025);
}

    .upload-panel h2,
    .ai-panel h2 {
        margin: 0 0 9px;
        font-size: 17px;
        font-weight: 800;
    }

    .upload-panel > p,
    .ai-panel > p {
        color: var(--text-muted);
        font-size: 13px;
        line-height: 1.7;
    }

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    margin-top: 22px;
    padding: 28px;
    border: 2px dashed #cbd8df;
    border-radius: 13px;
    background: #fbfdfd;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

    .dropzone:hover {
        border-color: var(--primary);
        background: #f5fcf9;
    }

    .dropzone h3 {
        margin: 15px 0 8px;
        font-size: 16px;
        font-weight: 700;
    }

    .dropzone p {
        margin: 0 0 15px;
        color: var(--text-muted);
        font-size: 12px;
        line-height: 1.6;
    }

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 28px;
}

.dropzone input[type="file"] {
    display: block;
    max-width: 100%;
    margin-top: 12px;
    font-size: 12px;
}

.file-info {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 11px;
}

.upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.ai-panel {
    background: #fff;
}

.ai-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ai-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 23px;
}

.ai-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 600;
}

.ai-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

    .ai-step:last-child {
        border-bottom: 0;
    }

.ai-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f3f6;
    color: #68758a;
    font-size: 12px;
    font-weight: 700;
}

.ai-step strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
}

.ai-step p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.6;
}

.notice,
.alert {
    padding: 13px 15px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.6;
}

.notice {
    margin-top: 18px;
    border: 1px solid #d9eee7;
    background: #f0faf6;
    color: #327460;
}

/* =========================================
   PAINEL INICIAL
========================================= */

.home-page {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

    .home-page .page-heading {
        margin-bottom: 0;
    }

.home-welcome-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(120deg, #ffffff, #f2fbf8);
}

.home-welcome-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: 15px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 27px;
}

.home-welcome-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
}

.home-welcome-card p {
    max-width: 700px;
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
}

.home-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.home-info-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 23px;
}

.home-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 17px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 22px;
}

.home-info-card h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 800;
}

.home-info-card p {
    flex: 1;
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.8;
}

.home-info-card a {
    font-size: 12px;
    font-weight: 700;
}

.home-bottom-card h2 {
    margin: 0 0 22px;
    font-size: 17px;
    font-weight: 800;
}

.home-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.home-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

    .home-step > span {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--primary-light);
        color: var(--primary-dark);
        font-size: 13px;
        font-weight: 800;
    }

    .home-step strong {
        display: block;
        margin: 3px 0 7px;
        font-size: 12px;
    }

    .home-step p {
        margin: 0;
        color: var(--text-muted);
        font-size: 11px;
        line-height: 1.7;
    }

/* =========================================
   FORMULÁRIOS
========================================= */

.form-control,
.form-select {
    min-height: 43px;
    border-color: #dce3ea;
    border-radius: 8px;
    font-size: 13px;
}

.form-label {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.12);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-muted);
    text-align: start;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* =========================================
   TABELAS
========================================= */

.table {
    width: 100%;
    margin-bottom: 0;
    color: var(--text);
    font-size: 13px;
    vertical-align: middle;
}

    .table thead th {
        padding: 14px;
        border-bottom: 1px solid var(--border);
        background: #f8fafc;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 700;
    }

    .table tbody td {
        padding: 14px;
        border-bottom: 1px solid var(--border);
    }

/* =========================================
   RODAPÉ PADRÃO
========================================= */

footer,
.footer {
    color: var(--text-muted);
    font-size: 12px;
}

/* =========================================
   ADAPTAÇÃO PARA TABLETS
========================================= */

@media (max-width: 1100px) {
    :root {
        --sidebar-width: 220px;
    }

    .main-content {
        padding: 30px 25px;
    }

    .scan-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-steps {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   ADAPTAÇÃO PARA CELULARES
========================================= */

@media (max-width: 767px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        padding: 15px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .brand {
        margin: 0 0 18px;
    }

    .brand-symbol {
        width: 38px;
        height: 38px;
        font-size: 25px;
    }

    .brand-text {
        font-size: 19px;
    }

    .side-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .side-link {
        gap: 7px;
        min-height: 42px;
        padding: 9px;
        font-size: 11px;
    }

    .menu-icon {
        width: 18px;
        font-size: 17px;
    }

    .sidebar-profile {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 24px 16px;
    }

    .page-heading {
        margin-bottom: 23px;
    }

        .page-heading h1 {
            font-size: 25px;
        }

        .page-heading p {
            font-size: 13px;
        }

    .upload-panel,
    .ai-panel,
    .home-bottom-card {
        padding: 19px;
    }

    .dropzone {
        min-height: 220px;
        padding: 20px 12px;
    }

    .home-welcome-card {
        flex-direction: column;
        padding: 22px;
    }

        .home-welcome-card h2 {
            font-size: 18px;
        }

    .home-info-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .home-info-card {
        padding: 20px;
    }

    .home-steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .upload-actions {
        flex-direction: column;
    }

        .upload-actions .btn {
            width: 100%;
        }
}

/* =========================================
   CELULARES PEQUENOS
========================================= */

@media (max-width: 380px) {
    .main-content {
        padding: 20px 12px;
    }

    .side-link {
        font-size: 10px;
    }

    .page-heading h1 {
        font-size: 22px;
    }

    .home-welcome-card,
    .home-info-card {
        padding: 17px;
    }
}

