/* Home page */
.home { display: flex; flex-direction: column; gap: 0.9rem; padding: 0.6rem; max-width: 1500px; margin: 0 auto; }

.home-hero {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    background: linear-gradient(120deg, #0d5cab 0%, #0e7f8c 100%);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    color: #fff;
    box-shadow: 0 2px 10px rgba(13, 92, 171, 0.3);
}
.home-hero-date { text-align: center; min-width: 86px; }
.home-hero-date b { display: block; font-size: 2.6rem; line-height: 1; }
.home-hero-date span { font-size: 0.85rem; opacity: 0.9; }
.home-hero-main { flex: 1; min-width: 0; }
.home-hero-main h1 { color: #fff; margin: 0; font-size: 1.5rem; }
.home-hero-main p { margin: 0.15rem 0 0.7rem; opacity: 0.9; font-size: 0.9rem; }
.home-hero-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.home-hero-actions .btn { border-radius: 9px; font-size: 0.85rem; }

.home-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.home-stat-card {
    background: var(--app-surface, #fff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.1));
    border-radius: 14px;
    padding: 0.6rem 0.8rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.home-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 0.9rem; align-items: start; }
.home-panel {
    background: var(--app-surface, #fff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.1));
    border-radius: 14px;
    padding: 0.8rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Today agenda */
.home-agenda-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.home-agenda-title { font-size: 1.1rem; font-weight: 700; color: #107ad4; }
.home-agenda-date { font-size: 0.82rem; color: var(--app-muted, #555); }
.home-agenda-count {
    min-width: 2.4rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    background: #107ad4;
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
}
.home-agenda-body { display: grid; grid-template-columns: 220px 1fr; gap: 0.8rem; align-items: start; }
.home-agenda-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 460px; overflow-y: auto; }
.home-ag-row {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 0.6rem;
    align-items: center;
    color: #161616;
    text-align: left;
    background: var(--app-surface-2, #f4f6f7);
    border: 1px solid var(--app-border, rgba(0,0,0,0.1));
    border-left: 5px solid #107ad4;
    border-radius: 9px;
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    width: 100%;
}
.home-ag-row:hover { border-color: #107ad4; }
.home-ag-time { font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.home-ag-main { min-width: 0; display: flex; flex-direction: column; }
.home-ag-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-ag-main span { font-size: 0.78rem; color: var(--app-muted, #555); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-ag-warn { color: var(--app-danger, darkred); font-weight: 700; }
body.app-dark .home-ag-row { color: #e8edf3; }
.home-ag-empty { color: var(--app-muted, #555); text-align: center; }
.home-agenda-empty { display: flex; flex-direction: column; gap: 0.7rem; align-items: center; padding: 1rem 0; }
.home-agenda-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

.home-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.home-links button {
    background: transparent;
    border: 1px solid var(--app-border, rgba(0,0,0,0.15));
    color: var(--app-muted, #555);
    border-radius: 8px;
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
}
.home-links button:hover { border-color: #107ad4; color: #107ad4; }

/* KPI stat tiles */
.kpi-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--app-muted, #555); margin-bottom: 0.5rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.5rem; }
.kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: #161616;
    gap: 0.1rem;
    background: var(--app-surface-2, #f4f6f7);
    border: 1px solid var(--app-border, rgba(0,0,0,0.1));
    border-left: 6px solid #107ad4;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.kpi:hover { border-color: #107ad4; }
.kpi-num { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.kpi-label { font-size: 0.78rem; color: var(--app-muted, #555); }
.kpi-pending { border-left-color: #d9a400; }
body.app-dark .kpi { color: #e8edf3; }
.kpi-payed { border-left-color: #28a745; }
.kpi-overdue { border-left-color: #dc3545; }
.kpi-credited { border-left-color: #8e44ad; }

.home-chart .mud-chart { width: 100%; }
.sales-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.sales-head .kpi-title { margin-bottom: 0; }
.sales-kpis { margin-bottom: 0.6rem; }
.kpi-booked { border-left-color: #107ad4; }

@media (max-width: 900px) {
    .home-grid { grid-template-columns: 1fr; }
    .home-agenda-body { grid-template-columns: 1fr; }
    .home-stats { grid-template-columns: 1fr; }
    .home-hero { flex-direction: column; text-align: center; }
}
