:root {
    --primary: #300060;
    --secondary: #0098F8;
    --bg: #f8f8f8;
    --card: #ffffff;
    --border: #e3e0ec;
    --text: #1f1a2e;
    --muted: #6b6675;
    --success: #12b886;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(120deg, var(--primary), #280060 35%, var(--secondary));
    color: #fff;
}

/* Botón hamburguesa - Mejoras */
.burger {
    display: inline-flex;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.burger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.burger.active {
    background: rgba(255, 255, 255, 0.25);
}

.logo {
    display: flex;
    flex-direction: column;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-sub {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .burger {
        display: none !important;
    }

    .topbar .nav-links {
        display: flex;
        flex-wrap: nowrap;
        gap: 2px;
    }
}

.nav-links a {
    color: #f5f7fa;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.user-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Menú Hamburguesa - Estilos completos */
.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: #130528;
    color: #fff;
    padding: 20px 16px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-drawer.open {
    transform: translateX(0);
}

.nav-drawer .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.nav-drawer .nav-links a {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.nav-drawer .nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    z-index: 1500;
    transition: opacity 0.2s ease;
}

.nav-overlay.open {
    opacity: 1;
    pointer-events: all;
}

body.no-scroll {
    overflow: hidden;
}

/* Mejoras de accesibilidad */
.nav-drawer:focus {
    outline: 2px solid var(--secondary);
    outline-offset: -2px;
}

/* Asegurar que los enlaces sean táctiles en móviles */
@media (hover: none) and (pointer: coarse) {
    .nav-drawer .nav-links a {
        min-height: 44px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
    }
}

.drawer-user {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-user .btn-link {
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.drawer-user .btn-link:hover {
    background: rgba(255, 255, 255, 0.16);
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.btn-link {
    color: var(--primary);
    border: 1px solid var(--secondary);
    background: #c8e8f8;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-link:hover {
    background: #b6def4;
}

.btn-link.danger {
    color: #c0392b;
    border-color: #c0392b;
    background: #fdecea;
}

a.icon-only,
button.icon-only,
.btn-primary.icon-only,
.btn-secondary.icon-only,
.btn-link.icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    width: 36px;
    height: 36px;
    min-width: 36px;
}

.icon {
    display: inline-flex;
    line-height: 0;
}

.icon svg {
    width: 16px;
    height: 16px;
}

.phone-link {
    color: var(--secondary);
    font-weight: 600;
}

.topbar .btn-link {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
}

.layout {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.card+.card {
    margin-top: 16px;
}

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

.eyebrow {
    align-items: center;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--muted);
}

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

.chip {
    padding: 6px 10px;
    background: #eaf7ff;
    color: #0b77c5;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid #cbe6ff;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}

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

.compact-table th,
.compact-table td {
    padding: 6px 8px;
}

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

th {
    background: #ecf1f6;
    color: #1f2d3d;
    font-weight: 600;
}

.btn-primary {
    display: inline-block;
    background: var(--secondary);
    color: #fff;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover {
    filter: brightness(0.95);
}

.btn-secondary {
    display: inline-block;
    background: #eef2fb;
    color: var(--text);
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-secondary.danger {
    color: #c0392b;
    background: #fdecea;
    border-color: #f5c6cb;
}

.btn-secondary.danger:hover {
    background: #fadbd8;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.inline-input {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.info-box {
    background: #c8e8f8;
    border: 1px solid #98c8f8;
    color: #173260;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-weight: 600;
}

.helper {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

/* Tooltips */
.has-tip {
    position: relative;
    cursor: help;
    display: inline-flex;
    align-items: center;
}

.has-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translate(-50%, -4px);
    background: var(--primary);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    white-space: normal;
    max-width: 260px;
    font-size: 12px;
    line-height: 1.3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
    z-index: 12000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    text-align: left;
}

button.icon-only .icon,
button.icon-only .icon svg,
a.icon-only .icon,
a.icon-only .icon svg {
    pointer-events: none;
}

.has-tip::after {
    pointer-events: none;
}

.has-tip:hover::after,
.has-tip:focus::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.alert.error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-box {
    width: 360px;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.login-box h1 {
    margin: 0 0 8px;
}

.login-box p {
    margin: 0 0 20px;
    color: var(--muted);
}

.login-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #c8e8f8;
    color: #173260;
    font-weight: 700;
    margin-bottom: 12px;
    border: 1px solid #98c8f8;
}

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

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

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--secondary);
    border-color: var(--secondary);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .login-body {
        padding: 12px;
    }

    .login-box {
        width: 92%;
        padding: 16px;
        border-radius: 10px;
    }

    .login-box h1 {
        font-size: 20px;
    }

    .login-box p {
        font-size: 14px;
    }

    .login-box input,
    .login-box button {
        font-size: 14px;
    }
}

button {
    font-family: inherit;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 14px;
}

.hidden {
    display: none !important;
}

.toolbar-left {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

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

.table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.pager {
    display: flex;
    gap: 8px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.metric {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fbff;
}

.metric h3 {
    margin: 4px 0 0;
}

.card-link {
    display: block;
    padding: 14px;
    background: #ecf1f6;
    border-radius: 8px;
    border: 1px dashed var(--border);
    color: var(--text);
    font-weight: 600;
}

.footer {
    text-align: center;
    padding: 16px;
    color: var(--muted);
    font-size: 14px;
}

#toast-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}

.toast {
    background: #1f2d3d;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-success {
    background: var(--success);
}

.toast.toast-error {
    background: #c0392b;
}

.toast.toast-info {
    background: var(--primary);
}

.toast .toast-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    margin-left: 8px;
}

.toast .toast-msg {
    flex: 1;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal {
    background: #fff;
    border-radius: 10px;
    width: min(600px, 90vw);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: pop 0.18s ease;
}

.modal-header,
.modal-footer {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.modal-body {
    padding: 16px;
    max-height: 70vh;
    overflow: auto;
    color: var(--text);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

@keyframes pop {
    from {
        transform: translateY(6px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =========================================== */
/* TARJETAS MÓVILES PARA LISTADOS             */
/* =========================================== */

.cards-container {
    display: none;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-month {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    flex: 1;
}

.calendar-grid {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #ecf1f6;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
}

.cal-weekdays span {
    padding: 10px 4px;
    color: var(--text);
    border-right: 1px solid var(--border);
}

.cal-weekdays span:last-child {
    border-right: none;
}

.cal-cells {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(80px, auto);
}

.cal-cell {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px 6px;
    min-height: 80px;
    position: relative;
    background: var(--card);
    transition: background-color 0.2s ease;
}

.cal-cell:nth-child(7n) {
    border-right: none;
}

.cal-cell.muted {
    background: #f8f9fa;
    color: var(--muted);
}

.cal-cell-date {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 4px;
    color: var(--text);
    text-align: center;
    position: absolute;
    top: 4px;
    right: 6px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
}

.cal-cell.today .cal-cell-date {
    background: var(--secondary);
    color: #fff;
}

.cal-cell-events {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: calc(100% - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cal-cell-events::-webkit-scrollbar {
    display: none;
}

.cal-pill {
    background: var(--pill-color, #7f8c8d);
    color: #fff;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.cal-pill:hover {
    opacity: 0.9;
}

.cal-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}

.cal-pill-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.cal-pill-time {
    font-size: 0.7rem;
    opacity: 0.9;
    flex-shrink: 0;
    margin-left: auto;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--legend-color, #7f8c8d);
    display: inline-block;
}

.cal-cell-events .muted {
    font-size: 0.75rem;
    text-align: center;
    padding: 8px 4px;
    color: var(--muted);
    font-style: italic;
}

.cal-cell.has-many-events::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: var(--secondary);
    border-radius: 50%;
}

.cal-cell:hover {
    background-color: rgba(0, 152, 248, 0.05);
}

.cal-pill:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.cal-cell-date:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

@media (max-width: 374px) {
    .cal-cells {
        grid-auto-rows: minmax(70px, auto);
    }

    .cal-cell {
        min-height: 70px;
        padding: 6px 4px;
    }

    .cal-cell-date {
        font-size: 0.75rem;
        width: 20px;
        height: 20px;
        line-height: 20px;
        top: 3px;
        right: 4px;
    }

    .cal-cell-events {
        margin-top: 24px;
        gap: 2px;
    }

    .cal-pill {
        padding: 3px 4px;
        font-size: 0.7rem;
    }

    .cal-pill-dot {
        width: 4px;
        height: 4px;
    }

    .cal-pill-time {
        display: none;
    }

    .calendar-month {
        font-size: 1.1rem;
        order: -1;
        width: 100%;
        margin-bottom: 8px;
    }

    .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-toolbar .actions {
        display: flex;
        justify-content: center;
        gap: 8px;
    }
}

@media (min-width: 375px) and (max-width: 480px) {
    .cal-cells {
        grid-auto-rows: minmax(75px, auto);
    }

    .cal-cell {
        min-height: 75px;
        padding: 7px 5px;
    }

    .cal-cell-date {
        font-size: 0.8rem;
        width: 22px;
        height: 22px;
        line-height: 22px;
    }

    .cal-cell-events {
        margin-top: 26px;
    }

    .cal-pill {
        padding: 3px 5px;
        font-size: 0.7rem;
    }

    .cal-pill-time {
        font-size: 0.65rem;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .cal-cells {
        grid-auto-rows: minmax(85px, auto);
    }

    .cal-cell {
        min-height: 85px;
    }

    .cal-pill {
        font-size: 0.75rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .cal-cells {
        grid-auto-rows: minmax(100px, auto);
    }

    .cal-cell {
        min-height: 100px;
        padding: 10px 8px;
    }

    .cal-cell-date {
        font-size: 0.9rem;
        width: 26px;
        height: 26px;
        line-height: 26px;
    }

    .cal-cell-events {
        margin-top: 32px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .cal-pill {
        min-height: 32px;
        padding: 8px 10px;
    }

    .cal-cell-date {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 0.9rem;
    }

    .calendar-toolbar button {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
}

@supports not (display: grid) {
    .cal-weekdays {
        display: flex;
    }

    .cal-weekdays span {
        flex: 1;
        min-width: 14.28%;
    }

    .cal-cells {
        display: flex;
        flex-wrap: wrap;
    }

    .cal-cell {
        width: 14.28%;
        box-sizing: border-box;
    }
}

@media (prefers-color-scheme: dark) {
    .cal-cell {
        background: #1a1a1a;
        border-color: #333;
    }

    .cal-cell.muted {
        background: #2a2a2a;
        color: #888;
    }

    .cal-weekdays {
        background: #2a2a2a;
        border-color: #333;
    }

    .calendar-grid {
        background: #1a1a1a;
        border-color: #333;
    }
}

@media (max-width: 480px) and (max-height: 854px) {
    .cal-cells {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .cal-cell {
        min-width: 0;
        overflow: hidden;
    }

    .cal-pill-title {
        font-size: 0.65rem;
    }
}

@media (min-width: 360px) and (max-width: 400px) and (min-height: 700px) {
    .cal-cells {
        grid-auto-rows: minmax(90px, auto);
    }

    .cal-cell {
        min-height: 90px;
    }

    .cal-cell-events {
        max-height: 140px;
    }

    .cal-pill {
        margin-bottom: 2px;
    }
}

@media (width: 360px) and (height: 760px) {
    .cal-cells {
        grid-auto-rows: minmax(95px, auto);
    }

    .cal-cell {
        min-height: 95px;
    }

    .cal-cell-events {
        max-height: 130px;
    }

    .cal-pill {
        margin-bottom: 3px;
        padding: 5px 6px;
    }
}

@media (min-aspect-ratio: 20/9) {
    .cal-cells {
        grid-auto-rows: minmax(70px, auto);
    }

    .cal-cell {
        min-height: 70px;
    }

    .cal-cell-events {
        max-height: 100px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .cal-cells {
        grid-auto-rows: minmax(60px, auto);
    }

    .cal-cell {
        min-height: 60px;
    }

    .cal-cell-date {
        top: 2px;
        right: 2px;
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 0.7rem;
    }

    .cal-cell-events {
        margin-top: 22px;
        max-height: 80px;
    }

    .cal-pill {
        padding: 2px 4px;
        font-size: 0.65rem;
    }

    .cal-pill-dot {
        display: none;
    }
}

.provider-search-container {
    position: relative;
}

.provider-search-input {
    width: 100%;
}

.provider-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    max-height: 260px;
    overflow: auto;
    z-index: 20;
}

.provider-result {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.provider-result:last-child {
    border-bottom: none;
}

.provider-result:hover {
    background: #f5f7fb;
}

.provider-result-name {
    font-weight: 700;
}

.provider-result-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    align-items: center;
}

.provider-details {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.provider-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: cardAppear 0.3s ease;
}

.provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.provider-card:active {
    transform: scale(0.99);
    transition: transform 0.1s ease;
}

.card-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.card-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.card-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
    min-width: 80px;
}

.card-value {
    flex: 1;
    text-align: right;
    font-size: 14px;
    color: var(--text);
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: nowrap;
    align-items: center;
    overflow: visible;
}

.compact-actions {
    gap: 0.25rem;
    white-space: nowrap;
}

.compact-actions .icon-only {
    padding: 0.25rem;
}

.card-actions .btn-link {
    border-radius: 6px;
    font-size: 13px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    text-align: center;
    min-height: 40px;
}

.card-actions .btn-link:hover {
    background: #f0f7ff;
}

.card-actions .btn-link.danger {
    background: #fdecea;
    color: #c0392b;
}

.card-actions .btn-link.danger:hover {
    background: #fadbd8;
}

.card-actions .btn-secondary {
    border-radius: 6px;
    font-size: 13px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    text-align: center;
    min-height: 40px;
}

.card-actions .btn-secondary:hover {
    filter: brightness(0.97);
}

.card-actions .icon-only {
    flex: 0 0 auto;
}

/* Estilos para botones con ícono y texto */
.btn-secondary.icon-text,
.btn-link.icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
}

.btn-secondary.icon-text .icon,
.btn-link.icon-text .icon {
    font-size: 14px;
    line-height: 1;
}

.btn-secondary.icon-text .btn-text,
.btn-link.icon-text .btn-text {
    font-size: 14px;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #333;
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

.phone-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.phone-link::before {
    content: "📱";
    font-size: 14px;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================== */
/* MEJORAS RESPONSIVAS - SEGURAS E INCREMENTALES */
/* =========================================== */

/* 1. Móviles < 768px */
@media (max-width: 767px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 16px 12px 60px;
        position: relative;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-links a {
        font-size: 14px;
        padding: 6px 8px;
    }

    .user-meta {
        width: 100%;
        justify-content: space-between;
    }

    .layout {
        padding: 0 12px;
        margin: 16px auto;
    }

    .card {
        padding: 16px;
    }

    .cards-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 16px;
    }

    .table-wrapper {
        display: none;
    }

    .table-wrapper::after {
        content: '↔';
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        font-size: 20px;
        opacity: 0.5;
        pointer-events: none;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 8px 6px;
        min-width: 80px;
        white-space: nowrap;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .metric {
        padding: 10px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        padding: 12px;
        min-height: 44px;
    }

    button,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        font-size: 16px;
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .toolbar-left {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .inline-input {
        flex-direction: column;
        align-items: stretch;
    }

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

    /* Acciones en tabla: evitar desborde horizontal */
    .actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .actions .btn-primary,
    .actions .btn-secondary,
    .actions .btn-link,
    .actions button,
    .actions a {
        flex: 1 1 120px;
        text-align: center;
    }

    /* Acciones: sin sticky para evitar superposiciones en desktop */
    td.actions,
    th.actions,
    td.actions-cell,
    th.actions-cell {
        position: static;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        z-index: auto;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .modal {
        width: calc(100% - 24px);
        margin: 12px;
        max-height: calc(100vh - 24px);
    }

    .modal-body {
        max-height: calc(100vh - 140px);
    }

    /* Vista tipo tarjeta para tablas (opt-in con .table-card-view o .table-card) */
    .table-card-view,
    .table-card {
        display: block;
    }

    .table-card-view thead,
    .table-card thead {
        display: none;
    }

    .table-card-view tbody,
    .table-card tbody,
    .table-card-view tr,
    .table-card tr,
    .table-card-view td,
    .table-card td {
        display: block;
        width: 100%;
    }

    .table-card-view tr,
    .table-card tr {
        margin-bottom: 16px;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 12px;
        background: var(--card);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .table-card-view td,
    .table-card td {
        padding: 8px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }

    .table-card-view td::before,
    .table-card td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        min-width: 100px;
        font-size: 13px;
    }

    .table-card-view .actions-cell,
    .table-card .actions-cell {
        justify-content: flex-end;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px dashed var(--border);
    }

    .table-card-view .actions-cell::before,
    .table-card .actions-cell::before {
        content: 'Acciones';
    }

    /* Formularios táctiles */
    form {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .form-group {
        margin-bottom: 0;
    }

    label {
        margin-bottom: 6px;
        font-size: 14px;
    }

    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .form-actions button {
        width: 100%;
    }

    /* Toasts en top */
    #toast-container {
        right: 12px;
        top: 12px;
        bottom: auto;
        max-width: calc(100% - 24px);
    }

    .toast {
        font-size: 14px;
        padding: 12px;
    }

    /* Paginacion y filtros */
    .pager {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .pager button {
        min-width: 44px;
        padding: 10px;
    }

    .filter-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }

    /* Mejoras móviles generales */
    .table-meta {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    #table-info {
        text-align: center;
        font-size: 14px;
        margin-bottom: 8px;
    }

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

    /* Utilidades */
    .hide-on-mobile {
        display: none !important;
    }

    .show-on-mobile {
        display: block !important;
    }

    .hide-on-desktop {
        display: none !important;
    }

    .text-center-mobile {
        text-align: center;
    }

    .full-width-mobile {
        width: 100% !important;
        max-width: 100% !important;
    }

    .stack-mobile {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
}

/* 2. Tablets 768-991 */
@media (min-width: 768px) and (max-width: 991px) {
    .topbar {
        padding: 12px 16px;
    }

    .topbar .nav-links {
        gap: 1px;
    }

    .topbar .nav-links a {
        padding: 5px 6px;
        font-size: 0.82rem;
    }

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

    .layout {
        padding: 0 20px;
    }

    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .provider-card {
        padding: 14px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-subtitle {
        font-size: 13px;
    }
}

/* 3. Hover/touch targets (solo coarse pointers) */
@media (hover: none) and (pointer: coarse) {

    button,
    .btn-primary,
    .btn-secondary,
    a.btn-link,
    .nav-links a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .nav-links a {
        padding: 12px 16px;
        margin: 2px;
    }

    input,
    select,
    textarea {
        padding: 14px 12px;
    }
}

/* 4. Muy pequeñas < 375px */
@media (max-width: 374px) {
    .topbar {
        padding: 10px 12px 10px 48px;
    }

    .logo {
        font-size: 16px;
    }

    .brand-sub {
        font-size: 11px;
    }

    .nav-links a {
        font-size: 13px;
        padding: 8px 10px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .card {
        padding: 12px;
    }

    .modal {
        width: calc(100% - 16px);
        margin: 8px;
    }

    .cards-container {
        gap: 12px;
    }

    .provider-card {
        padding: 12px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-actions {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .card-actions .btn-link,
    .card-actions .btn-secondary {
        width: auto;
        margin-bottom: 0;
        flex: 0 0 auto;
    }
}

/* 5. Utilidades desktop/mobile */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .topbar {
        padding: 12px 16px 12px 56px;
        gap: 10px;
        position: relative;
    }

    .burger {
        display: inline-flex;
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    .logo {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: 1;
        margin: 0 auto;
        line-height: 1.2;
    }

    .logo-text {
        display: flex;
        flex-direction: column;
        text-align: center;
    }

    .logo .brand {
        font-size: 18px;
    }

    .logo .brand-sub {
        font-size: 13px;
    }

    .notification-bell-mobile {
        display: flex;
        align-items: center;
    }

    .topbar .user-meta {
        display: none;
    }

    .nav-links {
        display: none;
    }

    .nav-links.vertical {
        display: flex;
    }

    /* Evitar que los tooltips se recorten en tablas dentro de contenedores scroll */
    .table-wrapper {
        overflow-x: auto;
        overflow-y: visible;
    }

    /* Mejora de respuesta táctil en acciones */
    .card-actions button,
    .card-actions a {
        touch-action: manipulation;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .cards-container.mobile-only {
        display: grid;
    }

    /* Acciones en tarjetas: apilar y ocupar ancho completo */
    .card-actions,
    .card-actions.mobile-optimized {
        flex-direction: column;
        flex-wrap: wrap;
        gap: 8px;
        align-items: stretch;
    }

    .card-actions .btn-secondary,
    .card-actions .btn-link,
    .card-actions button,
    .card-actions a {
        width: 100%;
        margin-bottom: 4px;
        text-align: center;
        min-height: 44px;
        font-size: 14px;
        box-sizing: border-box;
    }

    .card-actions .btn-secondary.danger {
        order: 2;
    }

    .card-actions .btn-secondary:not(.danger) {
        order: 1;
    }

    .provider-card .card-actions {
        margin-top: 12px;
        padding-top: 12px;
    }

    /* Tablas: asegurar acciones accesibles si se muestran en móvil */
    .table-wrapper.mobile-actions-fix {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrapper.mobile-actions-fix table {
        min-width: 600px;
    }

    td.actions-cell .table-actions {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 100px;
    }

    td.actions-cell .btn-secondary {
        display: block;
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        padding: 8px 10px;
    }
}

@media (max-width: 374px) {

    .card-actions .btn-secondary,
    .card-actions .btn-link {
        font-size: 13px;
        padding: 10px 8px;
    }

    .btn-secondary.icon-text .btn-text,
    .btn-link.icon-text .btn-text {
        display: none;
    }

    .btn-secondary.icon-text,
    .btn-link.icon-text {
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .btn-secondary.icon-text .icon,
    .btn-link.icon-text .icon {
        font-size: 16px;
        margin: 0;
    }
}

@media (hover: none) and (pointer: coarse) {
    .card-actions button:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* 6. Progresivas desktop (>=768) */
@media (min-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .toolbar {
        flex-wrap: nowrap;
    }

    .toolbar-left {
        flex-wrap: nowrap;
    }

    .card-header {
        flex-direction: row;
        align-items: center;
    }

    .inline-input {
        flex-wrap: nowrap;
    }

    .btn-primary,
    .btn-secondary {
        min-height: auto;
        font-size: 15px;
    }

    input,
    select,
    textarea {
        font-size: 15px;
        padding: 10px;
        min-height: auto;
    }

    .layout {
        padding: 0 16px;
        margin: 24px auto;
    }

    .topbar {
        padding: 16px 24px;
        flex-direction: row;
        align-items: center;
    }

    .nav-links {
        width: auto;
        justify-content: center;
    }

    .user-meta {
        width: auto;
        justify-content: flex-end;
    }
}

/* 7. Fix iOS safari scroll en login */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 767px) {
        .login-box {
            max-height: 90vh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
    }
}

@media (min-width: 768px) {
    .topbar {
        justify-content: flex-start;
        gap: 12px;
    }

    .topbar .nav-links {
        flex-wrap: nowrap;
        gap: 2px;
    }

    .logo {
        text-align: left;
        flex-shrink: 0;
    }

    .topbar .user-meta {
        display: flex;
        margin-left: auto;
        flex-shrink: 0;
    }
}

/* Reclamos: badges y vencimientos */
.badge-danger { background: #ff4d4f; color: #fff; }
.badge-warning { background: #ffa940; color: #1f1a2e; }
.badge-info { background: #40a9ff; color: #fff; }
.badge-success { background: #12b886; color: #fff; }
.due-soon { color: #d4380d; font-weight: 600; }
.metric-card.emphasis {
    border: 1px solid #ff7875;
    box-shadow: 0 6px 20px rgba(255, 120, 117, 0.2);
}

/* ─── Profile Page ─────────────────────────────────────────── */

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 24px;
}

.profile-section {
    background: var(--surface, #1e1b2e);
    border: 1px solid var(--border, #2d2a3e);
    border-radius: 12px;
    padding: 24px;
}

.profile-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    color: var(--text, #e0ddf0);
}

.profile-section h3 .icon {
    display: flex;
    align-items: center;
    opacity: 0.7;
}

.profile-section .form-group {
    margin-bottom: 16px;
}

.profile-section .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted, #a9a5c0);
}

.profile-section .form-group label .required {
    color: var(--danger, #e74c3c);
}

.profile-section .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border, #2d2a3e);
    border-radius: 8px;
    background: var(--bg, #16132a);
    color: var(--text, #e0ddf0);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.profile-section .form-group input:focus {
    outline: none;
    border-color: var(--primary, #6c63ff);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.profile-section .form-group input.input-readonly {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-section .form-group .helper {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--muted, #a9a5c0);
}

.profile-section .form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.profile-section .form-actions .helper {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Password toggle button */
.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-wrapper input {
    padding-right: 42px !important;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--muted, #a9a5c0);
    opacity: 0.6;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
}

.btn-toggle-password:hover,
.btn-toggle-password.active {
    opacity: 1;
    color: var(--primary, #6c63ff);
}

/* Password strength bar */
.password-strength {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border, #2d2a3e);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Responsive profile */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 16px;
    }

    .profile-section {
        padding: 16px;
    }

    .profile-section .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-section .form-actions button {
        width: 100%;
    }
}
/* =============================================================================
   DASHBOARD — Reclamos (rediseño)
   ============================================================================= */

/* Hero de bienvenida */
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.dashboard-hero-left h2 { margin: .25rem 0 0; }
.dashboard-hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.dashboard-cta { display: inline-flex; align-items: center; gap: .4rem; }

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: .5rem;
}
.kpi-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--bg, #f8f8f8);
    border: 1px solid var(--border, #e3e0ec);
    border-radius: 10px;
    padding: .9rem 1rem;
    transition: box-shadow .15s, border-color .15s;
}
.kpi-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.kpi-card.kpi-alert {
    border-color: #ff4d4f;
    background: #fff2f0;
}
.kpi-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.kpi-info { flex: 1; min-width: 0; }
.kpi-label { font-size: .78rem; color: var(--muted, #6b6675); margin: 0 0 .1rem; font-weight: 500; }
.kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--text, #1f1a2e); margin: 0; line-height: 1; }

/* Chips de estado en el header */
.chip-loading { background: #e3e0ec; color: #666; }
.chip-ok  { background: #e6fbf0; color: #12b886; border: 1px solid #12b886; }
.chip-error { background: #fff2f0; color: #ff4d4f; border: 1px solid #ff4d4f; }

/* Grid central: reclamos + notificaciones */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.25rem;
    align-items: start;
}
.dashboard-reclamos-panel { min-width: 0; }
.dashboard-notif-panel { min-width: 0; }

/* Título de notificaciones con badge */
.notif-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: #ff4d4f;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 0 .35rem;
    margin-left: .4rem;
    vertical-align: middle;
}

/* Filas de reclamo en el panel */
#reclamos-activos-list .reclamo-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border, #e3e0ec);
    cursor: pointer;
    transition: background .15s;
    border-radius: 0;
}
#reclamos-activos-list .reclamo-row:first-child { border-radius: 8px 8px 0 0; }
#reclamos-activos-list .reclamo-row:last-child  { border-bottom: none; border-radius: 0 0 8px 8px; }
#reclamos-activos-list .reclamo-row:hover { background: var(--bg, #f8f8f8); }
#reclamos-activos-list .reclamo-row:focus { outline: 2px solid var(--secondary, #0098F8); outline-offset: -2px; }
#reclamos-activos-list .reclamo-row-overdue { background: #fff2f0; border-left: 3px solid #ff4d4f; }
#reclamos-activos-list .reclamo-row-soon    { background: #fffbe6; border-left: 3px solid #ffa940; }
#reclamos-activos-list .reclamo-row-overdue:hover { background: #ffe7e6; }
#reclamos-activos-list .reclamo-row-soon:hover    { background: #fff8d6; }
#reclamos-activos-list .reclamo-row-left { flex: 1; min-width: 0; }
#reclamos-activos-list .reclamo-row-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .3rem; }
#reclamos-activos-list .reclamo-row-title {
    font-size: .95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .25rem;
}
#reclamos-activos-list .reclamo-row-meta {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    font-size: .78rem;
    align-items: center;
}
#reclamos-activos-list .reclamo-codigo { font-weight: 600; }
#reclamos-activos-list .reclamo-resp { color: var(--muted, #6b6675); }
#reclamos-activos-list .reclamo-vencido-tag {
    color: #cf1322;
    font-weight: 600;
    background: #fff2f0;
    border: 1px solid #ffa39e;
    border-radius: 4px;
    padding: 0 .3rem;
}
#reclamos-activos-list .reclamo-vence-tag {
    color: #ad6800;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 4px;
    padding: 0 .3rem;
}
#reclamos-activos-list .reclamo-row-arrow {
    font-size: 1.2rem;
    color: var(--muted,#aaa);
    flex-shrink: 0;
}

/* Estado vacío de reclamos */
#reclamos-activos-list .reclamos-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 2.5rem 1rem;
    color: var(--muted, #6b6675);
    text-align: center;
}
#reclamos-activos-list .reclamos-empty-icon { font-size: 2.5rem; }

/* Badge sin leer en notificaciones */
.notif-unread-count {
    font-size: .78rem;
    color: var(--muted, #6b6675);
    margin-right: auto;
}
.notif-widget-footer {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    border-top: 1px solid var(--border, #eee);
}
.notif-widget-footer a {
    color: var(--secondary, #0098F8);
    font-weight: 600;
    font-size: .9rem;
    margin-left: auto;
}

/* Widgets de notificación */
.notif-widget-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 2rem 1rem;
    color: var(--muted, #888);
    text-align: center;
}
.notif-widget-icon { font-size: 2rem; display: block; }
.notif-widget-list { display: flex; flex-direction: column; }

.notif-widget-item {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--border, #eee);
    transition: background .15s;
    min-width: 0;
}
.notif-widget-item:last-child { border-bottom: none; }
.notif-widget-item:hover { background: var(--bg, #f9f9fb); }
.notif-widget-unread {
    background: #f0f7ff;
    border-left: 3px solid var(--secondary, #0098F8);
}

.notif-widget-item-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 2px;
    width: 1.4rem;
    text-align: center;
}

.notif-widget-item-body {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.notif-widget-item-header {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    justify-content: space-between;
    margin-bottom: .15rem;
    min-width: 0;
}

.notif-widget-item-title {
    font-weight: 600;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.notif-widget-item-time {
    font-size: .72rem;
    color: #aaa;
    white-space: nowrap;
    flex-shrink: 0;
}

.notif-widget-item-msg {
    font-size: .8rem;
    color: var(--muted, #666);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-widget-mark-btn {
    background: none;
    border: none;
    color: var(--success, #12b886);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    opacity: .6;
    flex-shrink: 0;
    align-self: center;
    border-radius: 4px;
    min-width: 2rem;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .15s, background .15s;
}
.notif-widget-mark-btn:hover {
    opacity: 1;
    background: #e6fbf0;
}

@media (max-width: 600px) {
    .notif-widget-item       { padding: .6rem .75rem; gap: .45rem; }
    .notif-widget-item-icon  { font-size: 1rem; width: 1.2rem; }
    .notif-widget-item-title { font-size: .82rem; }
    .notif-widget-item-msg   { font-size: .76rem; }
    .notif-widget-item-time  { font-size: .68rem; }
}

/* badge-error faltante */
.badge-error { background: #ff4d4f; color: #fff; }

/* Links secundarios en sistema */
.dashboard-system-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-sm { padding: .3rem .8rem; font-size: .8rem; border-radius: 6px; }

/* Responsive ----------------------------------------------------------------*/
@media (max-width: 900px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 600px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-hero { flex-direction: column; align-items: flex-start; }
    .dashboard-hero-actions { width: 100%; }
    .dashboard-cta { flex: 1; justify-content: center; }
}
