:root {
    --primary: #14b86a;
    --primary-dark: #0f8f54;
    --dark: #12201a;
    --muted: #6c757d;
    --bg: #f4f8f6;
    --card: #ffffff;
    --border: #e7eee9;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--dark);
}

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

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f2a1e, #153b2a);
    color: white;
    padding: 26px 18px;
    position: fixed;
    height: 100vh;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 34px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    background: rgba(255,255,255,.12);
    display: grid;
    place-items: center;
    font-size: 24px;
}

.brand h1 {
    font-size: 22px;
    margin: 0;
    font-weight: 800;
}

.brand span {
    font-size: 13px;
    color: rgba(255,255,255,.7);
}

.nav-menu {
    display: grid;
    gap: 8px;
}

.nav-menu a {
    color: rgba(255,255,255,.78);
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: .2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: white;
    background: rgba(255,255,255,.13);
}

.main-content {
    margin-left: 280px;
    padding: 28px;
    width: calc(100% - 280px);
}

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

.topbar h2 {
    font-size: 30px;
    font-weight: 800;
    margin: 0;
}

.user-pill {
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 26px rgba(18,32,26,.06);
}

.stat-card,
.content-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 14px 36px rgba(18,32,26,.06);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #e8fff3;
    color: var(--primary-dark);
    font-size: 23px;
    margin-bottom: 14px;
}

.stat-card h3 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
}

.stat-card p { color: var(--muted); margin: 0; }

.btn-primary-custom {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 10px 16px;
    font-weight: 700;
}

.btn-primary-custom:hover { background: var(--primary-dark); color: white; }

.table thead th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.badge-soft {
    background: #e8fff3;
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 8px 12px;
}

.form-control,
.form-select {
    border-radius: 14px;
    padding: 11px 14px;
    border-color: var(--border);
}

.meal-grid {
    display: grid;
    grid-template-columns: 130px repeat(5, 1fr);
    gap: 8px;
    overflow-x: auto;
}

.meal-cell {
    min-width: 160px;
    background: #f7fbf8;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    min-height: 90px;
}

.meal-head {
    background: #153b2a;
    color: white;
    font-weight: 700;
    min-height: auto;
}

.day-cell {
    background: #e8fff3;
    font-weight: 800;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
}

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    .app-wrapper { display: block; }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }
    .topbar { align-items: flex-start; gap: 14px; flex-direction: column; }
}

.meal-grid {
    display: grid;
    grid-template-columns: 120px repeat(5, minmax(150px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.meal-grid-head {
    background: #eef8f2;
    color: var(--primary-dark);
    font-weight: 800;
    padding: 12px;
    border-radius: 14px;
    text-align: center;
    min-width: 150px;
}

.meal-day {
    background: #153b2a;
    color: #fff;
    font-weight: 800;
    border-radius: 14px;
    display: grid;
    place-items: center;
    min-height: 72px;
    min-width: 120px;
}

.meal-input {
    min-width: 150px;
    border-radius: 14px;
    resize: vertical;
    font-size: 13px;
}

.tip-card {
    background: #f3fbf6;
    border: 1px solid #d9f2e4;
    padding: 14px;
    border-radius: 16px;
    color: #244435;
}

@media (max-width: 992px) {
    .meal-grid { grid-template-columns: 110px repeat(5, 160px); }
}

.report-status-list {
    display: grid;
    gap: 12px;
}

.report-status-list div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fbf8;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
}

.report-status-list strong {
    font-size: 24px;
    color: var(--primary-dark);
}

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

@media print {
    .sidebar, .topbar, .no-print, .btn, .alert { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 0 !important; }
    body { background: #fff !important; }
    .content-card, .stat-card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    .app-wrapper { display: block !important; }
    a { text-decoration: none !important; color: #000 !important; }
}

/* Visualização completa do plano alimentar */
.info-box {
    background: #f6faf8;
    border: 1px solid #dcebe3;
    border-radius: 18px;
    padding: 16px 18px;
    height: 100%;
}
.info-box span {
    display: block;
    color: #64748b;
    font-size: .78rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.info-box strong {
    color: #0f3d2b;
    font-size: 1rem;
}
.meal-plan-table thead th {
    background: #0f3d2b;
    color: #fff;
    border-color: #0f3d2b;
    font-size: .82rem;
    text-transform: uppercase;
}
.meal-plan-table td {
    min-width: 170px;
    vertical-align: top;
    white-space: normal;
}
.meal-plan-table .meal-day-cell {
    min-width: 110px;
    background: #eef7f2;
    color: #0f3d2b;
}

@media print {
    body { background: #fff !important; }
    .no-print, .sidebar, .topbar { display: none !important; }
    .main-content, .content-wrapper { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .content-card { box-shadow: none !important; border: none !important; padding: 0 !important; }
    .meal-plan-table thead th { background: #0f3d2b !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .meal-plan-table .meal-day-cell { background: #eef7f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Relatórios profissionais */
.professional-report {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 16px 42px rgba(18,32,26,.07);
}

.report-cover-bar {
    height: 10px;
    background: linear-gradient(90deg, #0f3d2b, #14b86a, #b8f3d5);
}

.report-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 26px 28px 18px;
    border-bottom: 1px solid var(--border);
}

.report-brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.report-logo {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: #e8fff3;
    color: #0f8f54;
    display: grid;
    place-items: center;
    font-size: 28px;
}

.report-brand-block h2 {
    margin: 0;
    font-weight: 900;
    color: #0f2a1e;
    font-size: 26px;
}

.report-brand-block p {
    margin: 4px 0 0;
    color: var(--muted);
}

.report-actions { display: flex; gap: 8px; }

.report-title-section {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    background: #f7fbf8;
    border-bottom: 1px solid var(--border);
}

.report-title-section.compact { padding: 18px; border: 1px solid var(--border); border-radius: 20px; margin-bottom: 18px; }

.report-kicker {
    display: inline-block;
    color: #0f8f54;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.report-title-section h3 {
    margin: 0;
    color: #10241b;
    font-size: 24px;
    font-weight: 900;
}

.report-title-section p { margin: 6px 0 0; color: #61716a; }

.report-date-box {
    min-width: 170px;
    border: 1px solid #dcebe3;
    border-radius: 18px;
    padding: 14px 16px;
    background: #fff;
    text-align: right;
}

.report-date-box span,
.report-info-item span,
.report-kpi span,
.report-indicator span,
.report-signature-row span {
    display: block;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: .06em;
    margin-bottom: 5px;
}

.report-date-box strong,
.report-info-item strong { color: #0f3d2b; }

.report-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 22px 28px 0;
}

.report-info-item,
.report-note,
.report-kpi,
.report-indicator {
    border: 1px solid #dcebe3;
    background: #fbfefd;
    border-radius: 18px;
    padding: 15px 16px;
}

.report-section {
    margin: 22px 28px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
}

.report-section h5 {
    color: #0f2a1e;
    font-weight: 900;
    margin-bottom: 14px;
}

.report-small-text { color: #64748b; font-size: 13px; font-weight: 700; }

.professional-meal-table,
.professional-table { margin: 0; }

.professional-meal-table thead th,
.professional-table thead th {
    background: #0f3d2b;
    color: #fff;
    border-color: #0f3d2b;
    font-size: 12px;
    text-transform: uppercase;
    vertical-align: middle;
}

.professional-meal-table td,
.professional-table td {
    vertical-align: top;
    font-size: 13px;
    line-height: 1.45;
}

.professional-meal-table td { min-width: 155px; }

.professional-day-cell {
    min-width: 96px !important;
    background: #eef7f2 !important;
    color: #0f3d2b !important;
}

.report-guidelines {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.report-guidelines div {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 16px;
    background: #f7fbf8;
    border: 1px solid #dcebe3;
    color: #244435;
}

.report-guidelines i { color: #0f8f54; font-size: 20px; }

.report-signature-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 6px 28px 22px;
}

.report-signature-row div {
    padding: 18px;
    border: 1px dashed #b8cbc0;
    border-radius: 18px;
    background: #fbfefd;
}

.report-signature-row strong { display: block; color: #0f2a1e; margin-top: 24px; }

.report-footer-note {
    padding: 15px 28px;
    color: #61716a;
    font-size: 12px;
    background: #f7fbf8;
    border-top: 1px solid var(--border);
}

.report-filter-bar {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 18px 28px 0;
}

.report-kpi-grid,
.report-indicator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.report-kpi strong,
.report-indicator strong {
    display: block;
    color: #0f3d2b;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 6px;
}

.report-kpi small,
.report-indicator em {
    color: #64748b;
    font-style: normal;
    font-size: 12px;
}

.professional-status div { background: #fbfefd; }

.report-section-row { margin-left: 16px; margin-right: 16px; }

@media (max-width: 992px) {
    .report-top, .report-title-section { flex-direction: column; }
    .report-date-box { text-align: left; }
    .report-info-grid { grid-template-columns: repeat(2, 1fr); }
    .report-guidelines, .report-kpi-grid, .report-indicator-grid { grid-template-columns: 1fr; }
}

@media print {
    @page { size: A4 landscape; margin: 8mm; }
    .sidebar, .topbar, .no-print, .btn, .alert { display: none !important; }
    .app-wrapper { display: block !important; }
    .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    body { background: #fff !important; color: #111 !important; }
    .professional-report { border: none !important; box-shadow: none !important; border-radius: 0 !important; }
    .report-cover-bar, .report-logo, .professional-meal-table thead th, .professional-table thead th, .professional-day-cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .report-top { padding: 8px 0 10px !important; }
    .report-title-section { padding: 10px 0 !important; }
    .report-info-grid { padding: 10px 0 0 !important; grid-template-columns: repeat(6, 1fr) !important; gap: 6px !important; }
    .report-info-item, .report-note, .report-kpi, .report-indicator { padding: 8px !important; border-radius: 10px !important; }
    .report-section { margin: 10px 0 !important; padding: 10px !important; border-radius: 10px !important; break-inside: avoid; }
    .report-kpi-grid, .report-indicator-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 6px !important; }
    .report-guidelines { grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; }
    .professional-meal-table th, .professional-meal-table td, .professional-table th, .professional-table td { font-size: 9px !important; padding: 5px !important; }
    .professional-meal-table td { min-width: auto !important; }
    .report-table-wrap { overflow: visible !important; }
    .report-signature-row { padding: 8px 0 !important; gap: 10px !important; }
    .report-footer-note { padding: 8px 0 !important; }
    .report-brand-block h2 { font-size: 20px !important; }
    .report-logo { width: 42px !important; height: 42px !important; font-size: 21px !important; }
}

.substitutions-box {
    white-space: normal;
    border-left: 5px solid var(--primary-color, #124734);
}

@media (max-width: 1100px) {
    .nav-menu a {
        font-size: 0.92rem;
    }
}

.section-mini-title{
    font-weight: 800;
    color: var(--primary-dark, #0f3d2e);
    background: #eef8f2;
    border: 1px solid #d9efe2;
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 0;
}
