.self-cost-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -10px 0 10px;
}

.self-cost-heading > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.self-cost-heading h1 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.1;
}

.self-cost-heading span {
    color: #647180;
    font-size: .84rem;
}

.month-navigation {
    display: flex;
    align-items: center;
    gap: 7px;
}

.month-picker input {
    min-height: 38px;
    border: 1px solid #cdd5dc;
    border-radius: 8px;
    background: #fff;
    padding: 6px 10px;
    color: #18202a;
    font: inherit;
    font-weight: 700;
}

.self-cost-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) minmax(190px, 1.25fr);
    gap: 9px;
    margin-bottom: 12px;
}

.self-cost-totals article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #dfe4e8;
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
}

.self-cost-totals span {
    color: #647180;
    font-size: .76rem;
}

.self-cost-totals span small {
    display: block;
    margin-top: 2px;
    color: #2b6f49;
    font-size: .62rem;
    font-weight: 700;
}

.self-cost-totals strong {
    font-size: .96rem;
    white-space: nowrap;
}

.self-cost-totals .total {
    border-color: #a9c7e8;
    background: #edf5ff;
}

.self-cost-totals .total span,
.self-cost-totals .total strong {
    color: #164f92;
}

.self-cost-workspace {
    display: grid;
    grid-template-columns: minmax(600px, 1.6fr) minmax(300px, .65fr);
    gap: 12px;
    align-items: start;
}

.automatic-cost-panel {
    margin-bottom: 12px;
    padding: 14px 16px;
}

.automatic-cost-panel .panel-heading {
    margin-bottom: 9px;
}

.automatic-cost-panel .panel-heading small {
    display: block;
    margin-top: 2px;
    color: #647180;
    font-size: .75rem;
}

.automatic-cost-panel .panel-heading a {
    text-decoration: none;
}

.automatic-cost-table th,
.automatic-cost-table td {
    padding-top: 7px;
    padding-bottom: 7px;
}

.rate-warning {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    border: 1px solid #e7c66c;
    border-radius: 9px;
    background: #fff8dc;
    padding: 9px 12px;
    margin-bottom: 12px;
    color: #6f5207;
    font-size: .78rem;
}

.rate-warning ul {
    display: flex;
    gap: 5px 18px;
    flex-wrap: wrap;
    margin: 0;
    padding-left: 18px;
}

.rate-warning a {
    color: #735704;
    font-weight: 700;
    white-space: nowrap;
}

.self-cost-workspace .panel,
.special-work-panel {
    padding: 16px;
}

.self-cost-list-panel .panel-heading small,
.special-work-heading small {
    display: block;
    margin-top: 3px;
    color: #647180;
    font-size: .78rem;
}

.self-cost-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.self-cost-table,
.special-work-table {
    width: 100%;
    border-collapse: collapse;
}

.self-cost-table th,
.self-cost-table td,
.special-work-table th,
.special-work-table td {
    border-bottom: 1px solid #e1e6ea;
    padding: 9px 8px;
    text-align: left;
    vertical-align: middle;
    font-size: .8rem;
}

.self-cost-table th,
.special-work-table th {
    background: #f5f7f9;
    color: #5e6b77;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.self-cost-table tr.selected {
    background: #fff8dc;
    box-shadow: inset 3px 0 0 #d1aa35;
}

.self-cost-table .money {
    text-align: right;
    white-space: nowrap;
}

.self-cost-table .actions {
    text-align: right;
    white-space: nowrap;
}

.text-action {
    border: 0;
    background: transparent;
    color: #245b8a;
    padding: 4px;
    font: inherit;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
}

.text-action:hover {
    text-decoration: underline;
}

.cost-delete-button {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    border: 1px solid #e5aaa5;
    border-radius: 6px;
    background: #fff;
    color: #b42318;
    font: 700 1rem/1 sans-serif;
    cursor: pointer;
}

.cost-delete-button:hover {
    background: #fff1f0;
}

.cost-category {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: .7rem;
    font-weight: 700;
}

.cost-category.personnel { background: #e8f2ff; color: #215b9b; }
.cost-category.vehicle { background: #e8f8ef; color: #176b36; }
.cost-category.material { background: #fff0d8; color: #805000; }
.cost-category.other { background: #f0eafb; color: #674299; }

.self-cost-editor.editing {
    border-color: #d9bd62;
    background: #fff8dc;
}

.self-cost-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.self-cost-form-grid .field {
    gap: 4px;
}

.self-cost-form-grid .field input,
.self-cost-form-grid .field select {
    padding: 8px 10px;
}

.amount-field {
    max-width: 190px;
}

.special-work-panel {
    margin-top: 12px;
}

.special-work-heading {
    margin-bottom: 12px;
}

.special-work-table td:first-child small {
    display: block;
    margin-top: 3px;
    color: #647180;
}

.special-reasons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.special-reason {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: .68rem;
    font-weight: 700;
}

.special-reason.night { background: #e8e9f7; color: #3b3e82; }
.special-reason.sunday { background: #fff0d8; color: #805000; }
.special-reason.holiday { background: #fde7e6; color: #9c2d25; }

.special-work-note {
    margin: 10px 0 0;
    color: #647180;
    font-size: .72rem;
}

@media (max-width: 1180px) {
    .self-cost-totals { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .self-cost-workspace { grid-template-columns: 1fr; }
    .self-cost-editor { order: -1; }
}

@media (max-width: 760px) {
    .self-cost-heading,
    .self-cost-heading > div:first-child { align-items: stretch; flex-direction: column; }
    .month-navigation { display: grid; grid-template-columns: auto 1fr auto; }
    .month-picker input { width: 100%; }
    .self-cost-totals { grid-template-columns: 1fr 1fr; }
    .self-cost-totals .total { grid-column: 1 / -1; }
    .self-cost-form-grid { grid-template-columns: 1fr; }
    .self-cost-table,
    .special-work-table { min-width: 680px; }
    .rate-warning { grid-template-columns: 1fr; }
    .rate-warning ul { display: grid; }
    .self-cost-totals span small { display: inline; margin-left: 4px; }
}
.self-cost-heading-actions{display:flex;gap:12px;align-items:center}.self-cost-export-actions{display:flex;gap:7px;align-items:center}.self-cost-export-actions .button-link{min-width:66px;justify-content:center}.self-cost-heading .month-navigation input{font:inherit;border:1px solid #cdd5dc;border-radius:8px;padding:7px;background:white;max-width:200px}.self-cost-totals{grid-template-columns:repeat(5,minmax(0,1fr))}.self-cost-totals article{padding:9px 11px;flex-wrap:wrap;gap:5px}.self-cost-totals .revenue{background:#edf8f1;border-color:#bbdfc9}.daily-finance-panel{padding:0!important;overflow:visible}.finance-table-toolbar{display:flex;gap:10px;align-items:center;padding:8px 12px;font-size:.76rem;color:#637484;border-bottom:1px solid #e1e6ea}.finance-table-toolbar>a{margin-left:auto}.daily-finance-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:.78rem}.daily-finance-table .finance-date{width:10%}.daily-finance-table .finance-action{width:40px}.daily-finance-table th,.daily-finance-table td{text-align:left;padding:10px 8px;border-bottom:1px solid #dfe6ed;vertical-align:top;overflow-wrap:anywhere}.daily-finance-table th{background:#f2f6fa;color:#5b6b7c;font-size:.72rem;padding-top:9px;padding-bottom:9px}.daily-finance-table tbody tr:last-child td{border-bottom:0}.daily-finance-table tbody tr:hover{background:#f8fbfe}.daily-finance-table small{display:block;font-size:.66rem;color:#627588;margin-top:4px}.daily-finance-table a{color:#245b8a;text-decoration:none;font-weight:600}.daily-finance-table a:hover{text-decoration:underline}.daily-finance-table .finance-incomplete{color:#8b6006}.finance-add{display:flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0!important}.finance-missing{padding:8px 12px;border:1px solid #e6ce8d;border-radius:8px;background:#fffaeb;margin-bottom:10px;font-size:.76rem;color:#6e510c}.finance-missing summary{cursor:pointer}.finance-missing ul{padding-left:18px;columns:2}.finance-help,.finance-hours-detail{position:relative}.finance-help summary{border:1px solid #c7d2de;border-radius:50%;width:23px;height:23px;display:grid;place-items:center;cursor:pointer;font-weight:700}.finance-help>div,.finance-hours-detail>div{position:absolute;z-index:5;padding:12px;background:white;border:1px solid #cbd5df;border-radius:8px;box-shadow:0 6px 22px #1232;width:300px;color:#48596b;line-height:1.5}.finance-help>div{right:0}.finance-hours-detail{font-size:.64rem;color:#5e7185;margin-top:4px}.finance-hours-detail summary{cursor:pointer}.finance-hours-detail>div{width:220px}.finance-hours-detail span{display:block}.cost-popup{max-width:800px;margin:auto}.cost-popup .panel{padding:18px}.cost-popup .self-cost-heading{margin:0 0 16px}.cost-popup-entries{margin-top:12px}.cost-popup-entries h2{font-size:1.05rem;margin:0 0 12px}.cost-popup-row{display:grid;grid-template-columns:1fr auto auto auto;gap:8px;align-items:center;border-bottom:1px solid #dce3ea;padding:10px 0;font-size:.85rem}.cost-popup-row small{display:block;color:#657585}
@media(max-width:1150px){.self-cost-totals{grid-template-columns:repeat(3,minmax(0,1fr))}.self-cost-heading-actions{flex-wrap:wrap;justify-content:flex-end}.daily-finance-table th,.daily-finance-table td{padding:9px 5px;font-size:.72rem}}
@media(max-width:760px){.self-cost-totals{grid-template-columns:1fr 1fr}.self-cost-heading-actions{justify-content:space-between}.daily-finance-table colgroup,.daily-finance-table thead{display:none}.daily-finance-table,.daily-finance-table tbody{display:block}.daily-finance-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-bottom:2px solid #cbd9e5}.daily-finance-table td{display:block;border:0;padding:8px 12px}.daily-finance-table td::before{content:attr(data-label);display:block;font-size:.67rem;color:#6a7b8a;margin-bottom:3px}.finance-missing ul{columns:1}.cost-popup-row{grid-template-columns:1fr auto}.finance-help>div{width:240px}.finance-hours-detail>div{position:static;width:auto}.self-cost-heading>div:first-child{gap:5px}}
.self-cost-totals{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:760px){.self-cost-totals{grid-template-columns:1fr 1fr}}
