:root {
    --brand: #196B26;
    --brand-dark: #13501D;
    --navy: #196B26;
    --navy-600: #13501D;
    --blue: #196B26;
    --paper: #F8F9F8;
    --line: #E7E7EC;
    --ink: #454B52;
}

html,
body {
    background: var(--paper);
    color: var(--ink);
    font-family: "DM Sans", system-ui, sans-serif;
}

.topline {
    height: 5px;
    background: linear-gradient(90deg, #13501D, #196B26, #78B77B);
}

.app-header {
    background: #fff;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
}

.brand-logo img {
    height: 42px;
    width: auto;
    display: block;
}

.app-header h1 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    color: var(--brand-dark);
}

.app-header p {
    margin: 0;
    color: #77838F;
    font-size: 0.86rem;
}

.app-header .btn-outline-light {
    color: var(--brand);
    border-color: #A9D3B3;
    background: #EAF5EC;
}

.app-header .btn-outline-light:hover {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.card-form {
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(12, 75, 30, 0.06);
}

.card-form .card-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-weight: 800;
    color: var(--brand-dark);
}

.preview-wrap {
    position: sticky;
    top: 1rem;
}

.folha-scale {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.folha-a4 {
    width: 210mm;
    min-width: 210mm;
    height: 297mm;
    background: #fff;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    position: relative;
    box-shadow: 0 12px 40px rgba(16, 42, 67, 0.18);
    transform-origin: top center;
    flex-shrink: 0;
}

.ficha {
    position: absolute;
    left: 24.1mm;
    right: 24.1mm;
    top: 145.8mm;
}

.ficha .cip {
    font-weight: 700;
    font-size: 12pt;
    text-align: center;
    margin: 0 0 1.4mm;
    line-height: 1.15;
    white-space: nowrap;
}

.ficha .linha {
    border: 0;
    border-top: 0.7pt solid #000;
    margin: 0 0 3.2mm;
    opacity: 1;
}

.ficha .entrada {
    font-size: 11pt;
    margin: 0 0 1.2mm 22mm;
    line-height: 4.97mm;
}

.ficha .bloco-titulo {
    position: relative;
    font-size: 11pt;
    line-height: 4.97mm;
}

.ficha .cutter {
    position: absolute;
    left: 0;
    top: 0;
    width: 22mm;
    font-size: 11pt;
    line-height: 4.97mm;
}

.ficha .descricao,
.ficha .fisica,
.ficha .nota,
.ficha .ori,
.ficha .traco {
    margin: 0 0 0 22mm;
    font-size: 11pt;
    line-height: 4.97mm;
    text-indent: 6.4mm;
}

.ficha .fisica {
    margin-top: 0;
}

.ficha .nota,
.ficha .ori-grupo,
.ficha .traco {
    margin-top: 1.7mm;
}

.ficha .ori {
    margin-bottom: 1.55mm;
}

.ficha .cdd {
    text-align: right;
    font-size: 11pt;
    margin: 10mm 10.4mm 1mm 0;
}

.ficha .elab {
    font-weight: 700;
    font-size: 12pt;
    text-align: center;
    margin: 1.6mm 0 0;
}

.repeater-item {
    background: #f8fafc;
    border: 1px dashed var(--line);
    border-radius: 0.75rem;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

.btn-outline-primary {
    color: var(--brand);
    border-color: var(--brand);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-navy {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-navy:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.app-footer {
    border-top: 1px solid var(--line);
    color: #77838F;
    font-size: 0.83rem;
}

.app-footer a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 700;
}

.cutter-list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    max-height: 220px;
    overflow: auto;
    display: none;
}

.cutter-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.45rem 0.75rem;
}

.cutter-list button:hover {
    background: #edf2f7;
}

@media print {
    body {
        background: #fff;
    }

    .no-print {
        display: none !important;
    }

    .folha-a4 {
        box-shadow: none;
        transform: none !important;
    }
}
