:root {
    --company-slate-bg: #e2e8f0;
    --company-slate-text: #334155;
    --company-blue-bg: #dbeafe;
    --company-blue-text: #1d4ed8;
    --company-green-bg: #dcfce7;
    --company-green-text: #15803d;
    --company-amber-bg: #fef3c7;
    --company-amber-text: #b45309;
    --company-rose-bg: #ffe4e6;
    --company-rose-text: #be123c;
    --timesheet-accent: var(--app-link);
    --timesheet-accent-dark: var(--app-link-hover);
    --timesheet-accent-soft: rgba(13, 110, 253, 0.08);
}

.app-table {
    width: 100%;
    border-collapse: collapse;
}

.app-table th,
.app-table td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid var(--app-line);
    text-align: left;
    vertical-align: top;
}

.app-table th {
    color: var(--app-text-soft);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.compact-table th,
.compact-table td {
    padding: 0.7rem 0.8rem;
}

.timesheet-week-shell {
    padding: 1.35rem 1.5rem;
}

.timesheet-week-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.timesheet-week-field {
    min-width: min(100%, 42rem);
}

.timesheet-week-caption,
.timesheet-modal-label,
.timesheet-summary-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--app-text-soft);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.timesheet-week-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 50px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--app-line-strong);
    border-radius: 0.8rem;
    background: #ffffff;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 700;
}

.timesheet-week-display i {
    color: var(--timesheet-accent);
}

.timesheet-week-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.timesheet-week-form input[type="date"] {
    min-height: 44px;
    min-width: 230px;
}

.timesheet-week-arrows {
    display: inline-flex;
    overflow: hidden;
    border-radius: 0.8rem;
    box-shadow: var(--app-shadow-sm);
}

.timesheet-arrow-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 52px;
    background: var(--timesheet-accent);
    color: #ffffff;
    font-size: 1rem;
}

.timesheet-arrow-button + .timesheet-arrow-button {
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.timesheet-arrow-button:hover {
    background: var(--timesheet-accent-dark);
    color: #ffffff;
}

.timesheet-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.timesheet-summary-card {
    padding: 1.25rem 1.3rem;
    border: 2px solid rgba(13, 110, 253, 0.28);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: var(--app-shadow-sm);
}

.timesheet-summary-card strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 1.9rem;
    line-height: 1.1;
    color: #111111;
}

.timesheet-summary-card small {
    color: var(--app-text-soft);
    font-size: 0.9rem;
}

.timesheet-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 1.5rem;
    padding: 2.6rem 1.5rem;
    text-align: center;
}

.timesheet-empty-state.has-entries {
    padding: 2rem 1.5rem;
}

.timesheet-empty-state h2 {
    margin: 0;
    font-size: 2rem;
    color: #111111;
}

.timesheet-empty-state p {
    max-width: 42rem;
    margin: 0;
    color: var(--app-text-soft);
    font-size: 1rem;
}

.timesheet-empty-art {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 108px;
    height: 108px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(61, 139, 44, 0.14), rgba(61, 139, 44, 0.04));
    color: var(--timesheet-accent-dark);
    font-size: 2.5rem;
}

.timesheet-primary-log {
    min-width: 160px;
    background: var(--timesheet-accent);
}

.timesheet-primary-log:hover {
    background: var(--timesheet-accent-dark) !important;
    border-color: var(--timesheet-accent-dark) !important;
}

.timesheet-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.overview-day-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.overview-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.overview-day-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.overview-day-head p {
    margin: 0.25rem 0 0;
    color: var(--app-text-soft);
}

.overview-day-head strong {
    color: var(--timesheet-accent-dark);
    font-size: 1.1rem;
}

.compact-entry-list {
    gap: 0.75rem;
}

.entry-list {
    display: grid;
    gap: 0.9rem;
}

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

.entry-card-head,
.entry-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.entry-card-head strong {
    color: var(--app-text);
}

.entry-meta {
    margin-top: 0.6rem;
    color: var(--app-text-soft);
    font-size: 0.86rem;
}

.entry-note {
    margin: 0.75rem 0 0.65rem;
    color: var(--app-text-soft);
}

.company-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.company-pill-slate {
    background: var(--company-slate-bg);
    color: var(--company-slate-text);
}

.company-pill-blue {
    background: var(--company-blue-bg);
    color: var(--company-blue-text);
}

.company-pill-green {
    background: var(--company-green-bg);
    color: var(--company-green-text);
}

.company-pill-amber {
    background: var(--company-amber-bg);
    color: var(--company-amber-text);
}

.company-pill-rose {
    background: var(--company-rose-bg);
    color: var(--company-rose-text);
}

.company-summary-list strong,
.company-summary-list span {
    display: block;
}

.company-summary-list span:last-child {
    color: var(--app-text-soft);
}

.timesheet-modal-card {
    width: min(1120px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    overflow: auto;
}

.timesheet-modal-card .modal-head {
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid var(--app-line);
}

.timesheet-log-form {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem;
}

.timesheet-modal-section {
    display: grid;
    gap: 0.8rem;
}

.timesheet-company-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.timesheet-company-option {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 600;
}

.timesheet-company-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.timesheet-company-dot {
    width: 1.45rem;
    height: 1.45rem;
    border: 4px solid var(--timesheet-accent);
    border-radius: 999px;
    box-shadow: inset 0 0 0 0 #ffffff;
    transition: box-shadow 0.15s ease;
}

.timesheet-company-option input:checked + .timesheet-company-dot {
    box-shadow: inset 0 0 0 6px #ffffff;
    background: var(--timesheet-accent);
}

.timesheet-day-picker {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    padding: 1px;
    overflow: hidden;
    border: 1px solid var(--app-line-strong);
    border-radius: 0.8rem;
    background: var(--app-line-strong);
}

.timesheet-day-button {
    appearance: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.85rem 0.4rem;
    border: 0;
    background: #ffffff;
    color: var(--app-text);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
}

.timesheet-day-button.active {
    background: rgba(61, 139, 44, 0.14);
    color: var(--timesheet-accent-dark);
    outline: 1px solid rgba(13, 110, 253, 0.35);
    outline-offset: -1px;
}

.timesheet-entry-shell {
    display: grid;
    gap: 0.9rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--app-line);
}

.timesheet-entry-headings,
.timesheet-entry-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr 1.2fr 0.8fr;
    gap: 1rem;
    align-items: start;
}

.timesheet-entry-headings span {
    color: #111111;
    font-size: 0.95rem;
    font-weight: 800;
    text-align: center;
}

.timesheet-date-box,
.timesheet-total-box {
    display: flex;
    align-items: center;
    min-height: 44px;
    color: #111111;
    font-size: 1.05rem;
    font-weight: 700;
}

.timesheet-field-box {
    display: grid;
    gap: 0.35rem;
}

.timesheet-field-box label,
.timesheet-modal-note label {
    color: var(--app-text-soft);
    font-size: 0.84rem;
    font-weight: 700;
}

.timesheet-field-box select,
.timesheet-modal-note input {
    min-height: 46px;
}

.timesheet-break-box {
    gap: 0.5rem;
}

.timesheet-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--app-text-soft);
    font-size: 0.84rem;
    font-weight: 600;
}

.timesheet-inline-check input {
    width: 18px;
    height: 18px;
}

.timesheet-total-box {
    justify-content: center;
    min-height: 46px;
    font-size: 1.25rem;
    color: #111111;
}

.timesheet-form-fields.disabled,
.timesheet-modal-note.disabled {
    opacity: 0.5;
}

.timesheet-modal-note {
    display: grid;
    gap: 0.45rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--app-line);
}

.timesheet-modal-actions {
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid var(--app-line);
}

[data-save-log]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

    .timesheet-entry-headings,
    .timesheet-entry-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .timesheet-entry-headings span:last-child,
    .timesheet-total-box {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .app-table {
        display: block;
        overflow-x: auto;
    }

    .timesheet-week-toolbar,
    .timesheet-week-form,
    .timesheet-modal-actions {
        align-items: stretch;
    }

    .timesheet-week-arrows {
        width: 100%;
    }

    .timesheet-arrow-button {
        width: 50%;
    }

    .timesheet-summary-strip,
    .timesheet-overview-grid,
    .timesheet-day-picker,
    .timesheet-entry-headings,
    .timesheet-entry-row {
        grid-template-columns: 1fr;
    }

    .timesheet-day-picker {
        gap: 1px;
    }

    .timesheet-day-button {
        border-bottom: 0;
    }

    .timesheet-entry-headings {
        display: none;
    }

    .timesheet-empty-state h2 {
        font-size: 1.6rem;
    }
}


.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.table-actions a {
    white-space: nowrap;
}

.button-small {
    min-height: 38px;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
}

.company-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.company-dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.company-dashboard-card-head,
.company-dashboard-actions,
.company-dashboard-card-meta,
.company-dashboard-card-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.company-dashboard-card-stats > div,
.company-detail-list > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.company-dashboard-card-stats span,
.company-detail-list span,
.company-dashboard-card-meta span,
.company-dashboard-rate {
    color: var(--app-text-soft);
    font-size: 0.88rem;
}

.company-dashboard-card-stats strong,
.company-detail-list strong {
    color: var(--app-text);
    font-size: 1.05rem;
}

.company-dashboard-actions {
    margin-top: auto;
}

.company-detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}


.table-subnote {
    margin-top: 0.25rem;
    color: var(--app-text-soft);
    font-size: 0.82rem;
}

.timesheet-chart-panel {
    margin-top: 1.5rem;
    padding: 1.5rem;
}

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

.timesheet-chart-header h2 {
    margin: 0;
    font-size: 1.9rem;
}

.timesheet-chart-header p {
    margin: 0.35rem 0 0;
    color: var(--app-text-soft);
}

.timesheet-chart-shell {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: stretch;
}

.timesheet-chart-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.15rem 0 1.75rem;
    color: var(--app-text-soft);
    font-size: 0.82rem;
}

.timesheet-chart-axis span:first-child {
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.timesheet-chart-stage {
    position: relative;
    height: 360px;
    padding: 0.5rem 0 0;
}

.timesheet-chart-lines {
    position: absolute;
    inset: 0 0 2.1rem;
}

.timesheet-chart-lines span {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px solid var(--app-line);
}

.timesheet-chart-columns {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
    height: 100%;
}

.timesheet-chart-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.85rem;
    min-width: 0;
    height: 100%;
}

.timesheet-chart-bar-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 280px;
}

.timesheet-chart-bar {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.18rem;
    width: min(100%, 88px);
    height: 100%;
}

.timesheet-chart-segment {
    display: block;
    width: 100%;
    min-height: 0;
    border-radius: 0.65rem 0.65rem 0 0;
}

.timesheet-chart-caption {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    text-align: center;
}

.timesheet-chart-caption strong {
    color: var(--app-text);
    font-size: 0.92rem;
}

.timesheet-chart-caption span {
    color: var(--app-text-soft);
    font-size: 0.86rem;
}

.timesheet-chart-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.timesheet-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--app-text-soft);
    font-size: 0.92rem;
}

.timesheet-chart-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
}

.timesheet-company-tables {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.timesheet-company-panel {
    overflow: hidden;
}

.timesheet-company-header h2 {
    margin: 0;
}

.company-tone-slate {
    background: var(--company-slate-text);
}

.company-tone-blue {
    background: var(--company-blue-text);
}

.company-tone-green {
    background: var(--company-green-text);
}

.company-tone-amber {
    background: var(--company-amber-text);
}

.company-tone-rose {
    background: var(--company-rose-text);
}

@media (max-width: 991px) {
    .timesheet-chart-shell {
        grid-template-columns: 1fr;
    }

    .timesheet-chart-axis {
        flex-direction: row;
        padding: 0;
        gap: 0.75rem;
        overflow-x: auto;
    }
}

@media (max-width: 767px) {
    .timesheet-chart-columns {
        gap: 0.5rem;
    }

    .timesheet-chart-stage {
        height: 320px;
    }

    .timesheet-chart-bar-wrap {
        height: 220px;
    }

    .timesheet-chart-caption strong,
    .timesheet-chart-caption span {
        font-size: 0.78rem;
    }
}


.panel-subtext {
    margin: 0.3rem 0 0;
    color: var(--app-text-soft);
    font-size: 0.9rem;
}

.compact-panel-header {
    margin-bottom: 0.85rem;
}

.company-schedule-editor {
    margin-top: 0.4rem;
}

.schedule-edit-table input[type="time"] {
    width: 100%;
    min-width: 140px;
}

.company-schedule-table-wrap {
    margin-top: 1rem;
}


.saved-companies-table td:last-child {
    min-width: 170px;
}


.company-kpi-grid .stat-card {
    min-height: 5.2rem;
    padding: 0.85rem 1rem;
}

.company-kpi-grid .stat-card strong {
    margin-bottom: 0.1rem;
    font-size: 1.45rem;
    line-height: 1;
}

.company-kpi-grid .stat-card small {
    font-size: 0.82rem;
    line-height: 1.35;
}

.company-kpi-grid .stat-card-meta {
    margin-bottom: 0.25rem;
}

.company-dashboard-card {
    gap: 0.75rem;
    padding: 1rem;
}

.company-dashboard-card h2,
.company-dashboard-card p {
    margin: 0;
}

.company-dashboard-card-stats strong,
.company-detail-list strong {
    font-size: 0.98rem;
}

.company-dashboard-card-meta span,
.company-dashboard-card-stats span,
.company-dashboard-rate {
    font-size: 0.82rem;
}
