/* CSS Reset & Variable Definitions */
:root {
    --bg-primary: #f9f9f6;
    --bg-secondary: #ffffff;
    --text-primary: #250016;
    --text-secondary: #676879;
    --border-color: #e6e9ef;
    --border-hover: #c5c7d0;
    --primary-color: #d81b60;
    --primary-hover: #b0104c;
    --primary-rgb: 216, 27, 96;
    
    /* Monday.com Colors for Tags (Updated for AAA/AA WCAG White Text Contrast) */
    --color-green: #008a47;
    --color-orange: #cc6d00;
    --color-red: #d92e46;
    --color-gray: #757980;
    --color-maqueo: #fd5a28; /* Naranja */
    --color-cubiertas: #69193e;
    --color-carpinteria: #007b91; /* Teal */
    --color-blue: var(--color-cubiertas);
    --color-purple: var(--color-maqueo);
    --color-teal: var(--color-carpinteria);
    --color-dark-gray: #7f5347;

    /* Shadow styles */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.15);
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Header Styling */
.app-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary-color), #a25ddc);
    color: white;
    font-weight: 700;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(var(--primary-rgb), 0.3);
}

.logo-icon-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-desktop {
    display: block;
}

.logo-mobile {
    display: none;
}

.logo-text h1 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
    color: #111111;
}

.logo-text p {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.app-tabs {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    height: 100%;
    gap: 4px;
    pointer-events: auto;
    z-index: 1;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.02);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(var(--primary-rgb), 0.03);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* ─── Hamburger button ─── */
.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.hamburger-btn:hover,
.hamburger-btn[aria-expanded="true"] {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(216,27,96,0.25);
}

.hamburger-btn svg {
    width: 18px;
    height: 18px;
}

/* ─── Dropdown Panel ─── */
.header-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 270px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(37,0,22,0.14), 0 2px 8px rgba(37,0,22,0.07);
    z-index: 9999;
    padding: 8px 0;
    animation: menuFadeIn 0.18s ease;
    overflow: hidden;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.header-menu-panel.hidden {
    display: none;
}

/* ─── User block ─── */
.hm-user-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 12px;
}

.hm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #a25ddc);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.hm-avatar svg {
    width: 22px;
    height: 22px;
}

.hm-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.hm-email {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.hm-role-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: var(--primary-color);
    padding: 2px 8px;
    border-radius: 20px;
    align-self: flex-start;
}

/* ─── Divider ─── */
.hm-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ─── Menu items ─── */
.hm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: default;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}

.hm-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.hm-action {
    cursor: pointer;
}

.hm-action:hover {
    background: #f9f0f4;
    color: var(--primary-color);
}

.hm-action:hover svg {
    color: var(--primary-color);
}

.hm-date-item {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ─── Logout ─── */
.hm-logout {
    color: #c0392b;
}

.hm-logout svg {
    color: #c0392b;
}

.hm-logout:hover {
    background: #fff0ee;
    color: #c0392b;
}

.hm-logout:hover svg {
    color: #c0392b;
}

/* ─── date-display inside menu ─── */
#date-display {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}


.status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.status-badge .status-text {
    display: none !important;
}

.status-badge.connected {
    color: #007f4f;
}

.status-badge.disconnected {
    color: #b91c1c;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.status-badge.connected .status-dot {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 200, 117, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(0, 200, 117, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 200, 117, 0); }
}

.current-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    background-color: var(--bg-primary);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Main Content Styles */
.app-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-width: 100%;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.25s ease;
}

.tab-content.active {
    display: flex;
}

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

/* Tab Header and Controls */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.tab-info h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tab-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

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

/* Search Box styling */
.search-box {
    position: relative;
    width: 260px;
}

.search-box i,
.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    font-size: 13px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* Buttons */
.btn {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.btn i {
    width: 15px;
    height: 15px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: #f9f9f6;
    border-color: var(--border-hover);
}

.btn-danger-outline {
    background-color: var(--bg-secondary);
    border-color: #fee2e2;
    color: #dc2626;
}

.btn-danger-outline:hover {
    background-color: #fef2f2;
    border-color: #fca5a5;
}

.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    transition: all 0.15s ease;
}

.icon-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background-color: #f8f9fa;
}

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

/* Board and Table Section */
.board-section {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.section-title-bar {
    padding: 12px 18px;
    background-color: #fafbfc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title-bar h3 {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-bar.bg-carp {
    background-color: rgba(162, 93, 220, 0.05);
    border-left: 4px solid var(--color-purple);
}

.section-title-bar.bg-anexo {
    background-color: rgba(87, 155, 252, 0.05);
    border-left: 4px solid var(--color-blue);
}

.section-title-bar.collapsible {
    cursor: pointer;
    user-select: none;
}

.section-title-bar.collapsible:hover {
    background-color: #f1f2f4;
}

.collapse-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.badge {
    background-color: #e1e3e9;
    color: #494b57;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 4px;
}

/* Monday Table Layout */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.monday-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
    text-align: left;
}

.monday-table th {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background-color: #fafbfc;
    height: 38px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.monday-table th:last-child {
    border-right: none;
}

.monday-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    height: 44px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    position: relative;
    vertical-align: middle;
}

.monday-table td:last-child {
    border-right: none;
}

/* Freeze first column (Client/Project Name) for horizontal scroll readability */
.monday-table th:first-child,
.monday-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.04);
    transition: width 0.18s ease, min-width 0.18s ease, max-width 0.18s ease, padding 0.18s ease;
}

/* Shrink the first column (Cliente) globally when scrolled horizontally */
.table-container.scrolled .monday-table th:first-child,
.table-container.scrolled .monday-table td:first-child {
    width: 10ch !important;
    max-width: 10ch !important;
    min-width: 10ch !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.monday-table th:first-child {
    background-color: #f9f9f6;
}

.monday-table td:first-child {
    background-color: var(--bg-secondary, #ffffff);
}

.monday-table tbody tr:hover {
    background-color: #f9f9f6;
}

.monday-table tbody tr:hover td:first-child {
    background-color: #f9f9f6 !important;
}

.archive-table td:first-child {
    background-color: #f9f9f6;
}

.archive-table tbody tr:hover td:first-child {
    background-color: #f2f2ed !important;
}

/* Specific Archive Table styling */
.archive-table {
    opacity: 0.85;
}

.archive-table tbody tr {
    background-color: #ffffff;
}

/* Table Input and Cell Elements */
.cell-editable {
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.cell-editable:hover {
    background-color: rgba(var(--primary-rgb), 0.04);
}

.cell-text-input {
    width: 100%;
    height: 100%;
    border: 1px solid var(--primary-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

/* Google Maps link integration */
.address-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.address-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.maps-btn {
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.cell-editable:hover .maps-btn,
td:hover .maps-btn {
    opacity: 1;
}

.maps-btn:hover {
    transform: scale(1.15);
    color: var(--primary-hover);
}

.maps-btn i {
    width: 14px;
    height: 14px;
}

/* File Preview inside Cell */
.file-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-link {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.file-link:hover {
    text-decoration: underline;
}

.file-link i {
    width: 14px;
    height: 14px;
}

/* Status & Label Tags styling */
.status-tag {
    display: block;
    width: 100%;
    height: 32px;
    line-height: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    border-radius: 4px;
    color: white;
    text-transform: capitalize;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(0,0,0,0.05);
}

.tag-listo,
.tag-terminado,
.tag-terminado-listo,
.tag-sí {
    background-color: var(--color-green);
}

.tag-en-curso,
.tag-trabajando {
    background-color: var(--color-orange);
}

.tag-faltante,
.tag-no {
    background-color: var(--color-red);
}

.tag-liquidación {
    background-color: var(--color-dark-gray);
}

.tag-n-a,
.tag-na,
.tag-sin {
    background-color: var(--color-gray);
}

.tag-maqueo,
.tag-melamina,
.tag-suministro {
    background-color: var(--color-purple);
}

.tag-cubierta,
.tag-enchapado,
.tag-corte {
    background-color: var(--color-blue);
}

.tag-carpinteria,
.tag-madera,
.tag-instalacion {
    background-color: var(--color-teal);
}

/* Multiple contract combinations */
.tag-cu-mq,
.tag-mq-car,
.tag-car-cu,
.tag-car-cu-mq {
    background: linear-gradient(135deg, var(--color-purple), var(--color-blue));
}

/* Follow-up status tags for leads */
.tag-followup-enviado {
    background-color: #fd5a28 !important; /* naranja */
    color: white !important;
}
.tag-followup-revision {
    background-color: #fca130 !important; /* amarillo-naranja */
    color: white !important;
}
.tag-followup-dudas {
    background-color: #f7d038 !important; /* amarillo */
    color: #250016 !important;
}
.tag-followup-negociacion {
    background-color: #c9de3c !important; /* amarillo-verde */
    color: #250016 !important;
}
.tag-followup-agendado {
    background-color: #79d85c !important; /* verde claro */
    color: white !important;
}
.tag-followup-vendido {
    background-color: #008a47 !important; /* verde */
    color: white !important;
}
.tag-followup-cancelado {
    background-color: #d92e46 !important; /* rojo */
    color: white !important;
}
.tag-followup-sin-respuesta {
    background-color: #b02222 !important; /* rojo oscuro */
    color: white !important;
}

/* Row Action Buttons */
.row-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.row-actions .btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 600;
}

/* Custom Dropdown Dialog / Overlay (Monday Tag Selection) */
.monday-tag-picker {
    position: absolute;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-hover);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 500;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: popIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(-6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.tag-picker-option {
    padding: 8px 12px;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    transition: filter 0.1s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tag-picker-option:hover {
    filter: brightness(0.9);
}

/* Modals styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(9, 30, 66, 0.54);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafbfc;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
}

.close-btn:hover {
    background-color: #ebecf0;
    color: var(--text-primary);
}

.close-btn i {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

/* Forms layout */
.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #172b4d;
}

input[type="text"],
input[type="date"],
input[type="url"],
select,
textarea {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
    height: auto;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.help-text {
    font-size: 11px;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

/* Quick Choice Buttons for Area Details */
.quick-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    margin-top: 4px;
}
.quick-choice-btn {
    padding: 6px 12px !important;
    font-size: 11px !important;
    height: auto !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}
.quick-choice-btn.active-choice {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

/* Alert Boxes */
.alert {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.alert-info {
    background-color: #deebff;
    color: #0747a6;
    border: 1px solid #b3d4ff;
}

.alert i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.settings-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.5;
}

/* File Upload Preview styling */
.file-preview-area {
    margin-top: 8px;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fafbfc;
}

.btn-remove-file {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-remove-file:hover {
    background-color: rgba(224, 85, 78, 0.1);
}

.contracts-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.contract-upload-item {
    background: #fdfdfe;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contract-sublabel {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    margin-bottom: 2px !important;
    text-transform: uppercase;
}

.contract-upload-item input[type="file"] {
    font-size: 11px;
    width: 100%;
    color: var(--text-secondary);
}

.contract-upload-item .file-preview-area {
    margin-top: 4px;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fafbfc;
    font-size: 11px;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #ebecf0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    transition: width 0.2s ease;
}

/* Placeholder card for pending views */
.placeholder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-width: 500px;
    margin: 40px auto;
    box-shadow: var(--shadow-sm);
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    opacity: 0.4;
    margin-bottom: 20px;
}

.placeholder-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.placeholder-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Utility alignments */
.text-center {
    text-align: center;
}

/* Hide containers */
.hidden-element,
.hidden {
    display: none !important;
}

/* Dashboard y Pendientes Panel Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.metric-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.metric-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.metric-card:hover .metric-icon {
    transform: scale(1.1);
}

.bg-active-light {
    background-color: rgba(var(--primary-rgb), 0.08);
}

.text-active {
    color: var(--primary-color);
    width: 24px;
    height: 24px;
}

.bg-purple-light {
    background-color: rgba(140, 62, 205, 0.08);
}

.text-purple {
    color: var(--color-purple);
    width: 24px;
    height: 24px;
}

.bg-blue-light {
    background-color: rgba(43, 118, 232, 0.08);
}

.text-blue {
    color: var(--color-blue);
    width: 24px;
    height: 24px;
}

.bg-teal-light {
    background-color: rgba(0, 123, 145, 0.08);
}

.text-teal {
    color: var(--color-teal);
    width: 24px;
    height: 24px;
}

.metric-visual {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dashboard Details Section (Two Columns) */
.dashboard-details {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    align-items: stretch;
}

.dashboard-panel {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    min-height: 450px;
}

.checklist-panel {
    flex: 1.3;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

.chart-panel {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.dashboard-panel h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2025;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header-icon {
    width: 20px;
    height: 20px;
}

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--color-orange);
}

.small-search {
    max-width: 260px;
    width: 100%;
}

/* Task List */
.task-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 5px;
}

/* Custom scrollbar for task list */
.task-list::-webkit-scrollbar {
    width: 6px;
}
.task-list::-webkit-scrollbar-track {
    background: transparent;
}
.task-list::-webkit-scrollbar-thumb {
    background: #e2e4e9;
    border-radius: 3px;
}
.task-list::-webkit-scrollbar-thumb:hover {
    background: #ccd1d9;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
    background-color: var(--bg-secondary);
}

.task-item:hover {
    background-color: #fafbfc;
}

.task-item.fade-out {
    transform: scale(0.92);
    opacity: 0;
    pointer-events: none;
}

.task-checkbox-container {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    margin-right: 15px;
}

.task-checkbox-input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ccd1d9;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
    position: relative;
    background-color: var(--bg-secondary);
    flex-shrink: 0;
}

.task-checkbox-input:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.task-checkbox-input:checked {
    background-color: var(--color-green);
    border-color: var(--color-green);
    transform: scale(1);
}

.task-checkbox-input:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.task-info-block {
    display: flex;
    flex-direction: column;
}

.task-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1f2025;
    line-height: 1.4;
    transition: color 0.2s;
}

.task-checkbox-input:checked + .task-info-block .task-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-meta {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.task-tag {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.task-tag.maqueo {
    background-color: var(--color-purple);
}

.task-tag.carpinteria {
    background-color: var(--color-teal);
}

.task-tag.cubiertas {
    background-color: var(--color-blue);
}

/* Stage Distribution styling */
.area-distributions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dist-section {
    display: flex;
    flex-direction: column;
}

.dist-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.bg-purple {
    background-color: var(--color-purple);
}

.bg-blue {
    background-color: var(--color-blue);
}

.bg-teal {
    background-color: var(--color-teal);
}

.dist-bar-container {
    width: 100%;
    background-color: #ebecf0;
    height: 28px;
    border-radius: 6px;
    display: flex;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.dist-segment {
    height: 100%;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 700;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

.dist-segment:hover {
    filter: brightness(1.1);
    z-index: 2;
}

.dist-segment[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2025;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 6px;
    pointer-events: none;
    box-shadow: var(--shadow-md);
}

/* Empty State checklist */
.empty-task-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-task-state i {
    width: 48px;
    height: 48px;
    color: var(--color-green);
    margin-bottom: 15px;
    opacity: 0.8;
}

.empty-task-state p {
    font-size: 13px;
    font-weight: 500;
}

/* --- PORTAL DE ACCESO / LOGIN OVERLAY --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 0, 22, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-card {
    background: var(--bg-secondary, #ffffff);
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    padding: 40px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    text-align: center;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-overlay.active .login-card {
    transform: scale(1);
}

.login-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color, #d81b60), #ff4081);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 26px;
    font-weight: 700;
    margin: 0 auto 20px auto;
    box-shadow: 0 8px 16px rgba(var(--primary-rgb), 0.2);
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.login-error-msg {
    color: #b91c1c;
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
    display: block;
    animation: shake 0.4s ease-in-out;
}

.login-error-msg.hidden {
    display: none;
}

.btn-block {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-weight: 600;
}

/* --- ROLE BADGE IN HEADER --- */
.current-role-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
}

.current-role-badge .role-icon {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.current-role-badge .role-text {
    text-transform: capitalize;
}

.logout-btn {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: 6px;
}

.logout-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.logout-btn i {
    width: 14px;
    height: 14px;
}

/* --- GENERAL RBAC HIDING STYLES --- */
.hidden-by-role {
    display: none !important;
}

.readonly-cell {
    cursor: default !important;
    background-color: rgba(0, 0, 0, 0.01);
}

.readonly-cell:hover {
    background-color: rgba(0, 0, 0, 0.01) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* --- TRAFFIC LIGHT PROGRESS INDICATORS --- */
.traffic-lights-container {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    cursor: help;
}

.traffic-light.light-gray {
    background-color: #cbd5e1; /* slate-300 */
    box-shadow: none;
}

.traffic-light.light-red {
    background-color: #ef4444; /* red-500 */
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulse-red 2s infinite alternate;
}

.traffic-light.light-green {
    background-color: #10b981; /* emerald-500 */
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@keyframes pulse-red {
    from {
        transform: scale(1);
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
    }
    to {
        transform: scale(1.15);
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    }
}

.traffic-light:not(.light-gray):hover {
    transform: scale(1.3);
    filter: brightness(1.15);
    box-shadow: 0 0 12px rgba(0,0,0,0.25);
}

/* --- INLINE CHECKLIST FOR TABLE CELLS --- */
.inline-checklist {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 12px;
    padding: 4px;
}

.checklist-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checklist-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: #cbd5e1; /* gray-300 */
}

.checklist-item.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.checklist-label {
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.3px;
}

/* --- ACCOUNTING PANEL STYLING --- */
.accounting-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.acc-kpi-card {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.acc-kpi-card.purple-border {
    border-top: 4px solid var(--color-purple);
}

.acc-kpi-card.blue-border {
    border-top: 4px solid var(--color-blue);
}

.acc-kpi-card.teal-border {
    border-top: 4px solid var(--color-teal);
}

.acc-kpi-card.total-highlight-card {
    border: 1px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.03), rgba(var(--primary-rgb), 0.08));
}

.acc-kpi-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.acc-kpi-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.acc-kpi-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acc-kpi-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.acc-kpi-row strong {
    font-size: 13px;
    color: var(--text-primary);
}

.acc-kpi-row strong.text-success {
    color: var(--color-green) !important;
}

.acc-kpi-row strong.text-danger {
    color: var(--color-red) !important;
}

/* Accounting section layouts */
.accounting-section {
    margin-bottom: 35px;
}

.accounting-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
}

.accounting-section-header.bg-purple {
    background-color: var(--color-purple);
}

.accounting-section-header.bg-blue {
    background-color: var(--color-blue);
}

.accounting-section-header.bg-teal {
    background-color: var(--color-teal);
}

.accounting-section-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-export-csv {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-export-csv:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

/* --- GOOGLE LOGIN & SPINNER --- */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: white !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    font-weight: 500;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background-color: #f9fafb !important;
    border-color: #c5c7c9 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- MODAL HISTORIAL TIMELINE --- */
.timeline {
    position: relative;
    padding-left: 24px;
    margin: 10px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 7px;
    width: 2px;
    background-color: #e5e7eb;
}

.timeline-event {
    position: relative;
    margin-bottom: 20px;
}

.timeline-event:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid white;
    box-shadow: 0 0 0 2px #d1e2ff;
    z-index: 1;
}

.timeline-content {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
}

.timeline-user {
    font-size: 12px;
    color: var(--text-color);
    margin-bottom: 6px;
}

.timeline-details {
    color: #4b5563;
}

.timeline-old {
    text-decoration: line-through;
    color: #9ca3af;
    background-color: #f3f4f6;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
}

.timeline-new {
    color: #065f46;
    background-color: #d1fae5;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    font-weight: 600;
}

/* --- ESTILOS EXTRAS PARA LA SECCION DE PERSONAL --- */
.bg-dark {
    background-color: #250016 !important;
}

/* --- RESPONSIVE CELLULAR VERTICAL (PORTRAIT) --- */
@media screen and (max-width: 767px) and (orientation: portrait) {
    /* Reduce container padding on small portrait viewports to maximize screen space */
    .app-main {
        padding: 12px 8px !important;
    }
    
    /* Expand list tables horizontally and reduce font zoom */
    .board-section .monday-table, 
    .accounting-section:not(#section-personal-admin) .monday-table {
        width: 1600px !important;
        font-size: 11px !important;
    }
    
    .board-section .monday-table th,
    .accounting-section:not(#section-personal-admin) .monday-table th {
        padding: 6px 8px !important;
        font-size: 11px !important;
        height: 32px !important;
    }
    
    .board-section .monday-table td,
    .accounting-section:not(#section-personal-admin) .monday-table td {
        padding: 6px 8px !important;
        font-size: 11px !important;
        height: 36px !important;
    }
    
    /* Status tags scaling for vertical mobile */
    .board-section .monday-table .status-tag,
    .accounting-section:not(#section-personal-admin) .monday-table .status-tag {
        height: 24px !important;
        line-height: 22px !important;
        font-size: 10px !important;
        font-weight: 500 !important;
    }
    
    /* Text inputs and editable cells inside table for vertical mobile */
    .board-section .monday-table select, 
    .board-section .monday-table input,
    .accounting-section:not(#section-personal-admin) .monday-table select,
    .accounting-section:not(#section-personal-admin) .monday-table input,
    .cell-text-input {
        font-size: 11px !important;
        padding: 2px 4px !important;
        height: 24px !important;
    }
    
    /* Action buttons in tables */
    .board-section .monday-table .row-actions .btn-sm,
    .accounting-section:not(#section-personal-admin) .monday-table .row-actions .btn-sm {
        height: 24px !important;
        padding: 0 6px !important;
        font-size: 10px !important;
    }

    /* Shrink the first column (Cliente) when the table container is scrolled */
    .board-section .monday-table th:first-child,
    .board-section .monday-table td:first-child,
    .accounting-section:not(#section-personal-admin) .monday-table th:first-child,
    .accounting-section:not(#section-personal-admin) .monday-table td:first-child {
        transition: width 0.18s ease, min-width 0.18s ease, max-width 0.18s ease, padding 0.18s ease;
    }

    .table-container.scrolled .monday-table th:first-child,
    .table-container.scrolled .monday-table td:first-child {
        width: 10ch !important;
        max-width: 10ch !important;
        min-width: 10ch !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    /* Stack search box and new project button vertically on mobile vertical */
    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    .tab-info {
        width: 100%;
    }

    .tab-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .search-box {
        width: 100% !important;
    }

    .tab-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Taller Consolidated Tab Headers */
.taller-block-header {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-top: 32px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.taller-block-header:first-of-type {
    margin-top: 8px;
}

.taller-block-header.bg-purple {
    border-left: 5px solid var(--color-purple);
}

.taller-block-header.bg-blue {
    border-left: 5px solid var(--color-blue);
}

.taller-block-header.bg-teal {
    border-left: 5px solid var(--color-teal);
}

.taller-block-info h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.taller-block-legend {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 6px 0;
}

.taller-block-owner {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

/* Hub View styles */
.taller-hub-view {
    padding: 0 0 24px 0;
}
.taller-hub-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}
.taller-hub-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.taller-hub-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.taller-hub-card.bg-purple {
    border-left: 6px solid var(--color-purple);
}
.taller-hub-card.bg-blue {
    border-left: 6px solid var(--color-blue);
}
.taller-hub-card.bg-teal {
    border-left: 6px solid var(--color-teal);
}
.taller-hub-card-left h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}
.taller-hub-legend {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}
.taller-hub-owner {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}
.btn-ver-taller {
    background-color: transparent;
    border: 2px solid #ff4e00; /* Red-orange color matching screenshot */
    color: #ff4e00;
    padding: 8px 28px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-ver-taller:hover {
    background-color: #ff4e00;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(255, 78, 0, 0.2);
}

/* Detail View Back Button & Nav Buttons */
.taller-nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.nav-separator {
    color: var(--border-color);
    font-weight: 300;
}
.btn-back-taller {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.2s ease;
}
.btn-back-taller:hover {
    color: var(--primary-color);
}
.btn-back-taller i {
    width: 16px;
    height: 16px;
}
.btn-nav-direct {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.btn-nav-direct.bg-purple-text {
    color: var(--color-purple);
}
.btn-nav-direct.bg-purple-text:hover {
    background-color: rgba(140, 62, 205, 0.08);
}
.btn-nav-direct.bg-blue-text {
    color: var(--color-blue);
}
.btn-nav-direct.bg-blue-text:hover {
    background-color: rgba(43, 118, 232, 0.08);
}
.btn-nav-direct.bg-teal-text {
    color: var(--color-teal);
}
.btn-nav-direct.bg-teal-text:hover {
    background-color: rgba(0, 123, 145, 0.08);
}

.btn-nav-direct i {
    width: 14px;
    height: 14px;
}

/* Hide text and show only icons on mobile (viewport <= 767px) */
@media screen and (max-width: 767px) {
    .logo-desktop {
        display: none !important;
    }
    .logo-mobile {
        display: block !important;
    }

    /* Main navigation tabs: hide text */
    .tab-btn .tab-text {
        display: none !important;
    }
    
    .tab-btn {
        padding: 0 12px !important;
        justify-content: center;
    }
    
    /* Header right side: hide date and role text */
    .current-date {
        display: none !important;
    }
    
    .current-role-badge .role-text {
        display: none !important;
    }
    
    .current-role-badge {
        padding: 6px 8px !important;
        gap: 4px !important;
    }
    
    /* Workshop detail view: hide button texts and separators */
    .btn-back-taller .btn-text,
    .btn-nav-direct .btn-text {
        display: none !important;
    }
    
    .nav-separator {
        display: none !important;
    }
    
    .taller-nav-buttons {
        gap: 8px !important;
    }
}


/* ═══════════════════════════════════════════════════════
   CALENDARIO DE ENTREGAS — Dashboard
   ═══════════════════════════════════════════════════════ */

.dashboard-calendar-section {
    padding: 0 24px 24px;
}

.calendar-panel {
    padding: 20px 24px 16px;
}

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

.calendar-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.cal-month-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 140px;
    text-align: center;
    text-transform: capitalize;
}

.cal-nav-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-size: 12px;
    font-weight: 500;
}

.cal-nav-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.cal-nav-btn svg {
    width: 14px;
    height: 14px;
}

.cal-today-btn {
    padding: 5px 12px;
    font-family: inherit;
}

/* ─── Grid del Calendario ─── */
.delivery-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cal-day {
    min-height: 74px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 6px;
    background: #fff;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
    overflow: hidden;
}

.cal-day:hover {
    border-color: var(--primary-color);
    background: #fff0f5;
}

.cal-day.empty {
    background: transparent;
    border: none;
    min-height: 74px;
}

.cal-day.today {
    border-color: var(--primary-color);
    background: #fff0f5;
}

.cal-day.has-events {
    background: #fff;
    border-color: #e8d0db;
}

.cal-day-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
    margin-bottom: 4px;
    display: block;
}

.cal-day.today .cal-day-number {
    color: #fff;
    background: var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.cal-day.other-month {
    opacity: 0.35;
    pointer-events: none;
}

/* ─── Chips de entrega ─── */
.cal-event-chip {
    display: block;
    font-size: 10px;
    font-weight: 500;
    border-radius: 4px;
    padding: 1px 5px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    line-height: 16px;
    max-width: 100%;
}

.cal-event-chip.maqueo {
    background: #fff1ec;
    color: var(--color-maqueo);
    border-left: 2px solid var(--color-maqueo);
}

.cal-event-chip.cubiertas {
    background: #f7eaee;
    color: var(--color-cubiertas);
    border-left: 2px solid var(--color-cubiertas);
}

.cal-event-chip.carpinteria {
    background: #e8f5f7;
    color: var(--color-carpinteria);
    border-left: 2px solid var(--color-carpinteria);
}

/* ─── Leyenda ─── */
.cal-legend {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.cal-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.cal-dot.maqueo      { background: var(--color-maqueo); }
.cal-dot.cubiertas   { background: var(--color-cubiertas); }
.cal-dot.carpinteria { background: var(--color-carpinteria); }

/* ─── Responsive ─── */
@media (max-width: 767px) {
    .dashboard-calendar-section {
        padding: 0 12px 16px;
    }

    .calendar-panel {
        padding: 14px 12px 12px;
    }

    .cal-day {
        min-height: 52px;
        padding: 4px;
    }

    .cal-event-chip {
        font-size: 9px;
        padding: 1px 3px;
    }

    .calendar-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ─── Cotizaciones module styles ─── */
.quote-option-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    background-color: #fafbfc;
    position: relative;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}
.quote-option-item:hover {
    border-color: #c1c7d0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.btn-remove-option {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #de350b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}
.btn-remove-option:hover {
    background-color: #ffebe6;
}
.opt-summary-text {
    background-color: rgba(9, 30, 66, 0.04);
    border-radius: 4px;
    padding: 8px 12px;
    font-weight: 500;
}
.hidden-by-role {
    display: none !important;
}

.quote-row-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    background-color: #fafbfc;
    position: relative;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}
.quote-row-item:hover {
    border-color: #c1c7d0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.btn-remove-row {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #de350b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}
.btn-remove-row:hover {
    background-color: #ffebe6;
}

/* Force visual uppercase in quote form inputs and textareas */
#form-quote input[type="text"],
#form-quote textarea {
    text-transform: uppercase;
}

/* --- Universal Card Grid for Leads in tab-cotizaciones --- */
#tab-cotizaciones .table-container {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
}
#tab-cotizaciones .monday-table {
    table-layout: auto;
    display: block;
    width: 100%;
    border: none;
}
#tab-cotizaciones .monday-table thead {
    display: none;
}
#tab-cotizaciones .monday-table tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
    gap: 20px;
    width: 100%;
}
#tab-cotizaciones .monday-table tr {
    display: block;
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#tab-cotizaciones .monday-table tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}
#tab-cotizaciones .monday-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    border-right: none;
    height: auto;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    width: 100% !important;
    box-sizing: border-box;
    text-align: right;
}
#tab-cotizaciones .monday-table td:last-child {
    border-bottom: none;
    justify-content: flex-end;
    padding-top: 14px;
    gap: 10px;
}
#tab-cotizaciones .monday-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    margin-right: 12px;
    text-align: left;
    flex-shrink: 0;
}

/* ─── RenovArt Cronograma & Capacity Semaphore Styles ─── */
.renovart-capacity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

.capacity-week-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.capacity-week-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.capacity-week-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.capacity-stage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.capacity-badge {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* Semaphore Colors */
.badge-green {
    background-color: #e6f4ea;
    color: #137333;
}

.badge-yellow {
    background-color: #fef7e0;
    color: #b06000;
}

.badge-red {
    background-color: #fce8e6;
    color: #c5221f;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(197, 34, 31, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(197, 34, 31, 0); }
    100% { box-shadow: 0 0 0 0 rgba(197, 34, 31, 0); }
}

/* Gantt Block Colors */
.gantt-block {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    box-sizing: border-box;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08);
}

.gantt-espera {
    background-color: #e2e8f0;
    color: #475569;
    border-left: 4px solid #94a3b8;
}

.gantt-recoger {
    background-color: #ffedd5;
    color: #c2410c;
    border-left: 4px solid #f97316;
}

.gantt-taller {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.gantt-domicilio {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.gantt-margen {
    background-color: #f3e8ff;
    color: #6b21a8;
    border-left: 4px solid #a855f7;
}

/* Weeks Header Columns in Gantt table */
.gantt-week-header {
    text-align: center !important;
    font-size: 11px !important;
    padding: 8px 4px !important;
}

.gantt-week-cell {
    text-align: center;
    padding: 6px 4px !important;
}

.gantt-client-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.btn-gantt-adjust {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-gantt-adjust:hover {
    border-color: #ff4e00;
    color: #ff4e00;
    background-color: rgba(255, 78, 0, 0.05);
}

/* ==========================================================================
   MÓDULO DE CITAS Y CALENDARIO SEMANAL / MENSUAL
   ========================================================================== */

.weekly-calendar-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.calendar-week-grid-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    min-width: 700px;
}

.hour-header-cell {
    width: 60px;
}

.day-header-cell {
    text-align: center;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.day-header-cell .day-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.day-header-cell .day-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.day-header-cell.today .day-number {
    background-color: var(--primary-color);
    color: #ffffff !important;
}

.calendar-week-body {
    display: flex;
    min-width: 700px;
    height: 780px; /* 13 hours * 60px */
    position: relative;
    overflow-y: auto;
}

.hours-column {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
    z-index: 2;
}

.hour-cell {
    height: 60px;
    text-align: right;
    padding-right: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-top: -6px; /* Align text with grid lines */
}

.days-columns-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex-grow: 1;
    position: relative;
    height: 780px;
    box-sizing: border-box;
}

.grid-lines-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    z-index: 1;
}

.grid-line {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

.day-column {
    position: relative;
    height: 100%;
    border-right: 1px solid var(--border-color);
    box-sizing: border-box;
    z-index: 2;
    background: transparent;
}

.day-column:last-child {
    border-right: none;
}

.day-column:hover {
    background: rgba(var(--primary-rgb), 0.015);
}

/* Appointment Cards */
.cita-card {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 4px;
    padding: 6px 8px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cita-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 11;
}

.cita-card .cita-card-title {
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cita-card .cita-card-time {
    font-size: 9.5px;
    opacity: 0.85;
}

.cita-card .cita-card-location {
    font-size: 9px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: auto;
}

/* Modal Google Calendar Style Specifics */
.gcal-modal .close-btn:hover {
    background-color: rgba(255,255,255,0.08) !important;
}

.gcal-type-tab {
    background: transparent;
    border: 1px solid #5f6368;
    color: #9aa0a6;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.gcal-type-tab:hover {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
}

.gcal-type-tab.active {
    background-color: #8ab4f8;
    border-color: #8ab4f8;
    color: #202124;
}

.color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s;
    box-sizing: border-box;
    border: 2px solid transparent;
}

.color-dot:hover {
    transform: scale(1.2);
}

.color-dot.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px #8ab4f8;
}

/* Monthly view layout */
.calendar-month-grid-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.calendar-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-secondary);
}

.calendar-month-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(100px, auto);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

.month-day-cell {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 6px;
    box-sizing: border-box;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.month-day-cell.other-month {
    background-color: rgba(0,0,0,0.02);
}

.month-day-cell .day-number-label {
    align-self: flex-end;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.month-day-cell.today .day-number-label {
    background-color: var(--primary-color);
    color: #ffffff !important;
}

.month-day-cell .month-events-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    flex-grow: 1;
}

.month-event-item {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    box-sizing: border-box;
}

/* ==========================================
   MÓDULO CRM & WHATSAPP PROTOTYPE STYLES
   ========================================== */

/* Sub-navigation tabs active state */
.active-subtab {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

/* Kanban Board Layout (Horizontally scrollable Trello-style) */
.kanban-board {
    display: flex;
    gap: 16px;
    align-items: start;
    min-height: 550px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 15px;
    width: 100%;
}

.kanban-column {
    background: #ebecf0;
    border: 1px solid #d2d5df;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    min-width: 270px;
    max-width: 270px;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.kanban-column.drag-over {
    background: #e2e4ea;
    border-color: var(--primary-color);
}

.column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #d2d5df;
}

.column-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid transparent;
}
.color-foto-pendiente { background-color: transparent; border-color: #00bcff; }
.color-cotizacion-pendiente { background-color: transparent; border-color: #e91e63; }
.color-visita-pendiente { background-color: transparent; border-color: #9c27b0; }
.color-agendado { background-color: transparent; border-color: #4caf50; }
.color-cliente-potencial { background-color: transparent; border-color: #009688; }
.color-en-el-aire { background-color: transparent; border-color: #ff9800; }
.color-cliente { background-color: transparent; border-color: #3f51b5; }
.color-terminado { background-color: transparent; border-color: #c62828; }
.color-sin-respuesta { background-color: transparent; border-color: #795548; }

.column-header h4 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    flex-grow: 1;
}

.column-count {
    background: #d2d5df;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 600px;
    padding-bottom: 15px;
}

/* Kanban Cards Styling */
.kanban-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.kanban-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.kanban-card:active {
    cursor: grabbing;
}

.card-client-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.tag-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.tag-important {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.tag-outside {
    background: #fce4ec;
    color: #c2185b;
    border: 1px solid #f8bbd0;
}

.tag-time {
    background: #fef9c3;
    color: #713f12;
    border: 1px solid #fef08a;
}

.card-msg-preview {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    margin-top: 8px;
}

.card-assignee {
    font-size: 10.5px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.card-actions-row {
    display: flex;
    gap: 6px;
}

.card-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.card-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* WhatsApp QR Panel Styling */
.qr-container-card {
    background: rgba(30, 27, 34, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    margin: 20px auto;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.qr-status-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.status-indicator-large {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 10px currentColor;
}
.status-indicator-large.disconnected {
    background-color: #ef4444;
    color: rgba(239, 68, 68, 0.4);
}
.status-indicator-large.connected {
    background-color: #10b981;
    color: rgba(16, 185, 129, 0.4);
}

.status-details h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.status-details p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.qr-display-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.qr-code-wrapper {
    position: relative;
    background: white;
    padding: 16px;
    border-radius: 12px;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mock-qr-code {
    width: 160px;
    height: 160px;
    position: relative;
}

.qr-square {
    width: 44px;
    height: 44px;
    border: 6px solid #111827;
    position: absolute;
}
.sq-tl { top: 0; left: 0; }
.sq-tr { top: 0; right: 0; }
.sq-bl { bottom: 0; left: 0; }

.qr-dots-pattern {
    position: absolute;
    top: 55px;
    left: 55px;
    width: 50px;
    height: 50px;
    background-image: radial-gradient(#111827 25%, transparent 25%), radial-gradient(#111827 25%, transparent 25%);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
}

.qr-overlay-expired {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 12px;
}

.qr-instructions {
    text-align: left;
    font-size: 12px;
    color: var(--text-secondary);
    width: 100%;
}
.qr-instructions ol {
    padding-left: 20px;
    margin: 8px 0;
}
.qr-instructions li {
    margin-bottom: 6px;
}

.connected-details-box {
    text-align: left;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Chat Drawer Panel Overlay & Animation */
.chat-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-drawer-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

@keyframes modalFadeIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.chat-drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f2f5;
}

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

.chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chat-user-details h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-user-details span {
    font-size: 11.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-dot.online {
    background-color: #10b981;
}

.chat-assigned-badge {
    font-size: 11px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    margin-right: 12px;
}

.chat-drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: #efeae2;
    background-image: radial-gradient(rgba(0,0,0,0.04) 1px, transparent 0);
    background-size: 20px 20px;
}

/* Chat Message Bubbles */
.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    animation: bubblePop 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes bubblePop {
    from { transform: scale(0.9) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.chat-bubble.received {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--text-primary);
    border-top-left-radius: 0px;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: #d9fdd3;
    color: #250016;
    border: 1px solid #c1e9bb;
    border-top-right-radius: 0px;
}

.chat-bubble-meta {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.chat-bubble.received .chat-bubble-meta {
    color: #64748b;
}

.chat-sender-tag {
    font-size: 9.5px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 2px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Chat Footer styling */
.chat-drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0f2f5;
}

.chat-attachment-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.chat-attachment-btn:hover {
    color: var(--text-primary);
    background: #e2e8f0;
}

.chat-drawer-footer input[type="text"] {
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}
.chat-drawer-footer input[type="text"]:focus {
    border-color: var(--primary-color);
}

.chat-send-btn {
    background: var(--primary-color, #e11d48);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    flex-shrink: 0;
    aspect-ratio: 1;
    align-self: center;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(225, 29, 72, 0.3);
}
.chat-send-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
    flex-shrink: 0;
    margin-left: 2px;
}
.chat-send-btn:hover {
    background: var(--primary-hover, #be123c);
    transform: scale(1.06);
    box-shadow: 0 5px 15px rgba(225, 29, 72, 0.4);
}
.chat-send-btn:active {
    transform: scale(0.94);
}

/* ==========================================
   BUBBLE PILLS DROPDOWNS (CRM CHAT MODAL)
   ========================================== */
.bubble-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.bubble-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    outline: none;
    user-select: none;
}

.bubble-pill-btn:hover {
    background: #ffffff;
    border-color: #94a3b8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.bubble-pill-btn.active {
    border-color: var(--primary-color, #e11d48);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
    background: #ffffff;
}

.bubble-pill-tag {
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
    padding-right: 4px;
    border-right: 1px solid #cbd5e1;
}

.bubble-pill-text {
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

.bubble-pill-arrow {
    width: 13px;
    height: 13px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.bubble-pill-btn.active .bubble-pill-arrow {
    transform: rotate(180deg);
}

/* Color thematic accents per pill type */
.bubble-pill-btn.stage-pill {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.bubble-pill-btn.stage-pill:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.bubble-pill-btn.modifier-pill {
    background: #fefce8;
    border-color: #fef08a;
    color: #a16207;
}
.bubble-pill-btn.modifier-pill:hover {
    background: #fef9c3;
    border-color: #fde047;
}

.bubble-pill-btn.assignee-pill {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
.bubble-pill-btn.assignee-pill:hover {
    background: #dcfce7;
    border-color: #86efac;
}

/* Floating Bubble Popover Panel */
.bubble-popover-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1200;
    min-width: 210px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.15), 0 6px 15px -3px rgba(0, 0, 0, 0.08);
    transform-origin: top right;
    animation: bubblePopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bubble-popover-panel.hidden {
    display: none;
}

@keyframes bubblePopIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popover-title {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #94a3b8;
    padding: 4px 8px 6px 8px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 6px;
}

.popover-bubble-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 2px;
}

.popover-bubble-list::-webkit-scrollbar {
    width: 4px;
}
.popover-bubble-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.bubble-option-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7.5px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
    outline: none;
}

.bubble-option-pill:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateX(3px);
}

.bubble-option-pill.selected {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    border-color: #bae6fd;
}

.bubble-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Sub-navigation bar styling for nested view structure */
.sub-nav-bar-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0px;
    flex-wrap: wrap;
    background: transparent;
}

.sub-tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    outline: none;
}

.sub-tab-btn i {
    width: 15px;
    height: 15px;
}

.sub-tab-btn:hover {
    color: var(--text-primary);
    border-bottom-color: #cbd5e1;
}

.sub-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Hide legacy quotes view toggle */
#btn-toggle-cotizaciones-view {
    display: none !important;
}

