*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #1a1a1a;
    background: #f4f4f5;
}

:root {
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #d9dde3;
    --text-muted: #5b6470;
    --primary: #1f4acc;
}

.wrap {
    max-width: 28rem;
    margin: 0 auto;
    padding: 1.25rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrap--centered {
    justify-content: center;
}

.wrap--page {
    justify-content: flex-start;
    max-width: 100%;
    width: 100%;
    padding: 0.2rem 0.1rem;
    box-sizing: border-box;
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 0.75rem;
}

.lede {
    margin: 0 0 1rem;
    color: #444;
}

.notice {
    padding: 0.75rem 1rem;
    background: #fff8e6;
    border: 1px solid #e6d4a8;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.ok {
    padding: 0.75rem 1rem;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 0.5rem;
}

.hint {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: #555;
}

code {
    font-size: 0.85em;
    word-break: break-all;
}

.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;
}

.error {
    padding: 0.75rem 1rem;
    margin: 0 0 1rem;
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: #b71c1c;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    background: #fff;
}

.input:focus {
    outline: 2px solid #333;
    outline-offset: 1px;
}

.btn-primary {
    margin-top: 0.25rem;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #1a1a1a;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.btn-primary:active {
    opacity: 0.9;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.toolbar-title {
    font-size: 1.2rem;
    margin: 0 0 0.1rem;
    letter-spacing: 0.2px;
}

.wrap--page .toolbar-title {
    font-size: 1.08rem;
}

.wrap--page .toolbar-subtitle {
    font-size: 0.72rem;
}

.toolbar-subtitle {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.app-shell {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 0.85rem;
}

.wrap--page .app-shell {
    padding: 0.2rem;
    border-radius: 0.6rem;
}

.wrap--page .app-topbar {
    padding: 0.4rem;
    margin-bottom: 0.45rem;
}

.wrap--page .toolbar {
    margin-bottom: 0.75rem;
}

.app-topbar {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.app-logo {
    display: block;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.wrap--centered .app-logo {
    margin: 0 auto 0.35rem;
}

.app-logo--sm {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin: 0;
}

.app-topbar .app-title-wrap {
    flex: 1;
    min-width: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-chip {
    display: inline-block;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.32rem 0.55rem;
    border-radius: 999px;
    background: #e9eefc;
    color: #233875;
    font-size: 0.78rem;
    font-weight: 600;
}

.btn-text {
    font-size: 0.82rem;
    color: #1f2a3a;
    text-decoration: none;
}

.btn-signout {
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: #fff;
}

.meta {
    margin: 1rem 0 0;
    padding: 0.75rem 0 0;
    border-top: 1px solid #ddd;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    font-size: 0.9rem;
}

.meta dt {
    margin: 0;
    color: #666;
    font-weight: 500;
}

.meta dd {
    margin: 0;
}

.daily-section-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}

.daily-section-head .dash-heading {
    margin: 0;
    min-width: 0;
}

.daily-date-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    min-width: 9.5rem;
}

.daily-date-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
}

.daily-date-input {
    width: 100%;
    min-height: 2.25rem;
    padding: 0.42rem 0.55rem;
    font-size: 0.92rem;
    color: #0f172a;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: #ffffff;
    max-width: 11rem;
    text-align: left;
    color-scheme: light;
    -webkit-text-fill-color: #0f172a;
}

.daily-date-input::-webkit-datetime-edit,
.daily-date-input::-webkit-datetime-edit-fields-wrapper,
.daily-date-input::-webkit-datetime-edit-text,
.daily-date-input::-webkit-datetime-edit-month-field,
.daily-date-input::-webkit-datetime-edit-day-field,
.daily-date-input::-webkit-datetime-edit-year-field {
    color: #0f172a;
}

.daily-date-input::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
}

@media (max-width: 640px) {
    .daily-section-head {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .daily-date-group {
        align-items: stretch;
        min-width: 0;
    }

    .daily-date-input {
        max-width: 100%;
    }
}

.daily-detail-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.daily-loc-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.75rem 0.6rem 0.95rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.wrap--page .daily-loc-block {
    padding: 0.38rem 0.22rem 0.55rem;
}

.daily-loc-title {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.wrap--page .daily-loc-title {
    font-size: 0.92rem;
}

.daily-detail-table {
    min-width: 18rem;
    font-size: 0.85rem;
}

.wrap--page .daily-detail-table {
    min-width: 0;
    width: 100%;
    font-size: 0.78rem;
    table-layout: fixed;
}

.wrap--page .daily-detail-table th:first-child,
.wrap--page .daily-detail-table td:first-child {
    width: 34%;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.wrap--page .dash-table:not(.daily-detail-table) th:first-child,
.wrap--page .dash-table:not(.daily-detail-table) td:first-child {
    width: 13%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dash-section {
    margin-top: 0.95rem;
}

.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.8rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.wrap--page .section-card {
    padding: 0.4rem 0.28rem;
}

.dash-heading {
    font-size: 1.03rem;
    margin: 0;
}

.wrap--page .dash-heading {
    font-size: 0.95rem;
}

.wrap--page .dash-sub {
    font-size: 0.76rem;
}

.dash-sub {
    margin: 0 0 0.7rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

.wrap--page .table-scroll {
    margin: 0;
    padding: 0;
    overflow-x: visible;
}

.dash-table {
    width: 100%;
    min-width: 22rem;
    border-collapse: collapse;
    font-size: 0.86rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    overflow: hidden;
}

.wrap--page .dash-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 0.78rem;
}

.dash-table th,
.dash-table td {
    padding: 0.52rem 0.45rem;
    border-bottom: 1px solid #edf1f5;
    text-align: left;
}

.wrap--page .dash-table th,
.wrap--page .dash-table td {
    padding: 0.38rem 0.28rem;
}

.dash-table thead th {
    background: #eef2f8;
    font-weight: 600;
    font-size: 0.76rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.wrap--page .dash-table thead th {
    font-size: 0.65rem;
    letter-spacing: 0.06px;
}

.wrap--page .dash-table tbody td.num {
    font-size: 0.76rem;
}

.dash-table tbody tr:nth-child(even):not(.table-total) {
    background: #fafbfc;
}

.dash-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dash-table .num--strong {
    font-weight: 700;
    color: #1c2e5f;
}

.dash-table tbody tr:last-child td {
    border-bottom: none;
}

.dash-table .table-total td {
    background: #e9f7ef;
    font-weight: 600;
    border-top: 2px solid #9ecfb0;
}

.dash-loading,
.dash-err {
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    padding: 1rem 0.5rem !important;
}

.dash-err {
    color: #b71c1c;
    background: #ffebee;
}
