/* Daily Book-keeping - Frontend Styles */

.km-bk-form-wrapper {
    max-width: 640px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

.km-bk-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.km-bk-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #111827;
}

.km-bk-field input[type="text"],
.km-bk-field input[type="number"],
.km-bk-field input[type="date"],
.km-bk-field input[type="file"],
.km-bk-field select,
.km-bk-field textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-color: #ffffff;
    box-sizing: border-box;
}

.km-bk-field select optgroup {
    font-weight: 600;
    color: #374151;
    padding: 0.5rem 0;
}

.km-bk-field select option {
    padding: 0.5rem 0.8rem;
    font-weight: normal;
}

.km-bk-field input:focus,
.km-bk-field select:focus,
.km-bk-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.km-bk-field small {
    display: block;
    margin-top: 0.25rem;
    color: #6b7280;
    font-size: 0.8rem;
}

.km-bk-actions {
    margin-top: 0.5rem;
}

.km-bk-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
}

.km-bk-btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.35);
}

.km-bk-btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.km-bk-meta {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.km-bk-notice {
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
}

.km-bk-notice-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.km-bk-balance {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border-radius: 12px;
    border: 1px solid #dbeafe;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    text-align: center;
}

.km-bk-recent {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.08);
}

.km-bk-recent h3 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.km-bk-recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.km-bk-recent-table thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 2px solid #e2e8f0;
}

.km-bk-recent-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.km-bk-recent-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.15s ease;
}

.km-bk-recent-table tbody tr:hover {
    background-color: #f9fafb;
}

.km-bk-recent-table tbody tr:last-child {
    border-bottom: none;
}

.km-bk-recent-table td {
    padding: 1rem 1.25rem;
    color: #374151;
    vertical-align: middle;
    white-space: nowrap;
}

.km-bk-recent-table td:nth-child(2) {
    white-space: normal;
    min-width: 120px;
}

.km-bk-recent-table td:nth-child(4) {
    white-space: normal;
    min-width: 120px;
    text-align: right;
}

.km-bk-recent-table th:nth-child(4) {
    text-align: right;
}

.km-bk-recent-table th:nth-child(3) {
    text-align: right;
}

.km-bk-recent-table td:nth-child(3) {
    text-align: right;
}

.km-bk-recent-table td:first-child {
    font-weight: 500;
    color: #111827;
}

.km-bk-recent-table td:nth-child(3) {
    font-weight: 600;
    color: #059669;
    font-family: 'Courier New', monospace;
}

.km-bk-link-edit {
    display: inline-block;
    padding: 0.4rem 0.875rem;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.km-bk-link-edit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.km-bk-badge-locked {
    display: inline-block;
    padding: 0.4rem 0.875rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

.km-bk-login-required {
    max-width: 640px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

.km-bk-login-message {
    text-align: center;
    padding: 2rem 1rem;
}

.km-bk-login-message h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #111827;
}

.km-bk-login-message p {
    margin-bottom: 1.5rem;
    color: #6b7280;
    font-size: 1rem;
}

.km-bk-login-message .km-bk-btn-primary {
    display: inline-block;
    text-decoration: none;
}

@media (min-width: 768px) {
    .km-bk-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .km-bk-field:nth-child(5),
    .km-bk-field:nth-child(6),
    .km-bk-actions,
    .km-bk-meta {
        grid-column: span 2;
    }

    .km-bk-recent-table th,
    .km-bk-recent-table td {
        padding: 1rem 1.25rem;
    }
}

