/* ==========================================================
   Overview
   Office aesthetic
   ========================================================== */

.overview-page {
    display: grid;
    gap: 22px;
    --ov-card: var(--surface);
    --ov-card-strong: color-mix(in srgb, var(--surface-2) 92%, var(--surface));
    --ov-field: color-mix(in srgb, var(--surface-2) 92%, var(--surface));
    --ov-border: var(--border);
    --ov-shadow: var(--shadow-md);
}

.overview-topline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 4px 0 10px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.overview-topline h1 {
    margin: 10px 0 4px;
    color: var(--text);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.05;
}

.overview-topline p {
    margin: 0;
    max-width: 620px;
    color: var(--text-muted);
    font-size: .92rem;
    font-weight: 500;
    line-height: 1.7;
}

.overview-eyebrow,
.overview-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border: 1px solid color-mix(in srgb, var(--app-primary) 18%, var(--ov-border));
    border-radius: 999px;
    padding: 6px 10px;
    background: color-mix(in srgb, var(--app-primary) 8%, transparent);
    color: var(--app-primary);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.overview-pill.danger {
    border-color: color-mix(in srgb, #ef4444 35%, var(--ov-border));
    background: color-mix(in srgb, #ef4444 8%, transparent);
    color: #dc2626;
}

.overview-date-card {
    min-width: 230px;
    padding: 16px 18px;
    border: 1px solid var(--ov-border);
    border-radius: 18px;
    background: var(--ov-card);
    box-shadow: var(--ov-shadow);
    text-align: right;
}

.overview-date-card small {
    display: block;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .68rem;
    font-weight: 700;
}

.overview-date-card strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
}

.overview-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
    gap: 22px;
    align-items: start;
}

.overview-alert {
    padding: 13px 16px;
    border: 1px solid var(--ov-border);
    border-radius: 15px;
    background: var(--ov-card);
    color: var(--text);
    font-size: .78rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.overview-alert.danger {
    border-color: rgba(239,68,68,.28);
    background: color-mix(in srgb, #ef4444 8%, var(--surface));
    color: #dc2626;
}

.time-card {
    height: 620px;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    overflow: hidden;
    border: 1px solid var(--ov-border);
    border-radius: 24px;
    background: var(--ov-card);
    box-shadow: var(--shadow-lg);
}

.time-map-wrap {
    position: relative;
    min-height: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--surface-2) 92%, #dbe4f0);
}

.time-google-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.time-map-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(15,23,42,.08), rgba(15,23,42,.02));
}

html.app-theme-dark .time-map-shade {
    background: linear-gradient(180deg, rgba(15,23,42,.22), rgba(15,23,42,.08));
}

.time-map-overlay {
    position: absolute;
    top: 22px;
    left: 22px;
    z-index: 2;
    max-width: 380px;
    padding: 18px 20px;
    border: 1px solid var(--ov-border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow-md);
}

.time-map-overlay h2 {
    margin: 10px 0 5px;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.time-map-overlay p {
    margin: 0;
    color: var(--text-muted);
    font-size: .84rem;
    font-weight: 500;
}

.time-location {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    z-index: 2;
    padding: 14px 16px;
    border: 1px solid var(--ov-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow-sm);
}

.time-site-status {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding-bottom: 11px;
    margin-bottom: 11px;
    border-bottom: 1px solid var(--ov-border);
}

.time-site-status > span {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 0 6px rgba(148,163,184,.14);
}

.time-site-status.onsite > span {
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34,197,94,.14);
}

.time-site-status.offsite > span,
.time-site-status.unavailable > span {
    background: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245,158,11,.14);
}

.time-site-status strong {
    margin-top: 1px;
    font-size: .92rem;
}

.time-site-status.onsite strong { color: #16a34a; }
.time-site-status.offsite strong,
.time-site-status.unavailable strong { color: #d97706; }

.time-site-status em {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: .65rem;
    font-style: normal;
    line-height: 1.35;
}

.time-location small {
    display: block;
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.time-location strong {
    display: block;
    margin-top: 3px;
    color: var(--text);
    font-size: .84rem;
    font-weight: 650;
}

.time-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    border-left: 1px solid var(--ov-border);
    background: var(--ov-card);
}

.time-panel h2 {
    margin: 12px 0 6px;
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.time-panel p {
    margin: 0;
    color: var(--text-muted);
    font-size: .88rem;
    font-weight: 500;
}

.time-panel-head {
    display: grid;
    gap: 18px;
}

.time-clock {
    color: var(--text);
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: 1;
}

.time-date {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: .84rem;
    font-weight: 600;
}

.time-actions {
    display: grid;
    gap: 12px;
}

.time-toggle,
.time-arrangement,
.time-meta-grid > div {
    padding: 14px;
    border: 1px solid var(--ov-border);
    border-radius: 16px;
    background: var(--ov-field);
}

.time-toggle {
    font-size: .88rem;
    font-weight: 700;
}

.time-toggle-note {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: .67rem;
    line-height: 1.5;
}

.time-toggle .form-check-input:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.time-toggle .form-check-input {
    border-color: var(--ov-border);
    background-color: var(--surface);
}

.time-toggle .form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.time-toggle .form-check-label {
    color: var(--text);
    font-weight: 700;
}

.time-arrangement small,
.time-meta-grid small {
    display: block;
    color: var(--text-muted);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.time-arrangement strong,
.time-meta-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: .88rem;
    font-weight: 750;
}

.overview-btn {
    width: 100%;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0 16px;
    font-size: .86rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: .18s ease;
}

.overview-btn.primary {
    background: var(--app-primary);
    color: #fff;
    border-color: var(--app-primary);
}

.overview-btn.primary:hover {
    transform: translateY(-1px);
}

.overview-btn.soft {
    border-color: var(--ov-border);
    background: var(--surface);
    color: var(--text);
}

.overview-btn.soft:hover {
    border-color: color-mix(in srgb, var(--app-primary) 28%, var(--ov-border));
    background: color-mix(in srgb, var(--app-primary) 6%, var(--surface));
}

.overview-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.time-meta-grid {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.overview-side {
    height: 620px;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.overview-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--ov-border);
    border-radius: 22px;
    background: var(--ov-card);
    box-shadow: var(--ov-shadow);
}

.overview-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.overview-card-header h3 {
    margin: 8px 0 4px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.overview-card-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 500;
}

.overview-count {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--app-primary) 18%, var(--ov-border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--app-primary) 8%, transparent);
    color: var(--app-primary);
    font-size: .96rem;
    font-weight: 800;
}

.office-list,
.announcement-list {
    flex: 1;
    min-height: 0;
    display: grid;
    gap: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    align-content: start;
    padding-right: 6px;
}

.office-group {
    display: grid;
    gap: 9px;
}

.office-group-title {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.office-group-title strong {
    color: var(--app-primary);
}

.office-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--ov-border);
    border-radius: 16px;
    background: var(--ov-field);
}

.office-person > div:last-child {
    min-width: 0;
}

.office-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid color-mix(in srgb, var(--app-primary) 18%, var(--ov-border));
    border-radius: 50%;
    background: color-mix(in srgb, var(--app-primary) 8%, var(--surface));
    color: var(--app-primary);
    font-size: .86rem;
    font-weight: 800;
}

.office-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.office-person strong {
    display: block;
    color: var(--text);
    font-size: .86rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.office-person small {
    display: block;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.announcement-card {
    padding: 15px;
    border: 1px solid var(--ov-border);
    border-radius: 16px;
    background: var(--ov-field);
}

.announcement-card.pinned {
    border-color: color-mix(in srgb, var(--app-primary) 24%, var(--ov-border));
    background: color-mix(in srgb, var(--app-primary) 6%, var(--ov-field));
}

.announcement-card span {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--app-primary);
    color: #fff;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.announcement-card h4 {
    margin: 0 0 5px;
    color: var(--text);
    font-size: .92rem;
    font-weight: 800;
}

.announcement-card p {
    margin: 0 0 9px;
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.announcement-card small {
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 650;
}

.overview-empty {
    display: grid;
    gap: 4px;
    padding: 24px;
    border: 1px dashed var(--ov-border);
    border-radius: 16px;
    background: var(--ov-field);
    text-align: center;
}

.overview-empty strong {
    color: var(--text);
    font-size: .9rem;
    font-weight: 800;
}

.overview-empty span {
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 500;
}

.office-list::-webkit-scrollbar,
.announcement-list::-webkit-scrollbar {
    width: 6px;
}

.office-list::-webkit-scrollbar-thumb,
.announcement-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-primary) 28%, transparent);
}

.office-list::-webkit-scrollbar-track,
.announcement-list::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 1320px) {
    .overview-shell {
        grid-template-columns: 1fr;
    }

    .overview-side {
        height: 420px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: minmax(0, 1fr);
    }

    .time-card {
        height: 580px;
    }

    .time-map-wrap {
        min-height: 0;
    }
}

@media (max-width: 980px) {
    .overview-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .overview-date-card {
        width: 100%;
        text-align: left;
    }

    .time-card {
        height: auto;
        grid-template-columns: 1fr;
    }

    .time-map-wrap {
        min-height: 420px;
    }

    .time-panel {
        border-left: 0;
        border-top: 1px solid var(--ov-border);
    }

    .overview-side {
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .overview-card {
        height: 390px;
    }
}

@media (max-width: 680px) {
    .overview-topline {
        padding-top: 12px;
    }

    .time-map-wrap {
        min-height: 500px;
    }

    .time-map-overlay {
        position: absolute;
        top: 12px;
        left: 12px;
        max-width: calc(100% - 24px);
        margin: 0;
        padding: 10px 12px;
        border-radius: 13px;
    }

    .time-map-overlay h2,
    .time-map-overlay p {
        display: none;
    }

    .time-location {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 11px 12px;
        border-radius: 13px;
    }

    .time-site-status {
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .time-panel,
    .overview-card {
        padding: 18px;
    }

    .overview-card {
        height: 360px;
    }

    .time-clock {
        font-size: 2.25rem;
    }
}
