/* ==========================================================================
   STYLES.CSS — CSS UNIFICADO DEL CRM
   Reemplaza: style.css, style2.css, css/style.css,
              clientes/style.css, servicio/style.css, presupuestos/style.css
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* Variables CSS para consistencia */
:root {
    --sidebar-width: 272px;
    --sidebar-width-collapsed: 68px;
    --color-primary: #1f2937;
    --color-primary-dark: #1f2937;
    --color-secondary: #64748b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #06b6d4;

    --bg-light: #0d0d0d;
    --bg-white: #111111;
    --bg-dark: #1e293b;
    --bg-darker: #0f172a;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --text-white: #f1f5f9;

    --border-color: #1e1e1e;
    --border-light: #161616;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: all 0.2s ease;
}

/* ==========================================================================
   1. RESET Y ESTRUCTURA GLOBAL
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* El body del DASHBOARD usa flex para el sidebar + main-content */
body.app-layout {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    background-color: #080808;
    color: #e2e8f0;
    margin: 0;
    padding: 0;
}

/* El body del LOGIN es centrado */
body.login-layout {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #080808;
    color: #e2e8f0;
}

/* ==========================================================================
    2. SIDEBAR - MINIMALISTA OSCURO & SOFISTICADO
    ========================================================================== */

:root {
    --sb-bg: #000000;
    --sb-hover: #0a0a0a;
    --sb-border: #121212;
    --sb-text: #f3f5f8;
    --sb-text-secondary: #a9b4c6;
    --sb-text-muted: #7e8ba0;
    --sb-accent: #27c997;
    --sb-accent-soft: rgba(39, 201, 151, 0.17);
    --sb-shadow: 0 12px 36px rgba(6, 8, 12, 0.46);
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sb-bg);
    color: var(--sb-text);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: width 0.26s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s ease;
    flex-shrink: 0;
    border-right: 1px solid var(--sb-border);
    box-shadow: var(--sb-shadow);
    overflow: hidden;
}

.sidebar-hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 14px 14px;
    border-bottom: 1px solid var(--sb-border);
    background: linear-gradient(180deg, #080808 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.sidebar-logo-img {
    max-width: calc(100% - 32px);
    height: auto;
    max-height: 40px;
    display: block;
    margin: 0;
}

.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--sb-border);
    background: #1a2130;
    color: var(--sb-text-secondary);
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
}

.sidebar-collapse-btn:hover {
    background: var(--sb-accent);
    border-color: var(--sb-accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(39, 201, 151, 0.26);
}

.sidebar-nav {
    list-style: none;
    padding: 14px 10px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav li {
    margin-bottom: 6px;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    color: var(--sb-text-secondary);
    text-decoration: none;
    border-radius: 9px;
    transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.nav-link:hover {
    background: var(--sb-hover);
    color: var(--sb-text);
    transform: translateX(1px);
}

.nav-link.active {
    background: var(--sb-accent-soft);
    color: var(--sb-accent);
    font-weight: 600;
    border-left: 2px solid var(--sb-accent);
    padding-left: 10px;
}

.nav-link.active:hover {
    background: var(--sb-accent-soft);
    transform: translateX(1px);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.nav-link.active .nav-icon {
    opacity: 1;
    color: var(--sb-accent);
}

.nav-arrow {
    width: 14px;
    height: 14px;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
}

.nav-arrow.rotated {
    transform: rotate(180deg);
}

.nav-group-toggle {
    justify-content: flex-start;
}

.nav-group {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition:
        max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.18s ease,
        transform 0.22s ease;
    list-style: none;
    padding: 2px 0 0;
    margin: 0;
    background: transparent;
    border: none;
}

.nav-group.open {
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin: 4px 0 4px 0;
}

.nav-sublink {
    display: block;
    padding: 9px 11px 9px 30px;
    color: var(--sb-text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease;
    font-size: 10.5px;
    font-weight: 400;
    margin-left: 0;
}

.nav-sublink:hover {
    color: var(--sb-text);
    background: var(--sb-hover);
    transform: translateX(1px);
    padding-left: 32px;
}

.nav-sublink.active {
    color: var(--sb-accent);
    background: var(--sb-accent-soft);
    font-weight: 600;
}

/* Rediseño del nav-group solo para sidebar vertical */
body.app-layout:not(.top-nav-preview) .nav-group-toggle {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 11px;
}

body.app-layout:not(.top-nav-preview) .nav-item-group > .nav-group-toggle:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: #0b0b0b;
}

body.app-layout:not(.top-nav-preview) .nav-item-group > .nav-group-toggle.active {
    border-color: rgba(39, 201, 151, 0.34);
    background: rgba(39, 201, 151, 0.1);
}

body.app-layout:not(.top-nav-preview) .nav-group {
    transform: translateY(-6px) scale(0.985);
    transition:
        max-height 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease,
        transform 0.2s ease;
    padding: 0;
    background: #050505;
    border-radius: 12px;
    border: 0;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 12px 26px rgba(0, 0, 0, 0.42);
}

body.app-layout:not(.top-nav-preview) .nav-group.open {
    max-height: 390px;
    transform: translateY(0) scale(1);
    margin: 7px 0 3px;
    padding: 6px;
}

body.app-layout:not(.top-nav-preview) .nav-sublink {
    padding: 8px 10px;
    color: #8f9db2;
    border-radius: 9px;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    margin: 0;
    border: 0;
}

body.app-layout:not(.top-nav-preview) .nav-sublink:hover {
    color: #f4f7ff;
    background: #0f0f0f;
    transform: translateX(2px);
    padding-left: 10px;
}

body.app-layout:not(.top-nav-preview) .nav-sublink.active {
    color: #8dffd8;
    background: rgba(39, 201, 151, 0.16);
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--sb-border);
    background: var(--sb-bg);
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    position: relative;
}

.sidebar-search {
    padding: 4px 8px 8px;
    position: relative;
    z-index: 155;
    margin-bottom: 4px;
}

.sidebar-search::after {
    content: '';
    display: block;
    height: 1px;
    margin-top: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.16) 52%, rgba(255, 255, 255, 0.03) 100%);
}

#sidebar-search-box {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    column-gap: 7px;
    width: 100%;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    background: linear-gradient(180deg, #101010 0%, #050505 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 22px rgba(0, 0, 0, 0.34);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#sidebar-search-box:hover {
    border-color: rgba(255, 255, 255, 0.28);
}

#sidebar-search-box:focus-within {
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 2px rgba(255, 255, 255, 0.1), 0 14px 28px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

#sidebar-search-box svg {
    width: 12px;
    height: 12px;
    color: #8f9aab;
    flex-shrink: 0;
}

#sidebar-global-search {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #edf3ff;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .015em;
    line-height: 1;
}

#sidebar-global-search::placeholder {
    color: #7a879b;
}

.search-shortcut {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1.2;
    color: #9ba9be;
    background: rgba(255, 255, 255, 0.03);
    font-family: inherit;
}

#sidebar-search-suggest {
    position: absolute;
    top: calc(100% + 8px);
    left: 8px;
    right: 8px;
    max-height: 340px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #0c0c0c 0%, #050505 100%);
    box-shadow: 0 22px 34px rgba(0, 0, 0, 0.5);
    padding: 6px;
}

.search-hit {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border-radius: 9px;
    padding: 7px 8px;
    text-decoration: none;
    color: #d1ddef;
    transition: background-color .14s ease, transform .14s ease;
}

.search-hit:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(1px);
}

.search-hit-icon {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 13px;
    line-height: 1.2;
}

.search-hit-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-hit-body strong {
    color: #f4f8ff;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-hit-body small {
    color: #95a7be;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-empty {
    color: #9aa8bb;
    font-size: 12px;
    padding: 8px;
}

.nav-pill-unread {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #f04438;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.messages-menu {
    position: relative;
    z-index: 151;
}

.messages-trigger {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(169, 180, 198, 0.28);
    background: #1a212d;
    color: #d7e2f2;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.messages-trigger:hover,
.messages-trigger[aria-expanded="true"] {
    border-color: var(--sb-accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(39, 201, 151, 0.22);
}

.messages-icon {
    width: 18px;
    height: 18px;
}

.messages-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #f04438;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 1px solid #10151f;
}

.messages-unread-badge.is-hidden {
    display: none;
}

.messages-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(320px, calc(100vw - 24px));
    border-radius: 12px;
    background: #050505;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 20px 38px rgba(0, 0, 0, 0.55);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px) scale(0.99);
    transition: opacity 0.15s ease, transform 0.17s ease, visibility 0.17s ease;
}

.messages-popover.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.messages-popover-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.messages-popover-head strong {
    font-size: 12px;
    color: #eef5ff;
}

.messages-popover-head a {
    font-size: 11px;
    color: #8dffd8;
    text-decoration: none;
}

.messages-popover-list {
    max-height: 320px;
    overflow: auto;
}

.messages-item {
    display: block;
    border-radius: 9px;
    padding: 8px;
    text-decoration: none;
    border: 1px solid transparent;
}

.messages-item:hover {
    background: #0f0f0f;
    border-color: rgba(255, 255, 255, 0.06);
}

.messages-item-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    align-items: center;
}

.messages-item-user {
    font-size: 11px;
    font-weight: 600;
    color: #eef5ff;
}

.messages-item-unread {
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #f04438;
    color: #fff;
    font-size: 10px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.messages-item-text {
    margin-top: 4px;
    font-size: 11px;
    color: #8fa0b8;
}

.messages-empty {
    font-size: 11px;
    color: #8fa0b8;
    padding: 8px;
}

/* Notificaciones */
.notif-item {
    cursor: default;
    border-left: 2px solid transparent;
    transition: border-color 0.15s;
}

.notif-item:hover {
    background: rgba(79,142,247,0.06);
    border-left-color: var(--accent, #4f8ef7);
}

.notif-item-read {
    opacity: 0.55;
}

.notif-icon {
    font-size: 14px;
    margin-right: 6px;
    flex-shrink: 0;
}

.notif-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent, #4f8ef7);
    display: inline-block;
    flex-shrink: 0;
    margin-left: auto;
}

.notif-time {
    margin-top: 3px;
    font-size: 10px;
    color: #6b7a96;
}

.notif-toast-host {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notif-toast {
    width: min(380px, calc(100vw - 24px));
    background: #1a2233;
    border: 1px solid rgba(79, 142, 247, 0.4);
    border-left: 4px solid var(--accent, #4f8ef7);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    padding: 12px 14px;
    color: #eef5ff;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: all;
    cursor: default;
}

.notif-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.notif-toast-tarea_comentario {
    border-left-color: #4f8ef7;
}
.notif-toast-tarea_vence_hoy {
    border-left-color: #f7a04f;
}
.notif-toast-tarea_vencida {
    border-left-color: #ef5252;
}

.notif-toast-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.notif-toast-icon {
    font-size: 16px;
    line-height: 1.3;
    flex-shrink: 0;
}

.notif-toast-body {
    font-size: 13px;
    line-height: 1.45;
    color: #d0e4ff;
    flex: 1;
    word-break: break-word;
}

.notif-toast-close {
    background: none;
    border: none;
    color: #7a8aaa;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 6px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.notif-toast-close:hover {
    color: #fff;
}

.profile-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 150;
}

.profile-trigger {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(169, 180, 198, 0.28);
    background: #1a212d;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-trigger:hover,
.profile-menu:focus-within .profile-trigger {
    border-color: var(--sb-accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(39, 201, 151, 0.22);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #263143 0%, #1b2230 100%);
    color: #d8e6fa;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-menu .nav-group.profile-nav-group {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    min-width: 236px;
    max-width: min(236px, calc(100vw - 24px));
    background: #050505;
    border: none;
    border-radius: 14px;
    padding: 10px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 20px 38px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px) scale(0.99);
    transition: opacity 0.15s ease, transform 0.17s ease, visibility 0.17s ease;
    z-index: 140;
}

.profile-menu:hover .nav-group.profile-nav-group,
.profile-menu:focus-within .nav-group.profile-nav-group {
    max-height: 520px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    margin: 0;
}

.profile-meta-item {
    list-style: none;
}

.profile-meta {
    border-bottom: none;
    margin-bottom: 6px;
    padding: 4px 6px 6px;
}

.profile-name {
    color: #eef5ff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.profile-user {
    color: #8fa0b8;
    font-size: 11px;
    line-height: 1.2;
    margin-top: 2px;
}

.profile-photo-form {
    margin: 0;
}

.profile-photo-input {
    display: none;
}

.profile-photo-label {
    margin: 0;
}

.profile-flash {
    margin-top: 7px;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 10px;
    line-height: 1.3;
}

.profile-flash.ok {
    background: rgba(39, 201, 151, 0.15);
    color: #9bf7dc;
}

.profile-flash.error {
    background: rgba(248, 113, 113, 0.18);
    color: #ffb0b0;
}

/* Sidebar sin animación de aparición global para evitar sensación de parpadeo */

.sidebar-nav li:nth-child(1) .nav-link { animation-delay: 0.08s; }
.sidebar-nav li:nth-child(2) .nav-link { animation-delay: 0.12s; }
.sidebar-nav li:nth-child(3) .nav-link { animation-delay: 0.16s; }
.sidebar-nav li:nth-child(4) .nav-link { animation-delay: 0.20s; }
.sidebar-nav li:nth-child(5) .nav-link { animation-delay: 0.24s; }
.sidebar-nav li:nth-child(6) .nav-link { animation-delay: 0.28s; }
.sidebar-nav li:nth-child(7) .nav-link { animation-delay: 0.32s; }
.sidebar-nav li:nth-child(8) .nav-link { animation-delay: 0.36s; }
.sidebar-nav li:nth-child(9) .nav-link { animation-delay: 0.40s; }
.sidebar-nav li:nth-child(10) .nav-link { animation-delay: 0.44s; }
.sidebar-nav li:nth-child(6) .nav-link { animation-delay: 0.3s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

body.app-layout .profile-nav-group .nav-sublink.logout-link {
    color: #ff6f6f;
}

body.app-layout .profile-nav-group .nav-sublink.logout-link:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #ffd1d1;
}

.menu-toggle {
    display: none;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.sidebar-overlay-active {
    display: block;
}

.settings-link {
    margin-top: auto;
    border-top: 1px solid #34495e;
    border-bottom: none !important;
}

.sidebar-hidden {
    transform: translateX(-100%);
}

.menu-toggle {
    display: none;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay-active {
    display: block;
}

.sidebar-top { display: flex; flex-direction: column; }

.sidebar-logo {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid #34495e;
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
}

.sidebar a {
    display: block;
    padding: 11px 14px;
    color: #ecf0f1;
    text-decoration: none;
    border-bottom: 1px solid #34495e;
    transition: background 0.2s, padding-left 0.2s;
    font-size: 14px;
    font-weight: 400;
}

/* Evita que estilos legacy de .sidebar a rompan la maquetacion moderna */
.sidebar a.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
}

.sidebar a:hover {
    background-color: #34495e;
    padding-left: 14px;
}

.sidebar-submenu {
    padding: 8px 0;
    background: #233342;
    display: none;
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    color: #ecf0f1;
    cursor: pointer;
    border-bottom: 1px solid #34495e;
    font-size: 14px;
    transition: background 0.2s;
    font-weight: 400;
}

.sidebar-toggle:hover {
    background-color: #34495e;
}

.toggle-arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.toggle-arrow.rotated {
    transform: rotate(180deg);
}

.sidebar-submenu .submenu-item {
    display: block;
    padding: 10px 14px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 13px;
    border: none;
    transition: all 0.2s;
    font-weight: 400;
}

.sidebar-submenu .submenu-item:hover {
    background: #34495e;
    color: white;
    padding-left: 14px;
}

.settings-link {
    display: block;
    padding: 15px 20px;
    color: #bdc3c7;
    text-decoration: none;
    border-top: 1px solid #34495e;
}

.settings-link:hover {
    background: #34495e;
    color: white;
}

.mini-calendar {
    background: #34495e;
    border-radius: 6px;
    padding: 4px;
    margin: 6px 4px;
    box-sizing: border-box;
    overflow: hidden;
}

.mini-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    opacity: 0.8;
}

/* RESPONSIVE DESHABILITADO POR AHORA - MEDIA QUERY COMENTADO ABAJO */
/*
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-content { margin-left: 0; padding: 15px; width: 100%; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .header { flex-wrap: wrap; gap: 10px; }
    .header h1 { font-size: 18px; }
    .calendar-layout { flex-direction: column; }
    .mini-calendar-panel { width: 100%; }
    .kpi-cards { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-analitica { grid-column: 1; }
    .kpi-card { padding: 24px; }
    .kpi-number { font-size: 42px; }
    .tabla-panel, table { display: block; overflow-x: auto; }
    .tabla-panel th, .tabla-panel td, table th, table td { white-space: nowrap; }
    .header-container { flex-direction: column; gap: 15px; align-items: flex-start; }
    .page-title { margin-top: 0; margin-bottom: 10px; }
    .search-bar { flex-direction: column; width: 100%; }
    .search-bar input { width: 100%; }
    .search-bar-clientes { flex-direction: row !important; }
    .search-bar-clientes input { width: auto !important; }
    table { font-size: 12px; }
    table th, table td { padding: 8px 4px; }
    .btn-sm { padding: 4px 8px; font-size: 11px; }
    .dashboard-grid, .kpi-cards { grid-template-columns: 1fr; }
}
*/

.main-content {
    margin-left: var(--sidebar-width);
    padding: 20px;
    padding-left: 20px;
    height: 100vh;
    overflow-y: auto;
    background: #0a0a0a;
    box-sizing: border-box;
    width: calc(100% - var(--sidebar-width));
    position: relative;
    z-index: 1;
    transition: margin-left 0.26s cubic-bezier(0.22, 1, 0.36, 1), width 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 769px) {
    body.app-layout.sidebar-collapsed .sidebar {
        width: var(--sidebar-width-collapsed);
        overflow: visible;
    }

    body.app-layout.sidebar-collapsed .main-content {
        margin-left: var(--sidebar-width-collapsed);
        width: calc(100% - var(--sidebar-width-collapsed));
    }

    body.app-layout.sidebar-collapsed .sidebar-header {
        padding: 12px 8px;
    }

    body.app-layout.sidebar-collapsed .sidebar-header-row {
        flex-direction: row;
        justify-content: center;
    }

    body.app-layout.sidebar-collapsed .sidebar-logo-img {
        max-width: 26px;
        max-height: 26px;
    }

    body.app-layout.sidebar-collapsed .sidebar-nav {
        padding: 10px 7px;
        overflow: visible;
    }

    body.app-layout.sidebar-collapsed .nav-link {
        justify-content: center;
        gap: 0;
        padding: 8px 0;
        min-height: 36px;
        border-left: none;
    }

    body.app-layout.sidebar-collapsed .sidebar a.nav-link {
        justify-content: center;
        gap: 0;
        padding: 8px 0;
        min-height: 36px;
    }

    body.app-layout.sidebar-collapsed .nav-group-toggle,
    body.app-layout.sidebar-collapsed .sidebar-footer .nav-link {
        justify-content: center;
    }

    body.app-layout.sidebar-collapsed .nav-link .nav-icon {
        margin: 0;
    }

    body.app-layout.sidebar-collapsed .nav-link > span,
    body.app-layout.sidebar-collapsed .nav-arrow {
        opacity: 0;
        width: 0;
        overflow: hidden;
        transform: translateX(-6px);
    }

    body.app-layout.sidebar-collapsed .sidebar-footer {
        padding: 8px 7px;
        justify-content: center;
    }

    body.app-layout.sidebar-collapsed .sidebar-search {
        display: none;
    }

    body.app-layout.sidebar-collapsed .profile-nav-group {
        left: auto;
        right: calc(100% + 8px);
        bottom: auto;
        top: -4px;
    }

    body.app-layout.sidebar-collapsed .nav-group {
        position: absolute;
        left: calc(100% + 8px);
        top: 0;
        min-width: 210px;
        max-height: none;
        background: #050505;
        border: none;
        box-shadow: 0 14px 26px rgba(8, 12, 18, 0.4);
        border-radius: 12px;
        padding: 6px;
        z-index: 120;
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(3px) scale(0.985);
        pointer-events: none;
        margin: 0;
        overflow: visible;
        transition: opacity .14s ease, transform .16s ease, visibility .16s ease;
    }

    body.app-layout.sidebar-collapsed .nav-item-group {
        position: relative;
        z-index: 121;
    }

    body.app-layout.sidebar-collapsed .nav-item-group:hover .nav-group,
    body.app-layout.sidebar-collapsed .nav-item-group:focus-within .nav-group,
    body.app-layout.sidebar-collapsed .nav-group.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    body.app-layout.sidebar-collapsed .nav-sublink {
        padding: 8px 10px;
        border-radius: 9px;
        white-space: nowrap;
        font-size: 11px;
    }

    body.app-layout.sidebar-collapsed .nav-item-group:hover .nav-group {
        max-height: none;
    }
}

@media (min-width: 769px) {
    body.app-layout.top-nav-preview .sidebar {
        width: 100%;
        height: 70px;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0 18px;
        overflow: visible;
        z-index: 300;
        background: #000000;
        border-bottom: 1px solid #111111;
        backdrop-filter: blur(14px) saturate(125%);
        -webkit-backdrop-filter: blur(14px) saturate(125%);
    }

    body.app-layout.top-nav-preview .sidebar-header {
        padding: 8px 12px 8px 4px;
        border-bottom: none;
        background: transparent;
        width: auto;
        min-width: 132px;
        flex-shrink: 0;
    }

    body.app-layout.top-nav-preview .sidebar-header-row {
        justify-content: flex-start;
    }

    body.app-layout.top-nav-preview .sidebar-logo-img {
        max-height: 36px;
        max-width: 118px;
    }

    body.app-layout.top-nav-preview .sidebar-collapse-btn {
        display: none;
    }

    body.app-layout.top-nav-preview .sidebar-nav {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0;
        margin: 0 12px 0 auto;
        overflow: visible;
    }

    body.app-layout.top-nav-preview .sidebar-nav > li {
        margin: 0;
        position: relative;
    }

    body.app-layout.top-nav-preview .sidebar-search {
        padding: 0 12px 0 0;
        margin: 0;
    }

    body.app-layout.top-nav-preview .sidebar-search::after {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 34px;
        margin-top: 0;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.2) 52%, rgba(255, 255, 255, 0.03) 100%);
    }

    body.app-layout.top-nav-preview .nav-link {
        min-height: 36px;
        white-space: nowrap;
        border-left: none;
        border-radius: 9px;
        padding: 8px 13px;
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 0.01em;
        color: #c8d4e6;
        transform: translateY(0);
        transition: background-color .16s ease, color .16s ease, transform .16s ease;
        gap: 0;
        justify-content: center;
    }

    body.app-layout.top-nav-preview .nav-icon {
        display: none;
    }

    body.app-layout.top-nav-preview .nav-link:hover {
        background: rgba(255, 255, 255, 0.06);
        color: #f5f9ff;
        transform: translateY(-1px);
    }

    body.app-layout.top-nav-preview .nav-link.active {
        border-left: none;
        padding-left: 12px;
        background: rgba(39, 201, 151, 0.14);
        color: #7df5cc;
        font-weight: 600;
    }

    body.app-layout.top-nav-preview .nav-item-group {
        position: relative;
    }

    body.app-layout.top-nav-preview .nav-item-group::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 10px;
    }

    body.app-layout.top-nav-preview .nav-item-group .nav-arrow {
        width: 13px;
        height: 13px;
        opacity: 0.75;
        margin-left: 6px;
        transition: transform .18s ease, opacity .18s ease;
    }

    body.app-layout.top-nav-preview .nav-item-group:hover .nav-arrow,
    body.app-layout.top-nav-preview .nav-item-group:focus-within .nav-arrow,
    body.app-layout.top-nav-preview .nav-item-group .nav-arrow.rotated {
        transform: rotate(180deg);
        opacity: 1;
    }

    body.app-layout.top-nav-preview .nav-group {
        position: absolute;
        top: calc(100% + 2px);
        left: 0;
        min-width: 236px;
        max-height: none;
        overflow: visible;
        margin: 0;
        padding: 6px;
        border-radius: 12px;
        border: none;
        background: #050505;
        box-shadow: 0 18px 36px rgba(6, 10, 16, 0.48);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px) scale(0.985);
        transition: opacity .15s ease, transform .18s ease, visibility .18s ease;
    }

    body.app-layout.top-nav-preview .nav-item-group .nav-group,
    body.app-layout.top-nav-preview .nav-item-group .nav-group.open {
        max-height: none !important;
    }

    body.app-layout.top-nav-preview .nav-item-group:hover .nav-group,
    body.app-layout.top-nav-preview .nav-item-group:focus-within .nav-group,
    body.app-layout.top-nav-preview .nav-group.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    body.app-layout.top-nav-preview .nav-sublink {
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.01em;
        color: #b5c3d8;
    }

    body.app-layout.top-nav-preview .nav-item-group[data-group-key="tareas"] .nav-group {
        left: auto;
        right: 0;
    }

    body.app-layout.top-nav-preview .nav-sublink:hover {
        background: rgba(255, 255, 255, 0.07);
        color: #f2f7ff;
        transform: translateX(0);
        padding-left: 10px;
    }

    body.app-layout.top-nav-preview .nav-sublink.active {
        background: rgba(39, 201, 151, 0.15);
        color: #8dffd8;
    }

    body.app-layout.top-nav-preview .nav-group-toggle.active,
    body.app-layout.top-nav-preview .nav-link.active {
        background: rgba(39, 201, 151, 0.14);
        color: #7df5cc;
        font-weight: 600;
        box-shadow: inset 0 -2px 0 #27c997;
    }

    body.app-layout.top-nav-preview .sidebar-footer {
        padding: 0;
        border-top: none;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex-shrink: 0;
        padding-left: 18px;
        border-left: none;
        position: relative;
    }

    body.app-layout.top-nav-preview .sidebar-footer::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 34px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.2) 52%, rgba(255, 255, 255, 0.03) 100%);
    }

    body.app-layout.top-nav-preview .profile-trigger,
    body.app-layout.top-nav-preview .messages-trigger {
        width: 36px;
        height: 36px;
    }

    body.app-layout.top-nav-preview .profile-nav-group,
    body.app-layout.top-nav-preview .messages-popover {
        left: auto;
        bottom: auto;
        top: calc(100% + 8px);
        right: 0;
    }

    body.app-layout.top-nav-preview .main-content {
        margin-left: 0;
        width: 100%;
        margin-top: 70px;
        height: calc(100vh - 70px);
    }

    body.app-layout.top-nav-preview .main-content > .header {
        margin-top: 4px;
    }

    body.app-layout.top-nav-preview.sidebar-collapsed .sidebar {
        width: 100%;
    }

    body.app-layout.top-nav-preview.sidebar-collapsed .main-content {
        margin-left: 0;
        width: 100%;
    }

    body.app-layout.top-nav-preview .menu-toggle {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1240px) {
    body.app-layout.top-nav-preview .sidebar {
        padding: 0 12px;
    }

    body.app-layout.top-nav-preview .sidebar-header {
        min-width: 116px;
    }

    body.app-layout.top-nav-preview .sidebar-logo-img {
        max-width: 104px;
    }

    body.app-layout.top-nav-preview .sidebar-nav {
        margin: 0 8px 0 auto;
        gap: 4px;
    }

    body.app-layout.top-nav-preview .nav-link {
        font-size: 12px;
        padding: 7px 9px;
    }

    body.app-layout.top-nav-preview .sidebar-footer {
        gap: 0;
        padding-left: 10px;
    }

    body.app-layout.top-nav-preview .sidebar-footer::before {
        height: 30px;
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    padding-left: 4px;
    padding-right: 4px;
    margin-bottom: 25px;
    margin-top: 10px;
}

.header h1, .header h2 { margin: 0; color: #e2e8f0; }

/* Cabecera de sección (título + botón de acción) */
.header-seccion {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vista-selector {
    display: flex;
    gap: 5px;
    background: #161616;
    border-radius: 6px;
    padding: 3px;
    margin-bottom: 12px;
}

.btn-vista {
    padding: 8px 16px;
    text-decoration: none;
    color: #94a3b8;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-vista:hover {
    background: #1e1e1e;
}

.btn-vista.active {
    background: #3b82f6;
    color: white;
    font-weight: 500;
}

.btn-vista-mini {
    padding: 6px 12px;
    text-decoration: none;
    color: #94a3b8;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #1e1e1e;
}

.btn-vista-mini:hover {
    background: #1e1e1e;
}

.btn-vista-mini.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.calendar-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: flex-start;
}

.mini-calendar-panel {
    flex-shrink: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
}

.mini-calendar-panel .mini-calendar-inline {
    background: transparent;
    border-radius: 12px;
    padding: 0;
}

.mini-calendar-panel .mini-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 12px;
    font-weight: 600;
}

.mini-calendar-panel .mini-cal-header a {
    color: #2563eb;
    text-decoration: none;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.mini-calendar-panel .mini-cal-header a:hover {
    background: rgba(37, 99, 235, 0.08);
}

.mini-calendar-panel .mini-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 9px;
    color: #6b7280;
    margin-bottom: 4px;
    text-align: center;
    gap: 2px;
}

.mini-calendar-panel .mini-cal-days span {
    font-weight: 700;
    text-transform: uppercase;
}

.mini-calendar-panel .mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.mini-calendar-panel .mini-cal-grid span,
.mini-calendar-panel .mini-cal-grid a {
    width: 100%;
    aspect-ratio: 1 / 1;
    font-size: 11px;
    color: #374151 !important;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mini-calendar-panel .mini-cal-grid span:empty {
    visibility: hidden;
}

.mini-calendar-panel .mini-cal-grid a:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.mini-calendar-panel .mini-cal-grid a.today {
    background: #2563eb;
    color: white !important;
}

.mini-calendar-panel .mini-cal-grid a.semana-actual {
    background: #60a5fa;
    color: white !important;
    font-weight: 700;
}

.mini-calendar-panel .mini-cal-grid a.hoy {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.4);
}

.mini-calendar-filter {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.mini-calendar-filter-label {
    font-size: 12px;
    color: #374151;
    font-weight: 600;
    margin-bottom: 2px;
}

.mini-calendar-filter-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-size: 12px;
}

.mini-calendar-panel .mini-cal-grid a {
    width: 24px;
    height: 24px;
    font-size: 11px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    line-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
}

.calendar-grande {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 0;
}

.header-actions { display: flex; gap: 10px;}

/* ==========================================================================
   4. CARDS
   ========================================================================== */
.card, .card-edit, .card-config, .card-form {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.card-form { max-width: 500px; }
.card-config { max-width: 600px; }

/* ==========================================================================
   5. TABLAS
   ========================================================================== */
table, .table, .table-presupuestos, .tabla-panel {
    width: 100%;
    border-collapse: collapse;
    background: #111111;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

th, td,
.table th, .table td,
.table-presupuestos th, .table-presupuestos td,
.tabla-panel th, .tabla-panel td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #1e1e1e;
}

th, .table th, .table-presupuestos th, .tabla-panel th {
    background-color: #0d0d0d;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

tr:hover { background-color: #1a1a1a; }

/* Última columna (acciones) siempre a la derecha */
th:last-child, td:last-child,
.table th:last-child, .table td:last-child,
.table-presupuestos th:last-child, .table-presupuestos td:last-child,
.tabla-panel th:last-child, .tabla-panel td:last-child,
.col-acciones {
    text-align: right !important;
    white-space: nowrap;
    padding-right: 20px;
}

.texto-usuario {
    color: #999;
    font-size: 12px;
}

/* ==========================================================================
   6. BOTONES
   ========================================================================== */
.btn, .btn-principal, .btn-primary, .btn-save, .btn-accion, .btn-search {
    padding: 8px 15px;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    background-color: var(--color-success);
}

.btn:hover, .btn-principal:hover, .btn-primary:hover, .btn-save:hover, .btn-accion:hover, .btn-search:hover {
    background-color: #218838;
    opacity: 0.9;
}

.btn-sm, .btn-info-sm, .btn-danger-sm {
    padding: 5px 10px;
    font-size: 12px;
    margin-left: 4px;
}

/* Azul info */
.btn-info, .btn-info-sm, .btn-accion.info { background-color: #17a2b8; }
.btn-info:hover, .btn-info-sm:hover, .btn-accion.info:hover { background-color: #138496; }

/* Naranja / advertencia */
.btn-warning       { background-color: var(--color-warning); }
.btn-warning:hover { background-color: #e67e22; }

/* Rojo / peligro */
.btn-danger, .btn-danger-sm, .btn-cancel, .logout-btn, .btn-accion.peligro {
    background-color: var(--color-danger);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.btn-danger:hover, .btn-danger-sm:hover, .btn-cancel:hover,
.logout-btn:hover, .btn-accion.peligro:hover {
    background-color: #c0392b;
}

/* Grupo de botones alineados a la derecha */
.grupo-botones, .acciones-flex, .acciones-wrapper {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    align-items: center;
}

/* ==========================================================================
   7. FORMULARIOS
   ========================================================================== */
.form-group { margin-bottom: 18px; }

.form-group label, label {
    display: block;
    color: #94a3b8;
    font-weight: 600;
    font-size: 13px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea,
.form-control,
.input-edit {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    color: #e2e8f0;
    background-color: #0d0d0d;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
    outline: none;
    border-color: #27c997;
    background-color: #0a0a0a;
    box-shadow: 0 0 0 3px rgba(39, 201, 151, 0.12);
}

.textarea-config { resize: vertical; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.full-width { grid-column: span 2; }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.form-actions .btn,
.form-actions .btn-save,
.form-actions .btn-cancel {
    flex: 1;
    text-align: center;
    padding: 12px;
}

/* Barra de búsqueda / asignación */
.header-container, .d-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 10px;
    gap: 10px;
}

.page-title {
    margin: 0;
}

.page-title h2 {
    margin: 0;
    color: #e2e8f0;
}

.search-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.search-bar select  { min-width: 220px; }
.search-bar input[type="number"] { min-width: 100px; }
.search-bar input[type="date"]   { min-width: 150px; }
.search-bar input[type="text"]   { min-width: 200px; }

.search-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   8. ALERTAS Y MENSAJES
   ========================================================================== */
.alert-success {
    background: rgba(39, 201, 151, 0.12);
    color: #9bf7dc;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(39, 201, 151, 0.25);
}

.alert-error {
    color: #fca5a5;
    background-color: rgba(239, 68, 68, 0.12);
    padding: 12px;
    border-radius: 5px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    margin-bottom: 18px;
    font-size: 14px;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
}

/* ==========================================================================
   9. BADGES
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #1a1a1a;
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.06);
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.12);
    color: #1e7e34;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.badge-danger {
    background-color: rgba(220, 53, 69, 0.12);
    color: #bd2130;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ==========================================================================
   10. TABS (PESTAÑAS)
   ========================================================================== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #1e1e1e;
    margin-bottom: 0;
}

.tab-btn {
    padding: 12px 20px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    background: #111111;
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
}

.tab-btn:hover { background: #1a1a1a; color: #e2e8f0; }

.tab-btn.active {
    background: #0a0a0a;
    color: #27c997;
    border: 1px solid #1e1e1e;
    border-bottom: 2px solid #0a0a0a;
    margin-bottom: -2px;
}

.tab-content { display: none; padding: 25px 0; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   11. MÓDULO LOGIN
   ========================================================================== */
.login-box {
    background: #111111;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    width: 100%;
    max-width: 420px;
}

.login-box h2 { text-align: center; margin-top: 0; color: #e2e8f0; }

.logo-login { text-align: center; margin-bottom: 20px; }
.logo-login img { max-width: 150px; height: auto; }

/* Login Product Preview */
.login-page {
    position: relative;
    overflow: hidden;
    background: #080808;
    padding: 24px;
}

.login-shell {
    width: min(1080px, 100%);
    min-height: min(86vh, 730px);
    background: rgba(12, 12, 12, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    position: relative;
    z-index: 1;
}

.login-hero {
    padding: 52px 42px;
    color: #e2e8f0;
    background: linear-gradient(170deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 20, 30, 0.98) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
}

.login-hero-top {
    max-width: 530px;
}

.login-brand {
    max-width: 178px;
    height: auto;
    margin-bottom: 26px;
    filter: drop-shadow(0 8px 18px rgba(59, 130, 246, 0.18));
}

.login-kicker {
    display: inline-block;
    margin: 0 0 14px 0;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-hero h1 {
    margin: 0;
    color: #f1f5f9;
    font-size: clamp(31px, 3.1vw, 42px);
    line-height: 1.05;
    max-width: 16ch;
    letter-spacing: -0.02em;
}

.login-hero p {
    margin: 15px 0 0;
    color: #94a3b8;
    line-height: 1.6;
    font-size: 14px;
    max-width: 42ch;
}

.login-preview-board {
    background: #111111;
    border: 1px solid #1e1e1e;
    border-radius: 18px;
    box-shadow: 0 22px 35px rgba(0, 0, 0, 0.6);
    padding: 14px;
    max-width: 520px;
}

.preview-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
}

.preview-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eff4fb;
    color: #48617f;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.preview-pill-brand {
    background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
    color: #ffffff;
}

.preview-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.preview-kpi {
    border: 1px solid #1e1e1e;
    background: #0d0d0d;
    border-radius: 12px;
    padding: 9px 10px;
}

.preview-kpi-label {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 0.02em;
}

.preview-kpi strong {
    font-size: 19px;
    line-height: 1;
    color: #e2e8f0;
}

.preview-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 10px;
}

.preview-panel {
    border: 1px solid #1e1e1e;
    background: #111111;
    border-radius: 12px;
    padding: 10px;
}

.preview-panel h3 {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.preview-bars {
    display: grid;
    gap: 8px;
}

.preview-bars span {
    height: 8px;
    width: var(--w);
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
}

.preview-donut-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-donut {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: conic-gradient(#22c55e 0 62%, #f59e0b 62% 84%, #e2e8f0 84% 100%);
    position: relative;
}

.preview-donut::after {
    content: "";
    position: absolute;
    inset: 11px;
    border-radius: inherit;
    background: #ffffff;
}

.preview-legend {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 5px;
    color: #475569;
    font-size: 11px;
}

.login-panel {
    padding: 42px 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.98) 0%, rgba(8, 8, 8, 0.99) 100%);
}

.login-card {
    width: 100%;
    max-width: 390px;
    background: #111111;
    border: 1px solid #1e1e1e;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    padding: 30px 24px;
}

.login-card h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.04;
    color: #f1f5f9;
    letter-spacing: -0.025em;
}

.login-card-subtitle {
    margin: 11px 0 22px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.55;
}

.login-card .form-group {
    margin-bottom: 13px;
}

.login-card .form-group label {
    margin-bottom: 7px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.login-card .form-group input {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    background: #0d0d0d;
    font-size: 14px;
}

.login-card .form-group input:focus {
    border-color: #27c997;
    box-shadow: 0 0 0 3px rgba(39, 201, 151, 0.15);
    background: #ffffff;
}

.login-card .btn-login {
    margin-top: 10px;
    width: 100%;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
}

.login-card .btn-login:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #0f766e 100%);
    opacity: 1;
}

.login-page .error {
    text-align: left;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 13px;
}

.login-panel-footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.login-help-link {
    text-decoration: none;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
}

.login-help-link:hover {
    color: #1d4ed8;
}

.login-trust-note {
    color: #6b7d93;
    font-size: 12px;
}

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

    .login-shell {
        grid-template-columns: 1fr;
        border-radius: 16px;
        min-height: auto;
    }

    .login-hero {
        padding: 30px 24px;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.22);
        gap: 18px;
    }

    .login-hero h1 {
        max-width: 100%;
        font-size: clamp(24px, 7vw, 32px);
    }

    .login-hero p {
        max-width: 100%;
    }

    .login-preview-board {
        max-width: 100%;
    }

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

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

    .preview-panel:last-child {
        display: none;
    }

    .login-panel {
        padding: 22px 16px 18px;
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 14px;
    }
}

/* ==========================================================================
   12. MÓDULO SERVICIOS
   ========================================================================== */
/* ==========================================================================
   13. MÓDULO PRESUPUESTOS
   ========================================================================== */
.bg-light-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.linea-item {
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.totales-box {
    float: right;
    width: 300px;
    margin-top: 20px;
    text-align: right;
    padding: 15px;
    background: #f1f3f5;
    border-radius: 8px;
}

.totales-final {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    border-top: 1px solid #ccc;
    margin-top: 10px;
    padding-top: 10px;
}

/* Colores de importes */
.text-success-bold { color: #28a745; font-weight: bold; }
.text-primary-bold { color: #007bff; font-weight: bold; }
.text-purple-bold  { color: #6f42c1; font-weight: bold; }

/* Info cliente en tabla presupuestos */
.info-cliente { display: flex; flex-direction: column; line-height: 1.4; }
.info-cliente .nombre { font-weight: 600; color: #2c3e50; }
.info-cliente .empresa { font-size: 12px; color: #777; }

/* Colores de celdas de monto */
td.monto.unico    { color: #28a745; font-weight: 600; }
td.monto.mensual  { color: #007bff; font-weight: 600; }
td.monto.anual    { color: #6f42c1; font-weight: 600; }

/* ==========================================================================
   14. MÓDULO CLIENTES (FICHA)
   ========================================================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.info-box {
    background: #fcfcfc;
    padding: 14px;
    border-radius: 6px;
    border: 1px solid #eee;
    font-size: 14px;
    color: #444;
}

.info-box strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6a737d;
    margin-bottom: 4px;
}

/* Formulario inline para accesos */
.form-acceso-inline {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

.form-acceso-inline > input[type="text"],
.form-acceso-inline > input[type="password"] {
    flex: 1;
    min-width: 0;
    width: auto !important;
    padding: 7px 10px !important;
    font-size: 13px;
    height: 34px;
    box-sizing: border-box;
}

.form-acceso-inline > .btn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 13px;
    height: 34px;
    white-space: nowrap;
}

/* ==========================================================================
   15. MODAL
   ========================================================================== */
.modal-container {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-container.active { display: flex; }

.modal-body {
    width: 500px;
    max-width: 90%;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* ==========================================================================
   16. VARIOS / UTILIDADES
   ========================================================================== */
.logout-btn {
    background-color: #e74c3c;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}
.logout-btn:hover { background-color: #c0392b; }

hr { border: 0; border-top: 1px solid #eee; margin: 25px 0; }

.vencimiento-alerta { color: #e74c3c; font-weight: bold; }
.vencimiento-normal  { color: #d35400; font-weight: bold; }

.status-active   { color: #28a745; font-weight: bold; }
.status-canceled { color: #e74c3c; font-weight: bold; }

.td-empty { text-align: center; color: #999; padding: 35px; font-style: italic; }

/* Barra del logo en configuración */
.logo-container {
    margin-bottom: 20px;
    text-align: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.img-preview {
    max-height: 80px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    padding: 5px;
    background: white;
}

.label-bold  { display: block; margin-bottom: 8px; font-weight: bold; color: #555; }
.label-hint  { display: block; margin-bottom: 5px; font-size: 13px; color: #777; }

/* ==========================================================================
   MÓDULO CLIENTES — EXTRAS
   ========================================================================== */

/* Campo contraseña con ojo pegado */
.pass-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pass-field input.input-invisible {
    width: 110px !important;
    padding: 5px 8px !important;
    font-size: 12px !important;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    color: #333;
}

.btn-eye {
    background: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
    height: 28px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.btn-eye:hover { background: #dee2e6; }

/* Editar cliente — cabecera con botón Volver */
.edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.edit-header h2 { margin: 0; color: #2c3e50; }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: #f8f9fa;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.btn-back:hover { background: #e9ecef; color: #333; }

/* Botones guardar/cancelar más compactos en editar */
.form-actions-edit {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.btn-edit-save {
    padding: 8px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-edit-save:hover { background: #218838; }

.btn-edit-cancel {
    padding: 8px 18px;
    background: #f8f9fa;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-edit-cancel:hover { background: #e9ecef; color: #333; }

/* ==========================================================================
   LOGIN — BOTÓN
   ========================================================================== */
.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #28a745, #20c55a);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 6px;
}
.btn-login:hover  { opacity: 0.92; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

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

.btn-login-secondary:hover {
    background: #e5e7eb;
}

.alert-success {
    padding: 12px 14px;
    border-radius: 8px;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
    margin-bottom: 16px;
    font-size: 14px;
}

.login-divider {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

.login-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #e5e7eb;
}

.login-divider span {
    position: relative;
    display: inline-block;
    padding: 0 10px;
    background: #fff;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.login-reset-form {
    margin-top: 0;
}

.login-helper {
    margin: 0 0 16px 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.login-alt-actions {
    margin-top: 16px;
    text-align: center;
}

.login-link-inline {
    color: #111827;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.login-link-inline:hover {
    text-decoration: underline;
}

/* ==========================================================================
   NUEVO PRESUPUESTO
   ========================================================================== */

/* Cabecera de página */
.presup-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
}
.presup-page-header h2 { margin: 0 0 4px 0; color: #2c3e50; }
.presup-subtitle { margin: 0; color: #7f8c8d; font-size: 13px; }

/* Bloque cliente + fecha */
.presup-meta { margin-bottom: 16px; }
.presup-meta-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: end;
}
.presup-meta-grid .form-group { margin-bottom: 0; }

.presup-cliente-row { display: flex; gap: 8px; align-items: center; }
.presup-cliente-row select { flex: 1; }

.btn-nuevo-cliente {
    white-space: nowrap;
    padding: 9px 14px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.btn-nuevo-cliente:hover { background: #138496; }

/* Cabecera del bloque de líneas */
.presup-lineas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.presup-lineas-header h3 { margin: 0; color: #2c3e50; font-size: 1rem; }

.btn-add-linea {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-add-linea:hover { background: #218838; }

/* Cabecera de columnas */
.lineas-col-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 6% 6% 6% 6% 3%;    
    gap: 6px;
    padding-left: 8px;
    padding-right: 2px;
    padding-top: 6px;
    padding-bottom: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.4px;
}

/* Fila de línea */
.linea-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 6% 6% 6% 6% 3%;
    width: 100%;
    gap: 6px;
    align-items: center;
    padding-left: 8px;
    padding-right: 2px;
    padding-top: 8px;
    padding-bottom: 8px;
    border: 1px solid #eef0f2;
    border-radius: 6px;
    margin-bottom: 6px;
    background: white;
    transition: box-shadow 0.15s;
}

.col-fracciones { text-align: center; }
.col-total-fraccion { text-align: right; font-size: 12px; }
.linea-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }


.linea-row input,
.linea-row select {
    width: 100%;
    padding: 7px 9px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}
.linea-row input:focus,
.linea-row select:focus { border-color: #007bff; outline: none; background: #fff; }

.input-final { color: #28a745 !important; font-weight: 700; }

/* Input descuento con % */
.dto-input-wrap { position: relative; }
.dto-input-wrap input { padding-right: 22px; }
.dto-pct {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    font-size: 12px; color: #999;
    pointer-events: none;
}

/* Botón eliminar línea */
.btn-del-linea {
    width: 30px; height: 30px;
    border: none;
    background: #fff0f0;
    color: #e74c3c;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding-right: 8px;
}
.btn-del-linea:hover { background: #e74c3c; color: white; }

/* Mensaje vacío */
.lineas-empty-msg {
    text-align: center;
    color: #aaa;
    padding: 30px;
    font-style: italic;
    font-size: 14px;
    border: 2px dashed #eee;
    border-radius: 6px;
    margin: 10px 0;
}

/* Totales card */
.presup-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 16px;
}
.presup-totales-inline {
    width: 320px;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid #eef0f2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.totales-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px 8px 0;
    font-size: 15px;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}
.totales-row:last-child { border-bottom: none; }
.totales-row span { padding-right: 20px; }
.totales-row strong { color: #333; font-weight: 600; }

.totales-total {
    font-size: 18px !important;
    font-weight: 700;
    padding-top: 14px !important;
    margin-top: 6px;
}
.totales-total span  { color: #2c3e50; font-weight: 700; padding-right: 20px; }
.totales-total strong { color: #28a745; font-size: 22px; }

/* Acciones */
.presup-acciones {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.btn-guardar-presup {
    padding: 11px 26px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn-guardar-presup:hover  { background: #218838; transform: translateY(-1px); }
.btn-guardar-presup:active { transform: translateY(0); }

/* =========================================
   ESTILOS NOTAS (Ficha Cliente)
   ========================================= */
.notas-lista { display: flex; flex-direction: column; gap: 15px; margin-top: 15px; }
.nota-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}
.nota-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nota-header strong { color: #2c3e50; font-size: 15px; }
.nota-fecha { color: #6c757d; font-size: 12px; }
.nota-contenido { color: #495057; font-size: 13px; margin: 0 0 10px 0; line-height: 1.5; }
.nota-foto { margin: 10px 0; }
.nota-foto img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: transform 0.2s;
}
.nota-foto img:hover { transform: scale(1.05); }
.nota-acciones { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e9ecef; display: flex; gap: 10px; align-items: center; }
.nota-usuario { color: #999; font-size: 12px; margin-left: auto; }
#modal-imagen { cursor: pointer; }
#modal-imagen img { object-fit: contain; }
.badge-success { background: #d4edda; color: #155724; padding: 3px 10px; border-radius: 10px; font-size: 12px; }

/* =========================================
   ANALITICAS DASHBOARD
   ========================================= */
.analiticas-card { padding: 20px; margin-bottom: 24px; }
.analiticas-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.analiticas-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.analiticas-filters-btns { display: flex; gap: 4px; }
.analiticas-btn {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    border: 1px solid #ddd;
    background: #f9fafb;
    color: #555;
    transition: all 0.2s;
}
.analiticas-btn:hover { background: #e5e7eb; }
.analiticas-btn.active { background: #3b82f6; color: white; border-color: #3b82f6; }
.analiticas-select { padding: 6px 10px; border-radius: 6px; border: 1px solid #ddd; font-size: 12px; background: white; }
.analiticas-chart { height: 250px; }

/* =========================================
   CALENDARIO DASHBOARD
   ========================================= */
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-nav { display: flex; gap: 8px; align-items: center; }
.calendar-nav-btn {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    transition: var(--transition);
}

.calendar-nav-btn:hover {
    background: var(--bg-white);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.calendar-month { font-weight: 600; font-size: 14px; color: #2c3e50; min-width: 130px; text-align: center; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 3px; }
.calendar-weekday { text-align: center; font-size: 11px; font-weight: 700; color: #9ca3af; padding: 4px 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-day {
    min-height: 48px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 4px;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}

.calendar-day:hover {
    background: var(--bg-white);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.calendar-day.today {
    background: var(--color-primary);
    border: 2px solid var(--color-primary-dark);
    color: white;
}
.calendar-day.today .calendar-day-num { color: white; font-weight: 700; }
.calendar-day.has-venc { background: #fff7ed; border: 1px solid #fed7aa; cursor: pointer; }
.calendar-day-num { font-size: 12px; color: #374151; text-align: right; }
.calendar-venc-badge { background: #f97316; color: white; border-radius: 10px; font-size: 9px; font-weight: 700; text-align: center; padding: 1px 3px; margin-top: 2px; }
.calendar-legend { margin-top: 14px; display: flex; gap: 14px; font-size: 11px; color: #6b7280; }
.calendar-legend-item { display: inline-flex; align-items: center; }
.calendar-legend-box { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }

/* =========================================
   LISTA VENCIMIENTOS
   ========================================= */
.venc-list { max-height: 380px; overflow-y: auto; }
.venc-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; margin-bottom: 8px; background: #f9fafb; border-radius: 8px; border-left: 3px solid; }
.venc-row.urgent { border-left-color: #e74c3c; }
.venc-row.soon { border-left-color: #f39c12; }
.venc-row.normal { border-left-color: #3498db; }
.venc-info { flex: 1; min-width: 0; }
.venc-client { font-weight: 600; color: #1f2937; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.venc-service { color: #6b7280; font-size: 11px; margin-top: 2px; }
.venc-badge { font-size: 9px; padding: 1px 6px; border-radius: 8px; margin-left: 4px; font-weight: 600; }
.venc-badge.mensual { background: #3b82f622; color: #3b82f6; border: 1px solid #3b82f644; }
.venc-badge.anual { background: #7c3aed22; color: #7c3aed; border: 1px solid #7c3aed44; }
.venc-badge.unico { background: #05966922; color: #059669; border: 1px solid #05966944; }
.venc-date { text-align: right; margin-left: 10px; }
.venc-days { font-weight: 700; font-size: 12px; }
.venc-days.today { color: #e74c3c; }
.venc-days.soon { color: #f39c12; }
.venc-days.normal { color: #3498db; }
.venc-date-detail { color: #9ca3af; font-size: 11px; }
.venc-btn { margin-left: 10px; background: #2c3e50; color: white; text-decoration: none; border-radius: 6px; padding: 5px 10px; font-size: 11px; white-space: nowrap; }
.venc-btn:hover { background: #1a252f; }

/* =========================================
   GRID LAYOUTS
   ========================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* =========================================
   DASHBOARD
   ========================================= */
.dashboard-container { padding: 0; }
.dashboard-title { margin-bottom: 25px; }
.dashboard-title h2 { color: #2c3e50; margin: 0; }
.dashboard-title p { color: #7f8c8d; margin: 5px 0 0 0; }

.kpi-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { padding: 18px; text-align: center; border-radius: 8px; background: white; }
.kpi-card.kpi-red { border-top: 4px solid #e74c3c; }
.kpi-card.kpi-orange { border-top: 4px solid #f39c12; }
.kpi-card.kpi-blue { border-top: 4px solid #3498db; }
.kpi-number { font-size: 36px; font-weight: 800; }
.kpi-red .kpi-number { color: #e74c3c; }
.kpi-orange .kpi-number { color: #f39c12; }
.kpi-blue .kpi-number { color: #3498db; }
.kpi-label { color: #7f8c8d; font-size: 13px; margin-top: 4px; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.dashboard-card { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.dashboard-card h3 { margin: 0 0 16px 0; color: #2c3e50; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.card-header h3 { margin: 0; }

.calendar-nav { display: flex; gap: 8px; align-items: center; }
.nav-btn { text-decoration: none; color: #555; font-size: 18px; padding: 2px 8px; border-radius: 4px; border: 1px solid #ddd; background: #f9f9f9; }
.nav-btn:hover { background: #e5e7eb; }
.month-label { font-weight: 600; font-size: 14px; color: #2c3e50; min-width: 130px; text-align: center; }

.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 3px; }
.weekday { text-align: center; font-size: 11px; font-weight: 700; color: #9ca3af; padding: 4px 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-cell { min-height: 48px; background: #f9fafb; border: 1px solid #f0f0f0; border-radius: 6px; padding: 4px; position: relative; }
.calendar-cell.today { background: #2c3e50; border: 2px solid #2c3e50; }
.calendar-cell.today .day-number { color: white; font-weight: 700; }
.calendar-cell.has-venc { background: #fff7ed; border: 1px solid #fed7aa; cursor: pointer; }
.day-number { font-size: 12px; color: #374151; text-align: right; display: block; }
.venc-badge { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); background: #f97316; color: white; border-radius: 10px; font-size: 9px; font-weight: 700; padding: 1px 5px; }

.calendar-legend { margin-top: 14px; display: flex; gap: 14px; font-size: 11px; color: #6b7280; }
.legend-box { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.legend-today { background: #2c3e50; }
.legend-venc { background: #fff7ed; border: 1px solid #fed7aa; }

.venc-list { max-height: 380px; overflow-y: auto; }
.venc-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; margin-bottom: 8px; background: #f9fafb; border-radius: 8px; border-left: 3px solid; }
.venc-item.today { border-left-color: #e74c3c; }
.venc-item.soon { border-left-color: #f39c12; }
.venc-item.normal { border-left-color: #3498db; }
.venc-info { flex: 1; min-width: 0; }
.venc-client { font-weight: 600; color: #1f2937; font-size: 13px; }
.venc-service { color: #6b7280; font-size: 11px; margin-top: 2px; }
.venc-type { font-size: 9px; padding: 1px 6px; border-radius: 8px; margin-left: 4px; font-weight: 600; }
.venc-type.mensual { background: #3b82f622; color: #3b82f6; }
.venc-type.anual { background: #7c3aed22; color: #7c3aed; }
.venc-type.unico { background: #05966922; color: #059669; }
.venc-dates { text-align: right; margin-left: 10px; }
.venc-days { font-weight: 700; font-size: 12px; }
.venc-days.today { color: #e74c3c; }
.venc-days.soon { color: #f39c12; }
.venc-days.normal { color: #3498db; }
.venc-date { color: #9ca3af; font-size: 11px; }
.venc-link { margin-left: 10px; background: #2c3e50; color: white; text-decoration: none; border-radius: 6px; padding: 5px 10px; font-size: 11px; }
.venc-link:hover { background: #1a252f; }
.no-venc { text-align: center; padding: 50px 20px; color: #9ca3af; font-size: 14px; }

.analiticas-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.analiticas-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-btns { display: flex; gap: 4px; }
.filter-selects { display: flex; gap: 6px; }
.filter-btn { padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 12px; border: 1px solid #ddd; background: #f9fafb; color: #555; }
.filter-btn:hover { background: #e5e7eb; }
.filter-btn.active { background: #3b82f6; color: white; border-color: #3b82f6; }
.filter-select { padding: 4px 8px; border-radius: 4px; border: 1px solid #ddd; font-size: 11px; background: white; }
#select-categoria { width: 180px; }
.chart-container { height: 250px; }

/* =========================================
   ORDENAR TABLAS
   ========================================= */
.sort-link { color: #555; text-decoration: none; font-weight: 600; }
.sort-link:hover { color: #2c3e50; }

/* =========================================
   SERVICIOS - CATEGORÍA
   ========================================= */
.categoria-tag { 
    display: inline-block; 
    font-size: 10px; 
    color: #888; 
    background: #f5f5f5; 
    padding: 2px 8px; 
    border-radius: 4px; 
    margin-bottom: 5px; 
    border: 1px solid #e0e0e0;
    width: auto;
    align-self: flex-start;
}

/* =========================================
   CALENDARIO MULTI-MES
   ========================================= */
.calendars-container { margin-top: 10px; }
.cal-month-header { font-weight: 600; color: #2c3e50; font-size: 14px; margin-bottom: 8px; text-align: center; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.badge-pending { background: #fff3cd; color: #856404; padding: 3px 10px; border-radius: 10px; font-size: 12px; }

/* =========================================
   GESTIÓN DE USUARIOS
   ========================================= */
.card-config h3 { margin-top: 0; color: #2c3e50; }
.card-config h4 { margin: 0 0 10px 0; color: #555; }

/* =========================================
   GESTIÓN DE USUARIOS
   ========================================= */
.card-usuarios { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #eef0f2; }
.card-usuarios h3 { margin: 0 0 15px 0; color: #2c3e50; }
.card-usuarios h4 { margin: 0 0 10px 0; color: #555; }
.card-usuarios .label-hint { display: block; font-size: 11px; color: #777; margin-bottom: 3px; }
.usuario-crear { background: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.usuario-crear input, .usuario-crear select { margin-bottom: 10px; }

.fila-cambiar-pass { background: #fff3cd; }
.cambiar-pass-box { padding: 15px; }
.cambiar-pass-box label { font-size: 13px; color: #856404; }
.cambiar-pass-box input[type="password"] { padding: 8px; border: 1px solid #ced4da; border-radius: 4px; }
.cambiar-pass-box .btn-save { background: #ffc107; color: #000; }
.cambiar-pass-box .btn-save:hover { background: #e0a800; }

.fila-icloud-config {
    background: #fafafa;
}

.btn-outline-minimal {
    background: #ffffff;
    color: #334155;
    border: 1px solid #dbe2ea;
}

.btn-outline-minimal:hover {
    background: #f8fafc;
}

.badge-icloud-ok {
    background: #dcfce7;
    color: #166534;
}

.badge-icloud-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-icloud-paused {
    background: #fff7ed;
    color: #9a3412;
    margin-left: 4px;
}

.badge-icloud-off {
    background: #f1f5f9;
    color: #475569;
}

.icloud-config-box {
    border: 1px solid #e9edf2;
    border-radius: 10px;
    background: #fff;
    padding: 14px;
}

.icloud-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #0f172a;
}

.icloud-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

.icloud-switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
    font-size: 13px;
    color: #334155;
}

.icloud-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.icloud-field .form-control {
    background: #fcfcfd;
}

.icloud-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.btn-save-minimal {
    background: #1f2937;
    color: #fff;
    border: 1px solid #111827;
}

.btn-save-minimal:hover {
    background: #0f172a;
}

.icloud-last-error {
    margin-top: 10px;
    font-size: 12px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 10px;
}

/* =========================================
   PÁGINA CONFIGURACIÓN
   ========================================= */
.ajustes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.ajustes-grid .card-config,
.ajustes-grid .card-usuarios {
    width: 100%;
}

.ajustes-grid h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.ajustes-grid .logo-container {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ajustes-grid .img-preview {
    max-height: 80px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    padding: 5px;
    background: white;
}

.ajustes-grid .form-group {
    margin-bottom: 15px;
}

.ajustes-grid .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 600;
    font-size: 13px;
}

.ajustes-grid .form-group .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.ajustes-grid .btn-save {
    width: 100%;
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

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

.ajustes-grid .btn-danger {
    padding: 5px 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
}

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

.ajustes-grid table th,
.ajustes-grid table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ajustes-grid table th {
    background: #f8f9fa;
    font-size: 12px;
    color: #555;
    font-weight: 600;
}

.ajustes-grid .badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    background: #e9ecef;
    color: #555;
}

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

/* ==========================================================================
   CALENDARIO DE TAREAS
   ========================================================================== */
.calendar-grande {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.calendar-grande-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.calendar-nav-grande {
    display: flex;
    align-items: center;
    gap: 15px;
}

.calendar-nav-grande a {
    color: #2196f3;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 14px;
}

.calendar-nav-grande a:hover {
    background: #e3f2fd;
}

.calendar-nav-grande .mes-actual {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    min-width: 200px;
    text-align: center;
}

/* Calendario Semanal */

.calendar-nav-grande a {
    text-decoration: none;
    color: #2c3e50;
    font-size: 20px;
    padding: 8px 15px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.2s;
}

.calendar-nav-grande a:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.calendar-nav-grande .mes-actual {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    min-width: 180px;
    text-align: center;
}

.dia-semana-grande {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.dia-semana-grande {
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    font-size: 14px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.dias-grid-grande {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.dia-grid-grande {
    min-height: 140px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    position: relative;
    transition: all 0.2s;
    overflow: hidden;
}

.dia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
}

.dia-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.dia-grid-grande:hover .dia-actions {
    opacity: 1;
}

.btn-add-tarea {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-tarea:hover {
    background: #219a52;
}

.btn-expand {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-expand:hover {
    background: #5a6268;
}

.tareas-expandidas {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.tareas-expandidas.show {
    display: block;
}

.tareas-total {
    background: #2196f3;
    color: white;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 12px;
}

.usuario-grupo {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}

.usuario-grupo-header {
    font-size: 12px;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.tarea-en-grupo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.tarea-en-grupo:last-child {
    border-bottom: none;
}

.tarea-grupo-info {
    flex: 1;
}

.tarea-titulo {
    font-weight: 500;
    font-size: 12px;
}

.tarea-desc {
    display: block;
    color: #666;
    font-size: 11px;
    margin-top: 3px;
}

.tarea-grupo-acciones {
    display: flex;
    gap: 4px;
}

.btn-tarea {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-complete {
    background: #27ae60;
    color: white;
}

.btn-complete:disabled {
    background: #95a5a6;
    cursor: default;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.tarea-completada .tarea-titulo {
    text-decoration: line-through;
    opacity: 0.6;
}

.tareas-expandidas.show {
    display: block;
}

.tarea-expandida {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    border-left: 4px solid #2196f3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tarea-expandida p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 11px;
}

.tarea-exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.tarea-exp-header strong {
    flex: 1;
    word-break: break-word;
}

.tarea-usuario {
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    font-weight: 500;
}

.usuario-tarea {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e9ecef;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 12px;
}

.usuario-tarea:hover {
    background: #dee2e6;
}

.usuario-nombre {
    font-weight: 500;
}

.usuario-contador {
    background: #2196f3;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.tareas-total {
    background: #2196f3;
    color: white;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: center;
}

.usuario-grupo {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}

.usuario-grupo-header {
    font-size: 12px;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.tarea-en-grupo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.tarea-en-grupo:last-child {
    border-bottom: none;
}

.tarea-grupo-info {
    flex: 1;
}

.tarea-titulo {
    font-weight: 500;
    font-size: 12px;
}

.tarea-desc {
    display: block;
    color: #666;
    font-size: 11px;
    margin-top: 3px;
}

.tarea-grupo-acciones {
    display: flex;
    gap: 4px;
}

.btn-tarea {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-complete {
    background: #27ae60;
    color: white;
}

.btn-complete:disabled {
    background: #95a5a6;
    cursor: default;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.tarea-completada .tarea-titulo {
    text-decoration: line-through;
    opacity: 0.6;
}

/* Calendario Semanal */
.semana-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.dia-semana {
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dia-semana-header {
    background: #2c3e50;
    color: white;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    text-align: center;
}

.dia-semana.hoy .dia-semana-header {
    background: #2196f3;
}

.dia-nombre {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline;
}

.dia-numero {
    font-size: 22px;
    font-weight: bold;
    color: inherit;
}

.dia-semana-tareas {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.dia-semana-acciones {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.dia-semana.hoy {
    background: transparent;
}

.dia-semana {
    border: none;
}

.dia-semana.hoy .dia-semana-header {
    background: #2196f3;
}

.dia-nombre {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0.9;
}

.dia-numero {
    font-size: 22px;
    font-weight: bold;
    color: inherit;
}

.dia-semana-tareas {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.usuario-tarea {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.usuario-tarea:hover {
    background: #e9ecef;
}

.usuario-nombre {
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usuario-contador {
    background: #2196f3;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

.sin-tareas {
    color: #999;
    font-size: 11px;
    text-align: center;
    padding: 10px;
    font-style: italic;
}

.btn-add-tarea {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    cursor: pointer;
    margin-top: auto;
}

.btn-add-tarea:hover {
    background: #219a52;
}

.btn-expand {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
}

.btn-expand:hover {
    background: #5a6268;
}

.color-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    vertical-align: middle;
}

/* Mini Calendar Sidebar */
.mini-calendar {
    background: #34495e;
    border-radius: 6px;
    padding: 4px;
    margin: 6px 4px;
}

.mini-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #ecf0f1;
}

.mini-cal-header a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 8px;
}

.mini-cal-days {
    display: flex;
    font-size: 7px;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.mini-cal-days span {
    width: 22px;
    text-align: center;
    margin: 0 1px;
}

.mini-cal-grid {
    display: flex;
    flex-wrap: wrap;
}

.mini-cal-grid span,
.mini-cal-grid a {
    width: 22px;
    height: 22px;
    font-size: 9px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 0;
    text-align: center;
    line-height: 22px;
    margin: 1px;
}

.mini-cal-grid span:empty {
    visibility: hidden;
}

.mini-cal-grid a:hover {
    background: #2c3e50;
}

.mini-cal-grid a.today {
    background: #3498db;
    font-weight: bold;
}

.mini-cal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid #4a6278;
    font-size: 8px;
}

.mini-cal-nav a {
    color: #bdc3c7;
    text-decoration: none;
}

.mini-cal-nav a:hover {
    color: white;
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.mini-calendar-header a {
    color: white;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    transition: background 0.2s;
}

.mini-calendar-header a:hover {
    background: rgba(255,255,255,0.2);
}

.mini-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 5px;
}

.mini-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.mini-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 12px;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    margin: auto;
}

.mini-day.empty {
    visibility: hidden;
}

.mini-day:hover {
    background: rgba(255,255,255,0.2);
}

.mini-day.today {
    background: #2196f3;
    font-weight: bold;
}

.mini-calendar-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mini-calendar-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 11px;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.mini-calendar-nav a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.dia-grid-grande:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dia-grid-grande.hoy {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.dia-grid-grande.otro-mes {
    background: #f0f0f0;
    opacity: 0.5;
}

.dia-numero {
    font-weight: 700;
    font-size: 16px;
    color: inherit;
    margin-bottom: 8px;
}

.dia-grid-grande.hoy .dia-numero {
    color: #2196f3;
}

.tareas-dia {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 90px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.tarea-item {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    border-left: 3px solid #2196f3;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    width: 100%;
    margin-bottom: 3px;
    box-sizing: border-box;
}

.btn-nueva-tarea {
    background: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-nueva-tarea:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Modal tareas */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.tareas-lista-dia {
    max-height: 300px;
    overflow-y: auto;
}

.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-body {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Tareas calendario semanal */
.dia-semana-tareas .usuario-grupo {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}

.dia-semana-tareas .usuario-grupo-header {
    font-size: 12px;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.dia-semana-tareas .tarea-en-grupo {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.dia-semana-tareas .tarea-en-grupo:last-child {
    border-bottom: none;
}

.dia-semana-tareas .tarea-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.dia-semana-tareas .tarea-titulo {
    font-weight: 500;
    font-size: 12px;
    flex: 1;
    min-width: 0;
}

.dia-semana-tareas .tarea-acciones {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    visibility: hidden;
}

.dia-semana-tareas .tarea-en-grupo:hover .tarea-acciones {
    opacity: 1;
    visibility: visible;
}

.dia-semana-tareas .btn-tarea {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.dia-semana-tareas .tarea-desc {
    color: #666;
    font-size: 11px;
    margin-top: 4px;
}

.dia-semana-tareas .tarea-completada {
    background: #d5f5e3;
    border-radius: 4px;
    padding: 6px 8px;
    margin: 4px 0;
}

.dia-semana-tareas .tarea-completada .tarea-titulo {
    text-decoration: line-through;
}

.dia-semana-tareas .tarea-eliminada {
    opacity: 0.5;
}

.dia-semana-tareas .tarea-eliminada .tarea-titulo {
    text-decoration: line-through;
    font-style: italic;
    color: #e74c3c;
}

.dia-semana-acciones {
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.btn-add-tarea {
    display: none;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.dia-semana-tareas:hover .btn-add-tarea {
    display: flex;
    opacity: 1;
}

.dia-header .btn-add-tarea {
    display: inline-flex;
    opacity: 1;
}

.dia-semana-tareas .tarea-completada {
    background: #d5f5e3;
    border-radius: 4px;
    padding: 6px 8px;
    margin: 4px 0;
}

.dia-semana-tareas .tarea-completada .tarea-titulo {
    text-decoration: line-through;
}

.dia-semana-tareas .tarea-eliminada .tarea-titulo {
    text-decoration: line-through;
    font-style: italic;
    color: #999;
}

.dia-semana-tareas .tarea-eliminada .tarea-titulo {
    text-decoration: line-through;
    font-style: italic;
    color: #999;
}

.dia-semana-tareas .tarea-titulo {
    font-weight: 500;
    font-size: 12px;
}

.dia-semana-tareas .tarea-desc {
    color: #666;
    font-size: 11px;
    margin-top: 4px;
}

.dia-semana-tareas .btn-tarea {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dia-semana-tareas .btn-complete {
    background: #27ae60;
    color: white;
}

.dia-semana-tareas .btn-complete:disabled {
    background: #95a5a6;
    cursor: default;
}

.dia-semana-tareas .btn-delete {
    background: #e74c3c;
    color: white;
}

.dia-semana-acciones {
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.btn-add-tarea {
    display: none;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.dia-semana-tareas:hover .btn-add-tarea {
    display: flex;
    opacity: 1;
}

/* Calendario estilo Notion */
.calendario-notion {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.notion-header-row {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.notion-time-column {
    width: 60px;
    flex-shrink: 0;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    border-right: 1px solid #e0e0e0;
}

.notion-day-header {
    flex: 1;
    min-width: 100px;
    padding: 10px;
    text-align: center;
    border-right: 1px solid #e0e0e0;
    position: relative;
}

.notion-day-header.hoy {
    background: #e3f2fd;
}

.notion-day-header .btn-add-tarea {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #27ae60;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.notion-day-header:hover .btn-add-tarea {
    display: flex;
    opacity: 1;
}

.notion-dia-nombre {
    display: block;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.notion-dia-num {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-top: 4px;
}

.notion-body-scroll {
    flex: 1;
    overflow-y: auto;
}

.notion-hour-row {
    display: flex;
    min-height: 50px;
    border-bottom: 1px solid #f0f0f0;
}

.notion-time-slot {
    width: 60px;
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 11px;
    color: #999;
    text-align: center;
    border-right: 1px solid #e0e0e0;
    background: #fafafa;
}

.notion-day-slot {
    flex: 1;
    border-right: 1px solid #f0f0f0;
    position: relative;
    height: 50px;
    min-width: 100px;
}

.notion-day-slot:hover {
    background: #f5f5f5;
}

.notion-tarea {
    background: #5dade2;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 11px;
    cursor: pointer;
    border-left: 3px solid #3498db;
}

.notion-tarea.tarea-completada {
    background: #d5f5e3;
    color: #2e7d32;
    border-left-color: #2e7d32;
    text-decoration: line-through;
    opacity: 0.7;
}

.notion-tarea.tarea-eliminada {
    background: #fadbd8;
    color: #c0392b;
    border-left-color: #c0392b;
    text-decoration: line-through;
    font-style: italic;
    opacity: 0.5;
}

.notion-tarea-hora {
    font-size: 10px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.notion-tarea-titulo {
    font-weight: 600;
    margin-bottom: 2px;
}

.notion-tarea-desc {
    font-size: 10px;
    opacity: 0.9;
    margin-bottom: 2px;
}

.notion-tarea-usuario {
    font-size: 9px;
    opacity: 0.8;
}

/* ===== VISTA DÍA ===== */
.calendario-dia {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
}

.dia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.dia-fecha {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.dia-nombre {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.dia-num {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
}

.dia-mes {
    font-size: 14px;
    color: #666;
}

.dia-horas {
    display: flex;
    flex-direction: column;
}

.dia-hora-row {
    display: flex;
    min-height: 50px;
    border-bottom: 1px solid #f0f0f0;
}

.dia-hora-slot {
    width: 80px;
    flex-shrink: 0;
    color: #999;
    font-size: 12px;
    padding: 5px 0;
}

.dia-tareas-slot {
    flex: 1;
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tarea-dia {
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 4px solid;
    transition: all 0.2s;
    cursor: pointer;
}

.tarea-dia-hora {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #495057;
}

.tarea-dia-titulo {
    font-weight: 500;
    font-size: 12px;
    margin-bottom: 4px;
}

.tarea-dia-desc {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

.tarea-dia:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.notion-tarea:hover {
    filter: brightness(0.95);
}

.tarea-dia.tarea-completada {
    background: #d4edda;
    border-left-color: #27ae60;
    color: #2f6f3f;
    opacity: 0.9;
    text-decoration: line-through;
}

.tarea-dia.tarea-eliminada {
    background: #fdecea;
    border-left-color: #c0392b;
    color: #922b21;
    opacity: 0.9;
    text-decoration: line-through;
    font-style: italic;
}

/* ===== VISTA MES ===== */
.calendario-mes {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
}

.mes-header {
    text-align: center;
    margin-bottom: 15px;
}

.mes-titulo {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.mes-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    max-width: 100%;
    overflow: hidden;
}

.mes-header-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.mes-dia-nombre {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    padding: 8px 0;
    text-transform: uppercase;
}

.mes-semana-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 5px;
    grid-column: 1 / -1;
}

.mes-semana-header span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    padding: 5px;
}

.mes-semana-header span:nth-child(6),
.mes-semana-header span:nth-child(7) {
    color: #999;
}

.mes-dia {
    min-height: 100px;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: background 0.2s;
    overflow: hidden;
    min-width: 0;
}

.mes-dia:hover {
    background: #e9ecef;
}

.mes-dia.vacio {
    background: transparent;
    cursor: default;
}

.mes-dia.laborable {
    background: #fff;
}

.mes-dia.hoy {
    background: #e3f2fd;
}

.mes-dia.otro-mes {
    background: #f0f0f0;
    opacity: 0.6;
}

.mes-dia.otro-mes .mes-dia-num {
    color: #999;
}

.mes-dia.hoy .mes-dia-num {
    background: #2196f3;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mes-dia-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2px;
}

.mes-dia-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.tareas-count {
    font-size: 9px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 1px 4px;
    border-radius: 3px;
}

.tiempo-count {
    font-size: 9px;
    font-weight: 700;
    color: #3b82f6;
}

.mes-dia-num {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

.mes-tareas {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    margin-top: 2px;
}

.mes-tarea-item {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mes-tarea-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mes-tarea-item:active {
    cursor: grabbing;
}

.mes-tarea-item.pendiente {
    background: #e5e7eb;
    color: #374151;
}

.mes-tarea-item.completada {
    background: #dcfce7;
    color: #166534;
}

.mes-tarea-item.cancelada {
    background: #fee2e2;
    color: #991b1b;
}

.mes-tarea-mas {
    font-size: 11px;
    color: #6b7280;
    padding: 2px 4px;
    cursor: pointer;
    text-align: center;
    background: #f3f4f6;
    border-radius: 4px;
    margin-top: 2px;
}

.mes-tarea-mas:hover {
    color: #2563eb;
    background: #e5e7eb;
}

.mes-tareas-expandidas {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #e5e7eb;
}

.mes-dia-tareas {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    width: 100%;
    align-items: stretch;
    max-height: calc(100% - 26px);
    overflow: hidden;
}

.mes-dia-titulo {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 11px;
    line-height: 1.3;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mes-dia-titulo.completada {
    background: #d4edda;
    color: #155724;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.mes-dia-titulo.cancelada {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    text-decoration: line-through;
}

.mes-tarea-punto {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    font-size: 9px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== VISTA HORAS ===== */
.calendario-horas {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
}

.horas-content {
    padding: 20px;
}

.mes-show-more {
    text-align: center;
    padding: 4px;
    background: #e9ecef;
    border-radius: 3px;
    font-size: 10px;
    color: #6c757d;
    cursor: pointer;
    margin-top: 4px;
}

.mes-show-more:hover {
    background: #dee2e6;
}

.mes-tareas-expandidas {
    display: none;
}

.mes-tareas-expandidas.show {
    display: block;
}

.mes-dia.expanded {
    min-height: 120px;
    aspect-ratio: unset;
}

/* ===== VISTA SEMANA LISTA ===== */
.calendario-semana-lista {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
}

.semana-header {
    text-align: center;
    margin-bottom: 15px;
}

.semana-titulo {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.semana-dias {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.semana-dia {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    min-height: 200px;
}

.semana-dia.hoy {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.semana-dia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.semana-dia-nombre {
    font-weight: 600;
    color: #495057;
}

.semana-dia-num {
    font-size: 18px;
    font-weight: 700;
    color: #495057;
}

.btn-add-tarea {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

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

.semana-tareas {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 100px;
}

.semana-tarea {
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    line-height: 1.4;
}

.semana-tarea.completada {
    background: #d4edda !important;
    color: #155724 !important;
}

.semana-tarea.cancelada {
    background: #f8d7da !important;
    color: #721c24 !important;
    text-decoration: line-through;
}

/* ===== HORAS TAREAS (estilo ClickUp) ===== */
.ht-container {
    max-width: 1400px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ht-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.ht-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ht-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 18px;
}

.ht-nav-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.ht-fecha-selector {
    position: relative;
    z-index: 1000;
}

.ht-fecha-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    transition: all 0.2s;
}

.ht-fecha-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ht-calendario-popup {
    display: none;
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 16px;
    z-index: 2000;
    min-width: 320px;
}

.vista-mes .ht-calendario-popup {
    left: 90%;
}

.vista-semana .ht-calendario-popup {
    left: 50%;
}

.ht-calendario-popup.show {
    display: block;
}

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

.ht-cal-title {
    font-weight: 600;
    color: #334155;
}

.ht-cal-nav {
    display: flex;
    gap: 4px;
}

.ht-cal-nav-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ht-cal-nav-btn:hover {
    background: #e2e8f0;
}

.ht-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ht-cal-day-header {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px;
    text-transform: uppercase;
}

.ht-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #475569;
    transition: all 0.15s;
    border: 1px solid transparent;
    background: #eff6ff;
}

.ht-cal-day:hover {
    background: #dbeafe;
}

.ht-cal-day.other-month {
    color: #cbd5e1;
    background: transparent;
}

.ht-cal-day.selected {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

.ht-cal-day.today {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

.ht-cal-day.week-selected {
    background: #eff6ff;
    color: #3b82f6;
    font-weight: 500;
}

.ht-cal-day.today.week-selected {
    background: #3b82f6;
    color: white;
}

.ht-total-card {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    text-align: center;
}

.ht-total-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.ht-total-value {
    font-size: 28px;
    font-weight: 700;
}

.ht-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.ht-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ht-filter-group label {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ht-filter-group select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    min-width: 140px;
}

.ht-filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ht-main-grid {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.ht-grid-body {
    display: flex;
    flex-direction: column;
}

.ht-tarea-wrapper {
    display: contents;
}

.ht-tarea-wrapper > .ht-tramos-panel {
    display: none;
    grid-column: 1 / -1;
}

.ht-tarea-wrapper > .ht-tramos-panel.show {
    display: block;
}

.ht-empty-row {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
}

.ht-grid-header {
    display: grid;
    grid-template-columns: 1fr repeat(7, 100px) 100px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.ht-gh-cell {
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #e2e8f0;
}

.ht-gh-cell:last-child {
    border-right: none;
}

.ht-gh-cell.tarea {
    color: #334155;
}

.ht-gh-cell.hoy {
    background: #eff6ff;
    color: #3b82f6;
}

.ht-gh-cell.total {
    background: #f1f5f9;
    color: #334155;
}

.ht-gh-cell.total-col {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ht-gh-cell.total-col svg {
    opacity: 0.6;
}

.ht-gh-cell.ht-total-header {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ht-gh-cell.ht-total-header svg {
    opacity: 1;
    stroke: white;
}

.ht-gh-cell.ht-total-header {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}



.ht-gh-cell.ht-gh-dia {
    text-align: center;
}

.ht-gh-num {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin-top: 2px;
}

.ht-gh-cell.hoy .ht-gh-num {
    color: #3b82f6;
}

.ht-tarea-row {
    display: grid;
    grid-template-columns: 1fr repeat(7, 100px) 100px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.ht-tarea-row:hover {
    background: #fafbfc;
}

.ht-tarea-wrapper:hover > .ht-tarea-row {
    background: #fafbfc;
}

.ht-tarea-cell {
    padding: 16px;
    border-right: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
}

.ht-tarea-cell:last-child {
    border-right: none;
}

.ht-tarea-info {
    flex: 1;
    min-width: 0;
}

.ht-tarea-titulo {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ht-tarea-cat {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ht-tarea-meta {
    font-size: 12px;
    color: #94a3b8;
}

.ht-tarea-vermas {
    font-size: 11px;
    color: #3b82f6;
    cursor: pointer;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ht-tarea-vermas:hover {
    color: #2563eb;
    text-decoration: underline;
}

.ht-dia-cell {
    padding: 16px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    border-right: 1px solid #f1f5f9;
}

.ht-dia-cell:last-child {
    border-right: none;
}

.ht-dia-cell.hoy {
    background: #fafcff;
}

.ht-tiempo {
    font-weight: 600;
    color: #1e293b;
}

.ht-tiempo.vacio {
    color: #cbd5e1;
}

.ht-total-cell,
.ht-tarea-cell.ht-total-row-cell {
    background: #eef2ff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #4f46e5;
    text-align: center;
}

.ht-total-final-col {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #4f46e5;
    text-align: center;
    background: #f9fafb;
}

.ht-total-final-col {
    background: #eef2ff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #4f46e5;
    border-left: 2px solid #c7d2fe;
}

.ht-total-final-col.hoy {
    background: #fde68a;
    color: #92400e;
}

.ht-total-final.hoy {
    background: #dbeafe;
    color: #2563eb;
}

.ht-totales-row {
    display: grid;
    grid-template-columns: 1fr repeat(7, 100px) 100px;
    background: #f1f5f9;
    border-top: 2px solid #c7d2fe;
}

.ht-total-label-cell {
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
}

.ht-total-dia {
    padding: 14px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    border-right: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ht-total-dia:last-child {
    border-right: none;
}

.ht-total-dia.hoy {
    background: #eff6ff;
    color: #3b82f6;
}

.ht-tramos-panel {
    display: none;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    grid-column: 1 / -1;
}

.ht-tramos-panel.show {
    display: block;
}

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

.ht-tramos-titulo {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.ht-tramos-close {
    width: 24px;
    height: 24px;
    border: none;
    background: #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ht-tramos-close:hover {
    background: #cbd5e1;
}

.ht-tramos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ht-tramo-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.ht-tramo-item.activo {
    background: #f0fdf4;
    border-color: #86efac;
}

.ht-tramo-fecha {
    font-size: 12px;
    color: #64748b;
    min-width: 80px;
}

.ht-tramo-hora {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    min-width: 120px;
}

.ht-tramo-dur {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    min-width: 60px;
}

.ht-tramo-estado {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ht-tramo-estado.activo {
    background: #dcfce7;
    color: #166534;
}

.ht-empty {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
    grid-column: 1 / -1;
}

.ht-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ht-empty-text {
    font-size: 14px;
    color: #64748b;
}

@media (max-width: 1024px) {
    .ht-grid-header,
    .ht-tarea-row,
    .ht-totales-row {
        grid-template-columns: 1fr repeat(7, 60px) 70px;
    }
    
    .ht-tarea-cell,
    .ht-dia-cell,
    .ht-tarea-cell.ht-total-row-cell {
        padding: 12px 4px;
        font-size: 11px;
    }
}

/* Vue Calendar */
.calendar-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fafafa;
    width: 100%;
    box-sizing: border-box;
}

.calendar-header {
    background: white;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.header-title {
    display: flex;
    align-items: center;
}

.header-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.btn-crear {
    background: #1f2937;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    margin-left: 20px;
}

.btn-crear:hover {
    background: #111827;
    transform: translateY(-1px);
}

.btn-crear span {
    font-size: 16px;
    font-weight: 700;
}

.header-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    padding: 0 4px;
}

.cal-nav-wrapper {
    display: flex;
    align-items: center;
    min-width: 200px;
}

.vista-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    margin-left: 0;
}

.filtros {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.nav-buttons {
    display: flex;
    gap: 8px;
}

.nav-btn, .nav-btn-hoy {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-btn:hover, .nav-btn-hoy:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.nav-btn-hoy {
    background: #1f2937;
    color: white;
    border-color: #1f2937;
}

.cal-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 13%;
}

.cal-date-picker {
    position: relative;
}

.cal-date-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.cal-month-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
}

.cal-month-nav-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.cal-date-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cal-date-btn svg {
    color: #6b7280;
}

.cal-popup {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 16px;
    z-index: 100;
    min-width: 280px;
}

.cal-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cal-popup-title {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
}

.cal-nav-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    transition: all 0.2s;
}

.cal-nav-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.cal-popup-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    padding: 6px 0;
}

.cal-day {
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: all 0.2s;
}

.cal-day:hover {
    background: #f3f4f6;
}

.cal-day.empty {
    cursor: default;
}

.cal-day.hoy {
    background: #dbeafe;
    color: #2563eb;
    font-weight: 600;
}

.cal-day.seleccionado {
    background: #2563eb;
    color: white;
}

.cal-day.week-selected {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
    border-radius: 8px;
}

.cal-day.week-selected.hoy {
    background: #2563eb;
    color: white;
    font-weight: 700;
}

.cal-day.semana-rango {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    font-weight: 600;
    border-radius: 8px;
}

.vista-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    text-decoration: none;
}

.tab-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-btn.active {
    background: #1f2937;
    color: white;
    box-shadow: 0 2px 4px rgba(31, 41, 55, 0.3);
}

.filtros {
    display: flex;
    gap: 12px;
}

.filtro-select {
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    min-width: 120px;
    cursor: pointer;
}

.calendar-content {
    flex: 1;
    overflow: auto;
    padding: 24px 0;
}

/* Vista Día */
.dia-view {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dia-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-bottom: 1px solid #e5e7eb;
}

.dia-sin-hora-wrap {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fffbeb;
}

.dia-sin-hora-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #92400e;
    margin-bottom: 10px;
}

.dia-sin-hora-lista {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.tarea-sin-hora-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tarea-sin-hora-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.tarea-sin-hora-item.cat-reunion { border-left: 4px solid #3b82f6; background: #eff6ff; }
.tarea-sin-hora-item.cat-cliente { border-left: 4px solid #f59e0b; background: #fff7ed; }
.tarea-sin-hora-item.cat-otro { border-left: 4px solid #9ca3af; background: #f9fafb; }
.tarea-sin-hora-item.completada { opacity: 0.6; background: #d1fae5 !important; }
.tarea-sin-hora-item.cancelada { opacity: 0.5; background: #fee2e2 !important; }

.dia-nombre {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dia-num {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.dia-num.hoy {
    background: #2563eb;
    color: white;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.dia-grid {
    display: flex;
    position: relative;
    min-height: 600px;
}

.hora-column {
    width: 60px;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
}

.hora-label {
    height: 50px;
    padding: 4px 8px;
    font-size: 12px;
    color: #9ca3af;
    text-align: right;
}

.tareas-column {
    flex: 1;
    position: relative;
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.grid-line {
    height: 50px;
    border-bottom: 1px solid #f3f4f6;
}

.tarea-bloque {
    position: absolute;
    left: 8px;
    right: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    z-index: 1;
}

.tarea-bloque:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

.tarea-bloque.cat-reunion { border-left: 4px solid #3b82f6; background: #eff6ff; }
.tarea-bloque.cat-cliente { border-left: 4px solid #f59e0b; background: #fffbeb; }
.tarea-bloque.cat-otro { border-left: 4px solid #9ca3af; background: #f9fafb; }

.tarea-bloque.completada { opacity: 0.6; background: #d1fae5 !important; }
.tarea-bloque.cancelada { opacity: 0.5; background: #fee2e2 !important; }

.tarea-horas {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.tarea-titulo {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tarea-usuario {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.tarea-cliente {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
    margin-top: 2px;
}

.tarea-tiempo {
    font-size: 11px;
    color: #2563eb;
    font-weight: 600;
    margin-top: 4px;
}

.timer-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Vista Semana */
.semana-view {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.semana-header {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.semana-dia-header {
    padding: 14px 8px;
    text-align: center;
    border-right: 1px solid #f3f4f6;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.semana-dia-header:last-child {
    border-right: none;
}

.semana-dia-header.hoy {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}

.semana-dia-header .dia-nombre {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.semana-dia-header .dia-num {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    display: inline-block;
    line-height: 1;
}

.semana-dia-header.hoy .dia-num {
    background: #2563eb;
    color: white;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.4);
}

.semana-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 400px;
    gap: 1px;
    background: #e5e7eb;
}

.semana-dia-columna {
    background: #fafafa;
    padding: 8px;
    min-height: 400px;
}

.semana-dia-header.fin-semana,
.semana-dia-columna.fin-semana {
    background: #f3f4f6;
}

.semana-tareas-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.semana-toolbar {
    display: flex;
    justify-content: center;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.weekend-toggle-btn {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.weekend-toggle-btn:hover {
    background: #eef2ff;
    border-color: #93c5fd;
}

.tarea-lista-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s;
    border-left: 3px solid #9ca3af;
    background: #ffffff;
}

.tarea-lista-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tarea-lista-item:active {
    cursor: grabbing;
}

.tarea-lista-item.cat-reunion { border-left-color: #3b82f6; }
.tarea-lista-item.cat-cliente { border-left-color: #f59e0b; }
.tarea-lista-item.cat-otro { border-left-color: #9ca3af; }

.tarea-lista-item.completada { background: #dcfce7; border-left-color: #22c55e; }
.tarea-lista-item.cancelada { background: #fee2e2; border-left-color: #ef4444; }

.tarea-lista-item .tarea-titulo-mini {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.semana-dia-columna:last-child {
    border-right: none;
}

.semana-tareas {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.tarea-mini {
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid #9ca3af;
    position: relative;
    z-index: 1;
}

.tarea-mini:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 2;
}

.tarea-mini.cat-reunion { border-left-color: #3b82f6; background: #eff6ff; }
.tarea-mini.cat-cliente { border-left-color: #f59e0b; background: #fffbeb; }
.tarea-mini.cat-otro { border-left-color: #9ca3af; background: #f9fafb; }

.tarea-mini.completada { opacity: 0.6; }
.tarea-mini.cancelada { opacity: 0.5; background: #fee2e2; }

.tarea-hora-mini {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
}

.tarea-titulo-mini {
    font-size: 12px;
    font-weight: 500;
    color: #1f2937;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tarea-cliente-mini {
    font-size: 10px;
    color: #f59e0b;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mes-tarea-cliente {
    display: block;
    font-size: 10px;
    color: #92400e;
    font-weight: 600;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.semana-timeline {
    position: relative;
    height: 450px;
}

.semana-grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

.semana-grid-line {
    flex: 1;
    border-bottom: 1px solid #f3f4f6;
}

.semana-timeline .tarea-mini {
    position: absolute;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sin-tareas {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    padding: 20px;
}

.timer-badge-mini {
    font-size: 12px;
    margin-left: 4px;
}

.timer-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 6px;
}

.timer-status-dot.activo {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    animation: pulse 1.5s infinite;
}

.timer-status-dot.parado {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
    box-sizing: border-box;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.input-titulo {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    transition: all 0.2s;
    border-radius: 0;
}

.input-titulo:focus {
    outline: none;
    border-bottom-color: #2563eb;
}

.input-titulo::placeholder {
    color: #9ca3af;
}

.usuarios-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.usuario-tag {
    padding: 6px 14px;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.usuario-tag:hover {
    background: #e5e7eb;
}

.usuario-tag.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.tarea-info {
    margin-top: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
    box-sizing: border-box;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.info-label {
    font-size: 12px;
    color: #6b7280;
    margin-right: 8px;
    flex-shrink: 0;
}

.info-value {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    word-break: break-word;
}

/* Comentarios en modal de tareas */
.comentarios-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.comentarios-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.comentarios-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.comentario-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.comentario-item strong {
    color: #2563eb;
}

.comentario-item small {
    display: block;
    margin-top: 4px;
    color: #9ca3af;
    font-size: 11px;
}

.no-comentarios {
    padding: 12px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 12px;
}

.no-comentarios p {
    margin: 0;
}

.solo-comentario-aviso {
    padding: 10px 14px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    margin-bottom: 16px;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.comentario-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comentario-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
}

.btn-comentar {
    align-self: flex-end;
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.btn-comentar:hover {
    background: #1d4ed8;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.info-label {
    font-size: 12px;
    color: #6b7280;
    margin-right: 8px;
    flex-shrink: 0;
}

.info-value {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    word-break: break-word;
}

.info-value.estado-pendiente {
    color: #d97706;
}

.info-value.estado-completada {
    color: #16a34a;
}

.info-value.estado-cancelada {
    color: #dc2626;
}

.info-value.tiempo {
    font-family: monospace;
    color: #2563eb;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.btn-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-iniciar {
    background: #dcfce7;
    color: #16a34a;
}

.btn-iniciar:hover {
    background: #bbf7d0;
}

.btn-parar {
    background: #fee2e2;
    color: #dc2626;
}

.btn-parar:hover {
    background: #fecaca;
}

.btn-reset {
    background: #fef3c7;
    color: #d97706;
}

.btn-reset:hover {
    background: #fde68a;
}

.timer-display {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.tramos-list {
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.tramos-title {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.tramo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    flex-wrap: wrap;
}

.tramo-item.activo {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.tramo-input {
    flex: 1;
    min-width: 180px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
}

.tramo-input:disabled {
    background: #e5e7eb;
    color: #9ca3af;
}

.tramo-fecha {
    color: #6b7280;
    min-width: 70px;
}

.tramo-hora {
    color: #374151;
    flex: 1;
}

.tramo-dur {
    font-weight: 600;
    color: #111827;
}

.tramo-estado {
    color: #3b82f6;
    font-size: 10px;
}

.modal-tarea-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
    box-sizing: border-box;
}

.footer-spacer {
    flex: 1;
}

.mensaje-modal {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 10px;
}

.mensaje-modal.mensaje-success {
    background: #dcfce7;
    color: #16a34a;
}

.mensaje-modal.mensaje-error {
    background: #fee2e2;
    color: #dc2626;
}

.btn-accion {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-guardar {
    background: #2563eb;
    color: white;
}

.btn-guardar:hover {
    background: #1d4ed8;
}

.btn-cancelar {
    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.btn-cancelar:hover {
    background: #f3f4f6;
}

.btn-aprobar {
    background: #dcfce7;
    color: #16a34a;
}

.btn-aprobar:hover {
    background: #bbf7d0;
}

.btn-cancelar-tarea {
    background: #fee2e2;
    color: #dc2626;
}

.btn-cancelar-tarea:hover {
    background: #fecaca;
}

.btn-descancelar {
    background: #fef3c7;
    color: #b45309;
}

.btn-descancelar:hover {
    background: #fde68a;
}

.btn-editar {
    background: #fef3c7;
    color: #b45309;
}

.btn-editar:hover {
    background: #fde68a;
}

.usuarios-tags.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.form-input:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.modal-tarea-body .tarea-cancelada-view {
    padding: 20px;
    background: #fef2f2;
    border-radius: 12px;
    border: 1px solid #fecaca;
}

.modal-tarea-body .cancelada-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #dc2626;
    font-weight: 600;
    font-size: 16px;
}

.modal-tarea-body .cancelada-header .icono-cancelada {
    font-size: 24px;
}

.modal-tarea-body .cancelada-info p {
    margin: 10px 0;
    color: #374151;
    font-size: 14px;
}

.modal-tarea-body .cancelada-info strong {
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
}

.modal-tarea-body .tarea-completada-view {
    padding: 20px;
    background: #f0fdf4;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

.modal-tarea-body .completada-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #166534;
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-tarea-body .completada-header .icono-completada {
    font-size: 24px;
    -webkit-text-fill-color: initial;
    color: #16a34a;
}

.modal-tarea-body .completada-info p {
    margin: 10px 0;
    color: #14532d;
    font-size: 14px;
}

.modal-tarea-body .completada-info strong {
    color: #166534;
    font-size: 12px;
    text-transform: uppercase;
}

.tramo-editar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

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

.tramo-field label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
}

.tramo-field .tramo-input {
    min-width: 160px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-editar .modal-form {
    padding: 20px;
}

.modal-editar .form-group {
    margin-bottom: 16px;
}

.modal-editar .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Botón de tarea recurrente mensual */
.recurrente-toggle-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
}
.btn-recurrente {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    color: #9ca3af;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-recurrente:hover {
    border-color: #9ca3af;
    color: #374151;
}
.btn-recurrente.active {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}
.btn-recurrente:disabled {
    opacity: 0.4;
    cursor: default;
}
.recurrente-msg {
    font-size: 11px;
    color: #9ca3af;
}

.usuarios-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-usuario {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.checkbox-usuario:hover {
    background: #e5e7eb;
}

.checkbox-usuario input {
    width: auto;
}

.checkbox-usuario input:checked + .checkbox-label {
    color: #2563eb;
    font-weight: 500;
}

.estado-display {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.estado-pendiente {
    background: #fef3c7;
    color: #d97706;
}

.estado-completada {
    background: #dcfce7;
    color: #16a34a;
}

.estado-cancelada {
    background: #fee2e2;
    color: #dc2626;
}

.modal-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
}

.footer-right {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn-footer {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-guardar {
    background: #2563eb;
    color: white;
}

.btn-guardar:hover {
    background: #1d4ed8;
}

.btn-cancelar {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-cancelar:hover {
    background: #f3f4f6;
}

.btn-eliminar {
    background: white;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-eliminar:hover {
    background: #fef2f2;
}

.btn-aprobar {
    background: #dcfce7;
    color: #16a34a;
}

.btn-aprobar:hover {
    background: #bbf7d0;
}

.btn-cancelar-tarea:hover {
    background: #fde68a;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.btn-cerrar {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.btn-cerrar:hover {
    color: #1f2937;
}

.modal-form {
    padding: 24px;
}

.modal-form .form-group {
    margin-bottom: 20px;
}

.modal-form .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.modal-form .form-group input,
.modal-form .form-group select,
.modal-form .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.modal-form .form-group input:focus,
.modal-form .form-group select:focus,
.modal-form .form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.multi-select {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.checkbox-item input {
    width: auto;
}

.timer-info {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
}

.timer-display {
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    font-family: monospace;
}

.modal-acciones {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    margin-top: 24px;
}

.acciones-derecha {
    display: flex;
    gap: 12px;
}

.modal-acciones .btn-eliminar {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modal-acciones .btn-cancelar {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.modal-acciones .btn-guardar {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modal-acciones .btn-guardar:hover {
    background: #1d4ed8;
}

.modal-acciones .btn-aprobar {
    background: #dcfce7;
    color: #16a34a;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modal-acciones .btn-aprobar:hover {
    background: #bbf7d0;
}

.modal-acciones .btn-cancelar-tarea {
    background: #fef3c7;
    color: #d97706;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modal-acciones .btn-cancelar-tarea:hover {
    background: #fde68a;
}

/* Timer Badge */
.timer-badge-component {
    display: inline-flex;
    align-items: center;
}

.timer-badge-component.compact {
    font-size: 12px;
}

.timer-activo, .timer-pausado, .timer-inactivo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-icon {
    font-size: 14px;
}

.timer-tiempo {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
}

.timer-btn {
    padding: 4px 8px;
    border: none;
    background: #f3f4f6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.timer-btn:hover {
    background: #e5e7eb;
}

.timer-btn.stop {
    background: #fee2e2;
    color: #dc2626;
}

/* =========================================
   VISTA MES - HORAS TAREAS
   ========================================= */
.ht-mes-grid {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.ht-mes-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.ht-mes-header-cell {
    padding: 12px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.ht-mes-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
}

.ht-mes-dia {
    min-height: 90px;
    padding: 6px;
    background: white;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.ht-mes-dia-top {
    display: flex;
    justify-content: flex-start;
}

.ht-mes-dia:hover {
    background: #f8fafc;
}

.ht-mes-dia.vacio {
    background: #fafafa;
    min-height: 90px;
}

.ht-mes-dia.hoy {
    background: #eff6ff;
}

.ht-mes-dia.hoy .ht-mes-dia-num {
    background: #3b82f6;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ht-mes-dia-num {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.ht-mes-dia-cats {
    display: flex;
    gap: 3px;
    margin-top: auto;
    padding-top: 4px;
}

.ht-mes-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.ht-mes-dia-total {
    font-size: 11px;
    font-weight: 700;
    color: #3b82f6;
    margin-top: 2px;
}

.ht-mes-dia-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}

.ht-mes-tareas-num {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.ht-mes-tiempo {
    font-size: 11px;
    font-weight: 700;
    color: #3b82f6;
}

/* Barra de categorías */
.ht-categorias-bar {
    margin-top: 24px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.ht-categorias-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ht-categorias-title::before {
    content: '📊';
    font-size: 18px;
}

.ht-categorias-bar-container {
    display: flex;
    height: 32px;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.ht-categoria-segment {
    height: 100%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ht-categoria-segment:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.5);
}

.ht-categorias-legend {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.ht-categoria-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 10px;
    transition: all 0.2s;
}

.ht-categoria-item:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.ht-categoria-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.ht-categoria-nombre {
    color: #64748b;
    font-weight: 600;
    text-transform: capitalize;
    font-size: 13px;
}

.ht-categoria-porc {
    color: #1e293b;
    font-weight: 800;
    font-size: 15px;
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 6px;
}

.ht-categoria-tiempo {
    color: #3b82f6;
    font-weight: 600;
    font-size: 13px;
}

.ht-mes-dia-debug {
    font-size: 8px;
    color: red;
    background: yellow;
    padding: 2px;
}

/* ==========================================================================
   ESTILOS MODERNOS PARA CALENDARIO DE TAREAS
   ========================================================================== */

/* Modal de tareas moderno */
.modal-tarea {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-tarea-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
    box-sizing: border-box;
}

.modal-tarea-header .header-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-tarea-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

.mensaje-header {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.mensaje-header.mensaje-success {
    background: #dcfce7;
    color: #16a34a;
}

.mensaje-header.mensaje-error {
    background: #fee2e2;
    color: #dc2626;
}

.modal-tarea-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    box-sizing: border-box;
    min-height: 100px;
}

.modal-tarea-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

.btn-cerrar {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    line-height: 1;
}

.btn-cerrar:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

/* Formularios modernos */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-white);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-titulo {
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid var(--border-light);
    border-radius: 0;
    padding: 8px 0;
}

.input-titulo:focus {
    border-bottom-color: var(--color-primary);
    box-shadow: none;
}

/* Grid de formularios */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

/* Tags de usuarios */
.usuarios-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-light);
}

.usuario-tag {
    padding: 6px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.usuario-tag:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.usuario-tag.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary-dark);
}

.usuarios-tags.disabled .usuario-tag {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Botones de acción */
.btn-accion {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-guardar {
    background: var(--color-success);
    color: white;
}

.btn-guardar:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-cancelar {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-cancelar:hover {
    background: var(--bg-white);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

/* Estados de tareas */
.estado-pendiente {
    color: var(--color-warning);
    font-weight: 600;
}

.estado-completada {
    color: var(--color-success);
    font-weight: 600;
}

.estado-cancelada {
    color: var(--color-danger);
    font-weight: 600;
}

/* Información de tareas */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.info-value.tiempo {
    font-family: monospace;
    color: var(--color-primary);
}

/* Preview de fotos */
.fotos-preview {
    margin-top: 12px;
}

.fotos-preview h5 {
    margin: 12px 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.foto-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-light);
    background: var(--bg-white);
    transition: var(--transition);
}

.foto-item:hover {
    border-color: var(--color-primary);
    transform: scale(1.02);
}

.foto-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.btn-eliminar-foto {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.foto-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 6px;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1;
    justify-content: center;
    transition: var(--transition);
}

.file-preview {
    width: 100%;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    gap: 8px;
}

.file-icon {
    font-size: 32px;
}

.file-name {
    font-size: 10px;
    color: #6b7280;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

.btn-eliminar-foto:hover {
    background: var(--color-danger);
    transform: scale(1.1);
}

/* Footer del modal */
.modal-tarea-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.footer-spacer {
    flex: 1;
}

/* Mensajes de notificación */
.mensaje-notificacion {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.mensaje-notificacion.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.mensaje-notificacion.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.btn-cerrar-mensaje {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    opacity: 0.7;
}

.btn-cerrar-mensaje:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ccc;
}

/* Mensajes específicos para ficha cliente */
.mensaje-error, .mensaje-exito {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.mensaje-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.mensaje-exito {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.info-archivos {
    margin-top: 8px;
    margin-bottom: 15px;
}

/* ─── Gestión Redes Sociales ─────────────────────────────────────── */
.redes-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.redes-search {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    width: 260px;
    outline: none;
    transition: border-color 0.2s;
}
.redes-search:focus { border-color: #6366f1; }

.redes-count {
    font-size: 13px;
    color: #94a3b8;
}

.redes-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e8edf4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.redes-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

.redes-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e8edf4;
}

.redes-table th {
    padding: 12px 16px;
    font-weight: 600;
    color: #475569;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.redes-table th.col-cliente {
    text-align: left;
    min-width: 200px;
}

.redes-table th.col-web,
.redes-table td.col-web {
    text-align: left;
    min-width: 220px;
}

.redes-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    vertical-align: middle;
}

.redes-table td.col-cliente { text-align: left; }

.redes-table tbody tr:last-child td { border-bottom: none; }

.redes-table tbody tr:hover { background: #f8fafc; }

.redes-table tbody tr.fila-listo { background: #f0fdf4; }
.redes-table tbody tr.fila-listo:hover { background: #dcfce7; }

.redes-nombre {
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
}
.redes-nombre:hover { color: #6366f1; text-decoration: underline; }
.redes-empresa { color: #94a3b8; font-weight: 400; }

.redes-empty {
    text-align: center;
    color: #94a3b8;
    padding: 40px 16px;
    font-size: 14px;
}

/* Checkbox button */
.check-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    color: #fff;
}
.check-btn svg { width: 16px; height: 16px; display: none; }
.check-btn.active svg { display: block; }

.check-btn:hover { border-color: #6366f1; transform: scale(1.1); }

.check-btn.active {
    background: #6366f1;
    border-color: #6366f1;
}

.check-btn-listo:hover { border-color: #22c55e; }
.check-btn-listo.active {
    background: #22c55e;
    border-color: #22c55e;
}

.col-listo { border-left: 2px solid #e8edf4; }

@media (max-width: 768px) {
    .redes-table th, .redes-table td { padding: 8px 10px; }
    .redes-search { width: 100%; }
    .redes-toolbar { flex-wrap: wrap; }
}

/* ==========================================================================
   PAPELERA AJAX MESSAGE — clase unificada para todos los módulos
   ========================================================================== */

@keyframes papeleraFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.papelera-ajax-msg {
    margin: 0 0 14px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    animation: papeleraFadeUp .22s ease;
}

.papelera-ajax-msg--ok {
    background: #ecfdf3;
    color: #065f46;
    border-color: #a7f3d0;
}

.papelera-ajax-msg--error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

    /* ─── Columnas de tabla ordenables ─────────────────────────────── */
    th.th-sort {
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
    }
    th.th-sort:hover {
        color: #374151;
        background: rgba(0,0,0,.03);
    }
    th.th-sort .th-sort-inner {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }
    th.th-sort .th-sort-arrow {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 14px;
        height: 14px;
        opacity: .3;
    }
    th.th-sort.th-sort-asc .th-sort-arrow,
    th.th-sort.th-sort-desc .th-sort-arrow {
        opacity: 1;
        color: #334155;
    }
    th.th-sort .th-sort-svg {
        width: 11px;
        height: 11px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    th.th-sort .th-sort-arrow-up,
    th.th-sort .th-sort-arrow-down {
        opacity: .3;
    }
    th.th-sort.th-sort-asc .th-sort-arrow-up   { opacity: 1; }
    th.th-sort.th-sort-desc .th-sort-arrow-down { opacity: 1; }



