/* ============================================
   PLANO DE NEGÓCIOS - SEBRAE
   Design System
   ============================================ */

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

:root {
    --brand:       #0056A6;
    --brand-dark:  #003d7a;
    --brand-light: #e8f0fb;
    --accent:      #00A859;
    --accent-dark: #007a40;
    --danger:      #e53e3e;
    --warn:        #e67e22;
    --warn-light:  #fef3e0;
    --text:        #1a1a2e;
    --text-muted:  #6b7280;
    --border:      #e2e8f0;
    --bg:          #f4f6fa;
    --white:       #ffffff;
    --card-shadow: 0 2px 12px rgba(0,0,0,.08);
    --radius:      10px;
    --radius-sm:   6px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
}

/* ---- HEADER ---- */
.header {
    background: var(--brand);
    color: #fff;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,50,.2);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; gap: 16px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
    width: 40px; height: 40px; border-radius: 8px;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.header-brand h1 { font-size: 16px; font-weight: 700; }
.header-brand span { font-size: 11px; opacity: .75; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.progress-text { font-size: 12px; opacity: .8; }
.btn-reset {
    background: rgba(255,255,255,.15); color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    padding: 5px 12px; border-radius: 6px; font-size: 12px;
    text-decoration: none; cursor: pointer;
    transition: background .2s;
}
.btn-reset:hover { background: rgba(255,255,255,.25); }
.progress-bar-wrap { height: 3px; background: rgba(255,255,255,.2); }
.progress-bar-fill { height: 100%; background: #4ade80; transition: width .4s ease; }

/* ---- LAYOUT ---- */
.app-layout { display: flex; min-height: calc(100vh - 60px); }

/* ---- SIDEBAR ---- */
.sidebar {
    width: 240px; min-width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    position: sticky; top: 63px;
    height: calc(100vh - 63px);
}
.step-nav { padding: 8px 0; }
.step-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; text-decoration: none;
    color: var(--text-muted); font-size: 13px;
    border-left: 3px solid transparent;
    transition: all .2s; cursor: pointer;
}
.step-item:hover { background: var(--bg); color: var(--brand); }
.step-item.active {
    background: var(--brand-light); color: var(--brand);
    border-left-color: var(--brand); font-weight: 600;
}
.step-item.done { color: var(--accent); }
.step-item.done:hover { background: #f0fdf4; }
.step-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--border); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.step-item.active .step-num { background: var(--brand); color: #fff; }
.step-item.done .step-num { background: var(--accent); color: #fff; }
.step-icon { font-size: 16px; }
.step-info strong { display: block; font-size: 12px; }
.step-info small { font-size: 10px; opacity: .7; }

/* ---- MAIN CONTENT ---- */
.main-content { flex: 1; padding: 28px; max-width: 900px; }

/* ---- STEP CARD ---- */
.step-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.step-header {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff; padding: 20px 28px;
    display: flex; align-items: center; gap: 14px;
}
.step-header-icon { font-size: 32px; }
.step-header h2 { font-size: 20px; font-weight: 700; }
.step-header p { font-size: 13px; opacity: .8; margin-top: 2px; }
.step-body { padding: 28px; }

/* ---- FORM ELEMENTS ---- */
.form-section {
    margin-bottom: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.form-section-title {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--brand);
    display: flex; align-items: center; gap: 8px;
}
.form-section-body { padding: 16px; }

.form-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px; margin-bottom: 14px;
}
.form-row:last-child { margin-bottom: 0; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
    font-size: 12px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px;
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px;
    color: var(--text); background: var(--white);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,86,166,.1);
}
.form-group input[readonly] {
    background: #f8fafc; color: var(--text-muted);
    cursor: default;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- DYNAMIC TABLES ---- */
.dyn-table-wrap { overflow-x: auto; }
.dyn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dyn-table th {
    background: #f1f5f9; padding: 8px 10px;
    text-align: left; font-size: 11px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    border-bottom: 2px solid var(--border);
}
.dyn-table td {
    padding: 6px 8px; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.dyn-table tr:hover td { background: #fafbfd; }
.dyn-table input, .dyn-table select {
    width: 100%; padding: 5px 8px;
    border: 1.5px solid var(--border);
    border-radius: 4px; font-size: 13px;
    font-family: inherit; outline: none;
}
.dyn-table input:focus, .dyn-table select:focus {
    border-color: var(--brand);
}
.dyn-table .col-actions { width: 40px; text-align: center; }
.btn-del {
    background: none; border: none; cursor: pointer;
    color: var(--danger); font-size: 16px; padding: 2px 6px;
    border-radius: 4px; transition: background .2s;
}
.btn-del:hover { background: #fff5f5; }

.add-row-wrap { margin-top: 10px; }
.btn-add-row {
    background: none; border: 2px dashed var(--border);
    width: 100%; padding: 8px; border-radius: var(--radius-sm);
    color: var(--brand); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-add-row:hover { border-color: var(--brand); background: var(--brand-light); }

/* ---- TOTALS ---- */
.totals-box {
    background: linear-gradient(135deg, #f0f7ff, #e8f4fd);
    border: 1px solid #bbd6f5; border-radius: var(--radius-sm);
    padding: 14px 18px; margin-top: 16px;
    display: flex; flex-wrap: wrap; gap: 20px;
}
.total-item { display: flex; flex-direction: column; gap: 2px; }
.total-item .total-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.total-item .total-val { font-size: 18px; font-weight: 700; color: var(--brand); }
.total-item .total-val.green { color: var(--accent); }
.total-item .total-val.red { color: var(--danger); }

/* ---- BUTTONS ---- */
.step-actions {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 24px; padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap; gap: 12px;
}
.btn {
    padding: 10px 24px; border-radius: 8px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; border: none; transition: all .2s;
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,86,166,.3); }
.btn-secondary { background: var(--white); color: var(--brand); border: 2px solid var(--brand); }
.btn-secondary:hover { background: var(--brand-light); }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: var(--accent-dark); }
.btn-lg { padding: 14px 32px; font-size: 16px; }

/* ---- ALERT BOX ---- */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 18px; font-size: 13px;
    display: flex; align-items: flex-start; gap: 10px;
}
.alert-info { background: var(--brand-light); border-left: 4px solid var(--brand); color: var(--brand-dark); }
.alert-warn { background: var(--warn-light); border-left: 4px solid var(--warn); color: #7a4f00; }
.alert-success { background: #f0fdf4; border-left: 4px solid var(--accent); color: #1a5c35; }

/* ---- REPORT ---- */
.report-section {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.report-section-header {
    background: var(--brand); color: #fff;
    padding: 12px 18px; font-weight: 600; font-size: 14px;
    display: flex; align-items: center; gap: 10px;
}
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th {
    background: #f1f5f9; padding: 8px 12px;
    font-size: 11px; text-transform: uppercase; color: var(--text-muted);
    text-align: left; border-bottom: 2px solid var(--border);
}
.report-table td {
    padding: 8px 12px; border-bottom: 1px solid #f8fafc;
}
.report-table tr.group-header td {
    background: #f8fafc; font-weight: 600; color: var(--brand);
    font-size: 12px; text-transform: uppercase; letter-spacing: .3px;
}
.report-table tr.total-row td {
    background: linear-gradient(135deg, #f0f7ff, #e8f4fd);
    font-weight: 700; color: var(--brand);
    border-top: 2px solid var(--brand);
}
.text-right { text-align: right; }
.text-green { color: var(--accent); font-weight: 600; }
.text-red { color: var(--danger); font-weight: 600; }

/* ---- INDICATORS ---- */
.indicators-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.indicator-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    text-align: center; box-shadow: var(--card-shadow);
}
.indicator-card .ind-icon { font-size: 28px; margin-bottom: 6px; }
.indicator-card .ind-val { font-size: 22px; font-weight: 700; color: var(--brand); }
.indicator-card .ind-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---- TOOLTIP / HELPER ---- */
.field-help { font-size: 11px; color: var(--text-muted); }

/* ---- CONFIRM NEXT ---- */
.confirm-next-box {
    background: #f0fdf4; border: 2px solid var(--accent);
    border-radius: var(--radius); padding: 16px 20px;
    margin-top: 20px; display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.confirm-next-box p { font-size: 14px; color: #1a5c35; font-weight: 500; }

/* ---- PRINT ---- */
@media print {
    .sidebar, .header-actions, .step-actions, .step-nav { display: none !important; }
    .app-layout { display: block; }
    .main-content { padding: 0; max-width: 100%; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 16px; }
    .form-row { grid-template-columns: 1fr; }
}
