:root {
    --geo-blue: #2159a6;
    --geo-blue-dark: #163f77;
    --geo-ink: #192d45;
    --geo-line: #e1e7ef;
    --geo-bg: #f4f6fa;
    --geo-soft: #f5f7fb;
}
body { font-size: 14px; line-height: 1.55; }
.developer-credit { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1010; min-height: 38px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); text-align: center; color: #718096; background: #fff; border-top: 1px solid var(--geo-line); font-size: 11px; }
.developer-credit a { color: #2159a6; font-weight: 700; text-decoration: none; }
.developer-credit a:hover { text-decoration: underline; }
.login-shell { padding-bottom: 76px; }
.business-description { color: var(--geo-muted); margin: 10px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.business-contact { color: #718096; margin: 10px 0 0; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.business-overview { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: #fff; border: 1px solid var(--geo-line); border-radius: 12px; margin-bottom: 26px; }
.business-home-logo { width: 52px; height: 52px; object-fit: contain; flex: 0 0 auto; }
.business-overview-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.business-overview-copy strong { font-size: 16px; }
.business-overview-copy p { margin: 3px 0; color: var(--geo-muted); font-size: 12px; }
.business-overview-copy small { color: var(--geo-muted); font-size: 11px; }
.business-logo-editor { display: flex; gap: 24px; align-items: center; margin-bottom: 20px; }
.business-logo-editor > div { min-width: 0; flex: 1; }
.business-logo-preview { width: 112px; height: 112px; object-fit: contain; padding: 10px; border: 1px solid var(--geo-line); border-radius: 12px; background: #f8fafc; }
.app-container { max-width: 1440px; padding-left: 32px; padding-right: 32px; margin: auto; }
.app-main { padding-top: 32px; }
.app-header { background: #fff; border-bottom: 1px solid var(--geo-line); box-shadow: 0 3px 16px #19355406; z-index: 1020; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--geo-ink); min-width: 0; }
.brand > span { min-width: 0; max-width: 320px; }
.brand strong, .brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand strong { display: block; font-size: 23px; letter-spacing: .1em; line-height: 1.1; }
.brand small { display: block; font-size: 11px; color: var(--geo-muted); margin-top: 4px; }
.nav-logo { width: 46px; height: 46px; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.sync-status { border-radius: 6px; font-weight: 500; font-size: 11px; max-width: 180px; white-space: normal; line-height: 1.35; }
.sync-status.text-bg-success { color: #246b50 !important; background: #edf7f2 !important; }
.primary-nav { display: flex; align-items: stretch; gap: 6px; }
.primary-link { position: relative; display: flex; gap: 9px; align-items: center; justify-content: center; color: #68778d; padding: 16px 21px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.primary-link:hover { background: #f7f9fc; color: var(--geo-blue); }
.primary-link.active { color: var(--geo-blue); background: #f0f5fc; }
.primary-link.active::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--geo-blue); }
.primary-link.new-record { margin-left: auto; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; min-height: 44px; }
.account-menu summary::-webkit-details-marker { display: none; }
.user-avatar { display: grid; place-items: center; background: #eef3f9; color: #456285; border: 1px solid #e1e9f1; border-radius: 50%; width: 40px; height: 40px; }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.account-name small { display: block; font-size: 10px; font-weight: 400; color: var(--geo-muted); }
.account-panel { position: absolute; right: 0; top: calc(100% + 12px); width: 265px; padding: 18px; border: 1px solid var(--geo-line); border-radius: 14px; background: white; box-shadow: 0 16px 50px #1d354b26; z-index: 1040; }
.account-panel > strong, .account-panel > small { display: block; overflow-wrap: anywhere; }
.account-panel > small { padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--geo-line); }
.account-panel a, .account-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 8px; border: 0; background: transparent; text-align: left; color: var(--geo-ink); border-radius: 6px; min-height: 44px; }
.account-panel a:hover, .account-panel button:hover { background: var(--geo-soft); }
.page-heading { align-items: center; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(1.65rem, 2.3vw, 2rem); letter-spacing: -.035em; font-weight: 700; }
.page-heading p { font-size: 13px; }
.page-heading .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .13em; margin: 0 0 6px; color: #728198; }
.btn { gap: 8px; min-height: 44px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.btn-lg { padding: 10px 18px; font-size: 14px; }
.btn-outline-secondary { border-color: #d5deea; color: #52647b; }
.icon-button { width: 42px; min-width: 42px; height: 42px; padding: 9px; }
.action-buttons { flex-wrap: nowrap; }
.action-buttons .btn { width: 42px; min-width: 42px; padding: 9px; }
.action-buttons .btn-outline-primary { background: #eff5ff; border-color: #e3edfc; }
.action-buttons .btn-outline-secondary { background: #f6f8fb; border-color: #e6ebf2; }
.action-buttons .btn-outline-danger { color: #b73f49; background: #fff3f3; border-color: #ffe2e3; }
.action-buttons .btn:hover { background: #dce9f9; color: #163f77; }
.action-buttons .btn-outline-danger:hover { background: #fbe1e3; color: #92252e; }
:is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #498ce0; outline-offset: 3px; }
.summary-grid { grid-template-columns: 1.4fr repeat(3, 1fr); gap: 18px; }
.summary-card { border-radius: 14px; padding: 24px; box-shadow: 0 3px 10px #18395304; }
.summary-card span { font-size: 10px; letter-spacing: .07em; font-weight: 600; }
.summary-card strong { font-size: clamp(1.3rem, 2vw, 1.9rem); font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.balance-card { background: #193f70; border-color: #193f70; }
.balance-card span { color: #c9d9ed; }
.content-block, .form-shell { border-radius: 14px; padding: 24px; box-shadow: 0 3px 12px #16365003; }
.section-title { margin-bottom: 20px; }
.section-title h2, .content-block h2, .form-section-title { font-size: 16px; font-weight: 650; }
.form-section-title { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.filter-bar { border-radius: 12px; padding: 20px; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 14px; margin-bottom: 20px; }
.dashboard-filter, .project-filter { grid-template-columns: minmax(200px, 360px) auto; background: transparent; border: 0; padding: 0; }
.dashboard-filter .filter-actions, .project-filter .filter-actions { justify-content: flex-start; }
.form-label { font-size: 12px; font-weight: 600; color: #50617a; }
.form-control, .form-select { font-size: 14px; min-height: 44px; border-radius: 8px; }
.app-table { font-size: 13px; }
.app-table thead th { font-size: 10px; font-weight: 600; letter-spacing: .055em; color: #758399; padding: 14px 12px; }
.app-table td { padding: 15px 12px; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: #f9fbfe; }
.description-cell { min-width: 160px; }
.money { font-weight: 650; font-variant-numeric: tabular-nums; }
.badge { padding: 6px 9px; border-radius: 5px; font-weight: 600; font-size: 10px; }
.app-table .text-bg-success { background: #eaf7f0 !important; color: #24734e !important; }
.app-table .text-bg-danger { background: #fceef0 !important; color: #b33b4d !important; }
.period-summary > div, .detail-grid article { border-radius: 12px; }
.period-summary span, .detail-grid span { font-size: 10px; letter-spacing: .04em; }
.export-actions { gap: 10px; margin: 20px 0; }
.export-actions .btn-success { background: #eef8f3; color: #246d50; border-color: #d3e9dd; }
.export-actions .btn-danger { background: #fff4f3; color: #a54544; border-color: #f0d9d8; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.permission-option { display: flex; align-items: center; gap: 14px; border: 1px solid var(--geo-line); padding: 16px; border-radius: 10px; cursor: pointer; height: 100%; min-height: 64px; }
.permission-option:hover { border-color: #91b1dc; }
.permission-option:has(input:checked) { background: #f0f5fc; border-color: #a9c2e3; }
.permission-option input { width: 20px; height: 20px; flex-shrink: 0; margin: 0; }
.permission-option small { display: block; color: var(--geo-muted); margin-top: 3px; }
.permission-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.permission-tag { background: #f0f4f9; color: #526881; padding: 3px 8px; border-radius: 5px; font-size: 11px; }
.user-editor { max-width: 980px; }
.legacy-pending-item { padding: 16px 0; border-bottom: 1px solid var(--geo-line); overflow-wrap: anywhere; }
.login-card { border-radius: 18px; }
.login-brand h1 { font-size: 20px; }
.login-body { background: #edf2f8; }
/* Let Bootstrap's grid own its gutters rather than adding a second gap. */
.row.g-3 { gap: 0; }
@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}
@media (max-width: 1199px) {
    .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-filter, .project-filter { grid-template-columns: minmax(0, 360px) auto; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .balance-card { grid-column: auto; }
}
@media (max-width: 767.98px) {
    .brand { flex: 1; }
    .topbar-actions { flex: 0 0 auto; }
    .brand > span { flex: 1; }
    .brand strong { letter-spacing: 0; }
    .business-overview { gap: 10px; padding: 14px; align-items: flex-start; }
    .business-home-logo { width: 36px; height: 36px; }
    .business-overview-copy strong { font-size: 14px; }
    .business-logo-editor { flex-direction: column; align-items: stretch; }
    .business-logo-preview { align-self: flex-start; }
    .app-container { padding-left: 18px; padding-right: 18px; }
    .app-main { padding-top: 24px; }
    .app-topbar { min-height: 72px; }
    .brand { gap: 8px; }
    .brand strong { font-size: 21px; }
    .brand small { font-size: 10px; }
    .nav-logo { width: 36px; height: 36px; }
    .topbar-actions { gap: 10px; }
    .account-name { display: none; }
    .sync-status { max-width: 98px; font-size: 9px; padding: 5px 7px; }
    .user-avatar { width: 36px; height: 36px; }
    .primary-nav { padding: 0 8px; gap: 0; }
    .primary-link { flex: 1; flex-direction: column; gap: 5px; padding: 11px 2px 13px; font-size: 10px; min-width: 0; }
    .primary-link .app-icon { width: 19px; height: 19px; }
    .primary-link.new-record { margin-left: 0; }
    .primary-link.active::after { left: 8px; right: 8px; }
    .page-heading { flex-direction: column; align-items: stretch; gap: 18px; }
    .page-heading h1 { font-size: 26px; }
    .page-heading .btn { width: auto; }
    .page-heading > .btn { align-self: flex-start; }
    .summary-grid { gap: 10px; }
    .summary-card { padding: 17px 14px; border-radius: 12px; }
    .summary-card span { font-size: 9px; }
    .summary-card strong { font-size: clamp(16px, 4.4vw, 23px); overflow-wrap: anywhere; }
    .balance-card { grid-column: auto; }
    .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; gap: 12px; }
    .dashboard-filter, .project-filter { grid-template-columns: 1fr; padding: 0; }
    .filter-actions { grid-column: 1 / -1; }
    .filter-actions .btn { flex: 1; }
    .content-block, .form-shell { padding: 18px; border-radius: 12px; }
    .content-block:has(.mobile-cards) { padding: 0; border: 0; background: transparent; box-shadow: none; }
    .section-title { margin-bottom: 16px; }
    .table-responsive:has(.mobile-cards) { overflow: visible; }
    .mobile-cards { display: block; min-width: 0; width: 100%; }
    .mobile-cards thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
    .mobile-cards tbody { display: grid; gap: 14px; }
    .mobile-cards tr { display: block; min-width: 0; border: 1px solid var(--geo-line); background: #fff; border-radius: 12px; padding: 10px 16px; }
    .mobile-cards td { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-width: 0; max-width: none; border: 0; padding: 8px 0; text-align: right; overflow-wrap: anywhere; }
    .mobile-cards td::before { content: attr(data-label); color: #78869a; text-align: left; font-size: 11px; font-weight: 500; flex: 0 0 94px; }
    .mobile-cards td > * { min-width: 0; max-width: 100%; }
    .mobile-cards td[colspan] { display: block; text-align: center; }
    .mobile-cards td[colspan]::before { display: none; }
    .mobile-cards td[data-label="Acciones"] { align-items: center; border-top: 1px solid #edf1f7; margin-top: 8px; padding-top: 13px; }
    .mobile-cards .description-cell { white-space: normal; }
    .mobile-cards .money { white-space: normal; }
    .mobile-cards .permission-tags { justify-content: flex-end; }
    .mobile-cards .action-buttons { flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
    .icon-button, .action-buttons .btn { min-width: 44px; width: 44px; height: 44px; }
    .period-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .period-summary > div:last-child { grid-column: 1 / -1; }
    .period-summary strong { font-size: 17px; }
    .export-actions { flex-direction: row; }
    .export-actions .btn { flex: 1; width: auto; }
    .heading-actions { flex-direction: row; }
    .heading-actions .btn { width: auto; }
    .permission-grid { grid-template-columns: 1fr; }
    .form-control, .form-select { font-size: 16px; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid strong { overflow-wrap: anywhere; }
    .floating-action { display: none; }
    .row > * { margin-bottom: 4px; }
    .account-panel { max-width: calc(100vw - 36px); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
