:root {
    --agro-green: #14532d;
    --agro-green-2: #166534;
    --agro-lime: #84cc16;
    --agro-bg: #f3f7ef;
    --agro-card: #ffffff;
    --agro-text: #102016;
}

* { box-sizing: border-box; }
body {
    background: var(--agro-bg);
    color: var(--agro-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.sidebar {
    width: 285px;
    min-height: 100vh;
    background: linear-gradient(180deg, #052e16 0%, #14532d 65%, #1a3a24 100%);
    color: #fff;
    padding: 22px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    box-shadow: 8px 0 30px rgba(5, 46, 22, .2);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}
.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255,255,255,.14);
    display: grid;
    place-items: center;
    font-size: 24px;
}
.brand strong { display: block; font-size: 20px; line-height: 1; }
.brand span { color: rgba(255,255,255,.65); font-size: 13px; }

.sidebar .nav-link {
    color: rgba(255,255,255,.78);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 600;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.14);
}
.sidebar-footer {
    margin-top: 28px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.1);
}

.main-content {
    margin-left: 285px;
    padding: 26px;
    width: calc(100% - 285px);
}
.topbar {
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(20,83,45,.08);
    border-radius: 24px;
    padding: 18px 22px;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.card-agro {
    border: 0;
    border-radius: 22px;
    background: var(--agro-card);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}
.card-agro .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(15, 23, 42, .07);
    padding: 18px 20px;
    font-weight: 800;
}
.card-agro .card-body { padding: 20px; }

.kpi-card {
    border: 0;
    border-radius: 22px;
    background: #fff;
    padding: 20px;
    min-height: 132px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
    position: relative;
    overflow: hidden;
}
.kpi-card:after {
    content: '';
    position: absolute;
    right: -22px;
    bottom: -22px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(132,204,22,.18);
}
.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #ecfdf5;
    color: #166534;
    margin-bottom: 12px;
}
.kpi-label { color: #64748b; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 25px; font-weight: 900; }

.form-control, .form-select {
    border-radius: 13px;
    border-color: #dbe5d2;
}
.form-control:focus, .form-select:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 .25rem rgba(34,197,94,.12);
}
.btn { border-radius: 13px; font-weight: 700; }
.table { vertical-align: middle; }
.table thead th { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top left, #dcfce7, transparent 34%), linear-gradient(135deg, #052e16, #14532d 55%, #84cc16);
    padding: 20px;
}
.login-card {
    width: min(100%, 460px);
    background: rgba(255,255,255,.94);
    border-radius: 28px;
    padding: 34px;
}
.login-logo {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 25px;
    background: #dcfce7;
    color: #166534;
    font-size: 38px;
}

.sim-result {
    border-radius: 20px;
    background: linear-gradient(135deg, #ecfdf5, #f7fee7);
    border: 1px solid #bbf7d0;
    padding: 18px;
}
.progress { border-radius: 999px; height: 12px; }

@media (max-width: 991px) {
    .app-shell { display: block; }
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
        border-radius: 0 0 26px 26px;
    }
    .sidebar .nav { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
    .main-content { margin-left: 0; width: 100%; padding: 16px; }
    .topbar { align-items: flex-start !important; flex-direction: column; }
}

/* AgroSim Gestão V2 */
.hero-panel {
    border-radius: 28px;
    padding: 26px;
    color: #fff;
    background: radial-gradient(circle at top right, rgba(132,204,22,.52), transparent 32%), linear-gradient(135deg, #052e16, #166534 62%, #365314);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    box-shadow: 0 18px 40px rgba(5, 46, 22, .20);
}
.hero-panel h2 { font-weight: 900; margin: 4px 0 8px; }
.hero-panel p { color: rgba(255,255,255,.78); margin: 0; max-width: 760px; }
.hero-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; color: #bef264; }
.hero-score {
    min-width: 160px;
    border-radius: 24px;
    padding: 18px;
    background: rgba(255,255,255,.14);
    text-align: center;
    backdrop-filter: blur(8px);
}
.hero-score span { display: block; color: rgba(255,255,255,.72); font-weight: 700; font-size: 13px; }
.hero-score strong { font-size: 32px; font-weight: 950; }
.alert-card {
    border-radius: 18px;
    padding: 14px 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #f8fafc;
}
.alert-card strong { display: block; font-weight: 900; }
.alert-card span { color: #64748b; font-size: 13px; }
.alert-success { background: #ecfdf5; border-color: #bbf7d0; }
.alert-warning { background: #fffbeb; border-color: #fde68a; }
.alert-danger { background: #fef2f2; border-color: #fecaca; }
.info-line {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(15,23,42,.07);
    padding: 10px 0;
}
.info-line span { color: #64748b; }
.info-line strong { text-align: right; }
.executive-report .report-cover {
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #ffffff, #f7fee7);
}
.report-cover h2 { font-weight: 950; margin: 4px 0; }
.report-cover p { color: #64748b; margin: 0; }
.report-stamp {
    padding: 14px 18px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
}
.report-note {
    padding: 12px 0;
    border-bottom: 1px solid rgba(15,23,42,.07);
}
.report-note strong { display: block; }
.report-note span { color: #64748b; }
.print-actions { position: sticky; top: 10px; z-index: 10; }
@media print {
    .sidebar, .topbar, .print-actions, .btn, a.btn { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 0 !important; }
    body { background: #fff !important; }
    .card-agro, .kpi-card { box-shadow: none !important; border: 1px solid #e5e7eb !important; break-inside: avoid; }
}
@media (max-width: 767px) {
    .hero-panel, .executive-report .report-cover { flex-direction: column; align-items: flex-start; }
    .hero-score { width: 100%; }
}

/* AgroSim Gestão V3 */
.game-rank { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px 14px; border-radius:16px; text-decoration:none; color:var(--agro-text); border:1px solid rgba(15,23,42,.07); margin-bottom:9px; background:#fff; }
.game-rank:hover, .game-rank.active { background:#ecfdf5; border-color:#bbf7d0; }
.game-rank span { display:grid; }
.game-rank small { color:#64748b; }
.game-rank b { color:#166534; font-size:20px; }
.timeline-item { position:relative; display:grid; grid-template-columns:24px 1fr; gap:12px; padding:0 0 18px; }
.timeline-item:not(:last-child):before { content:''; position:absolute; left:8px; top:18px; bottom:0; width:2px; background:#dcfce7; }
.timeline-dot { width:18px; height:18px; border-radius:50%; background:#22c55e; margin-top:2px; box-shadow:0 0 0 5px #dcfce7; }
@media print { .sidebar, .topbar, .btn { display:none!important; } .main-content { margin-left:0!important; width:100%!important; padding:0!important; } .card-agro, .kpi-card { box-shadow:none!important; border:1px solid #e2e8f0!important; } }
