/* ============================================================
   INTEGRATECH323
   SISTEMA DE GESTÃO
   CSS PRINCIPAL
   ============================================================ */

/* ============================================================
   VARIÁVEIS
   ============================================================ */
:root {
    --bg: #f3f7fc;
    --surface: #ffffff;
    --surface-soft: #f7faff;
    --surface-blue: #edf5ff;

    --text: #142235;
    --text-strong: #0d1b2d;
    --text-secondary: #64758a;
    --text-muted: #8d9bad;

    --border: #182d41;
    --border-light: #eaf0f5;

    --primary: #1769e8;
    --primary-hover: #0d5bd1;
    --primary-dark: #084ca9;
    --primary-soft: #edf5ff;
    --primary-border: #cfe1fb;

    --success: #0ca678;
    --success-dark: #07845f;
    --success-soft: #eafaf4;
    --success-border: #c8eedf;

    --danger: #df4b59;
    --danger-dark: #c63b4a;
    --danger-soft: #fff0f2;
    --danger-border: #f2d0d5;

    --warning: #eb9418;
    --warning-dark: #c9770d;
    --warning-soft: #fff7e9;
    --warning-border: #f2dfbd;

    --info: #2391d4;
    --info-soft: #edf8ff;

    --sidebar: #0a2035;
    --sidebar-light: #102f4d;
    --sidebar-hover: #153f65;

    --shadow-xs: 0 2px 7px rgba(18, 45, 74, .04);
    --shadow-sm: 0 5px 16px rgba(18, 45, 74, .06);
    --shadow-md: 0 10px 28px rgba(18, 45, 74, .08);
    --shadow-lg: 0 18px 45px rgba(18, 45, 74, .10);

    --radius-sm: 8px;
    --radius-md: 11px;
    --radius-lg: 15px;

    --sidebar-width: 252px;
}

/* ============================================================
   RESET
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--text-strong);
}

p {
    color: var(--text-secondary);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 100;
    background: linear-gradient(
        180deg,
        #0a2035 0%,
        #0b2943 48%,
        #092137 100%
    );
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 18px;
}

/* ============================================================
   LOGO
   ============================================================ */
.brand {
    width: 100%;
    padding: 0 0 20px;
}

.brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 112px;
    padding: 8px;
    background: #ffffff;
    border-radius: 2px;
    overflow: hidden;
}

.brand img {
    display: block;
    width: 100%;
    max-width: 205px;
    height: 105px;
    object-fit: contain;
}

/* ============================================================
   MENU
   ============================================================ */
.menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 2px;
}

.menu a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 13px;
    border-radius: 10px;
    color: #aebdcc;
    font-size: 13px;
    font-weight: 700;
    transition:
        background .18s ease,
        color .18s ease,
        transform .18s ease;
}

.menu a:hover {
    background: rgba(255, 255, 255, .07);
    color: #ffffff;
}

.menu a.active {
    background: linear-gradient(
        135deg,
        #1976f3,
        #1768e3
    );
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 105, 232, .25);
}

.menu a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: #ffffff;
}

.menu-icon {
    width: 22px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    opacity: .95;
}

.menu-text {
    white-space: nowrap;
}

/* ============================================================
   SIDEBAR FOOTER
   ============================================================ */
.sidebar-footer {
    margin-top: auto;
    padding: 17px 9px 4px;
    border-top: 1px solid rgba(255, 255, 255, .09);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-footer strong {
    color: #dce7f0;
    font-size: 10px;
    font-weight: 800;
}

.sidebar-footer span {
    color: #7f93a6;
    font-size: 9px;
    line-height: 1.45;
}

/* ============================================================
   MAIN
   ============================================================ */
.main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 31px 35px 55px;
}

.page-content {
    width: 100%;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 25px;
}

.topbar-content {
    min-width: 0;
}

.eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.topbar h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 28px;
    line-height: 1.15;
    font-weight: 820;
    letter-spacing: -.035em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        background .16s ease,
        border-color .16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-icon {
    font-size: 14px;
    font-weight: 900;
}

.button.primary {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #1977f5,
        #1466dc
    );
    box-shadow: 0 9px 20px rgba(23, 105, 232, .18);
}

.button.primary:hover {
    background: linear-gradient(
        135deg,
        #146be0,
        #0d59c9
    );
    box-shadow: 0 12px 25px rgba(23, 105, 232, .24);
}

.button.secondary {
    color: var(--text);
    background: #ffffff;
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}

.button.secondary:hover {
    border-color: var(--primary-border);
    color: var(--primary);
}

.button.full {
    width: 100%;
}

.button.small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 11px;
}

/* ============================================================
   FLASH
   ============================================================ */
.flash-area {
    display: grid;
    gap: 9px;
    margin-bottom: 18px;
}

.flash {
    padding: 12px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.flash.success {
    color: var(--success-dark);
    background: var(--success-soft);
    border-color: var(--success-border);
}

.flash.error {
    color: var(--danger-dark);
    background: var(--danger-soft);
    border-color: var(--danger-border);
}

/* ============================================================
   GENERIC PANEL
   ============================================================ */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 21px;
}

.panel-header h2 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.panel-header p {
    margin: 0;
    font-size: 12px;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 22px;
}

.dashboard-intro h2 {
    margin: 5px 0 7px;
    font-size: 20px;
}

.dashboard-intro p {
    margin: 0;
    font-size: 12px;
}

.section-kicker {
    display: inline-block;
    color: var(--primary);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .13em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stats-grid-financial {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    position: relative;
    min-height: 122px;
    padding: 19px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.stat-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 650;
}

.stat-card strong {
    display: block;
    margin: 8px 0 2px;
    color: var(--text-strong);
    font-size: 26px;
    line-height: 1.1;
    font-weight: 850;
}

.stat-card small {
    color: var(--text-muted);
    font-size: 10px;
}

.stat-card-blue::before {
    background: var(--primary);
}

.stat-card-profit::before {
    background: var(--success);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, .82fr);
    gap: 18px;
}

.dashboard-grid > .panel {
    min-width: 0;
    padding: 20px;
}

.dashboard-grid table {
    min-width: 100%;
}

.alert-list {
    border-top: 1px solid var(--border-light);
}

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

.alert-item:last-child {
    border-bottom: 0;
}

.alert-item > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alert-item strong {
    font-size: 13px;
}

.alert-item span {
    color: var(--text-secondary);
    font-size: 11px;
}

.alert-item b {
    color: var(--text-muted);
    font-size: 18px;
}

.alert-item.danger strong {
    color: var(--danger);
}

.alert-item.warning strong {
    color: var(--warning-dark);
}

.alert-item.neutral strong {
    color: var(--text-strong);
}

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

thead {
    background: #f8fafc;
}

th {
    padding: 11px 12px;
    color: #78889b;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 12px;
    vertical-align: middle;
}

tbody tr:hover {
    background: #fbfdff;
}

td strong {
    display: block;
    color: var(--text-strong);
    font-size: 12px;
}

td small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid var(--primary-border);
    border-radius: 7px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 9px;
    font-weight: 800;
}

.money-positive {
    color: var(--success-dark) !important;
}

.money-negative {
    color: var(--danger-dark) !important;
}

/* ============================================================
   EMPTY
   ============================================================ */
.empty {
    padding: 50px 25px;
    text-align: center;
}

.empty h2,
.empty h3 {
    margin-bottom: 8px;
}

.empty p {
    max-width: 540px;
    margin: 0 auto 20px;
}

/* ============================================================
   PRODUTOS
   ============================================================ */
.products-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.products-header h1,
.products-header h2 {
    margin: 4px 0 5px;
    font-size: 25px;
}

.products-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-item {
    position: relative;
    min-height: 112px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.summary-item::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: var(--primary);
}

.summary-item.found::before {
    background: var(--primary);
}

.summary-item.profitable::before {
    background: var(--success);
}

.summary-item.loss::before {
    background: var(--danger);
}

.summary-item.low-stock::before {
    background: var(--warning);
}

.summary-label {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
}

.summary-value {
    display: block;
    margin: 8px 0 2px;
    color: var(--text-strong);
    font-size: 27px;
    line-height: 1;
    font-weight: 850;
}

.summary-description {
    color: var(--text-strong);
    font-size: 12px;
}

.filters-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 180px auto;
    gap: 13px;
    align-items: end;
    padding: 16px;
    margin-bottom: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow-xs);
}

.filters-panel label {
    display: grid;
    gap: 6px;
}

.products-table,
.products-table-panel {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.products-table table {
    min-width: 900px;
}

.export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   FORMULÁRIOS E PRECIFICAÇÃO
   ============================================================ */
.form-layout {
    width: 100%;
    max-width: 1120px;
}

.form-page {
    width: 100%;
}

.form-page > .panel {
    padding: 24px;
}

.form-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-section {
    padding: 22px 0;
    border-top: 1px solid var(--border-light);
}

.form-section:first-of-type {
    padding-top: 4px;
    border-top: 0;
}

.section-title {
    margin-bottom: 18px;
}

.section-title h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-strong);
}

.section-title p {
    margin: 0;
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 25px;
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-field,
.form-group {
    min-width: 0;
}

.form-field-full,
.form-group-full {
    grid-column: 1 / -1;
}

.form-field label,
.form-group label {
    display: grid;
    gap: 8px;
    margin-bottom: 0;
    color: #3d5064;
    font-size: 11px;
    font-weight: 800;
}

.form-group strong {
    display: block;
    margin-top: 6px;
    padding: 11px 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border-light);
    border-radius: 9px;
    color: var(--text-strong);
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 47px;
    padding: 11px 14px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid #d6e1eb;
    border-radius: 9px;
    outline: none;
    font-size: 13px;
    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #a0adba;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #7eafe9;
    box-shadow: 0 0 0 3px rgba(23, 105, 232, .09);
}

.form-field small,
.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 47px;
}

.check-field input {
    width: auto;
    min-height: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 27px;
}

/* ============================================================
   CALCULADORA
   ============================================================ */
.calculator-page {
    width: 100%;
}

.calculator-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 20px;
}

.calculator-intro h2 {
    margin: 5px 0 7px;
    color: var(--text-strong);
    font-size: 21px;
    font-weight: 820;
    letter-spacing: -.025em;
}

.calculator-intro p {
    margin: 0;
    max-width: 720px;
    font-size: 12px;
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(330px, .58fr);
    gap: 20px;
    align-items: start;
}

.calculator-form-card {
    min-width: 0;
    padding: 24px;
}

.calculator-result-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.calculator-result-column > .panel {
    margin: 0;
}

.calculator-panel-header {
    padding-bottom: 18px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-light);
}

.calculator-panel-header h2 {
    margin: 5px 0 5px;
}

.calculator-form {
    width: 100%;
}

.calculator-step {
    padding: 25px 0;
    border-bottom: 1px solid var(--border-light);
}

.calculator-step:last-of-type {
    border-bottom: 0;
}

.step-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 21px;
}

.step-number {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    font-size: 10px;
    font-weight: 850;
}

.step-heading h3 {
    margin: 1px 0 3px;
    font-size: 14px;
    font-weight: 850;
}

.step-heading p {
    margin: 0;
    font-size: 11px;
}

.calculator-step .form-grid {
    row-gap: 22px;
}

.input-money,
.input-percent {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-money > span,
.input-percent > span {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 45px;
    min-height: 47px;
    background: #f5f8fb;
    border: 1px solid #d6e1eb;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.input-money > span {
    border-right: 0;
    border-radius: 9px 0 0 9px;
}

.input-percent > span {
    order: 2;
    border-left: 0;
    border-radius: 0 9px 9px 0;
}

.input-money input {
    border-radius: 0 9px 9px 0;
}

.input-percent input {
    border-radius: 9px 0 0 9px;
}

.input-money input:focus,
.input-percent input:focus {
    position: relative;
    z-index: 1;
}

/* ============================================================
   CHECKBOX PREMIUM
   ============================================================ */
.checkbox-card {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 73px;
    padding: 12px 14px;
    background: #004181;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.checkbox-card input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    accent-color: var(--primary);
    border: #004181;
}

.checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkbox-content strong {
    color: var(--text-strong);
    font-size: 11px;
}

.checkbox-content small {
    margin: 0;
    font-size: 9px;
}

/* ============================================================
   CALCULADORA — AÇÕES
   ============================================================ */
.calculator-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 22px;
}

.calculator-submit {
    min-width: 220px;
}

/* ============================================================
   CALCULADORA — RESULTADO
   ============================================================ */
.calculation-result {
    padding: 22px;
}

.calculation-result .panel-header {
    margin-bottom: 17px;
}

.big-result {
    position: relative;
    padding: 22px;
    margin-bottom: 17px;
    background: linear-gradient(
        135deg,
        #edf7ff,
        #f4fbff
    );
    border: 1px solid #d5e8fb;
    border-radius: 12px;
    overflow: hidden;
}

.big-result::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}

.big-result span {
    display: block;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 750;
}

.big-result strong {
    display: block;
    margin: 6px 0 2px;
    color: var(--primary-dark);
    font-size: 30px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -.035em;
}

.big-result small {
    color: var(--text-muted);
    font-size: 9px;
}

.money-list {
    display: grid;
}

.money-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 11px;
}

.money-list > div:last-child {
    border-bottom: 0;
}

.money-list > div span {
    color: var(--text-secondary);
}

.money-list > div strong {
    color: var(--text-strong);
    font-size: 11px;
    white-space: nowrap;
}

.money-list .total {
    margin-top: 2px;
    padding-top: 15px;
}

.money-list .total span {
    color: var(--text-strong);
    font-weight: 850;
}

.money-list .total strong {
    font-size: 14px;
}

/* ============================================================
   CALCULADORA — ESTADO VAZIO
   ============================================================ */
.calculation-empty {
    padding: 27px 22px;
    text-align: left;
}

.empty-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-radius: 11px;
    font-size: 17px;
    font-weight: 900;
}

.calculation-empty h2 {
    margin: 5px 0 7px;
    font-size: 16px;
}

.calculation-empty p {
    margin: 0;
    font-size: 11px;
    line-height: 1.65;
}

/* ============================================================
   CALCULADORA — DICA
   ============================================================ */
.calculator-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 17px;
    background: #fbfdff;
}

.tip-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--info);
    background: var(--info-soft);
    border: 1px solid #cfe9f8;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
}

.calculator-tip strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text-strong);
    font-size: 11px;
}

.calculator-tip p {
    margin: 0;
    font-size: 10px;
    line-height: 1.55;
}

/* ============================================================
   PRECIFICAÇÃO
   ============================================================ */
.result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.result-card {
    min-height: 110px;
    padding: 19px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.result-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
}

.result-card strong {
    display: block;
    margin: 8px 0 2px;
    font-size: 23px;
    font-weight: 850;
}

.result-card small {
    color: var(--text-muted);
    font-size: 9px;
}

.result-card.highlight {
    background: linear-gradient(
        135deg,
        #1769e8,
        #0e5bd0
    );
    border-color: transparent;
    color: #ffffff;
}

.result-card.highlight span,
.result-card.highlight small {
    color: rgba(255, 255, 255, 0.548);
}

.result-card.highlight strong {
    color: #ffffff;
}

/* ============================================================
   MONEY LIST / FÓRMULAS
   ============================================================ */
.formula-note {
    padding: 17px 19px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
}

.formula-note strong {
    color: var(--text-strong);
    font-size: 12px;
}

.formula-note p {
    margin: 6px 0 0;
    font-size: 11px;
}

/* ============================================================
   AÇÕES
   ============================================================ */
.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.actions a {
    color: var(--primary);
    font-size: 11px;
    font-weight: 750;
}

.actions form {
    margin: 0;
}

.link-danger {
    padding: 0;
    background: transparent;
    color: var(--danger);
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}


/* ==========================================================
   INTEGRATECH323 — CHECKLIST E TAREFAS
   Estilos isolados para a página /tarefas
   ========================================================== */

.tasks-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
    min-width: 0;
    color: var(--text-primary, #1f2937);
}

.tasks-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 26px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 18px;
    background: var(--card-bg, #ffffff);
}

.tasks-intro h2,
.tasks-panel-heading h2,
.tasks-form-heading h2 {
    margin: 7px 0 8px;
    color: var(--text-primary, #1f2937);
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: -0.035em;
}

.tasks-intro p,
.tasks-panel-heading p,
.tasks-form-heading p {
    margin: 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
    line-height: 1.6;
}

.tasks-today-date {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 125px;
    padding: 15px 18px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
}

.tasks-today-date span {
    color: #64748b;
    font-size: 0.75rem;
}

.tasks-today-date strong {
    color: #1d4ed8;
    font-size: 1.05rem;
}

.tasks-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.tasks-stat-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 15px;
    background: var(--card-bg, #ffffff);
}

.tasks-stat-card > span {
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
    font-weight: 600;
}

.tasks-stat-card > strong {
    color: var(--text-primary, #1f2937);
    font-size: 1.85rem;
    line-height: 1.2;
    letter-spacing: -0.04em;
}

.tasks-stat-card > small {
    color: var(--text-secondary, #64748b);
    font-size: 0.76rem;
}

.tasks-stat-highlight {
    border-color: #cfe0ff;
    background: #f8fbff;
}

.tasks-stat-highlight > strong {
    color: #2563eb;
}

.tasks-progress-track,
.tasks-day-progress {
    overflow: hidden;
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: #e5e7eb;
}

.tasks-progress-track span,
.tasks-day-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #3478f6;
    transition: width 0.2s ease;
}

.tasks-tabs {
    display: flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: var(--card-bg, #ffffff);
}

.tasks-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.tasks-tab:hover {
    background: #f8fafc;
}

.tasks-tab.active {
    border-color: #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
}

.tasks-tab-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.1rem;
}

.tasks-tab.active .tasks-tab-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.tasks-tab > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tasks-tab strong {
    font-size: 0.9rem;
}

.tasks-tab small {
    color: var(--text-secondary, #64748b);
    font-size: 0.75rem;
}

.tasks-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.85fr);
    align-items: start;
    gap: 20px;
}

.tasks-list-panel,
.tasks-form-panel {
    min-width: 0;
    border: 3px solid var(--border-color, #00449c);
    border-radius: 25px #00499c;
    background: var(--card-bg, #ffffff);
}

.tasks-list-panel {
    padding: 24px;
}

.tasks-form-panel {
    padding: 23px;
}

.tasks-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.tasks-panel-heading h2 {
    font-size: 1.15rem;
}

.tasks-panel-heading p {
    font-size: 0.82rem;
}

.tasks-count {
    flex-shrink: 0;
    padding: 7px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 650;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 17px 14px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--card-bg, #ffffff);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.task-item:hover {
    border-color: #cbd5e1;
}

.task-item.is-complete {
    background: #fafbfc;
}

.task-item.is-overdue {
    border-left: 3px solid #dc2626;
}

.task-check-form {
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.task-check-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 800;
    transition: all 0.15s ease;
}

.task-check-button:hover {
    border-color: #3478f6;
}

.task-check-button.checked {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.task-item-content {
    flex: 1;
    min-width: 0;
}

.task-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.task-title-row h3 {
    margin: 0;
    color: var(--text-primary, #1f2937);
    font-size: 0.91rem;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.task-item.is-complete .task-title-row h3,
.tasks-week-item.is-complete .tasks-week-item-body > strong {
    color: #94a3b8;
    text-decoration: line-through;
}

.task-description {
    margin: 6px 0 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.8rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.task-priority {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.priority-alta {
    background: #fee2e2;
    color: #b91c1c;
}

.priority-media {
    background: #fef3c7;
    color: #92400e;
}

.priority-baixa {
    background: #dcfce7;
    color: #166534;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 9px;
    color: var(--text-secondary, #64748b);
    font-size: 0.73rem;
}

.task-repeat {
    color: #2563eb;
}

.task-overdue-label {
    color: #b91c1c;
    font-weight: 700;
}

.task-item-actions {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 9px;
    flex: 0 0 auto;
}

.task-action-link,
.task-delete-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    text-decoration: none;
}

.task-delete-button {
    color: #b91c1c;
}

.task-action-link:hover,
.task-delete-button:hover {
    text-decoration: underline;
}

.task-item-actions form {
    margin: 0;
}

.tasks-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 42px 20px;
    text-align: center;
}

.tasks-empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    margin-bottom: 13px;
    border-radius: 16px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.6rem;
}

.tasks-empty h3 {
    margin: 0 0 8px;
    color: var(--text-primary, #1f2937);
    font-size: 1rem;
}

.tasks-empty p {
    max-width: 300px;
    margin: 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
    line-height: 1.6;
}

.tasks-form-heading {
    margin-bottom: 22px;
}

.tasks-form-heading h2 {
    font-size: 1.15rem;
}

.tasks-form-heading p {
    font-size: 0.82rem;
}

.tasks-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.tasks-form label {
    margin-top: 6px;
    color: var(--text-primary, #334155);
    font-size: 0.8rem;
    font-weight: 650;
}

.tasks-form input,
.tasks-form textarea,
.tasks-form select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    outline: none;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    font-size: 0.84rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tasks-form textarea {
    resize: vertical;
    min-height: 82px;
}

.tasks-form input:focus,
.tasks-form textarea:focus,
.tasks-form select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.tasks-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 10px;
}

.tasks-form-row > div {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.tasks-form-hint {
    margin: 5px 0 7px;
    color: var(--text-secondary, #64748b);
    font-size: 0.74rem;
    line-height: 1.55;
}

.tasks-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 8px;
}

.tasks-form-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
}

.tasks-form-actions .button.primary {
    background: #2563eb;
    color: #ffffff;
}

.tasks-form-actions .button.primary:hover {
    background: #1d4ed8;
}

.tasks-form-actions .button.secondary {
    border-color: #dbe2ea;
    background: #ffffff;
    color: #334155;
}

.tasks-week-heading {
    align-items: center;
}

.tasks-week-navigation {
    display: flex;
    align-items: center;
    gap: 7px;
}

.tasks-nav-button,
.tasks-nav-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 0.76rem;
    text-decoration: none;
    white-space: nowrap;
}

.tasks-nav-button {
    min-width: 34px;
    font-size: 1.15rem;
}

.tasks-nav-button:hover,
.tasks-nav-current:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.tasks-week-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tasks-day-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.tasks-day-column.is-today {
    border-color: #93c5fd;
    background: #f8fbff;
}

.tasks-day-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 11px;
}

.tasks-day-header > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tasks-day-header strong {
    color: #334155;
    font-size: 0.81rem;
}

.tasks-day-header > div > span {
    color: #64748b;
    font-size: 0.74rem;
}

.tasks-today-badge {
    padding: 4px 6px;
    border-radius: 6px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.65rem;
    font-weight: 750;
}

.tasks-day-progress {
    height: 4px;
    margin-bottom: 13px;
}

.tasks-day-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tasks-week-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.tasks-week-item form {
    margin: 1px 0 0;
    flex: 0 0 auto;
}

.task-check-small {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    font-size: 0.7rem;
}

.tasks-week-item-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
}

.tasks-week-item-body > strong {
    color: #334155;
    font-size: 0.76rem;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.tasks-week-item-body > small {
    color: #64748b;
    font-size: 0.7rem;
}

.tasks-day-empty {
    margin: 4px 0 14px;
    color: #94a3b8;
    font-size: 0.75rem;
    line-height: 1.5;
}

.tasks-add-day {
    display: block;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed #dbe2ea;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 650;
    text-decoration: none;
}

.tasks-add-day:hover {
    text-decoration: underline;
}


/* Sessão do usuário autenticado */
.user-session {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-session-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.user-session-label {
    color: #64748b;
    font-size: 11px;
}

.user-session-info strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.user-session-role {
    color: #64748b;
    font-size: 11px;
}

.logout-form {
    margin: 0;
}

.logout-button {
    cursor: pointer;
    font: inherit;
}

@media (max-width: 768px) {
    .user-session {
        flex-wrap: wrap;
        gap: 8px;
    }

    .user-session-info {
        max-width: 160px;
    }
}


@media (max-width: 1180px) {
    .tasks-main-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .tasks-form-panel {
        order: -1;
    }

    .tasks-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 14px;
    }

    .tasks-form > label,
    .tasks-form > input,
    .tasks-form > textarea,
    .tasks-form > select,
    .tasks-form > .tasks-form-row,
    .tasks-form > .tasks-form-hint,
    .tasks-form > .tasks-form-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .tasks-page {
        gap: 15px;
    }

    .tasks-intro {
        align-items: flex-start;
        flex-direction: column;
        padding: 19px;
    }

    .tasks-today-date {
        width: 100%;
        box-sizing: border-box;
    }

    .tasks-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .tasks-stat-card {
        padding: 15px;
    }

    .tasks-stat-card > strong {
        font-size: 1.55rem;
    }

    .tasks-tabs {
        gap: 4px;
    }

    .tasks-tab {
        gap: 8px;
        padding: 11px 8px;
    }

    .tasks-tab-icon {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .tasks-tab small {
        font-size: 0.68rem;
    }

    .tasks-list-panel,
    .tasks-form-panel {
        padding: 16px;
    }

    .tasks-panel-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .tasks-week-heading {
        align-items: stretch;
    }

    .tasks-week-navigation {
        flex-wrap: wrap;
    }

    .tasks-week-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .task-item {
        gap: 9px;
        padding: 13px 10px;
    }

    .task-item-actions {
        gap: 8px;
    }

    .task-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .tasks-form {
        display: flex;
    }

    .tasks-form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 1180px) {
    .main {
        padding-left: 27px;
        padding-right: 27px;
    }

    .stats-grid,
    .stats-grid-financial {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .calculator-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr);
    }

    .form-grid.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .sidebar {
        width: 220px;
    }

    .main {
        margin-left: 220px;
    }

    .products-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .calculator-result-column {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }
}

@media (max-width: 820px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .sidebar-inner {
        height: auto;
        padding: 15px;
    }

    .brand {
        padding-bottom: 13px;
    }

    .brand-link {
        min-height: 90px;
    }

    .brand img {
        height: 82px;
    }

    .menu {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 13px;
    }

    .menu a {
        justify-content: center;
    }

    .sidebar-footer {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 24px 18px 40px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .button {
        width: 100%;
    }

    .stats-grid,
    .stats-grid-financial {
        grid-template-columns: 1fr;
    }

    .two-columns {
        grid-template-columns: 1fr;
    }

    .form-grid,
    .form-grid.three,
    .form-grid.four {
        grid-template-columns: 1fr;
    }

    .form-field-full,
    .form-group-full {
        grid-column: auto;
    }

    .products-summary {
        grid-template-columns: 1fr;
    }

    .filters-panel {
        grid-template-columns: 1fr;
    }

    .calculator-result-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .main {
        padding: 20px 14px 35px;
    }

    .menu {
        grid-template-columns: 1fr;
    }

    .menu a {
        justify-content: flex-start;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .panel {
        border-radius: 12px;
    }

    .calculator-form-card,
    .calculation-result {
        padding: 18px;
    }

    .calculator-actions {
        justify-content: stretch;
    }

    .calculator-submit {
        width: 100%;
        min-width: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .button {
        width: 100%;
    }

    .dashboard-intro {
        flex-direction: column;
        align-items: flex-start;
    }
}