:root {
    --bg: #0b0f17;
    --bg-soft: #111827;
    --panel: #0f172a;
    --panel-2: #111c34;
    --panel-3: #0b1220;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);

    --text: #f3f4f6;
    --text-soft: #9ca3af;
    --text-muted: #6b7280;

    --primary: #22d3ee;
    --primary-strong: #06b6d4;
    --warning: #f59e0b;
    --danger: #ef4444;
    --success: #22c55e;

    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --radius-sm: 12px;

    --sidebar-width: 250px;
    --topbar-height: 76px;
}

/* Reset */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at top center, rgba(34, 211, 238, 0.08), transparent 30%),
        linear-gradient(180deg, #06090f 0%, #0b0f17 100%);
    color: var(--text);
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

/* Layout principal */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(9, 14, 28, 0.98));
    border-right: 1px solid var(--line);
    padding: 22px 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 20px 12px;
    border-bottom: 1px solid var(--line);
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.logo-mark {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 14px;
}

.logo-fullmark {
    display: block;
    width: 176px;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.22));
}

.logo-fullmark-image {
    display: block;
    width: 176px;
    max-width: 100%;
    height: auto;
}

.logo-realicon {
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}

.logo-fullmark-text {
    font-size: 23px;
    line-height: 1;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-title {
    display: flex;
    align-items: center;
}

.logo-subtitle {
    font-size: 0.82rem;
    color: var(--text-soft);
}

.logo-wordmark {
    display: block;
    width: 122px;
    max-width: 100%;
    height: auto;
    filter: brightness(1.08);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    padding-bottom: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

.nav-section-title {
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 12px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 13px 14px;
    border-radius: 14px;
    color: var(--text-soft);
    border: 1px solid transparent;
    transition: 0.2s ease;
    font-weight: 600;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--line);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(34, 211, 238, 0.07));
    color: white;
    border-color: rgba(34, 211, 238, 0.18);
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.92) 18%, rgba(15, 23, 42, 0.98));
    padding-bottom: 8px;
    position: relative;
    z-index: 1;
}

/* Área derecha */
.main-area {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 0 28px;
    background: rgba(11, 15, 23, 0.55);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.searchbar {
    flex: 1;
    max-width: 680px;
}

.searchbar input {
    width: 100%;
    height: 46px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 0 18px;
    font-size: 0.95rem;
}

.searchbar input:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    justify-content: flex-end;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.language-switcher {
    width: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    padding: 5px 10px 5px 12px;
}

.language-switcher-title {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-soft);
    line-height: 1;
}

.language-select-wrap {
    display: inline-flex;
    align-items: center;
    min-width: 128px;
}

.language-select {
    width: 100%;
    min-width: 128px;
    max-width: 160px;
    height: 30px;
    min-height: 30px;
    border-radius: 9px;
    border: 1px solid rgba(184, 197, 213, 0.14);
    background-color: rgba(8, 12, 18, 0.62);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 5px 32px 5px 10px;
    cursor: pointer;
    line-height: 1;
}

.language-switcher:hover {
    border-color: var(--line-strong);
}

.language-select:hover {
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.06);
}

.language-select:focus {
    border-color: rgba(38, 200, 230, 0.36);
    box-shadow: 0 0 0 4px rgba(38, 200, 230, 0.08);
}

.sidebar-overlay {
    display: none;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-right: auto;
}

.mobile-brand-copy strong {
    display: block;
    line-height: 1;
}

.mobile-wordmark {
    display: block;
    width: 132px;
    height: auto;
}

.mobile-wordmark-image {
    display: block;
    width: 132px;
    height: auto;
}

.mobile-wordmark-text {
    display: inline-block;
    font-size: 22px;
    line-height: 1;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
}

.mobile-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-brand-copy strong {
    font-size: 1rem;
    color: #fff;
    line-height: 1.1;
}

.mobile-brand-copy span {
    font-size: 0.76rem;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-userbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-username {
    font-size: 14px;
    opacity: 0.85;
}

.mobile-quicknav {
    display: none;
}

.circle-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-btn:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.notifications-menu {
    position: relative;
}

.notifications-menu summary {
    list-style: none;
}

.notifications-menu summary::-webkit-details-marker {
    display: none;
}

.notifications-trigger {
    cursor: pointer;
    position: relative;
}

.notifications-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.notifications-dropdown {
    position: absolute;
    top: 46px;
    right: 0;
    width: 380px;
    max-width: min(92vw, 380px);
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    padding: 16px;
    z-index: 50;
}

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

.notifications-header strong {
    font-size: 15px;
    color: #fff;
}

.notifications-header span {
    font-size: 12px;
    opacity: 0.7;
    color: #fff;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
    transition: 0.2s ease;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(34, 211, 238, 0.18);
}

.notification-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.notification-copy {
    min-width: 0;
    flex: 1;
}

.notification-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 4px;
}

.notification-title {
    font-weight: 700;
    line-height: 1.3;
}

.notification-date {
    font-size: 12px;
    color: var(--text-soft);
    white-space: nowrap;
}

.notification-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.4;
}

.notification-meta {
    margin-top: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.notifications-empty {
    color: #fff;
    opacity: 0.75;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, #374151, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
}

/* Contenido */
.page-content {
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 0.96rem;
}

.card {
    background: linear-gradient(180deg, rgba(17, 28, 52, 0.88), rgba(11, 18, 32, 0.92));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-body {
    padding: 22px;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #041016;
    box-shadow: 0 10px 25px rgba(34, 211, 238, 0.20);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: white;
    border-color: var(--line);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.22);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.20);
}

/* Métricas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.stat-label {
    color: var(--text-soft);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Tablas */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table th {
    color: var(--text-soft);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.table td {
    color: var(--text);
    font-size: 0.95rem;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.20);
}

.badge-success {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.20);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.20);
}

.badge-info {
    background: rgba(34, 211, 238, 0.14);
    color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, 0.20);
}

/* Formularios */
form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-full {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 2px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #d1d5db;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: white;
    padding: 12px 14px;
    font-size: 0.95rem;
}

/* SELECT mejorado */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='white' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.167l3.71-3.936a.75.75 0 111.08 1.04l-4.24 4.5a.75.75 0 01-1.08 0l-4.24-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

select option {
    background: #0f172a;
    color: white;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.helptext {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.seguimiento-upload-widget {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seguimiento-upload-list {
    display: grid;
    gap: 10px;
}

.seguimiento-upload-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(184, 197, 213, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.seguimiento-upload-row.has-files {
    border-color: rgba(34, 211, 238, 0.30);
    background: rgba(34, 211, 238, 0.055);
}

.seguimiento-upload-row input[type="file"] {
    min-height: 44px;
    padding: 9px 12px;
}

.seguimiento-upload-count {
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
}

.seguimiento-upload-row.has-files .seguimiento-upload-count {
    color: var(--primary);
}

.btn-compact {
    min-height: 38px;
    padding: 0 14px;
    align-self: flex-start;
    font-size: 0.88rem;
}

.cliente-search-input {
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.cliente-native-wrap {
    display: none;
    width: 100%;
}

.cliente-mobile-search {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
}

.cliente-search-amazon {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.cliente-search-bar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.cliente-search-bar-mobile,
.cliente-search-bar-mobile-panel {
    grid-template-columns: 44px minmax(0, 1fr);
}

.cliente-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.cliente-search-action {
    min-height: 48px;
    border: 0;
    padding: 0 16px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #180a02;
    font-weight: 800;
    cursor: pointer;
}

.cliente-search-bar .cliente-search-input {
    min-height: 48px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.cliente-search-bar .cliente-search-input:focus {
    border: 0;
    box-shadow: none;
}

.cliente-mobile-trigger-input {
    width: 100%;
}

.cliente-search-selected,
.cliente-mobile-search-selected {
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1.45;
    margin-top: 8px;
}

.cliente-search-selected {
    color: #dbeafe;
}

.cliente-search-results {
    -webkit-overflow-scrolling: touch;
    margin-top: 8px;
    border-radius: 16px !important;
    overflow: hidden;
}

.cliente-mobile-panel {
    display: none;
}

.cliente-mobile-panel.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 120;
}

.cliente-mobile-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 20, 0.72);
    backdrop-filter: blur(6px);
}

.cliente-mobile-panel-dialog {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 12px;
    bottom: 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 14, 28, 0.98));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cliente-mobile-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cliente-mobile-panel-copy {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.cliente-mobile-panel-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
}

.cliente-mobile-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cliente-search-result-item,
.cliente-mobile-result-item {
    width: 100%;
    min-height: 48px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    color: #fff;
    text-align: left;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.cliente-search-result-item {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
}

.cliente-search-result-item:hover,
.cliente-mobile-result-item:hover {
    background: linear-gradient(180deg, rgba(34,211,238,0.12), rgba(34,211,238,0.04));
}

.cliente-result-title {
    font-weight: 700;
    color: #fff;
}

.cliente-result-meta {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.cliente-mobile-search-empty {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.errorlist {
    color: #fca5a5;
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 0.86rem;
}

/* Mensajes Django */
.messages {
    margin-bottom: 16px;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    font-weight: 600;
}

.alert-success {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.alert-error,
.alert-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
}

.alert-info {
    background: rgba(34, 211, 238, 0.14);
    color: #67e8f9;
}

/* Acciones */
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== TIMELINE SEGUIMIENTO ===== */

.timeline {
    position: relative;
    margin-top: 10px;
    padding-left: 30px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -22px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
}

.timeline-card {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    transition: 0.2s ease;
}

.timeline-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-title {
    font-weight: 800;
    font-size: 1rem;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timeline-body {
    font-size: 0.95rem;
    color: var(--text-soft);
    margin-top: 10px;
    white-space: pre-line;
}

.timeline-meta {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-tech {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .app-layout {
        flex-direction: column;
    }

    .main-area {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        padding: 16px;
        height: auto;
        flex-wrap: wrap;
    }

    .notifications-dropdown {
        right: -8px;
    }

    .page-content {
        padding: 16px;
    }

    .form-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .timeline {
        padding-left: 22px;
    }

    .timeline-dot {
        left: -16px;
    }
}

/* Agenda pro */
.agenda-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.agenda-hero {
    overflow: hidden;
    position: relative;
}

.agenda-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.14), transparent 34%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.12), transparent 28%);
    pointer-events: none;
}

.agenda-hero .card-body,
.agenda-month-card .card-body {
    position: relative;
}

.agenda-eyebrow,
.agenda-context-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 800;
}

.agenda-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.agenda-toolbar {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}

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

.agenda-current-range {
    font-size: 1.15rem;
    font-weight: 800;
    padding: 0 10px;
}

.agenda-view-switch {
    display: inline-flex;
    padding: 6px;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.agenda-view-pill {
    min-width: 78px;
    text-align: center;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text-soft);
    font-weight: 700;
}

.agenda-view-pill.is-active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(59, 130, 246, 0.20));
    color: white;
    border: 1px solid rgba(34, 211, 238, 0.18);
}

.agenda-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.agenda-kpi-card {
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.agenda-kpi-card span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.agenda-kpi-card strong {
    font-size: 1.65rem;
}

.agenda-layout,
.agenda-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
}

.agenda-layout-month {
    grid-template-columns: minmax(0, 1fr);
}

.agenda-layout-month .agenda-sidebar {
    order: 2;
}

.agenda-main,
.agenda-form-main,
.agenda-sidebar,
.agenda-form-sidebar {
    min-width: 0;
}

.agenda-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.agenda-month-shell {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    overflow: hidden;
    background: #f7fafc;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.agenda-month-card {
    background: linear-gradient(180deg, rgba(244, 248, 252, 0.96), rgba(229, 238, 247, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.14);
}

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

.agenda-month-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #0f172a;
}

.agenda-month-subtitle {
    margin-top: 6px;
    color: #64748b;
    font-size: 0.92rem;
}

.agenda-month-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.agenda-month-grid-body {
    align-items: stretch;
    gap: 0;
}

.agenda-weekday-row {
    margin-bottom: 0;
    gap: 0;
    background: #eef3f8;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-weekday-row div {
    padding: 14px 8px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-weekday-row div:last-child {
    border-right: none;
}

.agenda-day-cell {
    min-height: 190px;
    padding: 14px;
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96)),
        #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

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

.agenda-day-cell:nth-last-child(-n + 7) {
    border-bottom: none;
}

.agenda-day-cell::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    opacity: 0.9;
    background: transparent;
}

.agenda-day-cell.is-muted {
    opacity: 1;
    background:
        linear-gradient(180deg, rgba(241, 245, 249, 0.92), rgba(248, 250, 252, 0.96)),
        #f8fafc;
}

.agenda-day-cell.is-today {
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.16);
}

.agenda-day-cell.carga-alta {
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.10), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(254, 242, 242, 0.96));
}

.agenda-day-cell.carga-alta::after {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(251, 146, 60, 0.9));
}

.agenda-day-cell.carga-media {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.10), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 237, 0.96));
}

.agenda-day-cell.carga-media::after {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.95), rgba(250, 204, 21, 0.9));
}

.agenda-day-cell.carga-suave {
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.10), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 249, 255, 0.96));
}

.agenda-day-cell.carga-suave::after {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.95), rgba(59, 130, 246, 0.9));
}

.agenda-day-cell.carga-libre::after {
    background: linear-gradient(90deg, rgba(107, 114, 128, 0.6), rgba(75, 85, 99, 0.5));
}

.agenda-day-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.agenda-day-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-day-number {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #0f172a;
    background: rgba(226, 232, 240, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.agenda-day-add,
.agenda-inline-add,
.agenda-planning-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #475569;
}

.agenda-day-add {
    width: 28px;
    height: 28px;
}

.agenda-day-load {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: #64748b;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    padding: 5px 8px;
}

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

.agenda-day-load-dot.carga-alta {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.agenda-day-load-dot.carga-media {
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.agenda-day-load-dot.carga-suave {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.agenda-day-load-dot.carga-libre {
    background: var(--text-muted);
}

.agenda-day-stack,
.agenda-side-list,
.agenda-slot-list,
.agenda-day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-chip,
.agenda-week-event,
.agenda-side-item,
.agenda-slot-item,
.agenda-day-event {
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    transition: 0.2s ease;
}

.agenda-chip:hover,
.agenda-week-event:hover,
.agenda-side-item:hover,
.agenda-slot-item:hover,
.agenda-day-event:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
}

.agenda-chip {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    min-height: 36px;
    border-radius: 10px;
    padding: 7px 9px;
}

.agenda-chip-time {
    font-weight: 800;
    white-space: nowrap;
    color: #0f172a;
}

.agenda-chip-copy {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1e293b;
}

.agenda-more-link {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 700;
}

.agenda-day-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.agenda-day-empty {
    font-size: 0.78rem;
    color: #94a3b8;
}

.agenda-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
}

.agenda-week-column {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.agenda-week-column.is-today {
    border-color: rgba(34, 211, 238, 0.36);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.14);
}

.agenda-week-header {
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.agenda-week-title {
    font-weight: 800;
}

.agenda-week-date,
.agenda-week-event-meta,
.agenda-side-meta,
.agenda-planning-meta,
.agenda-day-meta,
.agenda-side-time {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.agenda-inline-add {
    padding: 7px 10px;
    margin-top: 10px;
    font-size: 0.8rem;
}

.agenda-week-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-week-event-time,
.agenda-day-time {
    font-weight: 800;
    margin-bottom: 4px;
}

.agenda-week-event-title,
.agenda-side-title {
    font-weight: 700;
}

.agenda-empty-slot,
.agenda-empty-side,
.agenda-empty-day,
.agenda-planning-empty {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.86rem;
}

.agenda-day-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.agenda-day-event {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.agenda-day-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.agenda-side-item.is-urgent {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.85);
}

.agenda-context-card {
    margin-bottom: 20px;
}

.agenda-context-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.agenda-context-copy {
    margin-top: 6px;
    color: var(--text-soft);
}

.agenda-slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.agenda-planning-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.agenda-planning-day {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.agenda-planning-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.agenda-planning-top span {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.agenda-planning-top strong {
    font-size: 1.15rem;
}

.agenda-planning-add {
    width: 100%;
    min-height: 36px;
    margin-bottom: 10px;
}

.agenda-planning-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.agenda-planning-chip {
    font-size: 0.78rem;
    border-radius: 10px;
    padding: 8px 10px;
}

.estado-warning {
    border-color: rgba(245, 158, 11, 0.18);
    background: rgba(254, 243, 199, 0.8);
}

.estado-info {
    border-color: rgba(59, 130, 246, 0.18);
    background: rgba(219, 234, 254, 0.8);
}

.estado-success {
    border-color: rgba(34, 197, 94, 0.18);
    background: rgba(220, 252, 231, 0.82);
}

.estado-danger {
    border-color: rgba(239, 68, 68, 0.18);
    background: rgba(254, 226, 226, 0.82);
}

@media (max-width: 1200px) {
    .agenda-layout,
    .agenda-form-layout {
        grid-template-columns: 1fr;
    }

    .agenda-sidebar,
    .agenda-form-sidebar {
        order: -1;
    }
}

@media (max-width: 1100px) {
    .agenda-kpi-grid,
    .agenda-planning-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .agenda-week-grid {
        grid-template-columns: 1fr;
    }

    .agenda-layout-month {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .agenda-month-grid-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .agenda-weekday-row {
        display: none;
    }

    .agenda-day-event {
        grid-template-columns: 1fr;
    }

    .agenda-kpi-grid,
    .agenda-planning-strip {
        grid-template-columns: 1fr;
    }

    .agenda-day-cell:nth-child(7n) {
        border-right: 1px solid var(--line);
    }

    .agenda-day-cell:nth-child(2n) {
        border-right: none;
    }

    .agenda-day-cell:nth-last-child(-n + 7) {
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 640px) {
    .agenda-month-grid-body {
        grid-template-columns: 1fr;
    }

    .agenda-day-cell {
        min-height: 160px;
    }

    .agenda-day-cell:nth-child(2n) {
        border-right: 1px solid var(--line);
    }

    .agenda-day-cell {
        border-right: none;
    }
}

/* Dashboard operativo */
.dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-hero {
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(17, 28, 52, 0.96), rgba(11, 18, 32, 0.94));
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.04), transparent 50%),
        radial-gradient(circle at 85% 20%, rgba(168, 85, 247, 0.16), transparent 18%);
    pointer-events: none;
}

.dashboard-hero .card-body {
    position: relative;
}

.dashboard-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 800;
}

.dashboard-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: start;
}

.dashboard-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.dashboard-hero-side {
    display: grid;
    gap: 12px;
}

.dashboard-hero-stat {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(6px);
}

.dashboard-hero-stat span {
    display: block;
    color: var(--text-soft);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.dashboard-hero-stat strong {
    font-size: 1.2rem;
}

.dashboard-alerts-card {
    border-left: 4px solid var(--warning);
}

.dashboard-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.dashboard-alert-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.18);
}

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

.dashboard-kpi-card {
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(17, 28, 52, 0.88), rgba(11, 18, 32, 0.92));
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dashboard-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.16);
}

.dashboard-kpi-label {
    color: var(--text-soft);
    font-size: 0.84rem;
    margin-bottom: 10px;
}

.dashboard-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.dashboard-kpi-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dashboard-kpi-green { box-shadow: inset 0 3px 0 #22c55e, var(--shadow); }
.dashboard-kpi-cyan { box-shadow: inset 0 3px 0 #06b6d4, var(--shadow); }
.dashboard-kpi-blue { box-shadow: inset 0 3px 0 #3b82f6, var(--shadow); }
.dashboard-kpi-orange { box-shadow: inset 0 3px 0 #f97316, var(--shadow); }
.dashboard-kpi-violet { box-shadow: inset 0 3px 0 #8b5cf6, var(--shadow); }
.dashboard-kpi-yellow { box-shadow: inset 0 3px 0 #eab308, var(--shadow); }

.dashboard-main-grid,
.dashboard-duo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.dashboard-mini-card {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.04);
}

.dashboard-mini-card span {
    display: block;
    color: var(--text-soft);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.dashboard-mini-card strong {
    font-size: 1.35rem;
}

.dashboard-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.dashboard-action-card {
    display: block;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    transition: transform 0.2s ease, background 0.2s ease;
}

.dashboard-action-card:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.06);
}

.dashboard-action-card strong {
    display: block;
    margin-bottom: 6px;
}

.dashboard-action-card span {
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.45;
}

.dashboard-chart-card,
.dashboard-search-card {
    margin-bottom: 20px;
}

.dashboard-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-section-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.2rem;
}

.dashboard-list-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.dashboard-list-item {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
}

.dashboard-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.dashboard-timeline-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
}

.dashboard-timeline-item strong {
    color: white;
}

.dashboard-timeline-item span {
    color: var(--text);
}

.dashboard-timeline-item small {
    color: var(--text-soft);
}

@media (max-width: 1280px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .dashboard-hero-grid,
    .dashboard-main-grid,
    .dashboard-duo-grid,
    .dashboard-quick-actions {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    .dashboard-kpi-grid,
    .dashboard-mini-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dashboard-shell .card {
    position: relative;
    overflow: hidden;
}

.dashboard-shell .card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.08), transparent 26%),
        radial-gradient(circle at right center, rgba(59, 130, 246, 0.08), transparent 22%);
    pointer-events: none;
}

.dashboard-shell .card-body {
    position: relative;
    z-index: 1;
}

.dashboard-hero {
    border: 1px solid rgba(255,255,255,0.08);
    background:
        linear-gradient(135deg, rgba(12, 21, 40, 0.98), rgba(19, 32, 60, 0.92)),
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
    box-shadow: 0 24px 60px rgba(3, 10, 24, 0.4);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    top: -160px;
    right: -80px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.16), transparent 68%);
    pointer-events: none;
}

.dashboard-hero .page-title {
    margin-bottom: 10px;
    font-size: clamp(2rem, 2.8vw, 3rem);
    letter-spacing: -0.03em;
}

.dashboard-hero .page-subtitle {
    max-width: 62ch;
    color: rgba(230, 238, 250, 0.78);
    font-size: 1rem;
    line-height: 1.7;
}

.dashboard-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.18);
}

.dashboard-hero-actions .btn {
    min-width: 152px;
}

.dashboard-hero-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.dashboard-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.dashboard-hero-actions .btn-secondary {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

.dashboard-hero-stat {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.dashboard-hero-stat::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), rgba(59, 130, 246, 0.85));
}

.dashboard-alerts-card {
    background: linear-gradient(135deg, rgba(41, 24, 4, 0.95), rgba(27, 18, 8, 0.96));
}

.dashboard-alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(245, 158, 11, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.dashboard-alert-item::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
    background: var(--warning);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.16);
}

.dashboard-kpi-card {
    position: relative;
    overflow: hidden;
}

.dashboard-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.dashboard-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
    opacity: 0.6;
    pointer-events: none;
}

.dashboard-kpi-card::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    right: -50px;
    top: -50px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
    pointer-events: none;
}

.dashboard-kpi-value {
    letter-spacing: -0.04em;
    color: white;
}

.dashboard-kpi-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dashboard-main-grid > .card,
.dashboard-chart-card,
.dashboard-search-card,
.dashboard-duo-grid > .card {
    background: linear-gradient(180deg, rgba(13, 21, 38, 0.96), rgba(11, 18, 32, 0.98));
}

.dashboard-block-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-head-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-section-title {
    letter-spacing: -0.02em;
}

.dashboard-mini-card,
.dashboard-action-card,
.dashboard-list-item,
.dashboard-timeline-item {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.dashboard-mini-card {
    min-height: 104px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
        rgba(255,255,255,0.03);
}

.dashboard-mini-card strong {
    letter-spacing: -0.03em;
}

.dashboard-action-card {
    min-height: 132px;
    justify-content: flex-end;
    background:
        linear-gradient(180deg, rgba(21, 37, 71, 0.65), rgba(15, 23, 42, 0.88));
}

.dashboard-action-card strong {
    font-size: 1.02rem;
    color: #fff;
}

.dashboard-action-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.16);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.dashboard-chart-card canvas {
    margin-top: 20px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
}

.dashboard-search-card form {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.dashboard-results-header {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.dashboard-result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-result-card {
    background: linear-gradient(180deg, rgba(18, 29, 50, 0.9), rgba(12, 20, 36, 0.92));
}

.dashboard-result-body {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.dashboard-list-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
        rgba(255,255,255,0.03);
}

.dashboard-list-item strong {
    color: #fff;
}

.dashboard-row-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-timeline-item {
    position: relative;
    padding-left: 18px;
}

.dashboard-timeline-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), #3b82f6);
}

@media (max-width: 1000px) {
    .dashboard-hero .page-title {
        font-size: 2.1rem;
    }
}

@media (max-width: 720px) {
    .dashboard-hero-actions .btn {
        width: 100%;
    }

    .dashboard-block-head,
    .dashboard-result-body {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-search-card form {
        padding: 14px;
    }
}

/* Modos de visualizacion global */
body.layout-force-desktop {
    overflow-x: auto;
}

body.layout-force-desktop .app-layout {
    min-width: 1240px;
    flex-direction: row;
}

body.layout-force-desktop .sidebar {
    position: fixed;
    width: var(--sidebar-width);
    height: 100vh;
    border-right: 1px solid var(--line);
    border-bottom: none;
}

body.layout-force-desktop .main-area {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

body.layout-force-desktop .topbar {
    padding: 0 28px;
    height: var(--topbar-height);
    flex-wrap: nowrap;
}

body.layout-force-desktop .page-content {
    padding: 28px;
}

body.layout-force-desktop .form-grid {
    grid-template-columns: 1fr 1fr;
}

body.layout-force-desktop .searchbar {
    max-width: 680px;
}

body.layout-force-compact .app-layout,
body.layout-auto-compact .app-layout {
    flex-direction: column;
}

body.layout-force-compact .sidebar,
body.layout-auto-compact .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    height: 100vh;
    border-right: 1px solid var(--line);
    border-bottom: none;
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    z-index: 40;
    padding: 18px 14px;
    overflow-y: auto;
}

body.layout-force-compact.sidebar-open .sidebar,
body.layout-auto-compact.sidebar-open .sidebar {
    transform: translateX(0);
}

body.layout-force-compact .sidebar-overlay,
body.layout-auto-compact .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 20, 0.62);
    backdrop-filter: blur(6px);
    z-index: 35;
}

body.layout-force-compact.sidebar-open .sidebar-overlay,
body.layout-auto-compact.sidebar-open .sidebar-overlay {
    display: block;
}

body.layout-force-compact .mobile-brand,
body.layout-auto-compact .mobile-brand {
    display: flex;
}

body.layout-force-compact .mobile-menu-toggle,
body.layout-auto-compact .mobile-menu-toggle {
    display: inline-flex;
}

body.layout-force-compact .topbar,
body.layout-auto-compact .topbar {
    padding: 12px 14px;
    min-height: auto;
    height: auto;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(8, 12, 20, 0.9);
    backdrop-filter: blur(16px);
}

body.layout-force-compact .main-area,
body.layout-auto-compact .main-area {
    margin-left: 0;
    width: 100%;
}

body.layout-force-compact .searchbar,
body.layout-auto-compact .searchbar {
    max-width: none;
    width: 100%;
    order: 3;
}

body.layout-force-compact .topbar-actions,
body.layout-auto-compact .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

body.layout-force-compact .topbar-config-btn,
body.layout-auto-compact .topbar-config-btn {
    min-width: auto;
    padding: 0 14px;
    min-height: 40px;
}

body.layout-force-compact .topbar-username,
body.layout-auto-compact .topbar-username {
    display: none;
}

body.layout-force-compact .topbar-logout-btn,
body.layout-auto-compact .topbar-logout-btn {
    min-width: auto;
    padding: 0 14px;
    min-height: 40px;
}

body.layout-force-compact .notifications-dropdown,
body.layout-auto-compact .notifications-dropdown {
    right: 0;
    left: auto;
    width: min(92vw, 360px);
}

body.layout-force-compact .mobile-quicknav,
body.layout-auto-compact .mobile-quicknav {
    display: none;
}

body.layout-pref-compacta .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    height: 100vh;
    border-right: 1px solid var(--line);
    border-bottom: none;
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    z-index: 40;
    padding: 18px 14px;
    overflow-y: auto;
}

body.layout-pref-compacta.sidebar-open .sidebar {
    transform: translateX(0);
}

body.layout-pref-compacta .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 20, 0.62);
    backdrop-filter: blur(6px);
    z-index: 35;
}

body.layout-pref-compacta.sidebar-open .sidebar-overlay {
    display: block;
}

body.layout-pref-compacta .mobile-brand,
body.layout-pref-compacta .mobile-menu-toggle {
    display: inline-flex;
}

body.layout-pref-compacta .sidebar {
    display: flex;
}

body.layout-pref-compacta .main-area {
    margin-left: 0;
    width: 100%;
}

body.layout-pref-compacta .topbar {
    padding: 12px 14px;
    min-height: auto;
    height: auto;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(8, 12, 20, 0.9);
    backdrop-filter: blur(16px);
}

body.layout-pref-compacta .searchbar {
    max-width: none;
    width: 100%;
    order: 3;
}

body.layout-pref-compacta .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

body.layout-pref-compacta .topbar-username {
    display: none;
}

body.layout-pref-compacta .page-content {
    padding: 14px 14px 28px;
}

body.layout-pref-compacta .form-grid {
    grid-template-columns: 1fr;
}

body.layout-pref-compacta .actions {
    flex-direction: column;
    align-items: stretch;
}

body.layout-pref-compacta .actions .btn {
    width: 100%;
}

body.layout-pref-compacta .card-body {
    padding: 16px;
}

body.layout-pref-compacta .page-title {
    font-size: 1.55rem;
    line-height: 1.15;
}

body.layout-pref-compacta .page-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    body.layout-pref-auto .sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 320px);
        height: 100vh;
        border-right: 1px solid var(--line);
        border-bottom: none;
        transform: translateX(-105%);
        transition: transform 0.24s ease;
        z-index: 40;
        padding: 18px 14px;
        overflow-y: auto;
    }

    body.layout-pref-auto.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.layout-pref-auto .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(2, 8, 20, 0.62);
        backdrop-filter: blur(6px);
        z-index: 35;
    }

    body.layout-pref-auto.sidebar-open .sidebar-overlay {
        display: block;
    }

    body.layout-pref-auto .mobile-brand,
    body.layout-pref-auto .mobile-menu-toggle {
        display: inline-flex;
    }

    body.layout-pref-auto .main-area {
        margin-left: 0;
        width: 100%;
    }

    body.layout-pref-auto .topbar {
        padding: 12px 14px;
        min-height: auto;
        height: auto;
        flex-wrap: wrap;
        gap: 12px;
        background: rgba(8, 12, 20, 0.9);
        backdrop-filter: blur(16px);
    }

    body.layout-pref-auto .searchbar {
        max-width: none;
        width: 100%;
        order: 3;
    }

    body.layout-pref-auto .topbar-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    body.layout-pref-auto .topbar-username {
        display: none;
    }

    body.layout-pref-auto .page-content {
        padding: 14px 14px 28px;
    }

    body.layout-pref-auto .form-grid {
        grid-template-columns: 1fr;
    }

    body.layout-pref-auto .actions {
        flex-direction: column;
        align-items: stretch;
    }

    body.layout-pref-auto .actions .btn {
        width: 100%;
    }

    body.layout-pref-auto .card-body {
        padding: 16px;
    }

    body.layout-pref-auto .page-title {
        font-size: 1.55rem;
        line-height: 1.15;
    }

    body.layout-pref-auto .page-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

body.layout-force-compact .page-content,
body.layout-auto-compact .page-content {
    padding: 14px 14px 28px;
}

body.layout-force-compact .form-grid,
body.layout-auto-compact .form-grid {
    grid-template-columns: 1fr;
}

body.layout-force-compact .table-wrap,
body.layout-auto-compact .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.layout-force-compact .actions,
body.layout-auto-compact .actions {
    flex-direction: column;
    align-items: stretch;
}

body.layout-force-compact .actions .btn,
body.layout-auto-compact .actions .btn {
    width: 100%;
}

body.layout-force-compact .card-body,
body.layout-auto-compact .card-body {
    padding: 16px;
}

body.layout-force-compact .page-title,
body.layout-auto-compact .page-title {
    font-size: 1.55rem;
    line-height: 1.15;
}

body.layout-force-compact .page-subtitle,
body.layout-auto-compact .page-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
}

body.layout-force-compact input,
body.layout-auto-compact input,
body.layout-force-compact select,
body.layout-auto-compact select,
body.layout-force-compact textarea,
body.layout-auto-compact textarea {
    font-size: 16px;
}

body.layout-force-compact .btn,
body.layout-auto-compact .btn {
    min-height: 46px;
}

body.layout-force-compact .table th,
body.layout-auto-compact .table th,
body.layout-force-compact .table td,
body.layout-auto-compact .table td {
    padding: 12px 10px;
    font-size: 0.88rem;
}

.seguimiento-board-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.seguimiento-board-summary .card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.seguimiento-board-summary strong {
    font-size: 1.15rem;
    color: #fff;
}

.seguimiento-board-summary span {
    color: var(--text-soft);
}

.seguimiento-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(260px, 1fr));
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.seguimiento-column {
    min-width: 260px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(12, 20, 36, 0.96), rgba(8, 13, 24, 0.98));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
}

.seguimiento-column-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.seguimiento-column-head h2 {
    margin: 0;
    font-size: 1.02rem;
    color: #fff;
}

.seguimiento-column-head p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.seguimiento-column-badge {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.seguimiento-column-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.seguimiento-card {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    overflow: hidden;
}

.seguimiento-draggable {
    cursor: grab;
}

.seguimiento-draggable.is-dragging {
    opacity: 0.45;
    transform: rotate(1deg) scale(0.99);
}

.seguimiento-card-main {
    display: block;
    padding: 16px;
}

.seguimiento-card-cover {
    margin: -16px -16px 14px;
    height: 144px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.10), rgba(37, 99, 235, 0.12)),
        rgba(8, 13, 24, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.seguimiento-card-cover-photo {
    padding: 0;
}

.seguimiento-card-cover-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.seguimiento-card-cover-empty {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 14px;
}

/* Navegacion de retorno compartida */
.app-backbar {
    padding: 14px 30px 0;
}

.app-back-button {
    min-height: 38px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(184, 197, 213, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(230, 237, 245, 0.9);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.app-back-button:hover,
.app-back-button:focus-visible {
    border-color: rgba(38, 200, 230, 0.35);
    background: rgba(38, 200, 230, 0.08);
    color: #ffffff;
}

.app-back-button:focus-visible {
    outline: 2px solid rgba(38, 200, 230, 0.3);
    outline-offset: 2px;
}

.app-back-icon {
    font-size: 1.15rem;
    line-height: 1;
}

@media (max-width: 760px) {
    .app-backbar {
        padding: 10px 18px 0;
    }
}

body.layout-force-compact .app-backbar,
body.layout-auto-compact .app-backbar,
body.layout-pref-compacta .app-backbar {
    padding: 10px 14px 0;
}

/* Vista previa de documentos dentro de la aplicacion */
.document-preview-page .app-backbar {
    display: none;
}

.document-preview-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.document-preview-header .page-subtitle {
    margin-bottom: 0;
}

.document-preview-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.document-preview-surface {
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(184, 197, 213, 0.16);
    border-radius: 8px;
    background: #ffffff;
}

.document-preview-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
}

.document-preview-floating-return {
    display: none;
}

.document-preview-share { display: none; }
.document-preview-pages { display: grid; gap: 16px; padding: 12px; background: #e4e7eb; }
.document-preview-page-sheet { margin: 0 auto; width: 100%; max-width: 1100px; background: white; }
.document-preview-page-image { display: block; width: 100%; height: auto; }
.document-preview-empty { padding: 24px; color: #17212b; }
.document-preview-empty span { display: block; margin-top: 8px; }
.document-preview-action-status.is-error { color: #fca5a5; }

/* Visor privado de fotografias y documentos */
.private-file-preview {
    width: 100%;
    min-height: min(680px, calc(100vh - 280px));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    border: 1px solid rgba(184, 197, 213, 0.16);
    border-radius: 8px;
    background: rgba(5, 10, 18, 0.78);
}

.private-file-preview-image {
    padding: 16px;
}

.private-file-preview-image img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 310px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.private-file-preview-document {
    height: max(620px, calc(100vh - 280px));
    min-height: 620px;
    padding: 0;
    background: #ffffff;
}

.private-file-preview-document iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

@media (max-width: 760px) {
    .document-preview-header {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .document-preview-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-preview-return {
        display: none !important;
    }
    .document-preview-download { display: none !important; }
    .document-preview-share { display: inline-flex; }

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

    .document-preview-surface {
        height: auto;
        min-height: 0;
        padding: 0;
    }

    .document-preview-page .page-content {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    .document-preview-floating-return {
        position: fixed;
        z-index: 1600;
        right: 16px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        left: 16px;
        min-height: 50px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        border: 1px solid rgba(103, 232, 249, 0.42);
        border-radius: 8px;
        background: #0f7f98;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
        color: #ffffff;
        font-size: 0.96rem;
        font-weight: 800;
        text-decoration: none;
    }

    .private-file-preview {
        min-height: calc(100vh - 310px);
    }

    .private-file-preview-image {
        min-height: 0;
        padding: 8px;
    }

    .private-file-preview-image img {
        max-height: calc(100vh - 330px);
    }

    .private-file-preview-document {
        height: calc(100vh - 330px);
        min-height: 480px;
    }

    .private-file-preview-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    @supports (height: 100dvh) {
        .private-file-preview-document {
            height: calc(100dvh - 330px);
        }
    }
}

@media print {
    @page { size: auto; margin: 0; }
    body.document-preview-page { background: white !important; }
    .document-preview-page .sidebar,
    .document-preview-page .sidebar-overlay,
    .document-preview-page .topbar,
    .document-preview-page .mobile-quicknav,
    .document-preview-page .app-backbar,
    .document-preview-page .assistant-widget,
    .document-preview-page .messages,
    .document-preview-header,
    .document-preview-action-status,
    .document-preview-floating-return,
    .document-preview-notice { display: none !important; }
    .document-preview-page .app-layout,
    .document-preview-page .main-area,
    .document-preview-page .page-content,
    .document-preview-root { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
    .document-preview-surface { display: block; padding: 0; border: 0; border-radius: 0; background: white; overflow: visible; }
    .document-preview-page-sheet { max-width: none; break-after: page; page-break-after: always; }
    .document-preview-page-sheet:last-child { break-after: auto; page-break-after: auto; }
    .document-preview-page-image { max-height: 100vh; object-fit: contain; }
}

.seguimiento-card-cover-empty span {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(7, 12, 23, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

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

.seguimiento-ref {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.06em;
}

.seguimiento-card-cliente {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
}

.seguimiento-card-vehiculo {
    margin-top: 4px;
    color: #dbeafe;
    font-size: 0.92rem;
    line-height: 1.45;
}

.seguimiento-card-meta {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.seguimiento-meta-label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.seguimiento-card-meta strong,
.seguimiento-card-update strong {
    color: #fff;
}

.seguimiento-card-update {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.seguimiento-card-update p {
    margin: 8px 0 6px;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}

.seguimiento-card-update small {
    color: var(--text-muted);
}

.seguimiento-card-update-empty {
    color: var(--text-soft);
}

.seguimiento-card-actions {
    padding: 0 16px 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.seguimiento-card-actions .btn {
    flex: 1;
    min-width: 110px;
}

.seguimiento-empty-column {
    padding: 20px 16px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.03);
}

.seguimiento-dropzone.is-drop-target {
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12), 0 24px 60px rgba(0, 0, 0, 0.28);
}

.seguimiento-column.estado-pendiente .seguimiento-column-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.seguimiento-column.estado-en_proceso .seguimiento-column-badge {
    background: rgba(34, 211, 238, 0.2);
    color: #67e8f9;
}

.seguimiento-column.estado-pausada .seguimiento-column-badge,
.seguimiento-column.estado-cancelada .seguimiento-column-badge {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

.seguimiento-column.estado-finalizada .seguimiento-column-badge,
.seguimiento-column.estado-entregada .seguimiento-column-badge {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

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

    .seguimiento-board {
        grid-template-columns: repeat(6, minmax(280px, 1fr));
    }
}

body.layout-force-compact .cliente-search-shell,
body.layout-auto-compact .cliente-search-shell,
body.layout-pref-compacta .cliente-search-shell,
body.layout-pref-auto .cliente-search-shell {
    flex-direction: column;
    align-items: stretch;
}

body.layout-force-compact .cliente-native-wrap,
body.layout-auto-compact .cliente-native-wrap,
body.layout-pref-compacta .cliente-native-wrap {
    display: none;
}

body.layout-force-compact .cliente-search-wrap,
body.layout-auto-compact .cliente-search-wrap,
body.layout-pref-compacta .cliente-search-wrap {
    display: none;
}

body.layout-force-compact .cliente-mobile-search,
body.layout-auto-compact .cliente-mobile-search,
body.layout-pref-compacta .cliente-mobile-search {
    display: flex;
}

body.layout-force-compact .cliente-search-shell .btn,
body.layout-auto-compact .cliente-search-shell .btn,
body.layout-pref-compacta .cliente-search-shell .btn,
body.layout-pref-auto .cliente-search-shell .btn {
    width: 100%;
}

body.layout-force-compact .cliente-search-results,
body.layout-auto-compact .cliente-search-results,
body.layout-pref-compacta .cliente-search-results,
body.layout-pref-auto .cliente-search-results {
    position: static !important;
    margin-top: 10px !important;
    max-height: 220px !important;
}

@media (max-width: 1024px) {
    body.layout-pref-auto .cliente-search-wrap {
        display: none;
    }

    body.layout-pref-auto .cliente-native-wrap {
        display: none;
    }

    body.layout-pref-auto .cliente-mobile-search {
        display: flex;
    }
}

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

.workflow-steps-compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.workflow-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
}

.workflow-step strong {
    display: block;
    color: #fff;
    margin-bottom: 4px;
}

.workflow-step-index {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    background: rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
}

.workflow-step.is-complete {
    border-color: rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.08);
}

.workflow-step.is-complete .workflow-step-index {
    background: rgba(34, 197, 94, 0.22);
    color: #86efac;
}

.workflow-step.is-active {
    border-color: rgba(34, 211, 238, 0.22);
    background: rgba(34, 211, 238, 0.08);
}

.workflow-step.is-active .workflow-step-index {
    background: rgba(34, 211, 238, 0.18);
    color: #67e8f9;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.workflow-entry-card {
    display: block;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(17, 28, 52, 0.92), rgba(11, 18, 32, 0.96));
    color: inherit;
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
    box-shadow: var(--shadow);
}

.workflow-entry-card:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.24);
}

.workflow-entry-card h2 {
    margin: 6px 0 10px;
    font-size: 1.2rem;
    color: #fff;
}

.workflow-entry-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.workflow-entry-eyebrow,
.workflow-entry-link {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workflow-entry-eyebrow {
    color: var(--text-muted);
}

.workflow-entry-link {
    display: inline-flex;
    margin-top: 16px;
    color: var(--primary);
}

.workflow-entry-card.accent-cyan { box-shadow: inset 0 3px 0 #06b6d4, var(--shadow); }
.workflow-entry-card.accent-blue { box-shadow: inset 0 3px 0 #3b82f6, var(--shadow); }
.workflow-entry-card.accent-green { box-shadow: inset 0 3px 0 #22c55e, var(--shadow); }
.workflow-entry-card.accent-orange { box-shadow: inset 0 3px 0 #f97316, var(--shadow); }
.workflow-entry-card.accent-violet { box-shadow: inset 0 3px 0 #8b5cf6, var(--shadow); }
.workflow-entry-card.accent-slate { box-shadow: inset 0 3px 0 #94a3b8, var(--shadow); }

.seguimiento-card-actions form {
    margin: 0;
    flex: 1;
}

.seguimiento-card-actions form .btn {
    width: 100%;
}

/* =========================================================
   WePDR Brand Refresh · 2026
   Paleta basada en logo oficial: grafito + acero + cian
========================================================= */
:root {
    --bg: #06090d;
    --bg-soft: #0c1118;
    --panel: #121923;
    --panel-2: #17212d;
    --panel-3: #1b2734;
    --line: rgba(173, 186, 201, 0.12);
    --line-strong: rgba(173, 186, 201, 0.22);

    --text: #eef3f8;
    --text-soft: #a8b7c8;
    --text-muted: #728091;

    --primary: #26c8e6;
    --primary-strong: #159dbb;
    --primary-soft: rgba(38, 200, 230, 0.14);
    --primary-glow: rgba(38, 200, 230, 0.24);
    --steel: #b8c5d5;
    --steel-strong: #d8e0ea;
    --warning: #f0a646;
    --danger: #ec6e67;
    --success: #39c38d;

    --shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.22);
    --radius: 20px;
    --radius-sm: 14px;
}

body {
    background:
        radial-gradient(circle at top left, rgba(38, 200, 230, 0.12), transparent 28%),
        radial-gradient(circle at 85% 0%, rgba(184, 197, 213, 0.08), transparent 24%),
        linear-gradient(180deg, #05080c 0%, #0b1118 42%, #0d141d 100%);
    color: var(--text);
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(13, 18, 26, 0.98), rgba(17, 24, 35, 0.99)),
        linear-gradient(180deg, rgba(38, 200, 230, 0.03), transparent 32%);
    border-right: 1px solid rgba(184, 197, 213, 0.10);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.28);
}

.logo-box {
    min-height: 78px;
    padding: 14px 14px 22px 14px;
    border-bottom: 1px solid rgba(184, 197, 213, 0.10);
}

.logo-fullmark-image {
    width: 184px;
    max-width: 100%;
    filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.22));
}

.nav-section-title {
    color: rgba(168, 183, 200, 0.62);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    padding-top: 14px;
}

.nav-link {
    min-height: 46px;
    padding: 13px 15px;
    color: #cad4df;
    border: 1px solid transparent;
    border-radius: 16px;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-link:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
    border-color: rgba(184, 197, 213, 0.12);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(38, 200, 230, 0.18), rgba(38, 200, 230, 0.06));
    border-color: rgba(38, 200, 230, 0.26);
    box-shadow: inset 3px 0 0 var(--primary), 0 14px 30px rgba(0, 0, 0, 0.20);
}

.topbar {
    background: rgba(8, 12, 18, 0.78);
    border-bottom: 1px solid rgba(184, 197, 213, 0.08);
    backdrop-filter: blur(16px);
}

.searchbar input {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.025));
    border: 1px solid rgba(184, 197, 213, 0.12);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.searchbar input::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(168, 183, 200, 0.62);
}

.searchbar input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(38, 200, 230, 0.36);
    box-shadow: 0 0 0 4px rgba(38, 200, 230, 0.08), 0 12px 30px rgba(0, 0, 0, 0.14);
}

.circle-btn {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
    border-color: rgba(184, 197, 213, 0.12);
    color: var(--steel);
}

.page-content {
    background:
        radial-gradient(circle at top left, rgba(38, 200, 230, 0.035), transparent 18%),
        transparent;
}

.card,
.stat-card,
.timeline-card,
.dashboard-kpi-card,
.dashboard-mini-card,
.dashboard-action-card,
.agenda-kpi-card,
.agenda-context-card,
.agenda-side-item,
.agenda-day-event,
.agenda-slot-item,
.seguimiento-card,
.workflow-entry-card {
    background:
        linear-gradient(180deg, rgba(23, 33, 45, 0.94), rgba(15, 22, 31, 0.96));
    border: 1px solid rgba(184, 197, 213, 0.12);
    box-shadow: var(--shadow-soft);
}

.card,
.dashboard-kpi-card,
.dashboard-action-card,
.seguimiento-card,
.workflow-entry-card,
.timeline-card {
    backdrop-filter: blur(10px);
}

.card:hover,
.dashboard-kpi-card:hover,
.dashboard-action-card:hover,
.timeline-card:hover,
.seguimiento-card:hover,
.workflow-entry-card:hover {
    border-color: rgba(38, 200, 230, 0.18);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.28);
}

.btn {
    border-radius: 14px;
    min-height: 46px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #031217;
    box-shadow: 0 16px 32px rgba(21, 157, 187, 0.28);
}

.btn-primary:hover {
    box-shadow: 0 18px 36px rgba(21, 157, 187, 0.34);
}

.btn-secondary {
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
    border-color: rgba(184, 197, 213, 0.14);
    color: var(--steel-strong);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.04));
    border-color: rgba(184, 197, 213, 0.22);
}

.btn-danger {
    background: linear-gradient(180deg, rgba(236, 110, 103, 0.18), rgba(236, 110, 103, 0.12));
    border-color: rgba(236, 110, 103, 0.24);
    color: #ffd8d5;
}

.stats-grid {
    gap: 18px;
}

.stat-card {
    padding: 20px;
    border-radius: 18px;
}

.stat-value,
.dashboard-kpi-value {
    letter-spacing: -0.03em;
}

.table-wrap {
    border-radius: 18px;
    border: 1px solid rgba(184, 197, 213, 0.08);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    background: rgba(8, 12, 18, 0.28);
}

.worklog-table-wrap {
    overflow: hidden;
}

.worklog-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.worklog-table th,
.worklog-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
    padding: 14px 10px;
    font-size: 0.88rem;
    line-height: 1.35;
}

.worklog-table th {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}

.worklog-table th:nth-child(1),
.worklog-table td:nth-child(1) {
    width: 42px;
}

.worklog-table th:nth-child(2),
.worklog-table td:nth-child(2) {
    width: 11%;
}

.worklog-table th:nth-child(3),
.worklog-table td:nth-child(3) {
    width: 14%;
}

.worklog-table th:nth-child(4),
.worklog-table td:nth-child(4) {
    width: 17%;
}

.worklog-table th:nth-child(5),
.worklog-table td:nth-child(5) {
    width: 12%;
}

.worklog-table th:nth-child(6),
.worklog-table td:nth-child(6) {
    width: 11%;
}

.worklog-table th:nth-child(7),
.worklog-table td:nth-child(7) {
    width: 13%;
}

.worklog-table th:nth-child(8),
.worklog-table td:nth-child(8) {
    width: 12%;
}

.worklog-table th:nth-child(9),
.worklog-table td:nth-child(9) {
    width: 10%;
}

.worklog-table .actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.worklog-table .actions .btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.84rem;
}

.table {
    background: transparent;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.table th,
.table td {
    border-bottom: 1px solid rgba(184, 197, 213, 0.08);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
    padding: 14px 10px;
    font-size: 0.88rem;
    line-height: 1.35;
}

.table th {
    background: rgba(255,255,255,0.03);
    color: #b7c5d5;
    font-size: 0.74rem;
    letter-spacing: 0.1em;
}

.table td {
    color: #edf3f8;
}

.table .actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.table .actions .btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.84rem;
}

.table .badge {
    max-width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
}

.table tbody tr {
    transition: background 0.18s ease;
}

.table tbody tr:hover {
    background: rgba(38, 200, 230, 0.05);
}

label {
    color: #d8e2ec;
    font-weight: 700;
}

input,
select,
textarea {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.025));
    border: 1px solid rgba(184, 197, 213, 0.12);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

select option {
    background: #111923;
}

.badge {
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.badge-warning {
    background: rgba(240, 166, 70, 0.14);
    color: #ffd195;
    border-color: rgba(240, 166, 70, 0.22);
}

.badge-success {
    background: rgba(57, 195, 141, 0.14);
    color: #a7f3d0;
    border-color: rgba(57, 195, 141, 0.22);
}

.badge-danger {
    background: rgba(236, 110, 103, 0.14);
    color: #ffd1cd;
    border-color: rgba(236, 110, 103, 0.22);
}

.badge-info {
    background: rgba(38, 200, 230, 0.12);
    color: #9ce9f7;
    border-color: rgba(38, 200, 230, 0.22);
}

.messages .success,
.alert-success {
    background: rgba(57, 195, 141, 0.14);
    border-color: rgba(57, 195, 141, 0.22);
}

.messages .error,
.alert-danger {
    background: rgba(236, 110, 103, 0.14);
    border-color: rgba(236, 110, 103, 0.22);
}

.messages .warning,
.alert-warning {
    background: rgba(240, 166, 70, 0.14);
    border-color: rgba(240, 166, 70, 0.22);
}

.messages .info,
.alert-info {
    background: rgba(38, 200, 230, 0.12);
    border-color: rgba(38, 200, 230, 0.22);
}

.timeline::before {
    background: linear-gradient(180deg, rgba(38, 200, 230, 0.24), rgba(184, 197, 213, 0.08));
}

.timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 0 5px rgba(38, 200, 230, 0.12);
}

.agenda-hero,
.dashboard-hero {
    background:
        radial-gradient(circle at top left, rgba(38, 200, 230, 0.16), transparent 24%),
        radial-gradient(circle at top right, rgba(184, 197, 213, 0.10), transparent 24%),
        linear-gradient(180deg, rgba(23, 33, 45, 0.98), rgba(12, 18, 26, 0.96));
    border: 1px solid rgba(184, 197, 213, 0.10);
}

.dashboard-hero::before,
.agenda-hero::before {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.03), transparent 48%),
        radial-gradient(circle at 82% 18%, rgba(38, 200, 230, 0.12), transparent 18%);
}

.dashboard-alert-item {
    background: rgba(240, 166, 70, 0.10);
    border-color: rgba(240, 166, 70, 0.18);
}

.dashboard-kpi-green { box-shadow: inset 0 3px 0 #39c38d, var(--shadow-soft); }
.dashboard-kpi-cyan { box-shadow: inset 0 3px 0 #26c8e6, var(--shadow-soft); }
.dashboard-kpi-blue { box-shadow: inset 0 3px 0 #79b8d2, var(--shadow-soft); }
.dashboard-kpi-orange { box-shadow: inset 0 3px 0 #f0a646, var(--shadow-soft); }
.dashboard-kpi-violet { box-shadow: inset 0 3px 0 #b8c5d5, var(--shadow-soft); }
.dashboard-kpi-yellow { box-shadow: inset 0 3px 0 #e6c56c, var(--shadow-soft); }

.agenda-view-switch {
    background: rgba(255,255,255,0.04);
    border-color: rgba(184, 197, 213, 0.12);
}

.agenda-view-pill {
    color: #b7c5d4;
}

.agenda-view-pill.is-active {
    background: linear-gradient(135deg, rgba(38, 200, 230, 0.22), rgba(21, 157, 187, 0.14));
    border-color: rgba(38, 200, 230, 0.24);
}

.agenda-kpi-card,
.dashboard-hero-stat {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
    border-color: rgba(184, 197, 213, 0.10);
}

.agenda-month-shell {
    background: linear-gradient(180deg, rgba(17, 25, 35, 0.98), rgba(11, 18, 26, 0.96));
    border: 1px solid rgba(184, 197, 213, 0.10);
    box-shadow: var(--shadow);
}

.agenda-month-card {
    background: linear-gradient(180deg, rgba(20, 29, 40, 0.98), rgba(12, 18, 26, 0.96));
    border-color: rgba(184, 197, 213, 0.10);
}

.agenda-month-title {
    color: #eef3f8;
}

.agenda-month-subtitle,
.agenda-weekday-row div,
.agenda-day-meta,
.agenda-week-date,
.agenda-week-event-meta,
.agenda-side-meta,
.agenda-side-time,
.agenda-planning-meta {
    color: #8fa0b3;
}

.agenda-weekday-row {
    background: rgba(255,255,255,0.04);
    border-bottom-color: rgba(184, 197, 213, 0.10);
}

.agenda-weekday-row div {
    border-right-color: rgba(184, 197, 213, 0.08);
}

.agenda-day-cell {
    background: linear-gradient(180deg, rgba(18, 25, 35, 0.92), rgba(12, 18, 26, 0.96));
    border-right: 1px solid rgba(184, 197, 213, 0.08);
    border-bottom: 1px solid rgba(184, 197, 213, 0.08);
}

.agenda-day-cell::after {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent);
}

.agenda-day-cell.is-muted {
    background: linear-gradient(180deg, rgba(14, 19, 27, 0.9), rgba(10, 14, 20, 0.95));
}

.agenda-day-cell.is-today {
    border-color: rgba(38, 200, 230, 0.28);
    box-shadow: inset 0 0 0 1px rgba(38, 200, 230, 0.16);
}

.agenda-day-number {
    color: #edf3f8;
}

.agenda-chip,
.agenda-week-event,
.agenda-slot-item,
.agenda-day-event,
.agenda-side-item,
.agenda-planning-chip {
    background: linear-gradient(180deg, rgba(38, 200, 230, 0.14), rgba(184, 197, 213, 0.08));
    border: 1px solid rgba(38, 200, 230, 0.18);
    color: #eff8fb;
}

.agenda-chip:hover,
.agenda-week-event:hover,
.agenda-slot-item:hover,
.agenda-day-event:hover,
.agenda-side-item:hover,
.agenda-planning-chip:hover {
    background: linear-gradient(180deg, rgba(38, 200, 230, 0.18), rgba(184, 197, 213, 0.10));
}

.seguimiento-board-summary .card-body {
    background: linear-gradient(180deg, rgba(23, 33, 45, 0.96), rgba(14, 20, 28, 0.98));
}

.seguimiento-column {
    background: linear-gradient(180deg, rgba(17, 24, 34, 0.92), rgba(11, 17, 25, 0.94));
    border: 1px solid rgba(184, 197, 213, 0.10);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
}

.seguimiento-column-head {
    border-bottom: 1px solid rgba(184, 197, 213, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}

.seguimiento-column-badge {
    background: rgba(38, 200, 230, 0.14);
    border: 1px solid rgba(38, 200, 230, 0.18);
    color: #a8eef9;
}

.seguimiento-card-cover {
    background-color: #101721;
}

.seguimiento-card-update {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(184, 197, 213, 0.08);
}

.workflow-step.is-active {
    border-color: rgba(38, 200, 230, 0.24);
    background: rgba(38, 200, 230, 0.08);
}

.workflow-step.is-active .workflow-step-index {
    background: rgba(38, 200, 230, 0.18);
}

.workflow-entry-card.accent-cyan { box-shadow: inset 0 3px 0 #26c8e6, var(--shadow-soft); }
.workflow-entry-card.accent-blue { box-shadow: inset 0 3px 0 #79b8d2, var(--shadow-soft); }
.workflow-entry-card.accent-green { box-shadow: inset 0 3px 0 #39c38d, var(--shadow-soft); }
.workflow-entry-card.accent-orange { box-shadow: inset 0 3px 0 #f0a646, var(--shadow-soft); }
.workflow-entry-card.accent-violet { box-shadow: inset 0 3px 0 #b8c5d5, var(--shadow-soft); }
.workflow-entry-card.accent-slate { box-shadow: inset 0 3px 0 #8ea0b5, var(--shadow-soft); }

.presupuesto-board-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
}

.presupuesto-board-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.presupuesto-board-table .col-parte { width: 19%; }
.presupuesto-board-table .col-abolladuras { width: 16%; }
.presupuesto-board-table .col-tamano { width: 9%; }
.presupuesto-board-table .col-material { width: 10%; }
.presupuesto-board-table .col-acabado { width: 10%; }
.presupuesto-board-table .col-observaciones { width: 20%; }
.presupuesto-board-table .col-precio { width: 16%; }

.presupuesto-board-table th,
.presupuesto-board-table td {
    vertical-align: middle;
    padding: 12px 10px;
}

.presupuesto-board-table .parte-cell strong {
    display: block;
    line-height: 1.3;
    word-break: break-word;
}

.presupuesto-board-table select,
.presupuesto-board-table input,
.presupuesto-board-table textarea {
    width: 100%;
    min-width: 0;
    font-size: 0.95rem;
    padding: 10px 12px;
}

.presupuesto-board-table textarea {
    min-height: 44px;
    resize: vertical;
}

.presupuesto-board-table .sticky-col,
.presupuesto-board-table .sticky-price-col {
    background: #111c34;
}

/* Barra superior limpia */
.topbar {
    min-height: 72px;
    background:
        linear-gradient(180deg, rgba(10, 15, 22, 0.92), rgba(8, 12, 18, 0.82));
    border-bottom: 1px solid rgba(184, 197, 213, 0.10);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    padding: 6px;
    border: 1px solid rgba(184, 197, 213, 0.11);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 36px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(14px);
}

.topbar-actions .language-switcher,
.topbar-userbox,
.notifications-trigger {
    min-height: 42px;
    border: 1px solid rgba(184, 197, 213, 0.12);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(13, 20, 29, 0.88), rgba(9, 14, 21, 0.78));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.topbar-actions .language-switcher:hover,
.topbar-userbox:hover,
.notifications-trigger:hover,
.notifications-menu[open] .notifications-trigger {
    border-color: rgba(38, 200, 230, 0.26);
    background:
        linear-gradient(180deg, rgba(38, 200, 230, 0.10), rgba(9, 14, 21, 0.78));
}

.notifications-trigger {
    width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.notifications-icon,
.user-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: 0;
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1;
}

.notifications-icon {
    position: relative;
    color: #d9f7fc;
    background: rgba(38, 200, 230, 0.12);
}

.notifications-icon::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(38, 200, 230, 0.14);
}

.notifications-badge {
    top: -4px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    border: 2px solid #0b1118;
    background: linear-gradient(135deg, #ec6e67, #f0a646);
    color: #170b07;
    font-size: 10px;
    font-weight: 900;
}

.notifications-dropdown {
    top: 52px;
    right: -6px;
    background:
        linear-gradient(180deg, rgba(18, 27, 39, 0.98), rgba(10, 15, 22, 0.98));
    border: 1px solid rgba(184, 197, 213, 0.14);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.notifications-header {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(184, 197, 213, 0.10);
}

.notifications-header strong {
    color: var(--steel-strong);
}

.notifications-header span {
    color: var(--text-soft);
    opacity: 1;
}

.notification-item,
.notifications-empty {
    border-color: rgba(184, 197, 213, 0.10);
    background: rgba(255, 255, 255, 0.035);
}

.notification-item:hover {
    border-color: rgba(38, 200, 230, 0.24);
    background: rgba(38, 200, 230, 0.075);
}

.topbar-actions .language-switcher {
    width: auto;
    padding: 5px 10px 5px 12px;
}

.topbar-actions .language-switcher-title,
.topbar-user-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
}

.topbar-actions .language-select-wrap {
    min-width: 142px;
}

.topbar-actions .language-select {
    height: 32px;
    min-height: 32px;
    min-width: 142px;
    border: 1px solid rgba(184, 197, 213, 0.10);
    border-radius: 10px;
    background-color: rgba(3, 7, 12, 0.34);
    color: var(--steel-strong);
}

.topbar-actions .language-select:focus {
    outline: none;
}

.topbar-userbox {
    padding: 4px;
    gap: 9px;
}

.user-avatar {
    background: linear-gradient(135deg, var(--primary), var(--steel-strong));
    color: #041217;
    text-align: center;
}

.topbar-user-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding-right: 4px;
}

.topbar-username {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
    opacity: 1;
    line-height: 1.1;
}

.topbar-logout-form {
    width: auto;
    margin: 0;
}

.topbar-logout-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    box-shadow: none;
}

.topbar-logout-btn:hover {
    transform: none;
}

body.layout-force-compact .topbar-actions,
body.layout-auto-compact .topbar-actions,
body.layout-pref-compacta .topbar-actions {
    align-items: center;
    padding: 6px;
    border-radius: 16px;
}

body.layout-force-compact .topbar-actions .language-switcher,
body.layout-auto-compact .topbar-actions .language-switcher,
body.layout-pref-compacta .topbar-actions .language-switcher {
    flex: 1 1 190px;
}

body.layout-force-compact .topbar-user-meta,
body.layout-auto-compact .topbar-user-meta,
body.layout-pref-compacta .topbar-user-meta {
    display: none;
}

body.layout-force-compact .topbar-userbox,
body.layout-auto-compact .topbar-userbox,
body.layout-pref-compacta .topbar-userbox {
    gap: 6px;
}

@media (max-width: 720px) {
    body.layout-pref-auto .topbar-actions {
        align-items: center;
        padding: 6px;
        border-radius: 16px;
    }

    body.layout-pref-auto .topbar-actions .language-switcher {
        flex: 1 1 190px;
    }

    body.layout-pref-auto .topbar-user-meta {
        display: none;
    }
}

@media (max-width: 1100px) {
    .presupuesto-board-table {
        min-width: 760px;
    }

    .presupuesto-board-table th,
    .presupuesto-board-table td {
        padding: 10px 8px;
    }

    .presupuesto-board-table select,
    .presupuesto-board-table input,
    .presupuesto-board-table textarea {
        font-size: 0.88rem;
        padding: 9px 10px;
    }

    .presupuesto-board-table .col-parte { width: 170px; }
    .presupuesto-board-table .col-abolladuras { width: 135px; }
    .presupuesto-board-table .col-tamano { width: 78px; }
    .presupuesto-board-table .col-material { width: 88px; }
    .presupuesto-board-table .col-acabado { width: 88px; }
    .presupuesto-board-table .col-observaciones { width: 150px; }
    .presupuesto-board-table .col-precio { width: 96px; }
}

@media (max-width: 860px) {
    .presupuesto-board-table {
        min-width: 760px;
    }

    .presupuesto-board-table .sticky-col {
        position: sticky;
        left: 0;
        z-index: 2;
        box-shadow: 10px 0 18px rgba(2, 8, 23, 0.25);
    }

    .presupuesto-board-table .sticky-price-col {
        position: sticky;
        right: 0;
        z-index: 2;
        box-shadow: -10px 0 18px rgba(2, 8, 23, 0.22);
    }
}

/* Estadisticas de rentabilidad */
.rentabilidad-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rentabilidad-hero {
    overflow: hidden;
    position: relative;
    border-radius: 22px;
}

.rentabilidad-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 46%),
        radial-gradient(circle at 86% 18%, rgba(57, 195, 141, 0.12), transparent 22%);
    pointer-events: none;
}

.rentabilidad-hero .card-body {
    position: relative;
}

.rentabilidad-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.rentabilidad-hero-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
}

.rentabilidad-hero-summary div {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(184, 197, 213, 0.10);
    background: rgba(255, 255, 255, 0.04);
}

.rentabilidad-hero-summary span,
.rentabilidad-kpi-card span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rentabilidad-hero-summary strong {
    display: block;
    margin-top: 7px;
    color: var(--steel-strong);
    font-size: 1.35rem;
    line-height: 1;
}

.rentabilidad-filter .card-body {
    padding: 18px;
}

.rentabilidad-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 14px;
}

.rentabilidad-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

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

.rentabilidad-kpi-card {
    min-height: 186px;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(184, 197, 213, 0.11);
    background:
        linear-gradient(180deg, rgba(23, 33, 45, 0.92), rgba(12, 18, 26, 0.96));
    box-shadow: var(--shadow-soft);
}

.rentabilidad-kpi-card h2 {
    margin: 12px 0 10px;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.2;
}

.rentabilidad-kpi-card strong {
    display: block;
    color: var(--steel-strong);
    font-size: 1.9rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.rentabilidad-kpi-card p {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 0.86rem;
    line-height: 1.45;
}

.rentabilidad-kpi-primary {
    border-color: rgba(57, 195, 141, 0.24);
    background:
        linear-gradient(180deg, rgba(57, 195, 141, 0.14), rgba(13, 21, 28, 0.96));
}

.rentabilidad-kpi-primary strong {
    color: #a7f3d0;
}

.rentabilidad-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 20px;
    align-items: stretch;
}

.rentabilidad-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.rentabilidad-section-head h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1.2;
}

.rentabilidad-section-head p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.45;
}

.rentabilidad-chart-box {
    height: 310px;
    min-height: 310px;
}

.rentabilidad-chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

.rentabilidad-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rentabilidad-breakdown-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    align-items: center;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(184, 197, 213, 0.10);
    background: rgba(255, 255, 255, 0.035);
}

.rentabilidad-breakdown-row span {
    color: var(--steel-strong);
    font-weight: 800;
}

.rentabilidad-breakdown-row strong {
    color: #ffffff;
    white-space: nowrap;
}

.rentabilidad-breakdown-row small {
    grid-column: 1 / -1;
    color: var(--text-muted);
    line-height: 1.4;
}

.rentabilidad-breakdown-row.is-highlight {
    border-color: rgba(57, 195, 141, 0.22);
    background: rgba(57, 195, 141, 0.08);
}

.rentabilidad-current-row {
    background: rgba(57, 195, 141, 0.08);
}

.rentabilidad-current-row .badge {
    margin-left: 8px;
}

.rentabilidad-compact-table th,
.rentabilidad-compact-table td {
    padding: 13px 12px;
}

.rentabilidad-compact-table th:last-child,
.rentabilidad-compact-table td:last-child,
.rentabilidad-detail-table th:last-child,
.rentabilidad-detail-table td:last-child {
    text-align: right;
}

.rentabilidad-detail-table {
    min-width: 980px;
}

.rentabilidad-detail-table th,
.rentabilidad-detail-table td {
    font-size: 0.84rem;
}

@media (max-width: 1180px) {
    .rentabilidad-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rentabilidad-filter-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 860px) {
    .rentabilidad-hero-grid,
    .rentabilidad-main-grid {
        grid-template-columns: 1fr;
    }

    .rentabilidad-hero-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .rentabilidad-filter-grid,
    .rentabilidad-kpi-grid,
    .rentabilidad-hero-summary {
        grid-template-columns: 1fr;
    }

    .rentabilidad-chart-box {
        height: 260px;
        min-height: 260px;
    }

    .rentabilidad-kpi-card strong {
        font-size: 1.55rem;
    }
}

.worklog-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.worklog-hero {
    overflow: hidden;
    border-color: rgba(34, 211, 238, 0.14);
    background:
        linear-gradient(135deg, rgba(21, 157, 187, 0.14), rgba(17, 28, 52, 0.92) 38%),
        linear-gradient(180deg, rgba(17, 28, 52, 0.94), rgba(11, 18, 32, 0.97));
}

.worklog-hero .card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.worklog-eyebrow,
.worklog-kpi-card span,
.worklog-week-number {
    display: block;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.worklog-hero h1 {
    margin: 8px 0 0;
    color: #ffffff;
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    line-height: 1;
    letter-spacing: 0;
}

.worklog-hero p {
    max-width: 760px;
    margin: 14px 0 0;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.55;
}

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

.worklog-hero-metrics div {
    min-width: 120px;
    padding: 16px;
    border: 1px solid rgba(184, 197, 213, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.worklog-hero-metrics span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.worklog-hero-metrics strong {
    display: block;
    margin-top: 7px;
    color: var(--steel-strong);
    font-size: 1.8rem;
    line-height: 1;
}

.worklog-mode-tabs,
.worklog-status-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(184, 197, 213, 0.10);
    border-radius: 16px;
    background: rgba(8, 12, 18, 0.32);
}

.worklog-mode-tabs a,
.worklog-status-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 11px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 800;
}

.worklog-mode-tabs a.is-active,
.worklog-status-tabs a.is-active {
    background: rgba(34, 211, 238, 0.16);
    color: #d9fbff;
}

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

.worklog-kpi-card {
    min-height: 126px;
    padding: 18px;
    border: 1px solid rgba(184, 197, 213, 0.11);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(23, 33, 45, 0.88), rgba(12, 18, 26, 0.94));
    box-shadow: var(--shadow-soft);
}

.worklog-kpi-card strong {
    display: block;
    margin-top: 12px;
    color: #ffffff;
    font-size: 1.85rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.worklog-kpi-card.is-primary {
    border-color: rgba(34, 211, 238, 0.24);
    background:
        linear-gradient(180deg, rgba(34, 211, 238, 0.13), rgba(12, 18, 26, 0.96));
}

.worklog-filter-card .card-body {
    padding: 18px;
}

.worklog-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

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

.worklog-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
}

.worklog-filter-actions,
.worklog-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.worklog-bulk-bar {
    position: static;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(184, 197, 213, 0.12);
    border-radius: 16px;
    background: rgba(9, 14, 24, 0.88);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(18px);
}

.worklog-check-all,
.worklog-week-select label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--steel-strong);
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
}

.worklog-check-all input,
.worklog-week-select input,
.worklog-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.worklog-weeks {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.worklog-week-card {
    overflow: hidden;
}

.worklog-week-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(184, 197, 213, 0.09);
}

.worklog-week-head h2 {
    margin: 7px 0 0;
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.worklog-week-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.worklog-week-stats {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 8px;
    justify-content: end;
}

.worklog-week-stats span {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border: 1px solid rgba(184, 197, 213, 0.10);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.84rem;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.035);
}

.worklog-week-stats strong {
    color: #ffffff;
}

.worklog-week-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.worklog-week-actions .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.84rem;
}

.worklog-week-select {
    padding: 12px 22px;
    border-bottom: 1px solid rgba(184, 197, 213, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.worklog-week-card .worklog-table-wrap {
    overflow-x: auto;
}

.worklog-week-table {
    min-width: 760px;
}

.worklog-week-table th,
.worklog-week-table td {
    padding: 13px 12px;
}

.worklog-week-table th:nth-child(1),
.worklog-week-table td:nth-child(1) {
    width: 44px;
}

.worklog-week-table th:nth-child(2),
.worklog-week-table td:nth-child(2) {
    width: 10%;
}

.worklog-week-table th:nth-child(3),
.worklog-week-table td:nth-child(3) {
    width: 23%;
}

.worklog-week-table th:nth-child(4),
.worklog-week-table td:nth-child(4) {
    width: 18%;
}

.worklog-week-table th:nth-child(5),
.worklog-week-table td:nth-child(5) {
    width: 13%;
}

.worklog-week-table th:nth-child(6),
.worklog-week-table td:nth-child(6) {
    width: 14%;
}

.worklog-week-table th:nth-child(7),
.worklog-week-table td:nth-child(7) {
    width: 17%;
}

.worklog-week-table td > strong,
.worklog-summary-table td > strong {
    color: #ffffff;
}

.worklog-week-table .badge {
    justify-content: center;
    min-width: 82px;
    padding: 7px 10px;
    text-align: center;
    word-break: normal;
    overflow-wrap: normal;
}

.worklog-muted {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.worklog-empty-check {
    color: var(--text-muted);
}

.worklog-empty-state .card-body {
    text-align: center;
    padding: 36px 20px;
}

.worklog-empty-state h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
}

.worklog-empty-state p {
    margin: 9px 0 0;
}

.worklog-summary-card {
    margin-top: 8px;
}

.worklog-summary-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 16px;
    align-items: end;
    margin-bottom: 18px;
}

.worklog-summary-head h2 {
    margin: 7px 0 0;
    color: #ffffff;
    font-size: 1.25rem;
    letter-spacing: 0;
}

.worklog-summary-search label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.worklog-summary-search input {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(184, 197, 213, 0.14);
    background: rgba(8, 12, 18, 0.44);
    color: var(--text);
    padding: 0 13px;
}

.worklog-summary-wrap {
    overflow-x: auto;
}

.worklog-summary-table {
    min-width: 560px;
}

.worklog-summary-table th:last-child,
.worklog-summary-table td:last-child {
    text-align: right;
}

.worklog-send-card {
    max-width: 860px;
}

.worklog-send-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.worklog-send-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.worklog-send-summary span {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(184, 197, 213, 0.10);
    border-radius: 14px;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.035);
}

.worklog-send-summary strong {
    color: #ffffff;
    font-size: 1.2rem;
}

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

.worklog-send-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 160px;
    border-radius: 12px;
    border: 1px solid rgba(184, 197, 213, 0.14);
    background: rgba(8, 12, 18, 0.44);
    color: var(--text);
    padding: 13px;
    font: inherit;
    line-height: 1.45;
}

.worklog-send-form textarea:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.invoice-table-wrap {
    overflow-x: auto;
    padding-bottom: 82px;
}

.invoice-table {
    min-width: 820px;
    table-layout: fixed;
}

.invoice-col-ref { width: 86px; }
.invoice-col-subject { width: 220px; }
.invoice-col-origin { width: 82px; }
.invoice-col-lines { width: 56px; }
.invoice-col-status { width: 190px; }
.invoice-col-total { width: 106px; }
.invoice-col-actions { width: 54px; }

.invoice-table th,
.invoice-table td {
    word-break: normal;
    overflow-wrap: break-word;
}

.invoice-table th {
    letter-spacing: 0.06em;
}

.invoice-ref,
.invoice-total-cell {
    white-space: nowrap;
}

.invoice-ref span,
.invoice-subject-cell strong,
.invoice-total-cell {
    display: block;
    font-weight: 800;
}

.invoice-ref small,
.invoice-subject-cell span {
    display: block;
    margin-top: 4px;
    color: #9cafc0;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.25;
}

.invoice-muted-cell {
    color: #9cafc0;
    font-size: 0.82rem;
}

.invoice-lines-cell,
.invoice-actions-cell {
    text-align: center;
}

.invoice-status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.invoice-table .badge {
    width: auto;
    padding: 6px 10px;
    font-size: 0.72rem;
    line-height: 1;
    white-space: nowrap;
}

.invoice-actions-cell {
    position: relative;
    overflow: visible;
}

.invoice-actions-menu {
    position: relative;
    display: inline-block;
}

.invoice-actions-trigger {
    width: 34px;
    height: 34px;
    padding: 0 0 3px;
    border: 1px solid rgba(184, 197, 213, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    color: #edf3f8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1;
    list-style: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.invoice-actions-trigger::-webkit-details-marker {
    display: none;
}

.invoice-actions-trigger::marker {
    content: "";
}

.invoice-actions-trigger:hover,
.invoice-actions-menu[open] .invoice-actions-trigger {
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.32);
    transform: translateY(-1px);
}

.invoice-actions-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    min-width: 176px;
    padding: 8px;
    border: 1px solid rgba(184, 197, 213, 0.16);
    border-radius: 14px;
    background: rgba(12, 18, 27, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.invoice-action-form {
    margin: 0;
}

.invoice-action-link {
    width: 100%;
    min-height: 34px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #e8f1f8;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
}

.invoice-action-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.invoice-action-primary {
    color: #67e8f9;
}

.invoice-action-danger {
    color: #fca5a5;
}

.budget-table {
    min-width: 1060px;
    table-layout: fixed;
}

.budget-delivery-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.budget-delivery-meta {
    display: block;
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.budget-delivery-cell .badge {
    white-space: nowrap;
}

.budget-state-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.budget-state-dates {
    display: grid;
    gap: 3px;
    color: var(--text-soft);
    font-size: 0.76rem;
    line-height: 1.3;
}

.budget-state-dates span {
    display: block;
}

.budget-state-dates strong {
    color: #cbd5e1;
    font-weight: 800;
}

.budget-table-wrap {
    overflow-x: auto;
    padding-bottom: 18px;
}

.budget-table th,
.budget-table td {
    word-break: normal;
    overflow-wrap: break-word;
}

.budget-ref-cell,
.budget-plate-cell,
.budget-total-cell,
.budget-date-cell {
    white-space: nowrap;
}

.budget-ref-cell,
.budget-total-cell {
    font-weight: 850;
}

.budget-scope-cell,
.budget-client-cell,
.budget-vehicle-cell {
    font-weight: 720;
}

.budget-actions-cell .actions {
    gap: 6px;
    justify-content: flex-start;
}

.budget-actions-cell .btn {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 0.78rem;
}

.budget-actions-cell {
    position: relative;
    overflow: visible;
    text-align: center;
}

.budget-actions-menu {
    position: relative;
    display: inline-block;
}

.budget-actions-trigger {
    width: 34px;
    height: 34px;
    padding: 0 0 3px;
    border: 1px solid rgba(184, 197, 213, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    color: #edf3f8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1;
    list-style: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.budget-actions-trigger::-webkit-details-marker {
    display: none;
}

.budget-actions-trigger::marker {
    content: "";
}

.budget-actions-trigger:hover,
.budget-actions-menu[open] .budget-actions-trigger {
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.32);
    transform: translateY(-1px);
}

.budget-actions-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    min-width: 194px;
    padding: 8px;
    border: 1px solid rgba(184, 197, 213, 0.16);
    border-radius: 14px;
    background: rgba(12, 18, 27, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.budget-actions-panel.is-floating-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    z-index: 3000;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

.budget-action-link {
    width: 100%;
    min-height: 34px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #e8f1f8;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
}

.budget-action-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.budget-action-primary {
    color: #67e8f9;
}

.budget-action-danger {
    color: #fca5a5;
}

@media (max-width: 860px) {
    .budget-table-wrap {
        overflow: visible;
        padding-bottom: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .budget-table,
    .budget-table thead,
    .budget-table tbody,
    .budget-table tr,
    .budget-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .budget-table {
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
        table-layout: auto;
    }

    .budget-table thead {
        display: none;
    }

    .budget-table tbody {
        display: grid;
        gap: 14px;
    }

    .budget-table .budget-row {
        padding: 16px;
        border: 1px solid rgba(184, 197, 213, 0.14);
        border-radius: 18px;
        background:
            linear-gradient(145deg, rgba(17, 27, 39, 0.98), rgba(10, 17, 26, 0.98)),
            radial-gradient(circle at 90% 0%, rgba(34, 211, 238, 0.12), transparent 34%);
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
    }

    .budget-table .budget-row:hover {
        transform: none;
        background:
            linear-gradient(145deg, rgba(19, 31, 45, 0.98), rgba(10, 17, 26, 0.98)),
            radial-gradient(circle at 90% 0%, rgba(34, 211, 238, 0.16), transparent 34%);
    }

    .budget-table td {
        padding: 10px 0;
        border: 0;
        color: #eaf2f8;
        font-size: 0.95rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .budget-table td + td {
        border-top: 1px solid rgba(184, 197, 213, 0.08);
    }

    .budget-table td::before {
        content: attr(data-mobile-label);
        display: block;
        margin-bottom: 5px;
        color: #8ea2b4;
        font-size: 0.68rem;
        font-weight: 850;
        letter-spacing: 0.06em;
        line-height: 1;
        text-transform: uppercase;
    }

    .budget-ref-cell {
        padding-top: 0;
        font-size: 1.02rem;
    }

    .budget-total-cell {
        color: #ffffff;
        font-size: 1.12rem;
    }

    .budget-status-cell .badge {
        min-width: 0;
        max-width: 100%;
        padding: 7px 10px;
        white-space: normal;
        line-height: 1.15;
        overflow-wrap: normal;
        word-break: normal;
    }

    .budget-actions-cell {
        padding-bottom: 0;
        overflow: visible;
        text-align: left;
    }

    .budget-actions-menu {
        width: 100%;
        display: block;
    }

    .budget-actions-trigger {
        width: 100%;
        height: 42px;
        gap: 8px;
        justify-content: center;
        padding: 0 14px;
        border-radius: 12px;
        font-size: 0;
    }

    .budget-actions-trigger::after {
        content: "Acciones";
        font-size: 0.88rem;
        font-weight: 850;
        letter-spacing: 0;
    }

    .budget-actions-panel {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 8px;
        display: grid;
        gap: 6px;
        box-shadow: none;
    }

    .budget-actions-panel.is-floating-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .budget-action-link {
        min-height: 42px;
        justify-content: center;
        text-align: center;
        white-space: normal;
    }

    .budget-empty-row td {
        padding: 18px;
        border: 1px solid rgba(184, 197, 213, 0.14);
        border-radius: 18px;
        text-align: center;
    }
}

@media (max-width: 860px) {
    .invoice-table-wrap {
        overflow: visible;
        padding-bottom: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .invoice-table,
    .invoice-table colgroup,
    .invoice-table thead,
    .invoice-table tbody,
    .invoice-table tr,
    .invoice-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .invoice-table {
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
        table-layout: auto;
    }

    .invoice-table thead,
    .invoice-table colgroup {
        display: none;
    }

    .invoice-table tbody {
        display: grid;
        gap: 14px;
    }

    .invoice-table .invoice-row {
        padding: 16px;
        border: 1px solid rgba(184, 197, 213, 0.14);
        border-radius: 18px;
        background:
            linear-gradient(145deg, rgba(17, 27, 39, 0.98), rgba(10, 17, 26, 0.98)),
            radial-gradient(circle at 90% 0%, rgba(34, 211, 238, 0.12), transparent 34%);
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
    }

    .invoice-table .invoice-row:hover {
        transform: none;
        background:
            linear-gradient(145deg, rgba(19, 31, 45, 0.98), rgba(10, 17, 26, 0.98)),
            radial-gradient(circle at 90% 0%, rgba(34, 211, 238, 0.16), transparent 34%);
    }

    .invoice-table td {
        padding: 10px 0;
        border: 0;
        color: #eaf2f8;
        font-size: 0.95rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .invoice-table td + td {
        border-top: 1px solid rgba(184, 197, 213, 0.08);
    }

    .invoice-table td::before {
        content: attr(data-mobile-label);
        display: block;
        margin-bottom: 5px;
        color: #8ea2b4;
        font-size: 0.68rem;
        font-weight: 850;
        letter-spacing: 0.06em;
        line-height: 1;
        text-transform: uppercase;
    }

    .invoice-ref {
        padding-top: 0;
    }

    .invoice-ref span {
        font-size: 1rem;
    }

    .invoice-subject-cell strong {
        font-size: 1.02rem;
        line-height: 1.25;
    }

    .invoice-subject-cell span {
        font-size: 0.88rem;
        line-height: 1.35;
    }

    .invoice-muted-cell {
        font-size: 0.9rem;
    }

    .invoice-lines-cell,
    .invoice-actions-cell {
        text-align: left;
    }

    .invoice-status-stack {
        gap: 8px;
    }

    .invoice-table .badge {
        min-width: 0;
        max-width: 100%;
        padding: 7px 10px;
        white-space: normal;
        line-height: 1.15;
        overflow-wrap: normal;
        word-break: normal;
    }

    .invoice-total-cell {
        color: #ffffff;
        font-size: 1.12rem;
    }

    .invoice-actions-cell {
        padding-bottom: 0;
        overflow: visible;
    }

    .invoice-actions-menu {
        width: 100%;
        display: block;
    }

    .invoice-actions-trigger {
        width: 100%;
        height: 42px;
        gap: 8px;
        justify-content: center;
        padding: 0 14px;
        border-radius: 12px;
        font-size: 0;
    }

    .invoice-actions-trigger::after {
        content: "Acciones";
        font-size: 0.88rem;
        font-weight: 850;
        letter-spacing: 0;
    }

    .invoice-actions-panel {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 8px;
        display: grid;
        gap: 6px;
        box-shadow: none;
    }

    .invoice-action-link {
        min-height: 42px;
        justify-content: center;
        text-align: center;
        white-space: normal;
    }

    .invoice-empty-row td {
        padding: 18px;
        border: 1px solid rgba(184, 197, 213, 0.14);
        border-radius: 18px;
        text-align: center;
    }
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(0.2);
}

@media (max-width: 1180px) {
    .worklog-kpi-grid,
    .worklog-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .worklog-week-head {
        grid-template-columns: 1fr;
    }

    .worklog-week-side {
        align-items: flex-start;
    }

    .worklog-week-stats {
        justify-content: start;
    }
}

@media (max-width: 760px) {
    .worklog-hero .card-body,
    .worklog-summary-head {
        grid-template-columns: 1fr;
    }

    .worklog-hero-metrics,
    .worklog-kpi-grid,
    .worklog-filter-grid {
        grid-template-columns: 1fr;
    }

    .worklog-bulk-bar {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .worklog-bulk-actions {
        flex-direction: column;
    }

    .worklog-bulk-actions .btn {
        width: 100%;
    }

    .worklog-week-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .worklog-week-stats span {
        justify-content: center;
    }

    .worklog-week-actions,
    .worklog-send-actions {
        width: 100%;
        flex-direction: column;
    }

    .worklog-week-actions .btn,
    .worklog-send-actions .btn {
        width: 100%;
    }

    .worklog-send-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   WePDR App-wide Estadisticas Style
   Lleva la claridad visual de Estadisticas al resto de modulos.
========================================================= */
.page-content {
    padding: 30px;
}

.page-content > .page-header:first-child {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: 134px;
    padding: 24px;
    border: 1px solid rgba(184, 197, 213, 0.11);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 46%),
        linear-gradient(180deg, rgba(23, 33, 45, 0.96), rgba(12, 18, 26, 0.96));
    box-shadow: var(--shadow-soft);
}

.page-content > .page-header:first-child::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(38, 200, 230, 0.12), transparent 35%),
        linear-gradient(315deg, rgba(57, 195, 141, 0.08), transparent 32%);
    pointer-events: none;
    z-index: -1;
}

.page-content > .page-header:first-child > * {
    position: relative;
}

.page-title {
    color: #ffffff;
    font-size: clamp(1.55rem, 2.1vw, 2.05rem);
    line-height: 1.12;
    letter-spacing: 0;
}

.page-subtitle {
    max-width: 760px;
    color: rgba(168, 183, 200, 0.88);
    line-height: 1.5;
}

.page-header .actions,
.page-content > .actions,
.card-body > .actions {
    align-items: center;
    gap: 10px;
}

.card,
.stat-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(184, 197, 213, 0.11);
    background:
        linear-gradient(180deg, rgba(23, 33, 45, 0.94), rgba(12, 18, 26, 0.96));
    box-shadow: var(--shadow-soft);
}

.card::before,
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%);
    pointer-events: none;
}

.card > *,
.stat-card > * {
    position: relative;
}

.card-body {
    padding: 24px;
}

.card h2,
.card h3,
.card-body h2,
.card-body h3 {
    color: #ffffff;
    letter-spacing: 0;
}

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

.stat-card {
    min-height: 138px;
    padding: 20px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-value {
    color: var(--steel-strong);
    font-size: 1.9rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.stat-meta {
    color: var(--text-soft);
    line-height: 1.45;
}

.form-grid {
    gap: 16px;
}

label {
    color: var(--steel-strong);
    font-weight: 800;
}

input,
select,
textarea {
    border-color: rgba(184, 197, 213, 0.12);
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.025));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(184, 197, 213, 0.20);
}

.btn {
    min-height: 44px;
    border-radius: 14px;
    letter-spacing: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #031217;
    box-shadow: 0 16px 32px rgba(21, 157, 187, 0.28);
}

.btn-secondary {
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
    color: var(--steel-strong);
    border-color: rgba(184, 197, 213, 0.14);
}

.btn-danger {
    background: linear-gradient(180deg, rgba(236, 110, 103, 0.18), rgba(236, 110, 103, 0.12));
    color: #ffd8d5;
    border-color: rgba(236, 110, 103, 0.24);
}

.table-wrap {
    border-radius: 18px;
    border: 1px solid rgba(184, 197, 213, 0.09);
    background: rgba(8, 12, 18, 0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

.table {
    background: transparent;
}

.table th {
    background: rgba(255,255,255,0.032);
    color: rgba(184, 197, 213, 0.88);
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.table td {
    color: var(--text);
}

.table tbody tr {
    transition: background 0.18s ease;
}

.table tbody tr:hover {
    background: rgba(38, 200, 230, 0.045);
}

.badge {
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.alert,
.messages .success,
.messages .error,
.messages .warning,
.messages .info {
    border-radius: 16px;
    border: 1px solid rgba(184, 197, 213, 0.12);
    box-shadow: var(--shadow-soft);
}

.page-content > .card,
.page-content > .stats-grid,
.page-content > .form-grid,
.page-content > .table-wrap,
.page-content > section,
.page-content > article {
    margin-bottom: 20px;
}

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

@media (max-width: 760px) {
    .page-content {
        padding: 18px;
    }

    .page-content > .page-header:first-child {
        min-height: 0;
        padding: 20px;
        border-radius: 18px;
    }

    .page-content > .page-header:first-child .actions,
    .page-content > .actions,
    .card-body > .actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .page-content > .page-header:first-child .actions .btn,
    .page-content > .actions .btn,
    .card-body > .actions .btn {
        width: 100%;
    }

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

    .card-body {
        padding: 20px;
    }
}

@media (max-width: 760px) {
    .notifications-menu {
        position: static;
    }

    .notifications-dropdown {
        position: fixed;
        top: calc(var(--topbar-height) + 10px);
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100dvh - var(--topbar-height) - 24px);
        overflow-y: auto;
        padding: 14px;
        border-radius: 18px;
        z-index: 3000;
    }

    .notifications-header {
        align-items: flex-start;
        gap: 6px;
        flex-direction: column;
    }

    .notification-item {
        gap: 10px;
        padding: 12px;
        border-radius: 14px;
    }

    .notification-topline {
        gap: 4px;
        flex-direction: column;
    }

    .notification-title,
    .notification-text,
    .notification-meta {
        overflow-wrap: anywhere;
    }

    .notification-date {
        white-space: normal;
    }
}

.budget-portal-card,
.budget-chat-card {
    margin-bottom: 20px;
}

.budget-portal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.budget-portal-heading h2 {
    margin: 4px 0 0;
    font-size: 1.2rem;
}

.budget-portal-kicker,
.budget-chat-recipient {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.budget-portal-total {
    color: var(--primary);
    font-size: 1.35rem;
    white-space: nowrap;
}

.budget-portal-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.budget-portal-action p,
.budget-request-note,
.budget-chat-empty {
    margin: 6px 0 0;
    color: var(--muted);
}

.budget-portal-status,
.budget-appointment-confirmed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid rgba(184, 197, 213, 0.1);
    border-bottom: 1px solid rgba(184, 197, 213, 0.1);
}

.budget-portal-status span,
.budget-appointment-confirmed span {
    color: var(--muted);
}

.budget-portal-status.is-complete strong,
.budget-appointment-confirmed strong {
    color: var(--success);
}

.budget-appointment-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(184, 197, 213, 0.1);
}

.budget-appointment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.budget-request-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 18px;
    background: rgba(184, 197, 213, 0.1);
    border: 1px solid rgba(184, 197, 213, 0.1);
    overflow: hidden;
}

.budget-request-summary > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 14px;
    background: var(--surface, #111923);
}

.budget-request-summary span,
.budget-chat-meta time {
    color: var(--muted);
    font-size: 0.78rem;
}

.budget-request-note {
    margin: 0 0 18px;
    padding-left: 14px;
    border-left: 3px solid var(--primary);
}

.budget-chat-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 430px;
    padding: 4px 2px 16px;
    overflow-y: auto;
}

.budget-chat-message {
    align-self: flex-start;
    width: min(78%, 680px);
    padding: 12px 14px;
    border: 1px solid rgba(184, 197, 213, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.budget-chat-message.is-own {
    align-self: flex-end;
    border-color: rgba(38, 200, 230, 0.24);
    background: rgba(38, 200, 230, 0.09);
}

.budget-chat-message.is-system {
    align-self: center;
    width: auto;
    max-width: 90%;
    background: transparent;
    border-style: dashed;
}

.budget-chat-message p {
    margin: 7px 0 0;
    overflow-wrap: anywhere;
}

.budget-chat-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.budget-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(184, 197, 213, 0.1);
}

.budget-chat-form label {
    grid-column: 1 / -1;
}

.budget-chat-form textarea {
    min-height: 82px;
    resize: vertical;
}

@media (max-width: 760px) {
    .budget-portal-heading,
    .budget-portal-action,
    .budget-portal-status,
    .budget-appointment-confirmed {
        align-items: stretch;
        flex-direction: column;
    }

    .budget-portal-total {
        font-size: 1.2rem;
    }

    .budget-appointment-grid,
    .budget-request-summary,
    .budget-chat-form {
        grid-template-columns: 1fr;
    }

    .budget-chat-message,
    .budget-chat-message.is-system {
        width: 92%;
        max-width: none;
    }

    .budget-chat-form .btn,
    .budget-portal-action .btn,
    .budget-appointment-form .btn {
        width: 100%;
    }

    .budget-lines-table,
    .budget-lines-table tbody,
    .budget-lines-table tr,
    .budget-lines-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .budget-lines-table thead {
        display: none;
    }

    .budget-lines-table tbody {
        padding: 8px;
    }

    .budget-lines-table tbody tr {
        margin-bottom: 10px;
        padding: 8px 12px;
        border: 1px solid rgba(184, 197, 213, 0.1);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.025);
    }

    .budget-lines-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .budget-lines-table td {
        display: grid;
        grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1fr);
        gap: 12px;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid rgba(184, 197, 213, 0.08);
        overflow-wrap: anywhere;
    }

    .budget-lines-table td:last-child {
        border-bottom: 0;
    }

    .budget-lines-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }
}
