/* ===== HOME PAGE ===== */

/* ── Variables ──────────────────────────────────── */
:root {
    --ho-primary: var(--wk-primary);
    --ho-primary-10: rgba(var(--wk-primary-rgb),0.10);
    --ho-primary-06: rgba(var(--wk-primary-rgb),0.06);
    --ho-surface: rgba(255,255,255,0.88);
    --ho-border: rgba(255,255,255,0.55);
    --ho-text: #1a1a1a;
    --ho-text-2: #46443d;
    --ho-text-3: #8a8782;
    --ho-radius-card: 1.5rem;
    --ho-radius-sm: .75rem;
}

.dark {
    --ho-primary: var(--wk-primary);
    --ho-primary-10: rgba(var(--wk-primary-rgb),0.10);
    --ho-primary-06: rgba(var(--wk-primary-rgb),0.06);
    --ho-surface: rgba(28,28,28,0.94);
    --ho-border: rgba(255,255,255,0.10);
    --ho-text: #ededed;
    --ho-text-2: #cfcdc7;
    --ho-text-3: #8a8782;
}

/* ── Page shell ─────────────────────────────────── */
.ho-page {
    display: flex;
    flex-direction: column;
    gap: 28px;
    color: var(--ho-text);
    font-family: 'Inter', system-ui, sans-serif;
}

/* ── Loading ─────────────────────────────────────── */
.ho-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 320px;
    color: var(--ho-text-3);
    font-size: 14px;
}

.ho-spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid rgba(var(--wk-primary-rgb),0.12);
    border-top-color: var(--wk-text);
    border-radius: 50%;
    animation: ho-spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes ho-spin { to { transform: rotate(360deg); } }

/* ── Header ─────────────────────────────────────── */
.ho-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 4px;
}

.ho-overline {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: var(--wk-text);
    margin: 0 0 6px;
    opacity: .7;
}

.ho-title {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: var(--ho-text);
    margin: 0 0 4px;
    font-family: 'Manrope', sans-serif;
}

.ho-date {
    font-size: 13px;
    color: var(--ho-text-3);
    margin: 0;
    text-transform: capitalize;
}

/* ── Glass card base ─────────────────────────────── */
.ho-glass-card {
    background: var(--ho-surface);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius-card);
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    transition: box-shadow .2s ease, transform .2s ease;
    position: relative;
    overflow: hidden;
}

.dark .ho-glass-card {
    box-shadow: 0 4px 24px rgba(0,0,0,.25);
}

/* ── KPI Grid ────────────────────────────────────── */
.ho-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ho-kpi-card {
    padding: 22px 22px 20px;
}

/* Ghost decorative icon */
.ho-kpi-ghost {
    position: absolute;
    right: -12px;
    bottom: -12px;
    pointer-events: none;
    user-select: none;
    opacity: .06;
}

.dark .ho-kpi-ghost { opacity: .08; }

.ho-kpi-ghost .material-symbols-outlined {
    font-size: 100px !important;
    font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 48 !important;
    color: var(--wk-text);
    line-height: 1;
}

.ho-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.ho-kpi-body {
    position: relative;
    z-index: 1;
}

.ho-kpi-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ho-text-3);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.ho-kpi-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--ho-text);
    margin: 0;
    letter-spacing: -.02em;
    font-family: 'Manrope', sans-serif;
    line-height: 1.1;
}

.ho-val-danger { color: #ba1a1a; }
.dark .ho-val-danger { color: #ffb4ab; }

.ho-kpi-featured { background: linear-gradient(135deg, rgba(var(--wk-primary-rgb),0.07) 0%, rgba(var(--wk-primary-rgb),0.04) 100%); }
.dark .ho-kpi-featured { background: rgba(var(--wk-primary-rgb),0.06); }

.ho-kpi-warn { background: rgba(186,26,26,0.04); border-color: rgba(186,26,26,0.1); }
.dark .ho-kpi-warn { background: rgba(147,0,10,0.15); border-color: rgba(255,180,171,0.15); }

/* Icon wraps */
.ho-kpi-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ho-kpi-icon-wrap .material-symbols-outlined {
    font-size: 22px;
    font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.ho-icon-blue      { background: rgba(var(--wk-primary-rgb),0.09); color: var(--wk-text); }
.ho-icon-secondary { background: rgba(124,58,237,0.09); color: #7c3aed; }
.ho-icon-tertiary  { background: rgba(5,150,105,0.09); color: #059669; }
.ho-icon-danger    { background: rgba(186,26,26,0.08); color: #ba1a1a; }

.dark .ho-icon-blue      { background: rgba(var(--wk-primary-rgb),0.12); color: var(--wk-text); }
.dark .ho-icon-secondary { background: rgba(167,139,250,0.12); color: #a78bfa; }
.dark .ho-icon-tertiary  { background: rgba(52,211,153,0.12); color: #34d399; }
.dark .ho-icon-danger    { background: rgba(255,180,171,0.12); color: #ffb4ab; }

/* Badges */
.ho-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.ho-badge-green   { background: rgba(5,150,105,0.09); color: #059669; border: 1px solid rgba(5,150,105,0.15); }
.ho-badge-neutral { background: rgba(70,68,61,0.07); color: var(--ho-text-3); border: 1px solid rgba(70,68,61,0.10); }
.ho-badge-danger  { background: rgba(186,26,26,0.08); color: #ba1a1a; border: 1px solid rgba(186,26,26,0.12); }

.dark .ho-badge-green   { background: rgba(52,211,153,0.1); color: #34d399; border-color: rgba(52,211,153,0.15); }
.dark .ho-badge-neutral { background: rgba(255,255,255,0.06); color: var(--ho-text-3); border-color: rgba(255,255,255,0.08); }
.dark .ho-badge-danger  { background: rgba(255,180,171,0.1); color: #ffb4ab; border-color: rgba(255,180,171,0.15); }

/* Mini bars */
.ho-mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.ho-bar { width: 6px; background: linear-gradient(180deg,var(--wk-primary),rgba(var(--wk-primary-rgb),.4)); border-radius: 3px 3px 0 0; min-height: 4px; }
.dark .ho-bar { background: linear-gradient(180deg,var(--wk-primary),rgba(var(--wk-primary-rgb),.3)); }

/* ── Main Grid (4:8) ─────────────────────────────── */
.ho-main-grid {
    display: grid;
    grid-template-columns: 4fr 8fr;
    gap: 20px;
    align-items: start;
}

/* ── Section titles ─────────────────────────────── */
.ho-section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--ho-text);
    margin: 0;
    letter-spacing: -.01em;
    position: relative;
    padding-left: 12px;
    font-family: 'Manrope', sans-serif;
}

.ho-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--ho-primary);
    border-radius: 2px;
    opacity: .7;
}

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

/* ── Quick section ──────────────────────────────── */
.ho-quick-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ho-shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ho-shortcut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 18px 12px;
    border: none;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    color: var(--ho-text);
    transition: box-shadow .2s, transform .2s;
}

.ho-shortcut-card:hover {
    box-shadow: 0 8px 28px rgba(var(--wk-primary-rgb),0.1);
    transform: translateY(-2px);
}

.dark .ho-shortcut-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.35); }

.ho-shortcut-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(var(--wk-primary-rgb),0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.dark .ho-shortcut-icon-wrap { background: rgba(var(--wk-primary-rgb),0.1); }
.ho-shortcut-card:hover .ho-shortcut-icon-wrap { background: rgba(var(--wk-primary-rgb),0.13); }
.dark .ho-shortcut-card:hover .ho-shortcut-icon-wrap { background: rgba(var(--wk-primary-rgb),0.18); }

.ho-shortcut-icon-wrap .material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    color: var(--wk-text);
}

.ho-shortcut-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ho-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Promo card */
.ho-promo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.ho-promo-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(5,150,105,0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dark .ho-promo-icon { background: rgba(52,211,153,0.12); }

.ho-promo-icon .material-symbols-outlined {
    font-size: 20px;
    font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    color: #059669;
}

.dark .ho-promo-icon .material-symbols-outlined { color: #34d399; }

.ho-promo-body { flex: 1; }

.ho-promo-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ho-text);
    margin: 0 0 2px;
}

.ho-promo-sub {
    font-size: 11px;
    color: var(--ho-text-3);
    margin: 0;
}

.ho-promo-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #059669;
    flex-shrink: 0;
    animation: ho-pulse-dot 2.5s ease-in-out infinite;
}

.dark .ho-promo-dot { background: #34d399; }
@keyframes ho-pulse-dot { 0%,100%{ opacity:1; } 50%{ opacity:.4; } }

/* ── Activity section ───────────────────────────── */
.ho-activity-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ho-ver-mas {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--wk-text);
    text-decoration: none;
    opacity: .75;
    transition: opacity .15s, gap .15s;
}

.ho-ver-mas:hover { opacity: 1; gap: 8px; }

.ho-ver-mas .material-symbols-outlined {
    font-size: 16px !important;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24 !important;
}

/* Activity table */
.ho-activity-container { padding: 0; overflow: hidden; }

.ho-activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.ho-activity-table thead th {
    padding: 12px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ho-text-3);
    border-bottom: 1px solid rgba(70,68,61,0.07);
    white-space: nowrap;
}

.dark .ho-activity-table thead th { border-bottom-color: rgba(255,255,255,0.06); }

.ho-activity-tr {
    transition: background .15s;
    border-bottom: 1px solid rgba(70,68,61,0.05);
}

.dark .ho-activity-tr { border-bottom-color: rgba(255,255,255,0.04); }
.ho-activity-tr:last-child { border-bottom: none; }
.ho-activity-tr:hover { background: rgba(var(--wk-primary-rgb),0.025); }
.dark .ho-activity-tr:hover { background: rgba(255,255,255,0.03); }

.ho-activity-table td {
    padding: 12px 18px;
    vertical-align: middle;
}

.ho-activity-client { display: flex; align-items: center; gap: 10px; }

.ho-activity-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(var(--wk-primary-rgb),0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dark .ho-activity-avatar { background: rgba(var(--wk-primary-rgb),0.1); }

.ho-activity-avatar .material-symbols-outlined {
    font-size: 18px;
    font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    color: var(--wk-text);
}

.ho-activity-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ho-text);
    margin: 0 0 2px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ho-activity-sub {
    font-size: 11px;
    color: var(--ho-text-3);
    margin: 0;
}

.ho-activity-doc {
    font-size: 12px;
    font-weight: 600;
    color: var(--ho-text-3);
    font-family: 'Courier New', monospace;
    background: rgba(70,68,61,0.06);
    padding: 3px 8px;
    border-radius: 6px;
}

.dark .ho-activity-doc { background: rgba(255,255,255,0.06); }

.ho-activity-monto {
    font-size: 14px;
    font-weight: 700;
    color: var(--ho-text);
    white-space: nowrap;
    font-family: 'Manrope', sans-serif;
}

/* Estado badges */
.ho-estado {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .03em;
}

.ho-estado-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.ho-ok      { background: rgba(5,150,105,0.08); color: #059669; }
.ho-proc    { background: rgba(var(--wk-primary-rgb),0.08); color: var(--wk-text); }
.ho-firm    { background: rgba(124,58,237,0.08); color: #7c3aed; }
.ho-rech    { background: rgba(186,26,26,0.08); color: #ba1a1a; }
.ho-error   { background: rgba(186,26,26,0.08); color: #ba1a1a; }
.ho-invalid { background: rgba(70,68,61,0.08); color: var(--ho-text-3); }
.ho-default { background: rgba(70,68,61,0.06); color: var(--ho-text-3); }

.dark .ho-ok      { background: rgba(52,211,153,0.1); color: #34d399; }
.dark .ho-proc    { background: rgba(var(--wk-primary-rgb),0.1); color: var(--wk-text); }
.dark .ho-firm    { background: rgba(167,139,250,0.1); color: #a78bfa; }
.dark .ho-rech    { background: rgba(255,180,171,0.1); color: #ffb4ab; }
.dark .ho-error   { background: rgba(255,180,171,0.1); color: #ffb4ab; }
.dark .ho-invalid { background: rgba(255,255,255,0.05); color: var(--ho-text-3); }
.dark .ho-default { background: rgba(255,255,255,0.05); color: var(--ho-text-3); }

/* Empty state */
.ho-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 10px;
    text-align: center;
}

.ho-empty-icon .material-symbols-outlined {
    font-size: 44px;
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 48;
    color: var(--ho-text-3);
    opacity: .5;
}

.ho-empty-text { font-size: 14px; font-weight: 700; color: var(--ho-text-2); margin: 0; }
.ho-empty-sub  { font-size: 12px; color: var(--ho-text-3); margin: 0; }

/* ── Chart card ──────────────────────────────────── */
.ho-chart-card { padding: 20px 22px 16px; }

.ho-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ho-chart-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ho-text);
    margin: 0 0 6px;
}

.ho-chart-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--ho-text-3);
}

.ho-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--ho-primary);
    opacity: .7;
}

.ho-chart-canvas-wrap { height: 120px; position: relative; }
.ho-chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

.ho-chart-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 12px;
}

.ho-chart-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 2px;
    border-radius: 8px;
}

.ho-chart-day.ho-day-active { background: rgba(var(--wk-primary-rgb),0.05); }
.dark .ho-chart-day.ho-day-active { background: rgba(var(--wk-primary-rgb),0.08); }

.ho-day-name   { font-size: 9px; font-weight: 700; color: var(--ho-text-3); text-transform: uppercase; letter-spacing: .06em; }
.ho-day-amount { font-size: 10px; font-weight: 700; color: var(--ho-text-2); }
.ho-day-active .ho-day-name   { color: var(--wk-text); }
.ho-day-active .ho-day-amount { color: var(--ho-text); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1280px) {
    .ho-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .ho-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .ho-kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ho-shortcuts-grid { grid-template-columns: repeat(3, 1fr); }
    .ho-kpi-value { font-size: 22px; }
    .ho-title { font-size: 22px; }
    .ho-activity-table thead { display: none; }
    .ho-activity-table td { padding: 10px 14px; }
    .ho-activity-doc { display: none; }
}

@media (max-width: 480px) {
    .ho-kpi-grid { grid-template-columns: 1fr; }
    .ho-shortcuts-grid { grid-template-columns: repeat(2, 1fr); }
}
