* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 182px;
    background: #20263d;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}

.brand {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 10px 8px;
    background: #151b2d;
    overflow: hidden;
    font-size: 16px;
    font-weight: 700;
}

.sidebar .brand-logo,
.sidebar img[src="/empresa/logo/archivo"] {
    width: 155px;
    height: 48px;
    max-width: 155px;
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
    background: #ffffff;
    border-radius: 2px;
    padding: 2px;
    box-shadow: none;
    display: block;
    flex-shrink: 0;
}

.sidebar .brand-name {
    display: none;
}

.brand-icon {
    font-size: 18px;
    opacity: 0.95;
}

.menu {
    padding: 10px 7px 0;
}

.menu-item {
    height: 28px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #ffffff;
    text-decoration: none;
    padding: 0 9px;
    border-radius: 5px;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1;
    position: relative;
}

.menu-item:hover {
    background: rgba(255,255,255,0.08);
}

.menu-item.active {
    background: #3b82f6;
}

.menu-icon {
    width: 18px;
    font-size: 14px;
    text-align: center;
    opacity: 0.95;
}

.menu-plus {
    margin-left: auto;
    font-size: 17px;
    line-height: 1;
}

.menu-section {
    color: #9ca7c4;
    font-size: 10px;
    padding: 20px 10px 10px;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 8px;
}

.feature-btn {
    min-height: 30px;
    background: #333a58;
    color: #ffffff;
    border-radius: 5px;
    padding: 6px 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: 12px;
    font-size: 11px;
}

/* MAIN */
.main {
    margin-left: 182px;
    width: calc(100% - 182px);
    min-height: 100vh;
    background: #ffffff;
}

.topbar {
    height: 38px;
    border-bottom: 1px solid #dde3ef;
    background: #f7f8fd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 13px;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.refresh {
    color: #1f2937;
    font-size: 16px;
}

.search {
    position: relative;
    width: 255px;
    height: 30px;
    background: #f0f2fa;
    border: 1px solid #d5dbea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 9px;
    gap: 6px;
}

.search-icon {
    width: 16px;
    height: 16px;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 11px;
    color: #374151;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    width: 360px;
    max-width: calc(100vw - 32px);
    padding: 6px;
    border: 1px solid #d5dbea;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

.search-suggestion-item {
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border-radius: 4px;
    color: #111827;
    text-decoration: none;
}

.search-suggestion-item:hover {
    background: #f3f6fb;
}

.search-suggestion-type,
.search-suggestion-subtitle {
    color: #64748b;
    font-size: 11px;
}

.search-suggestion-item strong {
    font-size: 12px;
}

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

.company {
    font-size: 12px;
    color: #000;
}

.top-btn {
    width: 29px;
    height: 29px;
    border: 1px solid #d4d9e7;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
}

.top-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    font-size: 20px;
    line-height: 20px;
}

.top-icon-btn {
    width: 29px;
    height: 29px;
    border: 1px solid #d4d9e7;
    background: #ffffff;
    color: #334155;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.top-icon-btn:hover {
    background: #f3f6fb;
    border-color: #c2ccdc;
    color: #1f2937;
}

.top-icon-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.top-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.top-refresh-btn {
    color: #1f2937;
}

.topbar .top-icon-btn.primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.topbar .top-icon-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.quick-create .top-icon-btn.primary {
    width: 30px;
    height: 30px;
}

.quick-menu-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a8adbd;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}

.quick-menu-icon svg {
    width: 10px;
    height: 10px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.avatar {
    width: 29px;
    height: 29px;
    border-radius: 50%;
    border: 1px solid #cfd7e8;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.page {
    min-height: calc(100vh - 38px);
    background: #ffffff;
}

/* HEADERS */
.page-header {
    padding: 23px 18px 0;
    min-height: 115px;
    background: #ffffff;
    border-bottom: 1px solid #e5eaf3;
}

.page-header h1 {
    font-size: 16px;
    margin: 0;
    font-weight: 700;
}

.subtitle {
    margin: 5px 0 0;
    color: #5d6b85;
    font-size: 12px;
}

.tabs {
    display: flex;
    gap: 22px;
    padding: 0 10px;
    margin-top: 22px;
}

.tab {
    padding: 0 0 13px;
    font-size: 12px;
    color: #111827;
}

.tab.active {
    color: #2563eb;
    border-bottom: 3px solid #3b82f6;
}

/* DASHBOARD */
.cards-grid {
    width: 835px;
    max-width: calc(100% - 28px);
    margin: 32px 0 32px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
}

.card {
    background: #ffffff;
    border: 1px solid #dfe5f0;
    border-radius: 9px;
    overflow: hidden;
}

.card.large {
    grid-column: span 2;
}

.card-header {
    height: 41px;
    background: #fbfbff;
    border-bottom: 1px solid #e5eaf3;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.link-btn {
    border: none;
    background: transparent;
    color: #006af5;
    cursor: pointer;
    font-size: 12px;
}

.small-text {
    font-size: 11px;
    color: #506078;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid #eef1f6;
}

.stat-box {
    min-height: 74px;
    padding: 14px 20px;
    border-right: 1px solid #eef1f6;
}

.stat-box:last-child {
    border-right: none;
}

.stat-box .label {
    display: block;
    font-size: 10px;
    color: #4b74ff;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.stat-box .overdue {
    color: #ff4b4b;
}

.stat-box strong {
    font-size: 16px;
    font-weight: 500;
}

.chart-placeholder {
    display: grid;
    grid-template-columns: 1fr 140px;
    min-height: 260px;
}

.chart-lines {
    margin: 18px;
    border-right: 1px solid #dfe5f0;
    background:
        linear-gradient(to bottom, transparent 18%, #e3e8f2 19%, transparent 20%) repeat-y;
    background-size: 100% 32px;
}

.chart-summary {
    border-left: 1px solid #e5eaf3;
    padding: 28px 20px;
    font-size: 12px;
}

.chart-summary p {
    margin: 0 0 24px;
    color: #2563eb;
}

.chart-summary p:nth-child(2) {
    color: #168c22;
}

.chart-summary p:nth-child(3) {
    color: #ef4444;
}

.chart-summary strong {
    display: block;
    color: #000;
    font-size: 17px;
    font-weight: 400;
    margin-top: 6px;
}

.empty-box {
    height: 95px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #111827;
    font-size: 12px;
}

/* MODULE */
.module-header {
    height: 53px;
    border-bottom: 1px solid #e5eaf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.module-header h1 {
    font-size: 16px;
    margin: 0;
}

.primary-btn {
    background: #3b82f6;
    border: none;
    color: white;
    border-radius: 5px;
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
}

.empty-state {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: #5c6881;
}

.empty-state h3 {
    color: #111827;
    margin-bottom: 7px;
}

@media (max-width: 900px) {
    .sidebar {
        width: 165px;
    }

    .main {
        margin-left: 165px;
        width: calc(100% - 165px);
    }

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

    .card.large {
        grid-column: span 1;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}

/* LIST PAGE - CLIENTES */
.list-page {
    display: grid;
    grid-template-columns: 205px 1fr;
    min-height: calc(100vh - 38px);
    background: #ffffff;
}

.list-sidebar {
    border-right: 1px solid #e5eaf3;
    background: #fbfcff;
    padding: 14px 10px;
}

.list-filter {
    width: 100%;
    height: 31px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #344054;
    font-family: inherit;
    font-size: 12px;
    text-align: left;
    margin-bottom: 5px;
    cursor: pointer;
}

.list-filter:hover {
    background: #eef3ff;
}

.list-filter.active {
    background: #e8f0ff;
    color: #1d4ed8;
    font-weight: 600;
}

.list-main {
    background: #ffffff;
    min-width: 0;
}

.list-header {
    height: 58px;
    border-bottom: 1px solid #e5eaf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.list-header h1 {
    font-size: 16px;
    margin: 0;
}

.record-count {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #6b7280;
}

.list-actions,
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.secondary-btn,
.square-btn {
    border: 1px solid #d4d9e7;
    background: #ffffff;
    color: #1f2937;
    border-radius: 5px;
    height: 30px;
    padding: 0 11px;
    font-size: 12px;
    cursor: pointer;
}

.square-btn {
    width: 31px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.list-action-btn {
    width: 44px;
    height: 40px;
    padding: 0;
    border: 1px solid #d4d9e7;
    border-radius: 5px;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 44px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.list-action-btn:hover,
.export-menu.open .list-action-btn {
    background: #f4f7fb;
    border-color: #b9c2d6;
}

.list-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.list-action-btn:disabled:hover {
    background: #ffffff;
    border-color: #d4d9e7;
}

.list-action-btn img {
    width: 18px;
    height: 18px;
    display: block;
}

.list-action-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.list-action-btn .dots-icon {
    fill: currentColor;
    stroke: none;
}

.export-caret {
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #1f2937;
    border-bottom: 1.5px solid #1f2937;
    display: block;
    transform: translateY(-2px) rotate(45deg);
}

.export-menu {
    position: relative;
}

.export-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    min-width: 190px;
    padding: 6px;
    border: 1px solid #d4d9e7;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
    display: none;
}

.export-menu.open .export-menu-panel {
    display: block;
}

.export-menu-item {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-align: left;
    font-size: 12px;
    white-space: nowrap;
}

.export-menu-item:hover:not(:disabled) {
    background: #f4f7fb;
}

.export-menu-item:disabled {
    color: #98a2b3;
    cursor: not-allowed;
    background: transparent;
}

.export-config-panel {
    position: absolute;
    top: 62px;
    right: 18px;
    z-index: 30;
    display: none;
}

.export-config-panel.open {
    display: block;
}

.export-config-card {
    width: 360px;
    max-width: calc(100vw - 36px);
    border: 1px solid #d4d9e7;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
    padding: 14px;
}

.export-config-header h2 {
    margin: 0;
    color: #111827;
    font-size: 14px;
    line-height: 1.2;
}

.export-config-section {
    margin-top: 14px;
}

.export-config-label {
    display: block;
    margin-bottom: 8px;
    color: #344054;
    font-size: 12px;
    font-weight: 600;
}

.export-format-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.export-format-options label,
.export-field-options label {
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #1f2937;
    font-size: 12px;
}

.export-format-options label {
    justify-content: center;
    border: 1px solid #d4d9e7;
    border-radius: 5px;
    background: #fbfcff;
}

.export-format-options input,
.export-field-options input {
    width: 14px;
    height: 14px;
    margin: 0;
}

.export-field-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 2px;
}

.export-config-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.export-config-cancel,
.export-config-save {
    height: 32px;
    border-radius: 5px;
    padding: 0 12px;
    font-size: 12px;
    cursor: pointer;
}

.export-config-cancel {
    border: 1px solid #d4d9e7;
    background: #ffffff;
    color: #1f2937;
}

.export-config-save {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.list-toolbar {
    min-height: 48px;
    border-bottom: 1px solid #e5eaf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px;
    background: #ffffff;
}

.mini-search {
    width: 330px;
    height: 30px;
    border: 1px solid #d5dbea;
    border-radius: 5px;
    display: flex;
    align-items: center;
    padding: 0 9px;
    gap: 6px;
    background: #fbfcff;
}

.mini-search input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 12px;
}

.contact-list-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.contact-list-control {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #344054;
    font-size: 12px;
    white-space: nowrap;
}

.contact-inactive-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #344054;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

.contact-inactive-toggle[hidden] {
    display: none;
}

.contact-inactive-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.contact-toggle-track {
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: #cfd7e8;
    position: relative;
    transition: background 0.16s ease;
}

.contact-toggle-track::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.22);
    transition: transform 0.16s ease;
}

.contact-inactive-toggle input:checked + .contact-toggle-track {
    background: #2563eb;
}

.contact-inactive-toggle input:checked + .contact-toggle-track::after {
    transform: translateX(16px);
}

.contact-inactive-toggle input:focus + .contact-toggle-track {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.contact-list-control select {
    height: 30px;
    min-width: 128px;
    border: 1px solid #d5dbea;
    border-radius: 5px;
    background: #fbfcff;
    color: #1f2937;
    font-size: 12px;
    padding: 0 9px;
    outline: none;
}

.contact-list-control select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.table-card {
    padding: 0;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table thead {
    background: #f8f9fd;
}

.data-table th {
    height: 37px;
    color: #344054;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e5eaf3;
    padding: 0 11px;
    white-space: nowrap;
}

.data-table td {
    height: 42px;
    border-bottom: 1px solid #eef1f6;
    padding: 0 11px;
    color: #1f2937;
}

.actions-col {
    width: 84px;
    text-align: center !important;
}

.select-col,
.select-cell {
    width: 38px;
    text-align: center !important;
}

.select-col input,
.select-cell input {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
}

.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.inline-action-form {
    display: inline-flex;
    margin: 0;
}

.rubros-list-page {
    display: block;
}

.rubros-list-title h1 {
    white-space: nowrap;
}

.rubros-code-col {
    width: 130px;
}

.rubros-number-col,
.rubros-status-col {
    width: 140px;
}

.rubros-code-cell,
.rubros-number-cell,
.rubros-status-cell {
    white-space: nowrap;
}

.rubros-number-cell {
    color: #475467;
}

.list-alert {
    margin: 12px 18px 0;
    border: 1px solid #d5dbea;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
}

.list-alert.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.list-alert.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
    margin-bottom: 12px;
}

.list-alert.warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #78350f;
}

.list-alert-detail {
    margin-top: 4px;
    font-weight: 500;
}

.text-right {
    text-align: right !important;
}

.zoho-empty {
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: #667085;
}

.zoho-empty .empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.zoho-empty h3 {
    font-size: 17px;
    color: #111827;
    margin: 0 0 6px;
}

.zoho-empty p {
    margin: 0 0 15px;
    font-size: 12px;
}

/* SEARCH RESULTS */
.search-page {
    min-height: calc(100vh - 38px);
    background: #ffffff;
    padding: 18px;
    overflow-x: hidden;
}

.search-header {
    border-bottom: 1px solid #e5eaf3;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.search-header h1 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    line-height: 1.25;
}

.search-header p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 12px;
}

.search-sections {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.search-section {
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.search-section-title {
    min-height: 42px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf1f7;
    background: #fbfcff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-section-title h2 {
    margin: 0;
    color: #111827;
    font-size: 13px;
    line-height: 1.3;
}

.search-section-title span {
    color: #667085;
    font-size: 11px;
    white-space: nowrap;
}

.search-result-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    padding: 12px;
    min-width: 0;
}

.search-result-card {
    min-width: 0;
    border: 1px solid #e5eaf3;
    border-radius: 7px;
    background: #ffffff;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.search-result-card:hover {
    border-color: #c8d3e5;
    background: #fbfcff;
}

.search-result-content {
    min-width: 0;
}

.search-result-title {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.search-result-title:hover {
    text-decoration: underline;
}

.search-result-content p {
    margin: 4px 0 0;
    color: #344054;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.search-result-meta {
    display: inline-flex;
    margin-top: 8px;
    max-width: 100%;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.search-result-action {
    flex: 0 0 auto;
    border: 1px solid #d4d9e7;
    border-radius: 5px;
    background: #ffffff;
    color: #1f2937;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.search-result-action:hover {
    background: #f4f7ff;
    border-color: #c2ccdc;
    color: #2563eb;
}

.search-empty {
    padding: 18px;
    color: #667085;
    font-size: 12px;
}

.search-empty-large {
    min-height: 280px;
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.search-empty-large .empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.search-empty-large h3 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 17px;
}

.search-empty-large p {
    margin: 0;
    color: #667085;
    font-size: 12px;
}

@media (max-width: 950px) {
    .list-page {
        grid-template-columns: 1fr;
    }

    .list-sidebar {
        display: none;
    }

    .mini-search {
        width: 240px;
    }

    .search-page {
        padding: 14px;
    }

    .search-section-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .search-section-title span {
        white-space: normal;
    }

    .search-result-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .list-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 10px 18px;
    }

    .mini-search,
    .contact-list-controls {
        width: 100%;
    }

    .contact-list-controls {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .contact-list-control {
        flex: 1 1 180px;
    }

    .contact-list-control select {
        flex: 1;
        min-width: 0;
    }
}

/* FORM PAGE */
.form-page {
    background: #ffffff;
    min-height: calc(100vh - 38px);
}

.form-header {
    min-height: 68px;
    border-bottom: 1px solid #e5eaf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: #ffffff;
}

.form-header h1 {
    font-size: 17px;
    margin: 0;
}

.form-header p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 12px;
}

.form-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.zoho-form {
    padding: 22px;
    max-width: 950px;
}

.form-card {
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    margin-bottom: 18px;
    background: #ffffff;
    overflow: hidden;
}

.form-card h3 {
    height: 40px;
    margin: 0;
    padding: 0 16px;
    border-bottom: 1px solid #e5eaf3;
    display: flex;
    align-items: center;
    font-size: 14px;
    background: #fbfcff;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 22px;
    padding: 18px 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full {
    grid-column: span 2;
}

.form-group label {
    font-size: 12px;
    margin-bottom: 6px;
    color: #344054;
}

.form-group label span {
    color: #ef4444;
}

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid #d5dbea;
    border-radius: 5px;
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
    outline: none;
    background: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}

.link-as-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e8f7ef;
    color: #168c22;
    font-size: 11px;
    text-transform: capitalize;
}

.status-pill-inactive {
    background: #fef2f2;
    color: #b42318;
}

.import-guide {
    padding: 16px;
    border-bottom: 1px solid #e5eaf3;
    background: #fbfcff;
}

.import-template-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.import-help {
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #eff6ff;
    color: #344054;
    font-size: 12px;
    padding: 12px 14px;
}

.import-help p {
    margin: 0 0 6px;
}

.import-help p:last-child {
    margin-bottom: 0;
}

.import-columns-table-wrap {
    padding: 16px;
    overflow-x: auto;
}

.import-columns-table code {
    color: #1d4ed8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
}

.import-result {
    max-width: 950px;
    padding: 0 22px 24px;
}

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

.import-summary div {
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 16px;
}

.import-summary strong {
    display: block;
    color: #111827;
    font-size: 22px;
    line-height: 1;
    margin-bottom: 6px;
}

.import-summary span {
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}

.import-errors {
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.import-errors h3 {
    height: 40px;
    margin: 0;
    padding: 0 16px;
    border-bottom: 1px solid #e5eaf3;
    display: flex;
    align-items: center;
    font-size: 14px;
    background: #fbfcff;
}

@media (max-width: 850px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: span 1;
    }

    .form-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
        gap: 12px;
    }

    .form-header-actions {
        flex-wrap: wrap;
    }

    .import-summary {
        grid-template-columns: 1fr;
    }
}

.table-muted {
    margin-top: 3px;
    color: #667085;
    font-size: 11px;
}

/* INVOICE FORM */
.wide-form {
    max-width: 1180px;
}

.invoice-card {
    overflow: visible;
}

.invoice-table-wrap {
    overflow-x: auto;
}

.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.invoice-items-table th {
    height: 36px;
    background: #f8f9fd;
    border-bottom: 1px solid #e5eaf3;
    text-align: left;
    padding: 0 8px;
    color: #344054;
}

.invoice-items-table td {
    border-bottom: 1px solid #eef1f6;
    padding: 8px;
    vertical-align: top;
}

.invoice-items-table input,
.invoice-items-table select {
    width: 100%;
    height: 32px;
    border: 1px solid #d5dbea;
    border-radius: 5px;
    padding: 6px 8px;
    font-size: 12px;
    outline: none;
}

.invoice-items-table input:focus,
.invoice-items-table select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}

.row-total {
    padding-top: 15px !important;
    font-weight: 600;
}

.remove-row-btn {
    width: 27px;
    height: 27px;
    border: 1px solid #e5eaf3;
    background: #ffffff;
    border-radius: 5px;
    cursor: pointer;
    color: #ef4444;
    font-size: 18px;
    line-height: 1;
}

.invoice-actions {
    padding: 12px 16px;
}

.invoice-bottom {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 18px;
    align-items: start;
}

.notes-card {
    margin-bottom: 0;
}

.totals-card {
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 14px 16px;
}

.total-line {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eef1f6;
    font-size: 13px;
}

.total-line:last-child {
    border-bottom: none;
}

.total-line strong {
    font-weight: 600;
}

.grand-total {
    height: 42px;
    font-size: 15px;
    color: #111827;
}

.grand-total strong {
    font-size: 18px;
    color: #2563eb;
}

@media (max-width: 950px) {
    .invoice-bottom {
        grid-template-columns: 1fr;
    }
}

/* FACTURA DETALLE */
.detail-page {
    min-height: calc(100vh - 38px);
    background: #f5f7fb;
}

.detail-header {
    min-height: 72px;
    background: #ffffff;
    border-bottom: 1px solid #e5eaf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
}

.detail-header h1 {
    margin: 4px 0;
    font-size: 18px;
}

.detail-header p {
    margin: 0;
    color: #667085;
    font-size: 12px;
}

.back-link,
.table-link {
    color: #2563eb;
    text-decoration: none;
}

.back-link:hover,
.table-link:hover {
    text-decoration: underline;
}

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

.invoice-preview {
    padding: 28px;
}

.invoice-paper {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #dde3ef;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: 36px;
}

.invoice-paper-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #111827;
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.invoice-paper-header h2 {
    margin: 0;
    font-size: 21px;
}

.invoice-paper-header p {
    margin: 5px 0 0;
    color: #667085;
}

.invoice-title-box {
    text-align: right;
}

.invoice-title-box h3 {
    margin: 0 0 6px;
    font-size: 24px;
    letter-spacing: 1px;
}

.invoice-title-box strong {
    color: #2563eb;
}

.invoice-info-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 40px;
    margin-bottom: 28px;
}

.invoice-info-grid h4,
.invoice-notes h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #344054;
}

.invoice-info-grid p {
    margin: 3px 0;
    font-size: 12px;
    color: #344054;
}

.mini-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.mini-info-table td {
    border-bottom: 1px solid #eef1f6;
    padding: 7px 5px;
}

.mini-info-table td:first-child {
    color: #667085;
}

.mini-info-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.invoice-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.invoice-detail-table th {
    background: #f8f9fd;
    border-bottom: 1px solid #dfe5f0;
    padding: 10px 8px;
    text-align: left;
}

.invoice-detail-table td {
    border-bottom: 1px solid #eef1f6;
    padding: 10px 8px;
}

.invoice-detail-bottom {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    margin-top: 24px;
}

.invoice-notes {
    color: #667085;
    font-size: 12px;
}

.invoice-detail-totals {
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    overflow: hidden;
}

.invoice-detail-totals div {
    height: 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid #eef1f6;
    font-size: 12px;
}

.invoice-detail-totals div:last-child {
    border-bottom: none;
}

.invoice-detail-totals .grand {
    height: 44px;
    background: #f8f9fd;
    font-size: 15px;
}

.invoice-detail-totals .grand strong {
    color: #2563eb;
    font-size: 17px;
}

@media (max-width: 950px) {
    .detail-header,
    .invoice-paper-header,
    .invoice-info-grid,
    .invoice-detail-bottom {
        display: block;
    }

    .detail-actions {
        margin-top: 12px;
        flex-wrap: wrap;
    }

    .invoice-preview {
        padding: 12px;
    }

    .invoice-paper {
        padding: 18px;
    }
}

.payments-mini-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 12px;
}

.payments-mini-table th {
    text-align: left;
    background: #f8f9fd;
    border-bottom: 1px solid #e5eaf3;
    padding: 8px 6px;
    color: #344054;
}

.payments-mini-table td {
    border-bottom: 1px solid #eef1f6;
    padding: 8px 6px;
    color: #344054;
}

.summary-strip {
    min-height: 58px;
    border-bottom: 1px solid #e5eaf3;
    background: #fbfcff;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.summary-strip div {
    padding: 10px 18px;
    border-right: 1px solid #e5eaf3;
}

.summary-strip div:last-child {
    border-right: none;
}

.summary-strip span {
    display: block;
    font-size: 11px;
    color: #667085;
    margin-bottom: 4px;
}

.summary-strip strong {
    font-size: 15px;
    color: #111827;
}

.status-pill.warning {
    background: #fff7e6;
    color: #b45309;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.dashboard-metric {
    min-height: 105px;
    padding: 22px 20px;
    border-right: 1px solid #eef1f6;
}

.dashboard-metric:last-child {
    border-right: none;
}

.dashboard-metric span {
    display: block;
    font-size: 12px;
    color: #667085;
    margin-bottom: 10px;
}

.dashboard-metric strong {
    font-size: 21px;
    font-weight: 500;
}

.dashboard-metric.blue strong {
    color: #2563eb;
}

.dashboard-metric.green strong {
    color: #168c22;
}

.dashboard-metric.red strong {
    color: #ef4444;
}

.dashboard-metric.dark strong {
    color: #111827;
}

.mini-list {
    padding: 8px 16px;
}

.mini-list-row {
    min-height: 38px;
    border-bottom: 1px solid #eef1f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mini-list-row:last-child {
    border-bottom: none;
}

.mini-list-row span {
    color: #344054;
    font-size: 12px;
}

.mini-list-row strong {
    color: #111827;
    font-size: 13px;
}

@media (max-width: 950px) {
    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-metric {
        border-right: none;
        border-bottom: 1px solid #eef1f6;
    }
}

/* DASHBOARD CHART */
.chart-dashboard {
    display: grid;
    grid-template-columns: 1fr 140px;
    min-height: 305px;
}

.chart-canvas-wrap {
    padding: 14px 18px 8px;
    border-right: 1px solid #e5eaf3;
}

.chart-canvas-wrap canvas {
    width: 100%;
    max-width: 760px;
    height: 290px;
    display: block;
}

.chart-side-summary {
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chart-side-item span {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
}

.chart-side-item strong {
    display: block;
    font-size: 16px;
    font-weight: 400;
    color: #000;
}

.chart-side-item.blue span {
    color: #2563eb;
}

.chart-side-item.green span {
    color: #16a34a;
}

.chart-side-item.red span {
    color: #ef4444;
}

.chart-side-item.dark span {
    color: #111827;
}

@media (max-width: 950px) {
    .chart-dashboard {
        grid-template-columns: 1fr;
    }

    .chart-canvas-wrap {
        border-right: none;
        border-bottom: 1px solid #e5eaf3;
    }

    .chart-side-summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* HOME DASHBOARD */
.home-dashboard {
    width: min(100% - 40px, 1280px);
    margin: 28px auto 48px;
}

.home-dashboard-header {
    min-height: 84px;
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
}

.home-dashboard-header h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    color: #111827;
    font-weight: 700;
}

.home-dashboard-header p {
    margin: 6px 0 0;
    color: #667085;
    font-size: 13px;
}

.home-dashboard-tabs {
    display: flex;
    gap: 24px;
    margin: 18px 0 18px;
    border-bottom: 1px solid #e5eaf3;
}

.home-dashboard-tabs span {
    padding: 0 0 12px;
    color: #344054;
    font-size: 13px;
    line-height: 1;
}

.home-dashboard-tabs span.active {
    color: #2563eb;
    border-bottom: 3px solid #3b82f6;
    font-weight: 600;
}

.home-card {
    background: #ffffff;
    border: 1px solid #dfe5f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.home-card-wide {
    margin-bottom: 22px;
}

.home-card-header {
    min-height: 62px;
    border-bottom: 1px solid #e5eaf3;
    background: #fbfcff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
}

.home-card-header h2 {
    margin: 0;
    color: #111827;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 700;
}

.home-card-header p {
    margin: 5px 0 0;
    color: #667085;
    font-size: 12.5px;
}

.home-card-header a {
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.home-card-header a:hover {
    text-decoration: underline;
}

.home-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
}

.home-metric-card {
    min-height: 116px;
    border: 1px solid #e5eaf3;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 17px;
}

.home-metric-card span {
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-metric-card strong {
    color: #111827;
    font-size: 21px;
    line-height: 1.18;
    font-weight: 700;
    word-break: break-word;
}

.home-metric-primary {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.home-metric-primary strong {
    color: #1d4ed8;
}

.home-metric-danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.home-metric-danger strong {
    color: #b91c1c;
}

.home-metric-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.home-metric-success strong {
    color: #15803d;
}

.home-chart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    min-height: 420px;
}

.home-chart-canvas-wrap {
    min-width: 0;
    min-height: 398px;
    border-right: 1px solid #e5eaf3;
    padding: 22px 24px 20px;
    background: #ffffff;
}

.home-chart-canvas-wrap canvas {
    width: 100%;
    max-width: none;
    height: 360px;
    display: block;
}

.home-chart-summary {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 14px;
    padding: 22px;
    background: #fbfcff;
}

.home-chart-side-item {
    border: 1px solid #e5eaf3;
    border-radius: 8px;
    background: #ffffff;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.home-chart-side-item span {
    display: block;
    margin-bottom: 8px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-chart-side-item strong {
    display: block;
    color: #111827;
    font-size: 18px;
    line-height: 1.22;
    font-weight: 700;
    word-break: break-word;
}

.home-chart-side-item.blue span,
.home-chart-side-item.blue strong {
    color: #2563eb;
}

.home-chart-side-item.green span,
.home-chart-side-item.green strong {
    color: #16a34a;
}

.home-chart-side-item.red span,
.home-chart-side-item.red strong {
    color: #dc2626;
}

.home-chart-side-item.dark span {
    color: #344054;
}

.home-secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 22px;
    align-items: start;
}

.home-secondary-card {
    min-height: 260px;
}

.home-list {
    padding: 10px 20px 14px;
}

.home-list-row {
    min-height: 52px;
    border-bottom: 1px solid #eef1f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.home-list-row:last-child {
    border-bottom: none;
}

.home-list-row span {
    color: #344054;
    font-size: 13.5px;
    line-height: 1.35;
}

.home-list-row strong {
    color: #111827;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

.home-expenses-list .home-list-row:first-child strong {
    color: #dc2626;
    font-size: 16px;
}

.home-status-list .home-list-row strong {
    color: #2563eb;
}

.home-empty-box {
    min-height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667085;
    font-size: 13px;
    text-align: center;
    padding: 18px;
}

@media (max-width: 1180px) {
    .home-metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-chart-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .home-chart-canvas-wrap {
        border-right: none;
        border-bottom: 1px solid #e5eaf3;
    }

    .home-chart-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: stretch;
    }
}

@media (max-width: 820px) {
    .home-dashboard {
        width: calc(100% - 24px);
        margin: 18px auto 28px;
    }

    .home-dashboard-header {
        padding: 18px;
    }

    .home-dashboard-header h1 {
        font-size: 19px;
    }

    .home-dashboard-tabs {
        gap: 16px;
        overflow-x: auto;
    }

    .home-dashboard-tabs span {
        white-space: nowrap;
    }

    .home-metrics-grid,
    .home-secondary-grid,
    .home-chart-summary {
        grid-template-columns: 1fr;
    }

    .home-chart-canvas-wrap {
        min-height: 320px;
        padding: 16px 14px;
    }

    .home-chart-canvas-wrap canvas {
        height: 290px;
    }

    .home-card-header {
        align-items: flex-start;
        padding: 14px 16px;
    }

    .home-metrics-grid,
    .home-list {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* QUICK CREATE MENU LIMPIO */
.quick-create {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.settings-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notifications-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.quick-create-menu {
    display: none;
    position: absolute;
    top: 38px;
    right: 0;
    width: 520px;
    background: #ffffff;
    border: 1px solid #dfe5f0;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    z-index: 99999;
    padding: 18px 20px;
}

.quick-create-menu.open {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 22px;
}

.settings-dropdown {
    display: none;
    position: absolute;
    top: 38px;
    right: 0;
    width: 205px;
    background: #ffffff;
    border: 1px solid #dfe5f0;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    z-index: 99999;
    padding: 8px;
}

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

.settings-dropdown a {
    display: block;
    padding: 8px 10px;
    color: #374151;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.settings-dropdown a:hover {
    background: #f4f7ff;
    color: #2563eb;
}

.notifications-dropdown {
    display: none;
    position: absolute;
    top: 38px;
    right: 0;
    width: 230px;
    background: #ffffff;
    border: 1px solid #dfe5f0;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    z-index: 99999;
    padding: 8px;
}

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

.notifications-dropdown-header {
    padding: 8px 10px 10px;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    border-bottom: 1px solid #edf1f7;
}

.notifications-empty {
    padding: 12px 10px;
    color: #667085;
    font-size: 12px;
    line-height: 1.4;
}

.notifications-dropdown a {
    display: block;
    padding: 8px 10px;
    color: #374151;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.notifications-dropdown a:hover {
    background: #f4f7ff;
    color: #2563eb;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 38px;
    right: 0;
    width: 220px;
    background: #ffffff;
    border: 1px solid #dfe5f0;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    z-index: 99999;
    padding: 8px;
}

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

.user-dropdown-header {
    padding: 8px 10px 10px;
    border-bottom: 1px solid #edf1f7;
    margin-bottom: 6px;
}

.user-dropdown-header strong,
.user-dropdown-header span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-header strong {
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.user-dropdown-header span {
    color: #667085;
    font-size: 11px;
    line-height: 1.4;
}

.user-dropdown a {
    display: block;
    padding: 8px 10px;
    color: #374151;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.user-dropdown a:hover {
    background: #f4f7ff;
    color: #2563eb;
}

.quick-menu-column {
    min-width: 0;
}

.quick-menu-title {
    font-size: 11px;
    color: #667085;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.quick-create-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 4px 6px;
    color: #374151;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
}

.quick-create-menu a:hover {
    background: #f4f7ff;
    color: #2563eb;
}

.quick-create-menu a strong {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    color: inherit;
}

.quick-create-menu a small {
    display: none;
}

.top-btn.primary {
    width: 30px !important;
    height: 30px !important;
    background: #3b82f6 !important;
    color: #ffffff !important;
    border: 1px solid #3b82f6 !important;
    border-radius: 4px !important;
    font-size: 22px !important;
    line-height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: Arial, Helvetica, sans-serif !important;
}

/* PREVIEW LOGO EN CONFIGURACION */
.logo-preview-box {
    width: 240px;
    min-height: 130px;
    border: 1px dashed #cfd7e8;
    border-radius: 8px;
    background: #fbfcff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.logo-preview {
    max-width: 190px;
    max-height: 95px;
    object-fit: contain;
}

.logo-empty-text {
    display: none;
    color: #667085;
    font-size: 12px;
    text-align: center;
}

/* =========================================================
   CONFIGURACIÓN DE EMPRESA
========================================================= */

.zoho-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.zoho-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.zoho-card-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.zoho-card-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

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

.zoho-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.zoho-form .form-group-full {
    grid-column: 1 / -1;
}

.zoho-form label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.zoho-form input,
.zoho-form select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
}

.zoho-form input:focus,
.zoho-form select:focus {
    border-color: #408dfb;
    box-shadow: 0 0 0 3px rgba(64, 141, 251, 0.14);
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary,
.btn-secondary {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: #408dfb;
    color: #ffffff;
}

.btn-secondary {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #d1d5db;
}

.logo-preview-box {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 120px;
    padding: 16px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    margin-bottom: 18px;
}

@media (max-width: 768px) {
    .zoho-form .form-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   CONFIGURACIÓN DE EMPRESA - DISEÑO LIMPIO
========================================================= */

.clean-header {
    margin-bottom: 22px;
}

.settings-layout {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 8px 40px;
}

.app-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.app-card-header {
    border-bottom: 1px solid #edf0f5;
    padding-bottom: 16px;
    margin-bottom: 22px;
}

.app-card-header h3 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.app-card-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.app-form {
    width: 100%;
}

.app-grid {
    display: grid;
    gap: 18px 22px;
}

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

.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-full {
    grid-column: 1 / -1;
}

.field-group label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.field-group input,
.field-group select {
    width: 100%;
    height: 42px;
    border: 1px solid #cfd7e6;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    color: #111827;
}

.field-group input:focus,
.field-group select:focus {
    border-color: #408dfb;
    box-shadow: 0 0 0 3px rgba(64, 141, 251, 0.14);
}

.app-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 24px;
    gap: 10px;
}

.primary-button,
.secondary-button {
    border-radius: 9px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.primary-button {
    border: 1px solid #408dfb;
    background: #408dfb;
    color: #ffffff;
}

.primary-button:hover {
    background: #2f76dd;
}

.secondary-button {
    border: 1px solid #cfd7e6;
    background: #ffffff;
    color: #111827;
}

.secondary-button:hover {
    background: #f3f6fb;
}

.logo-preview-box {
    width: 100%;
    min-height: 150px;
    padding: 20px;
    border: 1px dashed #cfd7e6;
    border-radius: 14px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.logo-preview-box img {
    max-width: 240px !important;
    max-height: 130px !important;
    object-fit: contain !important;
}

@media (max-width: 900px) {
    .settings-layout {
        max-width: 100%;
    }

    .app-grid.two-columns {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   CABECERA / EMPRESA
========================================================= */

/* Nombre de empresa en barra superior */
.top-right .company {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-icon-danger {
    width: 34px;
    height: 34px;
    border: 1px solid #f1b7b7;
    border-radius: 8px;
    background: #fff5f5;
    color: #c53030;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-edit {
    width: 34px;
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-reactivate {
    width: 34px;
    height: 34px;
    border: 1px solid #a7d8c4;
    border-radius: 8px;
    background: #effaf5;
    color: #198754;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-danger:hover {
    background: #ffe3e3;
    border-color: #e53e3e;
}

.btn-icon-edit:hover {
    background: #f4f7fb;
    border-color: #94a3b8;
}

.btn-icon-reactivate:hover {
    background: #dff4eb;
    border-color: #5bb98a;
}


.menu-icon-img {
    width: 18px;
    height: 18px;
    display: inline-block;
    object-fit: contain;
}

.menu-plus img,
.action-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.btn-icon-danger img {
    width: 16px;
    height: 16px;
}

.btn-icon-edit img {
    width: 16px;
    height: 16px;
}

.btn-icon-reactivate img {
    width: 16px;
    height: 16px;
}

.cliente-detalle-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 10px 18px 48px;
    overflow-x: hidden;
}

.cliente-detalle-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    box-sizing: border-box;
}

.cliente-detalle-grid {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    gap: 0;
    width: 100%;
}

.cliente-detalle-label,
.cliente-detalle-value {
    padding: 13px 10px;
    border-bottom: 1px solid #eef2f7;
    font-size: 14px;
    min-width: 0;
}

.cliente-detalle-label {
    color: #64748b;
    font-weight: 700;
}

.cliente-detalle-value {
    color: #111827;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 640px) {
    .cliente-detalle-grid {
        grid-template-columns: 1fr;
    }

    .cliente-detalle-label {
        padding-bottom: 4px;
        border-bottom: 0;
    }

    .cliente-detalle-value {
        padding-top: 0;
    }
}
.menu-icon-img {
    width: 18px;
    height: 18px;
    min-width: 18px;
    display: inline-block;
    object-fit: contain;
}

.menu-plus {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-plus img {
    width: 14px;
    height: 14px;
    display: block;
}

.menu-item {
    gap: 10px;
}

/* ICONOS DEL MENÚ LATERAL */
.sidebar .menu-icon-img {
    width: 18px;
    height: 18px;
    min-width: 18px;
    display: inline-block;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.sidebar .menu-item.active .menu-icon-img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.sidebar .menu-plus {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar .menu-plus img {
    width: 14px;
    height: 14px;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.sidebar .menu-item {
    gap: 10px;
}


/* Ajuste final de color para SVG del sidebar */
.sidebar img.menu-icon-img,
.sidebar .menu-plus img {
    filter: brightness(0) invert(1) !important;
    opacity: 0.95;
}

.sidebar .menu-item.active img.menu-icon-img,
.sidebar .menu-item.active .menu-plus img {
    filter: brightness(0) invert(1) !important;
    opacity: 1;
}

.sidebar .menu-item {
    display: flex;
    align-items: center;
}


/* Corrección fuerte para íconos del menú lateral */
.sidebar .menu-item > img.menu-icon-img {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    filter: invert(100%) brightness(200%) !important;
    opacity: 0.9 !important;
}

.sidebar .menu-item.active > img.menu-icon-img {
    filter: invert(100%) brightness(200%) !important;
    opacity: 1 !important;
}

.sidebar .menu-plus img {
    width: 14px !important;
    height: 14px !important;
    filter: invert(100%) brightness(200%) !important;
    opacity: 0.9 !important;
}

.sidebar .menu-item.active .menu-plus img {
    opacity: 1 !important;
}


/* ================================
   ICONOS DEL MENÚ LATERAL
================================ */

.sidebar .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .menu-item > img.menu-icon-img {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    object-fit: contain;
    filter: brightness(0) invert(1) !important;
    opacity: 0.9 !important;
}

.sidebar .menu-item.active > img.menu-icon-img {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

.sidebar .menu-plus {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar .menu-plus img {
    width: 14px !important;
    height: 14px !important;
    display: block;
    filter: brightness(0) invert(1) !important;
    opacity: 0.9 !important;
}

.sidebar .menu-item.active .menu-plus img {
    opacity: 1 !important;
}


/* ================================
   ICONOS DE ACCIONES
================================ */

.action-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.btn-icon-danger {
    width: 34px;
    height: 34px;
    border: 1px solid #f1b7b7;
    border-radius: 8px;
    background: #fff5f5;
    color: #c53030;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-edit {
    width: 34px;
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-reactivate {
    width: 34px;
    height: 34px;
    border: 1px solid #a7d8c4;
    border-radius: 8px;
    background: #effaf5;
    color: #198754;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-danger:hover {
    background: #ffe3e3;
    border-color: #e53e3e;
}

.btn-icon-edit:hover {
    background: #f4f7fb;
    border-color: #94a3b8;
}

.btn-icon-reactivate:hover {
    background: #dff4eb;
    border-color: #5bb98a;
}

.btn-icon-danger img {
    width: 16px;
    height: 16px;
}

.btn-icon-edit img {
    width: 16px;
    height: 16px;
}

.btn-icon-reactivate img {
    width: 16px;
    height: 16px;
}

.usuarios-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 10px 18px 48px;
}

.usuarios-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.usuarios-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.usuarios-header p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.usuarios-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.usuarios-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.usuarios-card-title {
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.usuarios-card-title h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.usuarios-card-title p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.usuarios-table {
    width: 100%;
    border-collapse: collapse;
}

.usuarios-table th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.usuarios-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
    color: #111827;
    vertical-align: middle;
}

.user-name {
    font-weight: 700;
}

.user-email {
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.role-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.role-badge {
    background: #eef4ff;
    color: #1d4ed8;
}

.status-badge.active {
    background: #ecfdf3;
    color: #047857;
}

.status-badge.inactive {
    background: #fef2f2;
    color: #b91c1c;
}

.role-change-form select {
    height: 30px;
    min-width: 145px;
    border: 1px solid #cfd7e6;
    border-radius: 999px;
    padding: 0 10px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.role-change-form select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.user-row-inactive {
    background: #fafafa;
}

.user-row-inactive td {
    color: #94a3b8;
}

.role-disabled-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.role-disabled-select {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    min-width: 145px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0 10px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.role-disabled-box small {
    font-size: 11px;
    color: #94a3b8;
}

.usuario-action-form {
    display: inline;
}

.small-btn {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.small-btn.danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff7f7;
}

.small-btn.success {
    color: #047857;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.usuarios-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.field-group input,
.field-group select {
    width: 100%;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
}

.field-group input:focus,
.field-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.primary-button {
    height: 42px;
    border-radius: 10px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: #ffffff;
    width: 100%;
}

.primary-button:hover {
    background: #2563eb;
}

.empty-state {
    padding: 28px;
    text-align: center;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
}

@media (max-width: 980px) {
    .usuarios-grid {
        grid-template-columns: 1fr;
    }
}

.ppto-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 18px 48px;
}

.ppto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.ppto-header h1 {
    margin: 0 0 5px;
    font-size: 24px;
    color: #111827;
}

.ppto-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.ppto-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.ppto-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: #3b82f6;
    color: white;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}

.ppto-table {
    width: 100%;
    border-collapse: collapse;
}

.ppto-table th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.ppto-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
    color: #111827;
}

.ppto-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.ppto-small-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.ppto-small-btn:hover {
    background: #f8fafc;
}

.badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eef4ff;
    color: #1d4ed8;
}

.empty {
    padding: 34px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
}

.ppto-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 18px 48px;
}

.ppto-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.ppto-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.ppto-header h1 {
    margin: 0 0 5px;
    font-size: 24px;
    color: #111827;
}

.ppto-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.info-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}

.info-box small {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.info-box strong {
    font-size: 14px;
    color: #111827;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    padding: 9px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.items-table td {
    padding: 11px 8px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
    color: #111827;
}

.totals-box {
    max-width: 360px;
    margin-left: auto;
    margin-top: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #f8fafc;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.total-line.strong {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 10px;
}

.btn-secondary {
    height: 40px;
    border-radius: 10px;
    padding: 0 16px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
}

.ppto-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 18px 48px;
}

.ppto-header {
    margin-bottom: 22px;
}

.ppto-header h1 {
    margin: 0 0 5px;
    font-size: 24px;
    color: #111827;
}

.ppto-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.ppto-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.field input,
.field select {
    height: 42px;
}

.field textarea {
    min-height: 80px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.items-table td {
    padding: 8px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.items-table select,
.items-table input {
    width: 100%;
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    padding: 7px 9px;
    font-size: 13px;
    box-sizing: border-box;
}

.money-input {
    background: #f8fafc;
}

.totals-box {
    max-width: 360px;
    margin-left: auto;
    margin-top: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #f8fafc;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.total-line.strong {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 10px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    height: 42px;
    border-radius: 10px;
    padding: 0 18px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: #ffffff;
}

.btn-secondary {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
}

@media (max-width: 1000px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.print-page {
    max-width: 940px;
    margin: 0 auto;
    padding: 12px 18px 60px;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 18px;
}

.print-btn,
.back-btn {
    height: 38px;
    border-radius: 9px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.print-btn {
    background: #2563eb;
    color: white;
    border: 1px solid #2563eb;
}

.back-btn {
    background: white;
    color: #111827;
    border: 1px solid #d1d5db;
}

.print-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.doc-header {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    border-bottom: 2px solid #111827;
    padding-bottom: 22px;
    margin-bottom: 26px;
}

.company-block {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.company-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.company-info h2 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #111827;
}

.company-info p {
    margin: 2px 0;
    font-size: 13px;
    color: #475569;
}

.doc-title {
    text-align: right;
}

.doc-title h1 {
    margin: 0 0 6px;
    font-size: 28px;
    color: #111827;
    letter-spacing: 0.02em;
}

.doc-title p {
    margin: 2px 0;
    font-size: 13px;
    color: #475569;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.info-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #f8fafc;
}

.info-box small {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: 700;
}

.info-box strong {
    display: block;
    color: #111827;
    font-size: 14px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.items-table th {
    background: #111827;
    color: white;
    text-align: left;
    padding: 11px 9px;
    font-size: 12px;
}

.items-table td {
    padding: 11px 9px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    color: #111827;
}

.right {
    text-align: right;
}

.totals-box {
    width: 320px;
    margin-left: auto;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #f8fafc;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 10px;
}

.total-row.final {
    border-top: 1px solid #d1d5db;
    padding-top: 12px;
    margin-top: 12px;
    font-size: 20px;
    font-weight: 800;
}

.observacion {
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
}

.observacion h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #111827;
}

.observacion p {
    margin: 0;
    font-size: 13px;
    color: #475569;
    white-space: pre-line;
}

.footer-note {
    margin-top: 28px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

@media print {
    .sidebar,
    .topbar,
    .print-actions {
        display: none !important;
    }

    .main {
        margin: 0 !important;
        padding: 0 !important;
    }

    .print-page {
        max-width: 100%;
        padding: 0;
    }

    .print-card {
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
    }

    body {
        background: white !important;
    }
}

.empresa-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 18px 48px;
}

.empresa-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.empresa-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.empresa-header p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.empresa-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.empresa-card-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.empresa-card-title h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.empresa-card-title p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

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

.empresa-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.empresa-field.full {
    grid-column: 1 / -1;
}

.empresa-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.empresa-field input,
.empresa-field select {
    width: 100%;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
}

.empresa-field input:focus,
.empresa-field select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.empresa-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.empresa-btn-primary,
.empresa-btn-secondary {
    height: 42px;
    border-radius: 10px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
}

.empresa-btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.empresa-btn-primary:hover {
    background: #2563eb;
}

.empresa-btn-secondary {
    background: #ffffff;
    border-color: #d1d5db;
    color: #111827;
}

.empresa-btn-secondary:hover {
    background: #f8fafc;
}

.empresa-logo-area {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: center;
}

.empresa-logo-preview {
    width: 100%;
    min-height: 150px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}

.empresa-logo-preview img {
    max-width: 230px !important;
    max-height: 120px !important;
    object-fit: contain !important;
    display: block !important;
}

.empresa-file-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.empresa-file-box input[type="file"] {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px;
    background: #ffffff;
    font-size: 14px;
}

@media (max-width: 900px) {
    .empresa-form-grid,
    .empresa-logo-area {
        grid-template-columns: 1fr;
    }

    .empresa-page {
        padding: 8px 10px 40px;
    }
}
