:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #667085;
    --primary: #1f4e79;
    --primary-dark: #173b5c;
    --border: #d9e2ec;
    --danger: #b42318;
    --success: #067647;
    --warning: #b54708;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

.topbar {
    position: fixed;
    left: 220px;
    right: 0;
    top: 0;
    height: 58px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    z-index: 2;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 220px;
    background: #102a43;
    padding: 18px 0;
    overflow-y: auto;
}

.sidebar a {
    display: block;
    color: #ffffff;
    padding: 12px 20px;
    border-left: 4px solid transparent;
}

.sidebar a:hover {
    background: #1f4e79;
    border-left-color: #ffffff;
}

.content {
    margin-left: 220px;
    padding: 82px 26px 30px;
}

.login-content {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-box {
    background: var(--panel);
    width: 420px;
    max-width: 100%;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(16, 42, 67, 0.15);
}

h1 {
    margin-top: 0;
    font-size: 28px;
}

h2 {
    margin-top: 26px;
    font-size: 21px;
}

h3 {
    margin-top: 0;
    color: var(--muted);
    font-size: 16px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 3px 12px rgba(16, 42, 67, 0.05);
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

.big-number {
    font-size: 38px;
    font-weight: bold;
    color: var(--primary);
}

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

label {
    display: block;
    font-weight: bold;
    margin: 12px 0 6px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: #ffffff;
}

select[multiple] {
    height: auto;
}

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

.check,
.checks label {
    font-weight: normal;
}

.check input,
.checks input {
    width: auto;
    margin-right: 8px;
}

.checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: #ffffff;
    border: 0;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.btn-light {
    background: #eef2f6;
    color: var(--text);
}

.btn-light:hover {
    background: #d9e2ec;
    color: var(--text);
}

.btn-small {
    padding: 7px 10px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    margin-top: 16px;
}

.filters {
    display: flex;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.filters input,
.filters select {
    max-width: 280px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th,
td {
    padding: 10px 9px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #344054;
    font-size: 14px;
}

tr:hover td {
    background: #fbfdff;
}

.danger-row td {
    background: #fff4f2;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin: 5px 0 0;
}

.messages {
    margin-bottom: 16px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.alert-success {
    background: #ecfdf3;
    color: var(--success);
}

.alert-danger {
    background: #fef3f2;
    color: var(--danger);
}

.alert-warning {
    background: #fffaeb;
    color: var(--warning);
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
    }

    .topbar {
        position: static;
        left: 0;
    }

    .content {
        margin-left: 0;
        padding: 20px;
    }

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

    .filters {
        display: block;
    }

    .filters input,
    .filters select {
        max-width: 100%;
        margin-bottom: 8px;
    }

    table {
        font-size: 13px;
    }
}

.soft-card {
    background: #f8fafc;
    box-shadow: none;
}

.right { text-align: right; }
.small-money { font-size: 28px; }
@media print {
    .sidebar, .topbar, .no-print, .messages { display: none !important; }
    .content { margin: 0; padding: 0; }
    .card, .print-card { box-shadow: none; border: none; }
    body { background: #ffffff; }
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #8f1c13;
    color: #ffffff;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 22px 0;
}


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

.actions-cell {
    white-space: nowrap;
}

.statement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.statement-status {
    text-align: right;
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 10px;
}

.statement-info {
    margin-top: 10px;
}

.print-note {
    margin-top: 24px;
}

@media print {
    .statement-header { border-bottom: 1px solid #000; }
    .soft-card { border: 1px solid #ddd; }
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; page-break-after: auto; }
}

/* Version 12 - Estado de cuenta mas profesional */
.statement-document {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.statement-title-bar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.statement-company {
    font-size: 30px;
    font-weight: bold;
    color: var(--primary);
}

.statement-box {
    text-align: right;
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 18px;
    line-height: 1.6;
    min-width: 210px;
}

.status-pill {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2f6;
    font-size: 13px;
}

.statement-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 18px;
}

.statement-meta-grid > div {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: #ffffff;
}

.statement-meta-grid p {
    margin: 6px 0;
}

.statement-summary-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.statement-summary-band div {
    background: #102a43;
    color: #ffffff;
    border-radius: 12px;
    padding: 16px;
}

.statement-summary-band span {
    display: block;
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.statement-summary-band strong {
    font-size: 26px;
}

.statement-table .total-row th,
.statement-table .balance-row th {
    background: #f8fafc;
    font-size: 16px;
}

.statement-footer {
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

@media print {
    .statement-document {
        max-width: none;
        margin: 0;
        padding: 0;
        font-size: 12px;
    }

    .statement-title-bar {
        border-bottom: 2px solid #000;
    }

    .statement-company {
        color: #000;
    }

    .statement-box,
    .statement-meta-grid > div,
    .status-pill {
        background: #fff !important;
        border-color: #000;
    }

    .statement-summary-band div {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000;
    }

    .statement-summary-band strong {
        font-size: 20px;
    }

    th {
        background: #f2f2f2 !important;
    }
}

.btn-success {
    background: #067647;
    color: #ffffff;
}

.btn-success:hover {
    background: #045d38;
    color: #ffffff;
}

.summary-table {
    margin-bottom: 18px;
}


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

.inline-form {
    display: inline-block;
    margin: 0;
}


.report-location-title {
    margin: 8px 0 16px;
    padding: 10px 14px;
    background: #eef2f6;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    font-size: 18px;
}

.card ol,
.card ul {
    line-height: 1.6;
}

.card li {
    margin-bottom: 5px;
}
