/* begin section app_styles */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2933;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

.app-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
}

.app-logo {
    margin: 0;
    font-size: 28px;
}

.app-subtitle {
    margin: 6px 0 0;
    color: #52606d;
}

.app-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.app-content {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 24px;
}

.page-title {
    margin-top: 0;
    margin-bottom: 8px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.card {
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 18px;
    background: #ffffff;
}

.card h3 {
    margin-top: 0;
}

.content-split {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 16px;
}

.form-wrap {
    max-width: 420px;
}

.form-grid,
.filters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 16px;
}

.filters-box {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    background: #f8fafc;
}

.result-bar {
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

input,
select,
textarea,
button {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bcccdc;
    border-radius: 8px;
    font: inherit;
}

textarea {
    resize: vertical;
    min-height: 140px;
}

button {
    cursor: pointer;
    background: #111827;
    color: #ffffff;
    border: 0;
}

button:hover {
    background: #0f172a;
}

.button-auto {
    width: auto;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    text-decoration: none;
    line-height: 1;
    border: 0;
}

.button-link:hover {
    background: #0f172a;
    color: #ffffff;
    text-decoration: none;
}

.button-link-secondary {
    background: #e5e7eb;
    color: #111827;
}

.button-link-secondary:hover {
    background: #d1d5db;
    color: #111827;
}

.button-link-danger {
    background: #b91c1c;
    color: #ffffff;
}

.button-link-danger:hover {
    background: #991b1b;
    color: #ffffff;
}

.actions-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form {
    margin: 0;
}

.inline-form input[type="hidden"] {
    display: none;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

th {
    background: #f8fafc;
}

.flash {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 8px;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 12px;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.detail-card {
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 20px;
    background: #ffffff;
}

.detail-card-full {
    margin-top: 0;
}

.detail-card-title {
    margin-top: 0;
    margin-bottom: 18px;
}

.detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 700;
    color: #374151;
}

.detail-value {
    color: #111827;
    word-break: break-word;
}

.notes-box {
    min-height: 120px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    line-height: 1.5;
    white-space: normal;
}

.helper-text {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.checkbox-line {
    margin-bottom: 16px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.muted {
    color: #6b7280;
}

@media (max-width: 980px) {
    .content-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .page-head,
    .app-header {
        flex-direction: column;
    }

    .form-grid,
    .filters-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* end section app_styles */