* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #788196;
    --border: #e7eaf0;
    --dark: #111827;

    --jany: #e96b9a;
    --jms: #4d8df7;
    --shared: #737b8c;

    --danger: #e05252;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
a {
    font: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

.app {
    min-height: 100vh;
    display: flex;
}


/* SIDEBAR */

.sidebar {
    width: 255px;
    background: var(--dark);
    color: white;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 10px 30px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: white;
    color: var(--dark);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.brand strong {
    display: block;
    font-size: 16px;
}

.brand span {
    display: block;
    font-size: 11px;
    color: #9ca5b7;
    margin-top: 3px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar a {
    padding: 12px 14px;
    border-radius: 9px;
    color: #aeb6c6;
    font-size: 14px;
}

.sidebar a:hover,
.sidebar a.active {
    background: #1f2937;
    color: white;
}

.sidebar-bottom {
    margin-top: auto;
}


/* MAIN */

.main {
    width: calc(100% - 255px);
    margin-left: 255px;
}

.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    min-height: 82px;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar h1 {
    margin: 0;
    font-size: 23px;
}

.topbar span {
    color: var(--muted);
    font-size: 13px;
}

.mobile-menu {
    display: none;
    border: 0;
    background: none;
    font-size: 24px;
}

.content {
    padding: 30px;
    max-width: 1500px;
}


/* DASHBOARD */

.hero-card {
    background: var(--dark);
    color: white;
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 18px;
}

.hero-card span {
    color: #aeb6c6;
    font-size: 13px;
}

.hero-card strong {
    display: block;
    font-size: 38px;
    margin: 8px 0;
}

.hero-card small {
    color: #929bad;
}


.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card,
.company-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.stat-card {
    padding: 21px;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin: 8px 0;
    font-size: 23px;
}

.stat-card small {
    color: var(--muted);
}

.stat-card.warning strong {
    color: var(--danger);
}


/* EMPRESAS */

.companies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.company-card {
    padding: 21px;
    border-top: 4px solid var(--shared);
}

.company-card.janydoces {
    border-top-color: var(--jany);
}

.company-card.jmsprint {
    border-top-color: var(--jms);
}

.company-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.company-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--shared);
}

.janydoces .company-dot {
    background: var(--jany);
}

.jmsprint .company-dot {
    background: var(--jms);
}

.company-card > strong {
    font-size: 27px;
}

.company-details {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    font-size: 12px;
}

.company-details span {
    color: var(--muted);
}


/* PAINÉIS */

.dashboard-columns {
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    gap: 18px;
}

.panel {
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 0;
    font-size: 15px;
}

.panel-header a {
    color: var(--jms);
    font-size: 12px;
}

.movement {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid var(--shared);
}

.movement:last-child {
    border-bottom: 0;
}

.movement.jany {
    border-left-color: var(--jany);
}

.movement.jms {
    border-left-color: var(--jms);
}

.movement div strong {
    display: block;
    font-size: 14px;
}

.movement div span {
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px;
    display: block;
}

.movement b {
    font-size: 14px;
}

.movement.jany b,
.movement.jms b {
    color: #24915c;
}

.movement.shared b {
    color: var(--danger);
}

.conference-status {
    min-height: 130px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff0f0;
    color: var(--danger);
    display: grid;
    place-items: center;
    font-weight: bold;
}

.conference-status div:nth-child(2) {
    flex: 1;
}

.conference-status strong {
    display: block;
    font-size: 13px;
}

.conference-status span {
    color: var(--muted);
    font-size: 11px;
    display: block;
    margin-top: 5px;
}

.conference-status > b {
    color: var(--danger);
}


/* PÁGINAS VAZIAS */

.empty-page {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    min-height: 500px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.empty-icon {
    font-size: 50px;
    color: var(--muted);
}

.empty-page h2 {
    margin: 12px 0 5px;
}

.empty-page p,
.empty-page small {
    color: var(--muted);
}


/* MOBILE */

@media (max-width: 900px) {

    .sidebar {
        width: 220px;
    }

    .main {
        width: calc(100% - 220px);
        margin-left: 220px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .companies-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 700px) {

    .sidebar {
        display: none;
    }

    .main {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        padding: 17px 18px;
    }

    .topbar h1 {
        font-size: 19px;
    }

    .mobile-menu {
        display: block;
    }

    .content {
        padding: 15px;
    }

    .hero-card {
        padding: 23px;
    }

    .hero-card strong {
        font-size: 32px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card strong {
        font-size: 18px;
    }
}


@media (max-width: 430px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-card strong {
        font-size: 29px;
    }

    .company-card {
        padding: 18px;
    }
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.module-header h2 {
    margin: 0 0 5px;
    font-size: 22px;
}

.module-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.primary-button {
    border: 0;
    background: var(--dark);
    color: white;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 600;
}

.primary-button:hover {
    opacity: .9;
}

.flash {
    border-radius: 10px;
    padding: 13px 16px;
    margin-bottom: 18px;
    font-size: 13px;
}

.flash.success {
    background: #eaf8f0;
    color: #237a4c;
}

.flash.error {
    background: #fff0f0;
    color: #b43d3d;
}

.movement-form-panel {
    margin-bottom: 20px;
}

.movement-form {
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group.form-wide {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px;
    background: white;
    color: var(--text);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #9ba4b5;
}

.type-buttons {
    display: flex;
    gap: 10px;
}

.type-option {
    cursor: pointer;
}

.type-option input {
    display: none;
}

.type-option span {
    display: block;
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 9px;
    font-size: 13px;
}

.type-option.entrada input:checked + span {
    background: #eaf8f0;
    color: #237a4c;
    border-color: #b9e3cb;
}

.type-option.saida input:checked + span {
    background: #fff0f0;
    color: #b43d3d;
    border-color: #f0c0c0;
}

.form-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.empty-history {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--muted);
}

.empty-history div {
    font-size: 35px;
}

.empty-history strong {
    color: var(--text);
}

.empty-history span {
    font-size: 12px;
}

.movement-row {
    min-height: 74px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid var(--shared);
    display: grid;
    grid-template-columns: 1fr 170px 150px 35px;
    gap: 15px;
    align-items: center;
}

.movement-row:last-child {
    border-bottom: 0;
}

.movement-main {
    display: flex;
    align-items: center;
    gap: 11px;
}

.movement-company-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.movement-main strong {
    display: block;
    font-size: 13px;
}

.movement-main span,
.movement-date {
    color: var(--muted);
    font-size: 11px;
}

.value-positive {
    color: #24915c;
    font-weight: 700;
    text-align: right;
}

.value-negative {
    color: var(--danger);
    font-weight: 700;
    text-align: right;
}

.delete-button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: #fff0f0;
    color: var(--danger);
    cursor: pointer;
    font-size: 20px;
}

@media (max-width: 700px) {

    .module-header {
        align-items: flex-start;
        gap: 15px;
    }

    .module-header .primary-button {
        white-space: nowrap;
        padding: 10px 13px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.form-wide {
        grid-column: auto;
    }

    .movement-form {
        padding: 18px;
    }

    .movement-row {
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 15px;
    }

    .movement-date {
        grid-column: 1;
    }

    .movement-row > div:nth-child(3) {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .movement-row form {
        display: none;
    }

}


/* MENU MOBILE */

@media (max-width: 700px) {

    .sidebar {
        display: flex;
        position: fixed;
        z-index: 1000;
        width: 270px;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, .15);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

}


/* MOVIMENTAÇÕES */

.movement-form-panel {
    margin-bottom: 20px;
}

.movement-form {
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group.form-wide {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px;
    background: white;
    color: var(--text);
    outline: none;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #9ba4b5;
}

.type-buttons {
    display: flex;
    gap: 10px;
}

.type-option {
    cursor: pointer;
}

.type-option input {
    display: none;
}

.type-option span {
    display: block;
    border: 1px solid var(--border);
    padding: 11px 20px;
    border-radius: 9px;
    font-size: 13px;
    transition: .15s;
}

.type-option.entrada input:checked + span {
    background: #eaf8f0;
    color: #237a4c;
    border-color: #b9e3cb;
}

.type-option.saida input:checked + span {
    background: #fff0f0;
    color: #b43d3d;
    border-color: #f0c0c0;
}

.form-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.primary-button {
    border: 0;
    background: var(--dark);
    color: white;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 600;
}

.primary-button:hover {
    opacity: .9;
}


/* HISTÓRICO */

.movement-table {
    width: 100%;
}

.movement-row {
    min-height: 74px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid var(--shared);
    display: grid;
    grid-template-columns: 1fr 170px 150px 35px;
    gap: 15px;
    align-items: center;
}

.movement-row:last-child {
    border-bottom: 0;
}

.movement-main {
    display: flex;
    align-items: center;
    gap: 11px;
}

.movement-company-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.movement-main strong {
    display: block;
    font-size: 13px;
}

.movement-main span,
.movement-date {
    color: var(--muted);
    font-size: 11px;
}

.value-positive {
    color: #24915c;
    font-weight: 700;
    text-align: right;
}

.value-negative {
    color: var(--danger);
    font-weight: 700;
    text-align: right;
}

.delete-button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: #fff0f0;
    color: var(--danger);
    cursor: pointer;
    font-size: 20px;
}


/* AVISOS */

.flash {
    border-radius: 10px;
    padding: 13px 16px;
    margin-bottom: 18px;
    font-size: 13px;
}

.flash.success {
    background: #eaf8f0;
    color: #237a4c;
}

.flash.error {
    background: #fff0f0;
    color: #b43d3d;
}


/* RESPONSIVO */

@media (max-width: 700px) {

    .module-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 15px;
        margin-bottom: 18px;
    }

    .module-header h2 {
        margin: 0 0 5px;
        font-size: 20px;
    }

    .module-header p {
        margin: 0;
        color: var(--muted);
        font-size: 12px;
    }

    .module-header .primary-button {
        white-space: nowrap;
        padding: 10px 13px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.form-wide {
        grid-column: auto;
    }

    .movement-form {
        padding: 18px;
    }

    .movement-row {
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 15px;
    }

    .movement-date {
        grid-column: 1;
    }

    .movement-row > div:nth-child(3) {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .movement-row form {
        display: none;
    }

}



@media (max-width: 700px) {

    .sidebar.mobile-open {
        transform: translateX(0);
    }

}




.menu-toggle {
    display: none;
}

@media (max-width: 700px) {

    .sidebar {
        display: flex;
        position: fixed;
        z-index: 1000;
        width: 270px;
        max-width: 85vw;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, .15);
    }

    .menu-toggle:checked ~ .app .sidebar {
        transform: translateX(0);
    }

    .mobile-menu {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 24px;
        user-select: none;
    }

}



@media (max-width: 700px) {

    .sidebar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 270px;
        max-width: 85vw;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-menu {
        display: grid !important;
        position: relative;
        z-index: 10000;
        cursor: pointer;
    }

}


.movement-main > div:last-child strong {
    font-size: 15px;
    font-weight: 700;
}

.movement-main > div:last-child span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
}


.movement-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.movement-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--text);
    line-height: 1.2;
}

.movement-company {
    font-size: 11px !important;
    color: var(--muted);
}


.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 18px;
}



@media (max-width: 700px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}



.dashboard-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
}



@media screen and (max-width: 700px) {

    .dashboard .dashboard-stats {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .dashboard .dashboard-stats .stat-card {
        width: 100% !important;
        min-width: 0 !important;
    }

}




.account-group {
    overflow: hidden;
}

.account-row {
    min-height: 70px;
    padding: 15px 18px;
    display: grid;
    grid-template-columns: 1fr auto 35px;
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.account-row:last-child {
    border-bottom: 0;
}

.account-info strong {
    display: block;
    font-size: 14px;
}

.account-info span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px;
}

.account-balance {
    font-size: 15px;
}

@media (max-width: 700px) {

    .account-row {
        grid-template-columns: 1fr auto;
    }

    .account-row form {
        display: none;
    }

}




.account-stats {
    margin-bottom: 20px;
}

.account-values {
    display: flex;
    align-items: center;
    gap: 28px;
}

.account-values > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.account-values span {
    font-size: 10px;
    color: var(--muted);
}

.account-values strong {
    font-size: 12px;
}

.account-current {
    padding-left: 28px;
    border-left: 1px solid var(--border);
}

.account-current strong {
    font-size: 17px;
}

@media (max-width: 700px) {

    .account-values {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding-top: 8px;
    }

    .account-current {
        padding-left: 0;
        border-left: 0;
    }

}




.conference-list {
    width: 100%;
}

.conference-row {
    display: grid;
    grid-template-columns: 1.5fr .8fr .8fr .7fr;
    gap: 20px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid var(--shared);
}

.conference-row:last-child {
    border-bottom: 0;
}

.conference-account {
    display: flex;
    align-items: center;
    gap: 11px;
}

.conference-account strong {
    display: block;
    font-size: 14px;
}

.conference-account span,
.conference-system span,
.conference-difference span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 4px;
}

.conference-system strong {
    font-size: 14px;
}

.conference-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.conference-input label {
    color: var(--muted);
    font-size: 10px;
}

.conference-input input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px;
    outline: none;
    font-size: 14px;
}

.conference-difference strong {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: var(--danger);
}

.conference-observation {
    margin-top: 18px;
    padding: 20px;
}

.value-positive {
    color: #24915c !important;
}

.value-negative {
    color: var(--danger) !important;
}

@media (max-width: 700px) {

    .conference-row {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 16px;
    }

    .conference-account {
        grid-column: 1 / -1;
    }

    .conference-system {
        grid-column: 1;
    }

    .conference-input {
        grid-column: 2;
    }

    .conference-difference {
        grid-column: 1 / -1;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

}