/* --- Top Row and Header Styles --- */
.cash-up-top-row {
    margin-bottom: 10px;
}
.cash-up-header h2 {
    margin: 0 0 2px 0;
    font-size: 2em;
    display: flex;
    align-items: center;
    gap: 12px;
}
.cash-up-updated {
    font-size: small;
    color: #666;
    margin-bottom: 0;
    text-align: left;
}

/* --- Period/date row: period start, end, load button --- */
.cash-up-period-bar {
    display: flex;
    align-items: flex-start;
    gap: 34px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cash-up-period-bar .cash-up-period-group {
    display: flex;
    flex-direction: column;
    min-width: 230px;
    max-width: 340px;
    width: 100%;
}
.cash-up-period-bar .cash-up-period-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

/* --- Date input wider for time display --- */
.cash-up-period-bar .cash-up-period-group input[type="datetime-local"] {
    width: 100%;
    min-width: 220px;
    max-width: 340px;
    font-size: 1.08em;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* --- Display below date input --- */
.cash-up-period-bar .cash-up-period-display {
    font-size: 0.96em;
    color: #555;
    margin-top: 3px;
    margin-left: 2px;
}

/* --- Load button group aligned with inputs --- */
.cash-up-load-btn-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 150px;
    margin-top: 22px; /* aligns the button to top of inputs */
    gap: 1px;
}
#cash-up-load-expected.short {
    min-width: 90px;
    font-size: 1.12em;
    margin-bottom: 2px;
    padding: 10px 16px;
}
.cash-up-load-btn-desc {
    font-size: 0.96em;
    color: #444;
    padding-top: 3px;
    margin-bottom: 2px;
}

/* --- Next row for expected float input/label --- */
.cash-up-expected-float-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 12px;
}
.cash-up-expected-float-row .cash-up-period-group {
    min-width: 200px;
    width: 100%;
}
#cash-up-expected-float {
    width: 140px;
    font-size: 1.18em;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* --- Responsive: Adjust layout for narrower screens --- */
@media (max-width: 1050px) {
    .cash-up-period-bar {
        gap: 18px;
    }
    .cash-up-period-bar .cash-up-period-group {
        min-width: 160px;
        max-width: 100%;
    }
}
@media (max-width: 800px) {
    .cash-up-period-bar {
        flex-direction: column;
        gap: 12px;
    }
    .cash-up-load-btn-group {
        margin-top: 0;
    }
    .cash-up-expected-float-row {
        flex-direction: column;
        gap: 10px;
    }
    #cash-up-load-expected.short {
        width: 100%;
        min-width: 0;
    }
}

/* --- Tablet Very Specific Styles --- */
@media (min-width: 600px) and (max-width: 1024px) {
    .cash-up-root {
        max-width: 98vw;
        padding: 10px;
        font-size: 1.08em;
    }
    .cash-up-top-row {
        flex-direction: column;
        gap: 12px;
    }
    .cash-up-section {
        padding: 8px 4px;
        margin-bottom: 12px;
    }
    .cash-up-summary {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 8px;
        font-size: 1em;
    }
    .cash-up-denominations-table th, .cash-up-denominations-table td {
        padding: 10px 6px;
        font-size: 1em;
    }
    .cash-up-denominations-table {
        font-size: 1em;
    }
    .cash-up-denom-row input.denom-input {
        width: 48px;
        font-size: 1.1em;
        padding: 8px 4px;
    }
    .cash-up-button {
        font-size: 1.1em;
        padding: 16px 28px;
        min-width: 140px;
    }
    .cash-up-log, .cash-up-errors {
        font-size: 1em;
        padding: 10px;
    }
    .cash-up-history th, .cash-up-history td {
        font-size: 1em;
        padding: 8px 4px;
    }
}

/* --- Denominations Vertical List --- */
.cash-up-denominations-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}
.cash-up-denominations-table th, .cash-up-denominations-table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
}
.cash-up-denominations-table th {
    background: #f5f5f5;
    font-weight: 600;
    text-align: center;
}
.cash-up-denominations-table td label {
    text-align: right;
    display: block;
    width: 100%;
}
.cash-up-denom-row input.denom-input {
    width: 60px;
    text-align: right;
    font-size: 1em;
    padding: 6px 4px;
}
.denom-value {
    font-weight: 600;
}

/* --- Colour Coding for Expected vs Actual --- */
.cash-up-summary-value.expected-value {
    color: #1a73e8;
    background: #eaf1fb;
    border-radius: 3px;
    padding: 2px 8px;
}
.cash-up-summary-value.actual-value {
    color: #388e3c;
    background: #e8f5e9;
    border-radius: 3px;
    padding: 2px 8px;
}
.cash-up-summary-value.zero {
    color: #b71c1c;
    background: #ffebee;
    border-radius: 3px;
    padding: 2px 8px;
}

/* --- Save Buttons --- */
#cash-up-save-draft-bottom, #cash-up-submit-bottom {
    min-width: 120px;
}

/* --- Section Layout --- */
.cash-up-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 6px;
}

/* Pub Cash Up Plugin Styles */
.cash-up-root {
    max-width: 1100px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.cash-up-header {
    border-bottom: 2px solid #0073aa;
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.cash-up-header h2 {
    margin: 0;
    color: #0073aa;
}
.cash-up-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.1em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

/* --- summary row --- */
.cash-up-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.cash-up-summary-item {
    text-align: center;
}
.cash-up-summary-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 4px;
}
.cash-up-summary-value {
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
}
.cash-up-summary-value.positive {
    color: #28a745;
}
.cash-up-summary-value.negative {
    color: #dc3545;
}

/* --- Misc --- */
.cash-up-log {
    margin-top: 16px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.cash-up-errors {
    margin-top: 16px;
    padding: 12px;
    background: #fff0f0;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #900;
    font-family: monospace;
    font-size: 0.9em;
    display: none;
}
.cash-up-history {
    margin-top: 24px;
}
.cash-up-history table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9em;
}
.cash-up-history th,
.cash-up-history td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.cash-up-history th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}
.cash-up-history tr:hover {
    background: #f9f9f9;
}
.cash-up-history .status-draft {
    color: #6c757d;
    font-weight: 600;
}
.cash-up-history .status-submitted {
    color: #28a745;
    font-weight: 600;
}

/* --- Button Styles --- */
.cash-up-button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
}
.cash-up-button:hover {
    background: #005177;
}
.cash-up-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.cash-up-button.draft {
    background: #6c757d;
}
.cash-up-button.submit {
    background: #28a745;
}
.cash-up-status {
    margin-left: 12px;
    font-weight: 500;
}