/* ===== EMPLEADO EDIT TABS ===== */

.emp-edit-topbar {
    background: #fff;
    border-bottom: 1px solid var(--gray-d);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    min-height: 56px;
}

.emp-back-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 6px;
    background: #e67e22;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.emp-back-btn:hover {
    background: #cf6d17;
}

.emp-edit-name {
    flex: 1;
}

.emp-edit-nombre {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: .04em;
}

.emp-edit-apellido {
    font-size: 12px;
    color: var(--ink-m);
    margin-top: 2px;
}

.emp-edit-sections {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    border-bottom: 1px solid var(--gray-d);
    padding: 0 8px;
    flex-shrink: 0;
    overflow-x: auto;
}

.emp-sec-btn {
    padding: 10px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--ink-m);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color .1s, border-color .1s;
    white-space: nowrap;
    letter-spacing: .02em;
}

.emp-sec-btn:hover {
    color: var(--blue);
}

.emp-sec-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 600;
}


/* Emp tab content */
.emp-tab-wrap {
    padding: 20px 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.emp-form-section {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-m);
    padding: 10px 0 6px;
    border-bottom: 1px solid var(--gray-d);
    margin-bottom: 14px;
}

.emp-form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.emp-form-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 150px;
}

.emp-form-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-m);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.emp-form-field input[type=text],
.emp-form-field input[type=email],
.emp-form-field input[type=password],
.emp-form-field select,
.emp-form-field textarea {
    padding: 7px 10px;
    border: 1.5px solid var(--gray-d);
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
}

.emp-form-field input:focus,
.emp-form-field select:focus,
.emp-form-field textarea:focus {
    border-color: var(--blue);
}

.emp-ficha-btns {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-d);
}

.emp-btn-save {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    background: #28a745;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.emp-btn-save:hover {
    background: #218838;
}

.emp-btn-del {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.emp-btn-del:hover {
    background: #c0392b;
}

/* Especialidades */
.emp-esp-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--gray-d);
    border-radius: 5px;
    margin-bottom: 6px;
    font-size: 13px;
}

.emp-esp-del {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: #dc3545;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Esp modal */
.emp-esp-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emp-esp-modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    min-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}

.emp-esp-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Permisos tab */
.emp-perm-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.emp-perm-subtabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-d);
    background: #fff;
    flex-wrap: wrap;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.emp-perm-subtab {
    padding: 9px 16px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink-m);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.emp-perm-subtab:hover {
    color: var(--ink);
    background: #f5f7fa;
}

.emp-perm-subtab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 600;
}

.emp-perm-content-area {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.emp-perm-tree-wrap {
    padding: 0 0 80px;
}

.emp-perm-section-hdr {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #fff;
    background: var(--blue);
    padding: 8px 20px;
    margin-top: 2px;
}

.emp-perm-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--gray-d);
}

.emp-perm-lbl {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink);
    width: 100%;
}

.emp-perm-lbl:hover {
    color: var(--blue);
}

.emp-perm-lbl input[type=checkbox] {
    cursor: pointer;
    flex-shrink: 0;
}

.emp-perm-save-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 20px;
    border-top: 1px solid var(--gray-d);
    display: flex;
    gap: 8px;
}

/* Historia matrix */
.emp-perm-hist-tbl {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}

.emp-perm-hist-tbl th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-m);
    padding: 10px 10px;
    text-align: center;
    background: var(--gray-b);
    border: 1px solid var(--gray-d);
    white-space: nowrap;
}

.emp-perm-hist-tbl th:first-child {
    text-align: left;
}

.emp-perm-hist-tbl td {
    padding: 8px 10px;
    border: 1px solid var(--gray-d);
    text-align: center;
    vertical-align: middle;
}

.emp-perm-hist-tbl td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
}

.emp-perm-hist-tbl tr:hover td {
    background: #f5f7fa;
}

.emp-perm-hist-tbl tr:hover td:first-child {
    background: #eef2ff;
}

/* Horario tab */
.emp-hor-full {
    padding: 20px 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.emp-hor-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-d);
}

.emp-hor-hdr-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-m);
}

.emp-hor-format-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.emp-hor-format {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ink);
}

.emp-hor-format-lbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-m);
    margin-right: 4px;
}

.emp-hor-format label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.emp-hor-dias {
    display: flex;
    gap: 8px;
    font-size: 12.5px;
}

.emp-hor-dia {
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    font-size: 12.5px;
}

.emp-hor-time-tbl {
    border-collapse: collapse;
    font-size: 13px;
    width: 100%;
    margin-bottom: 20px;
}

.emp-hor-time-tbl th {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-m);
    text-align: center;
    padding: 9px 14px;
    background: var(--gray-b);
    border: 1px solid var(--gray-d);
}

.emp-hor-time-tbl td {
    padding: 9px 14px;
    border: 1px solid var(--gray-d);
    text-align: center;
}

.emp-hor-time-input {
    width: 90px;
    padding: 7px 10px;
    border: 1.5px solid var(--gray-d);
    border-radius: 5px;
    font-family: inherit;
    font-size: 13px;
    text-align: center;
    outline: none;
}

.emp-hor-time-input:focus {
    border-color: var(--blue);
}

.emp-hor-reset-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: #dc3545;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Vistas tab - dual listbox */
.emp-dual-box {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.emp-list-box {
    flex: 1;
    border: 1px solid var(--gray-d);
    border-radius: 4px;
    overflow: hidden;
}

.emp-list-box-hdr {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.emp-list-box-hdr.avail {
    background: var(--blue);
}

.emp-list-box-hdr.sel {
    background: #28a745;
}

.emp-list-box-body {
    min-height: 120px;
}

.emp-list-item {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--blue);
    cursor: pointer;
    text-align: right;
    border-bottom: 1px solid var(--gray-d);
}

.emp-list-item:hover {
    background: var(--blue-l);
}

.emp-list-swap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 20px;
    cursor: pointer;
    color: var(--ink-m);
}

/* Vacaciones tab */
.emp-vac-wrap {
    display: flex;
    gap: 20px;
    padding: 20px 28px;
    overflow-y: auto;
    align-items: flex-start;
}

.emp-vac-card {
    background: #fff;
    border: 1px solid var(--gray-d);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.emp-vac-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-m);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-d);
}

.emp-vac-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.emp-vac-field label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
}

.emp-vac-field input[type=number],
.emp-vac-field input[type=date],
.emp-vac-field textarea {
    padding: 8px 11px;
    border: 1.5px solid var(--gray-d);
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.emp-vac-field input:focus,
.emp-vac-field textarea:focus {
    border-color: var(--blue);
}

.emp-vac-field textarea {
    resize: vertical;
    min-height: 72px;
}

.emp-vac-cal-body {
    background: #f5f6fa;
    border-radius: 6px;
    min-height: 120px;
    padding: 16px;
}

.emp-vac-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid var(--gray-d);
    border-radius: 5px;
    margin-bottom: 8px;
    font-size: 13px;
}

.emp-vac-entry-dates {
    font-weight: 600;
    color: var(--ink);
}

.emp-vac-entry-motivo {
    font-size: 12px;
    color: var(--ink-m);
    margin-top: 2px;
}

.emp-vac-del-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    background: #dc3545;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== CONFIG EDIT WRAP ===== */
.cfg-edit-wrap {
    padding: 20px 24px 32px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.sala-edit-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.sala-edit-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}

.sala-edit-field label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-m);
}

.sala-edit-field input[type=text],
.sala-edit-field input[type=email],
.sala-edit-field select {
    padding: 7px 10px;
    border: 1.5px solid var(--gray-d);
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
}

.sala-edit-field input:focus,
.sala-edit-field select:focus {
    border-color: var(--blue);
}

.sala-edit-section {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-m);
    padding: 10px 20px 8px;
    border-top: 1px solid var(--gray-d);
    margin-top: 6px;
}

/* ===== CONFIG SCREENS ===== */
.cfg-page {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cfg-hdr {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-d);
    gap: 12px;
    flex-shrink: 0;
}

.cfg-hdr h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    flex: 1;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.cfg-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cfg-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cfg-tbl th {
    text-align: left;
    padding: 10px 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-m);
    background: var(--gray-b);
    border-bottom: 1px solid var(--gray-d);
}

.cfg-tbl td {
    padding: 14px 24px;
    border-bottom: 1px solid var(--gray-d);
    vertical-align: middle;
}

.cfg-tbl tr:last-child td {
    border-bottom: none;
}

.cfg-tbl tr:hover td {
    background: #f5f7fa;
}

.cfg-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, .1);
    margin-right: 10px;
    vertical-align: middle;
}

.cfg-name-cell {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}

.cfg-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
}

.cfg-badge.on {
    background: #e8f5e9;
    color: #2e7d32;
}

.cfg-badge.off {
    background: #fce4ec;
    color: #c62828;
}

.cfg-btn-add {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    background: #28a745;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: .03em;
}

.cfg-btn-add:hover {
    background: #218838;
}

.cfg-edit-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-d);
    border-radius: 5px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    color: var(--blue);
    padding: 0;
}

.cfg-edit-btn:hover {
    background: var(--gray-b);
    border-color: var(--blue);
}

.cfg-total {
    padding: 10px 24px;
    font-size: 12px;
    color: var(--ink-m);
    border-top: 1px solid var(--gray-d);
    flex-shrink: 0;
}

.cedit-back {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.cedit-back-btn {
    padding: 5px 12px;
    border: 1px solid var(--gray-d);
    border-radius: 5px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.cedit-back-btn:hover {
    background: var(--gray-b);
}

.cedit-back h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.cedit-section {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-m);
    padding: 12px 0 6px;
    border-bottom: 1px solid var(--gray-d);
    margin-bottom: 14px;
}

.cedit-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.cedit-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}

.cedit-field label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-m);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cedit-field input[type=text],
.cedit-field select {
    padding: 8px 10px;
    border: 1.5px solid var(--gray-d);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
}

.cedit-field input[type=text]:focus,
.cedit-field select:focus {
    border-color: var(--blue);
}

.cedit-color-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.cedit-color-preview {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, .1);
    flex-shrink: 0;
}

.cedit-save-row {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-d);
}

.cedit-btn-save {
    padding: 9px 20px;
    border: none;
    border-radius: 6px;
    background: var(--blue);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.cedit-btn-save:hover {
    background: var(--blue-h);
}

.cedit-btn-save:disabled {
    background: var(--gray-d);
    cursor: not-allowed;
}

.cedit-btn-del {
    padding: 9px 16px;
    border: none;
    border-radius: 6px;
    background: var(--red);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.cedit-btn-del:hover {
    background: #c0392b;
}

.cedit-fisios-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cedit-fisio-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1.5px solid var(--gray-d);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12.5px;
    transition: border-color .15s, background .15s, color .15s;
    user-select: none;
}

.cedit-fisio-chip:hover {
    border-color: var(--blue);
}

.cedit-fisio-chip.selected {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.cedit-fisio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== COBROS ===== */
.cobros-hdr-wrap {
    padding: 14px 24px 0;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
}

.cobros-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    padding: 0px !important;
}

.cobros-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.cobros-date-sub {
    font-size: 12px;
    color: var(--ink-l);
    margin-top: 2px;
}

.cobros-ctrl {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--gray-d);
    border-radius: 5px;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--ink);
    outline: none;
    background: #fff;
    cursor: pointer;
}

.cobros-ctrl:focus {
    border-color: var(--blue);
}

.cobros-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cobros-tab {
    padding: 8px 14px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink-m);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .1s;
}

.cobros-tab:hover {
    color: var(--blue);
}

.cobros-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 600;
}

.cobros-tab-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--gray-d);
    color: var(--ink-m);
}

.cobros-tab.active .cobros-tab-badge {
    background: var(--blue);
    color: #fff;
}

.cobros-action-btn {
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--gray-d);
    border-radius: 5px;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink-m);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cobros-action-btn:hover {
    background: var(--gray-l);
}

.cobros-tbl {
    width: 100%;
    border-collapse: collapse;
}

.cobros-tbl th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-m);
    border-bottom: 1px solid var(--gray-d);
    cursor: pointer;
    white-space: nowrap;
}

.cobros-tbl th:last-child {
    text-align: right;
}

.cobros-tbl td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gray-d);
    font-size: 13.5px;
    vertical-align: middle;
}

.cobros-tbl tr:hover td {
    background: #f8faff;
}

.cobros-cobrar-btn {
    padding: 5px 14px;
    border: 1.5px solid var(--blue);
    border-radius: 4px;
    background: #fff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: .04em;
    transition: background .12s, color .12s;
}

.cobros-cobrar-btn:hover {
    background: var(--blue);
    color: #fff;
}

.cobros-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid var(--gray-d);
    flex-shrink: 0;
    min-height: 56px;
}

.cobros-last-pago {
    background: #fff;
    border: 1px solid var(--gray-d);
    border-radius: 6px;
    padding: 8px 14px;
    min-width: 180px;
}

.cobros-last-pago-hora {
    font-size: 11px;
    color: var(--ink-l);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.cobros-last-pago-importe {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.cobros-last-pago-nombre {
    font-size: 12px;
    color: var(--ink-m);
    margin-top: 1px;
}

.cobros-total {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

/* ===== PREVISIÓN ===== */
.prev-toolbar {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
    gap: 12px;
}

.prev-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.prev-conceptos-btn {
    padding: 5px 14px;
    border: 1px solid var(--gray-d);
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
    cursor: pointer;
    white-space: nowrap;
}

.prev-conceptos-btn:hover {
    background: var(--blue-l);
}

.prev-conceptos-dd {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid var(--gray-d);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    z-index: 300;
    min-width: 180px;
    padding: 6px 0;
}

.prev-conceptos-dd.open {
    display: block;
}

.prev-conc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
}

.prev-conc-item:hover {
    background: var(--gray-b);
}

.prev-conc-item input {
    cursor: pointer;
}

.prev-filtrar-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 5px;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.prev-filtrar-btn:hover {
    background: var(--blue-h);
}

.prev-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
}

.prev-nav-btn {
    padding: 7px 18px;
    border: none;
    border-radius: 5px;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.prev-nav-btn:hover {
    background: var(--blue-h);
}

.prev-mes-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.prev-tbl-wrap {
    flex: 1;
    overflow: auto;
}

.prev-tbl {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.prev-th {
    background: #555;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #666;
}

.prev-th-total {
    background: #444;
}

.prev-cell {
    padding: 10px 12px 8px;
    border: 1px solid #e0e0e0;
    vertical-align: top;
    text-align: right;
}

.prev-cell-empty {
    background: #f9f9f9;
}

.prev-cell-alt {
    background: #f5f5f5;
}

.prev-cell-amt {
    font-size: 13.5px;
    color: var(--ink);
    font-weight: 400;
}

.prev-cell-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 1px 8px;
    border-radius: 12px;
    border: 2px solid var(--blue);
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.prev-cell-badge.zero {
    border-color: #ccc;
    color: #aaa;
}

.prev-cell-total-col {
    background: #f0f0f0;
    padding: 10px 12px 8px;
    border: 1px solid #ccc;
    text-align: right;
    vertical-align: top;
}

.prev-total-amt {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.prev-total-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 1px 8px;
    border-radius: 3px;
    background: #555;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.prev-mes-row {
    background: #e8e8e8;
}

.prev-mes-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    text-align: right;
    padding: 12px 16px;
    border: 1px solid #ccc;
}

.prev-mes-total-cell {
    padding: 12px;
    border: 1px solid #ccc;
    text-align: right;
}

/* ===== FACTURAS ===== */
.fact-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.fact-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-right: 4px;
}

.fact-btn-primary {
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    background: #28a745;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.fact-btn-primary:hover {
    background: #218838;
}

.fact-filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
    flex-wrap: wrap;
    background: var(--gray-b);
}

.fact-filter {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--gray-d);
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink);
    outline: none;
    background: #fff;
}

.fact-filter:focus {
    border-color: var(--blue);
}

.fact-filter[type=date] {
    width: 120px;
}

.fact-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
}

.fact-action-btn {
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--gray-d);
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink-m);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fact-action-btn:hover {
    background: var(--gray-l);
}

.fact-sel-label {
    font-size: 12px;
    color: var(--blue);
    font-weight: 600;
    margin-left: 4px;
}

.fact-show-sel {
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--gray-d);
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink);
    background: #fff;
    margin-left: auto;
}

.fact-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fact-tbl th {
    text-align: left;
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-m);
    border-bottom: 1px solid var(--gray-d);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.fact-tbl th .sort-icon {
    opacity: .4;
    font-size: 10px;
}

.fact-tbl td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--gray-d);
    vertical-align: middle;
}

.fact-tbl tr:hover td {
    background: #f8faff;
}

.fact-tbl td:last-child {
    text-align: right;
    white-space: nowrap;
}

.fact-num-link {
    color: var(--blue);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.fact-num-link:hover {
    text-decoration: underline;
}

.fact-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.fact-row-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-d);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.fact-row-btn:hover {
    background: var(--gray-b);
    border-color: var(--blue);
}

.fact-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 3px);
    background: #fff;
    border: 1px solid var(--gray-d);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    z-index: 200;
    min-width: 170px;
    overflow: hidden;
}

.fact-dropdown-menu.open {
    display: block;
}

.fact-dropdown-item {
    padding: 9px 14px;
    font-size: 12.5px;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.fact-dropdown-item:hover {
    background: var(--gray-b);
}

.fact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid var(--gray-d);
    flex-shrink: 0;
    font-size: 12.5px;
    color: var(--ink-m);
}

.fact-pag {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fact-pag-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 5px;
    border: 1px solid var(--gray-d);
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    color: var(--ink-m);
}

.fact-pag-btn:hover:not(:disabled) {
    background: var(--blue-l);
    border-color: var(--blue);
    color: var(--blue);
}

.fact-pag-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    font-weight: 600;
}

.fact-pag-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* Factura editor */
.fact-edit-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
}

.fact-edit-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fact-edit-actions {
    display: flex;
    gap: 8px;
}

.fact-btn-manual {
    padding: 7px 14px;
    border: none;
    border-radius: 5px;
    background: var(--blue);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.fact-btn-cancel {
    padding: 7px 14px;
    border: none;
    border-radius: 5px;
    background: #e67e22;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.fact-btn-next {
    padding: 7px 14px;
    border: none;
    border-radius: 5px;
    background: #28a745;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.fact-edit-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
    background: var(--gray-b);
}

.fact-edit-date {
    height: 32px;
    padding: 0 10px;
    border: 1.5px solid var(--gray-d);
    border-radius: 5px;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    outline: none;
    background: #fff;
}

.fact-edit-date:focus {
    border-color: var(--blue);
}

.fact-btn-search {
    height: 32px;
    padding: 0 16px;
    border: none;
    border-radius: 5px;
    background: var(--blue);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.fact-concept-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

.fact-pac-pick-btn {
    height: 32px;
    padding: 0 12px;
    border: 1.5px solid var(--gray-d);
    border-radius: 5px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 200px;
}

.fact-pac-pick-btn:hover {
    border-color: var(--blue);
    background: var(--blue-l);
}

/* Patient full-screen search panel */
.fact-pac-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fact-pac-panel-hdr {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--gray-d);
    flex-shrink: 0;
}

.fact-pac-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.fact-pac-search-input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid var(--gray-d);
    border-radius: 5px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ink);
    outline: none;
}

.fact-pac-search-input:focus {
    border-color: var(--blue);
}

.fact-pac-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    align-content: start;
}

.fact-pac-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-d);
}

.fact-pac-card:hover {
    background: var(--blue-l);
}

.fact-pac-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #d4c5a9;
    color: #8a7460;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fact-pac-card-name {
    font-size: 13px;
    color: var(--blue);
    font-weight: 500;
}

/* ===== Módulo Control de Caja extraído a control-caja.css ===== */

/* ===== IMAGE EDITOR ===== */
.img-edit-wrap {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 0;
    background: #f5f7fa;
}

.img-edit-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.img-edit-canvas-wrap {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid var(--gray-d);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.img-edit-canvas-wrap img {
    max-width: 100%;
    display: block;
}

.img-edit-aside {
    width: 120px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border-left: 1px solid var(--gray-d);
    z-index: 10;
}

.img-edit-btn {
    width: 100%;
    height: 38px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .15s;
    color: #fff;
}

.img-edit-btn.blue {
    background: var(--blue);
}

.img-edit-btn.blue:hover {
    background: var(--blue-h);
}

.img-edit-btn.red {
    background: var(--red);
}

.img-edit-btn.red:hover {
    background: #c0392b;
}

.img-edit-btn.green {
    background: #28a745;
}

.img-edit-btn.green:hover {
    background: #218838;
}

.img-edit-btn.tool {
    background: #eee;
    color: var(--ink-m);
    border: 1px solid var(--gray-d);
}

.img-edit-btn.tool:hover {
    background: var(--gray-d);
    color: var(--ink);
}

.img-edit-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.img-edit-tools-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-l);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}

/* Signature Pad */
.sig-pad-canvas {
    cursor: crosshair;
    background: #fff;
    touch-action: none;
}

.sig-pad-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: #f0f2f5;
    padding: 40px;
}

.sig-pad-box {
    background: #fff;
    border: 1px solid var(--gray-d);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

/* Multi-email chips */
.sala-email-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.sala-email-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #28a745;
    color: #fff;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.sala-email-chip-del {
    cursor: pointer;
    opacity: 0.7;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
}

.sala-email-chip-del:hover {
    opacity: 1;
}