:root {
    --bg: #d8e0e8;
    --surface: #f1f4f8;
    --panel: #ffffff;
    --color-secundary: #032e31;
    --sidebar: #032e31;
    --sidebar-soft: #0a4e52;
    --sidebar-text: #cde4e5;
    --text: #162232;
    --muted: #607184;
    --accent: #0d9d98;
    --accent-soft: #0a7673;
    --danger: #cf3040;
    --warning: #ca7b00;
    --success: #178d5a;
    --border: #dbe4ec;
    --botoes: #0a4e52;
    --radius-lg: 14px;
    --radius-md: 10px;
    --bordar:10px;
    --gap12: 12px;
    --gap10: 10px;  
    --gap8: 8px;
    --gap6: 6px;
    --size-font-desc: 14px;
    --font-size16: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(145deg, #cad3dd 0%, #e6ebf1 100%);
    min-height: 100vh;
}

.app-frame {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #032e31 0%, #052729 100%);
    color: var(--sidebar-text);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    min-height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #f2ffff;
    font-weight: 800;
    padding: 10px;
    border-radius: 10px;
}

.brand.brand-has-full-logo {
    display: block;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #3ad0cb);
    color: #032e31;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.brand-icon.brand-icon-image {
    padding: 0;
    overflow: hidden;
    background: #ffffff;
}

.brand-icon.brand-icon-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-full-image {
    display: block;
    width: 100%;
    max-width: 190px;
    min-height: 44px;
}

.brand-full-image img {
    width: 100%;
    max-height: 72px;
    object-fit: contain;
    display: block;
}

.menu-title {
    margin: 18px 10px 8px;
    font-size: 11px;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: rgba(205, 228, 229, 0.55);
}

.nav-menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    padding: 10px;
    transition: .2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}

.icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.nav-bottom {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 12px;
    display: grid;
    gap: 4px;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    background: var(--surface);
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.top-left, .top-right { display: flex; align-items: center; gap: 10px; }

.topbar-brand {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    min-height: 38px;
}

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

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
    color: #1d3d45;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .2s ease;
}

.icon-btn:hover {
    border-color: #b7d7d5;
    color: #0e6865;
    box-shadow: 0 6px 14px rgba(11, 74, 78, 0.12);
}

.icon-btn svg {
    width: 19px;
    height: 19px;
    display: block;
}

.notification-menu {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(360px, 88vw);
    display: none;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    z-index: 30;
}

.notif-dropdown.open {
    display: block;
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid #e6edf5;
    background: #f8fbff;
}

.notif-head small {
    color: var(--muted);
    font-size: 12px;
}

.notif-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-head-link {
    color: #28527f;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.notif-head-link:hover {
    color: #11365f;
}

.notif-list {
    display: grid;
    gap: 0;
    max-height: 360px;
    overflow-y: auto;
}

.notif-item,
.notif-empty {
    padding: 14px 16px;
    border-bottom: 1px solid #eef3f7;
}

.notif-item-linkable {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.notif-item-main {
    display: block;
    text-decoration: none;
}

.notif-item-main small {
    display: block;
    margin-top: 8px;
    color: #7d8ea4;
    font-size: 11px;
    font-weight: 700;
}

.notif-item strong {
    display: block;
    color: #14233a;
    margin-bottom: 4px;
}

.notif-item-linkable .notif-item-main:hover strong {
    color: #1d4ed8;
}

.notif-item p,
.notif-empty {
    margin: 0;
    color: #627487;
    font-size: 13px;
}

.notif-action-form {
    margin-top: 10px;
}

.notif-read-btn {
    border: 1px solid #d7e3ef;
    background: #f8fbff;
    color: #28527f;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.notif-read-btn:hover {
    background: #edf5ff;
    border-color: #b9cfe6;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    background: #fff;
}

.user-chip small { display: block; color: var(--muted); font-size: 11px; }

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e6f6f5;
    color: #0f5f62;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search {
    min-width: 260px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    padding: 8px 10px;
}

.search input {
    width: 100%;
    border: 0;
    background: transparent;
    outline: none;
}

.content-shell {
    flex: 1;
    overflow: auto;
    padding: 16px;
    min-width: 0;
}

.page-surface {
    min-height: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    max-width: 100%;
    min-width: 0;
}

.loading { color: var(--muted); font-weight: 600; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

h1,h2,h3 { margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

.card,
.panel,
.table-wrap,
.metric,
.stat,
.empty {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
}

.card,
.panel,
.stat,
.metric,
.empty {
    padding: 14px; 
    display: flex;
    gap: 14px;
    flex-direction: column;
}

.grid,
.stats-grid,
.form-grid {
    display: grid;
    gap: 12px;
}

.stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

label { font-size: 12px; font-weight: 400; color: var(--muted); display: inline-block; }
input, select, textarea {
    width: 100%;
    border: 1px solid #d4dee8;
    border-radius: var(--bordar);
    padding: 10px 11px;
    font-size: var(--font-size16);
    font-family: inherit;
    color: var(--text);
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #75c9c6;
    box-shadow: 0 0 0 3px rgba(13, 157, 152, 0.15);
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #b8c8da;
    border-radius: 4px;
    box-shadow: none;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

input[type="radio"] {
    border-radius: 999px;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    box-shadow: none;
}

.form-group { margin-bottom: 10px; }

.logo-row {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #d9e2ea;
    border-radius: 10px;
    background: #fbfdff;
}

.logo-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #d9e2ea;
    background: #fff;
}

.logo-remove-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #f2c7ce;
    background: #fff5f6;
    color: #c23040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 4px;
    transition: all .15s ease;
}

.logo-remove-btn svg {
    width: 16px;
    height: 16px;
}

.logo-remove-btn:hover {
    background: #fde8eb;
    border-color: #e7a9b3;
}

.logo-row.is-removing {
    border-color: #f2c7ce;
    background: #fff7f8;
}

.btn {
    border: 1px solid transparent;
    border-radius: var(--bordar);
    padding-left: .75rem;
    padding-right: .75rem;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 2.25rem;
}

.btn-primary {
    color: #fff;
    background: var(--botoes);
}

.btn-secondary {
    color: var(--color-secundary);
    background: #fff;
    border-color: var(--border);
}

.btn-danger { color: #c23040; border-color: #f2c7ce; background: #fff; }
.btn-warning { color: #a86800; border-color: #f6ddb8; background: #fff8ee; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid #edf2f6; font-size: 13px; text-align: left; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: #6a7d90; }

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
}

.badge.success { background: #e6f7ee; color: #178d5a; }
.badge.warning { background: #fff3e1; color: #b36f00; }
.badge.danger { background: #fde8eb; color: #bc2b3b; }
.badge.muted { background: #edf1f5; color: #627487; }

.empty {
    text-align: center;
    color: #6a7d90;
    min-height: 120px;
    display: grid;
    place-items: center;
}

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 10px;
}

.alert-success { background: #e6f7ee; color: #0f7f4d; }
.alert-danger { background: #fde8eb; color: #bc2b3b; }
.alert-warning { background: #fff3e1; color: #b36f00; }

#toasts {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 120;
    display: grid;
    gap: 8px;
}

.toast {
    min-width: 280px;
    border: 1px solid var(--border);
    background: #fff;
    border-left-width: 5px;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 9px 24px rgba(8, 25, 36, .12);
    font-size: 13px;
    font-weight: 600;
}
.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* Baixa de Parcela (modal) */
.cpb-modal {
    width: min(980px, 96vw);
    max-height: 92vh;
    border: none;
    border-radius: 20px;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 24px 54px rgba(8, 23, 37, 0.28);
}

.cpb-modal::backdrop {
    background: rgba(3, 17, 30, 0.58);
    backdrop-filter: blur(2px);
}

.cpb-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: linear-gradient(180deg, #f6fbff 0%, #ffffff 52%);
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.cpb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.cpb-head .btn {
    width: auto;
    min-width: 108px;
}

.cpb-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #0e1d2f;
}

.cpb-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.cpb-meta-card {
    border: 1px solid #d4e0ec;
    border-radius: var(--bordar);
    background: #ffffff;
    padding: 12px 14px;
}

.cpb-meta-label {
    display: block;
    font-size: 12px;
    color: #5f7083;
    margin-bottom: 4px;
}



.cpb-input-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.cpb-input-grid .form-group { display: flex; flex-direction: column; gap: var(--gap8); }

.cpb-section {
    border: 1px solid #d4e0ec;
    border-radius: var(--bordar);
    background: #fff;
    padding: 12px;
}

.cpb-section-title {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 800;
    color: #16273b;
    letter-spacing: 0.01em;
}

.cpb-pay-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.cpb-pay-btn {
    display: flex;
    min-height: 70px;
    align-items: center;
    text-align: center;
    line-height: 1.08;
    white-space: normal;
    flex-direction: column;
}

.cpb-pay-btn small {
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.cpb-price-box {
    border-left: 4px solid #c4b5fd;
}

.cpb-price-intro {
    margin: 0 0 10px;
    color: #5f7083;
    font-weight: 700;
}

.cpb-price-options {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.cpb-price-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #dfe7f1;
    border-radius: 12px;
    padding: 10px;
    background: #fbfdff;
}

.cpb-price-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.cpb-price-option strong {
    display: block;
    line-height: 1.2;
}

.cpb-price-option small {
    display: block;
    margin-top: 2px;
    color: #607184;
    font-weight: 600;
}

.cpb-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.cpb-preview-card {
    border: 1px solid #dfe7f1;
    border-radius: 12px;
    background: #f8fbff;
    padding: 10px;
}

.cpb-preview-card small {
    display: block;
    color: #607184;
    font-weight: 700;
    margin-bottom: 4px;
}

.cpb-preview-card strong {
    display: block;
    font-size: 24px;
    line-height: 1;
    color: #10213b;
}

.cpb-preview-card span {
    display: block;
    color: #5f7083;
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.cpb-preview-note {
    margin-bottom: 10px;
    color: #5f7083;
    font-size: 12px;
    font-weight: 700;
}

.cpb-alert {
    margin-top: 10px;
}

.cpb-extra-grid {
    margin-top: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cpb-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cpb-actions .btn {
    width: auto;
    min-width: 172px;
}

.mobile-only { display: none; }

.sidebar-backdrop {
    display: none;
}

@media (max-width: 980px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        z-index: 100;
        transition: left .25s ease;
    }
    .sidebar.open { left: 0; }
    .mobile-only { display: inline-flex; }
    .search { min-width: 180px; }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 19, 24, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 90;
    }
    .sidebar-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }
    body.sidebar-open-mobile {
        overflow: hidden;
    }
    .cpb-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cpb-input-grid,
    .cpb-pay-grid,
    .cpb-extra-grid,
    .cpb-preview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .cpb-title {
        font-size: 28px;
    }
}

@media (max-width: 880px) {
    .display-none2 { display: none; }
    .display-none3 { display: flex !important;
        height: 2.25rem;
        align-items: center;}
}

@media (max-width: 767px) {
    .cpb-input-grid,
    .cpb-pay-grid,
    .cpb-extra-grid,
    .cpb-preview {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .topbar { padding: 10px; }
    .content-shell { padding: 10px; }
    .page-surface { padding: 12px; overflow-x: hidden; }
    .user-chip small { display: none; }
    .search { min-width: 120px; }
    .cpb-meta-grid {
        grid-template-columns: 1fr;
    }
    .cpb-title {
        font-size: 24px;
    }
    .cpb-actions .btn {
        width: 100%;
    }
    .display-none { display: none; }
}

.page-header p{ 
    margin: 6px 0 0;
    color: #5c6d81; 
    font-size: 14px;
}


.btn-primary svg {
    width: 18px;
    height: 18px;
    color: var(--panel);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
    color: var(--color-secundary);
}

.btn-danger svg{ 
    width: 18px;
    height: 18px;
    color: var(--danger);
}
.btn-warning svg { color: #a86800; 
    width: 18px;
    height: 18px;
}
.display-none3 { display: none; }
.display-none-botao { display: none; }

.actions-row { display:flex; gap:6px;}

.filter-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px;}
.filter-tab { border:0px solid #d2dcea; border-radius:10px; background:#f3f6fb; color:#5f6f83;  font-size:12px; padding:9px 12px; cursor:pointer; }
.filter-tab.active { background: var(--botoes); color:#fff; font-weight: 700; }

.filter-tabs,
.table-wrap,
.filter-tabs2 {
    max-width: 100%;
    min-width: 0;
}

.filter-tabs2 { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px;}
.filter-tab2 { border:0px solid #d2dcea; border-radius:10px; background:#f3f6fb; color:#5f6f83;  font-size:12px; padding: 5px 8px; cursor:pointer; }
.filter-tab2.active { background: var(--botoes); color:#fff; font-weight: 700; }
.filter-tab2 svg{width: 18px; height: 18px;}

.filter-tabs2 .cob-order-row { display:flex; justify-content: flex-end; gap:10px; }


.lancamento {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 640px) {
.filter-tabs {
        grid-template-columns: 1fr 1fr;
    }
.filter-tabs2 {
        grid-template-columns: 1fr 1fr;
    }
.filter-tab2 {
    width: 100%;
}
 .filter-tab2 svg {
    width: 12px;
    height: 12px;
}
.filter-tabs2 .cob-order-row {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}
}

@media (max-width: 420px) {
.filter-tabs {
        grid-template-columns: 1fr;
    }
.filter-tabs2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
.display-none-botao { display: block; }
}
