.mrp-wrap { max-width: 100%; }
.mrp-card { border: 1px solid #ddd; border-radius: 8px; padding: 16px; margin: 0 0 18px; background: #fff; }
.mrp-notice { padding: 10px 14px; margin: 0 0 16px; border-radius: 6px; }
.mrp-success { background: #e8f7e8; border: 1px solid #83bc83; }
.mrp-error { background: #fdeaea; border: 1px solid #d98b8b; }
.mrp-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.mrp-form-grid label, .mrp-seat-add label, .mrp-date-add label, .mrp-filter-form label { display: flex; flex-direction: column; gap: 4px; }
.mrp-wrap input[type="text"], .mrp-wrap input[type="number"], .mrp-wrap input[type="date"], .mrp-wrap select { width: 100%; min-height: 40px; }
.mrp-wrap button { cursor: pointer; min-height: 40px; padding: 8px 14px; }
.mrp-form-action { display: flex; align-items: end; }
.mrp-section-card { margin-top: 22px; }
.mrp-section-title { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 8px; flex-wrap: wrap; }
.mrp-table { width: 100%; border-collapse: collapse; }
.mrp-table th, .mrp-table td { padding: 8px 10px; border-bottom: 1px solid #ddd; text-align: left; }
.mrp-right { text-align: right !important; }
.mrp-inline-form { display: inline; }
.mrp-link-button {
    border: 0 !important;
    background: transparent !important;
    color: #8b0000 !important;
    text-decoration: underline !important;
    padding: 0 !important;
    min-height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.mrp-link-button:hover, .mrp-link-button:focus { color: #5f0000 !important; background: transparent !important; }
.mrp-seat-add { display: grid; grid-template-columns: 150px minmax(220px, 1fr) auto; gap: 12px; align-items: end; margin-top: 14px; }
.mrp-delete-section { margin-top: 18px; text-align: right; }
.mrp-danger { background: #8b0000; color: #fff; border: 0; }
.mrp-date-add, .mrp-filter-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.mrp-date-add label, .mrp-filter-form label { min-width: 220px; }
.mrp-checkbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 14px 0 18px; }
.mrp-checkbox-list label { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid #eee; }
.mrp-checkbox-list input { transform: scale(1.25); }
.mrp-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; }
.mrp-legend span { display: flex; align-items: center; gap: 6px; }
.mrp-code { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; }
.mrp-v { background: #d8f3dc; }
.mrp-a { background: #fff3bf; }
.mrp-o { background: #ffd6d6; }
.mrp-attendance-section { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; margin-bottom: 16px; background: #fff; }
.mrp-attendance-section h4 { margin: 0; padding: 10px 12px; background: #f3f3f3; }
.mrp-attendance-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-top: 1px solid #eee; }
.mrp-place { font-weight: 700; text-align: center; }
.mrp-name { min-width: 0; }
.mrp-status-buttons { display: flex; gap: 4px; }
.mrp-status-button { width: 42px; min-height: 38px !important; padding: 4px !important; border: 1px solid #aaa; background: #fff; opacity: .45; font-weight: 700; }
.mrp-status-button.is-active { opacity: 1; box-shadow: inset 0 0 0 2px #333; }
.mrp-status-button.mrp-v { background: #d8f3dc; }
.mrp-status-button.mrp-a { background: #fff3bf; }
.mrp-status-button.mrp-o { background: #ffd6d6; }
.mrp-sticky-save { position: sticky; bottom: 10px; display: flex; justify-content: flex-end; padding: 10px 0; }
.mrp-sticky-save button { font-weight: 700; }

@media (max-width: 700px) {
    .mrp-form-grid, .mrp-seat-add { grid-template-columns: 1fr; }
    .mrp-checkbox-list { grid-template-columns: 1fr; }
    .mrp-attendance-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 6px; padding: 7px 5px; }
    .mrp-status-button { width: 36px; min-height: 36px !important; }
    .mrp-name { font-size: 14px; }
    .mrp-legend { font-size: 13px; }
}

.mrp-checkbox-list-single { grid-template-columns: 1fr; }

.mrp-x { background: #e5d4f7; }
.mrp-status-button.mrp-x { background: #e5d4f7; }
.mrp-timeout-add { display: grid; grid-template-columns: minmax(240px, 1fr) 180px 180px auto; gap: 12px; align-items: end; }
.mrp-timeout-add label { display: flex; flex-direction: column; gap: 4px; }
.mrp-timeout-member { background: #f5effb; }
.mrp-timeout-member small { color: #6f42a5; font-weight: 600; }
.mrp-timeout-member input[disabled] { opacity: 1; }

@media (max-width: 700px) {
    .mrp-timeout-add { grid-template-columns: 1fr; }
}

.mrp-status-button:disabled {
    cursor: not-allowed;
    filter: grayscale(.65);
    opacity: .2;
}
.mrp-status-button:disabled.is-active { opacity: 1; filter: none; }

.mrp-report-filter { display: grid; grid-template-columns: 180px 180px minmax(260px, 1fr) auto; gap: 12px; align-items: end; }
.mrp-report-filter label { display: flex; flex-direction: column; gap: 4px; }
.mrp-report-scroll { width: 100%; overflow-x: auto; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
.mrp-report-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
.mrp-report-table th, .mrp-report-table td { padding: 8px 9px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; text-align: center; }
.mrp-report-table thead th { position: sticky; top: 0; z-index: 3; background: #f3f3f3; font-weight: 400; }
.mrp-report-table .mrp-report-name { position: sticky; left: 0; z-index: 2; min-width: 210px; max-width: 280px; text-align: left; background: #fff; }
.mrp-report-table tbody .mrp-report-name { font-weight: 400; }
.mrp-report-table thead .mrp-report-name { z-index: 4; background: #f3f3f3; }
.mrp-report-date { min-width: 48px; height: 118px; vertical-align: bottom; }
.mrp-report-date span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); }
.mrp-report-status { min-width: 46px; font-weight: 400; }
.mrp-report-v { background: #d8f3dc !important; }
.mrp-report-a { background: #fff3bf !important; }
.mrp-report-o { background: #ffd6d6 !important; }
.mrp-report-x { background: #e5d4f7 !important; }
.mrp-report-empty { color: #aaa; background: #fafafa; }
.mrp-report-pct { min-width: 72px; font-weight: 700; }
.mrp-report-note { margin-top: 10px; font-size: .9em; }
.mrp-report-legend { margin-top: 14px; margin-bottom: 14px; }

@media (max-width: 700px) {
    .mrp-report-filter { grid-template-columns: 1fr; }
    .mrp-report-table .mrp-report-name { min-width: 160px; max-width: 210px; }
}

.mrp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: 9px;
    background: #666;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    box-sizing: border-box;
}
.mrp-button:hover { background: #4d4d4d; color: #fff !important; }
.mrp-report-filter .mrp-sort-reverse { align-self: end; }
.mrp-reset-card form { display: grid; gap: 14px; max-width: 520px; }
.mrp-reset-card label { display: grid; gap: 6px; font-weight: 700; }
.mrp-danger-button { background: #a40000 !important; color: #fff !important; }
.mrp-danger-button:hover { background: #7f0000 !important; color: #fff !important; }

.mrp-report-table tfoot th,
.mrp-report-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-top: 2px solid #999;
}
.mrp-report-table tfoot .mrp-report-name {
    z-index: 4;
    background: #f3f3f3;
    font-weight: 700;
}
.mrp-report-date-pct { background: #d8f3dc !important; font-weight: 700; }
.mrp-report-footer-empty { background: #f3f3f3; }


.mrp-section-form-grid {
    grid-template-columns: 130px 130px minmax(220px, 1fr) minmax(250px, 1fr) auto;
}
.mrp-seating-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.mrp-seating-actions p { margin: 0; }
.mrp-seating-scroll { width: 100%; overflow-x: auto; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
.mrp-seating-table { margin: 0; min-width: 620px; }
.mrp-seating-table th:last-child, .mrp-seating-table td:last-child { width: 140px; }
.mrp-seating-row-total td { background: #f3f3f3; font-weight: 700; border-top: 1px solid #aaa; }
.mrp-seating-table tfoot th { background: #ddd; font-weight: 700; border-top: 2px solid #777; }

@media (max-width: 900px) {
    .mrp-section-form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .mrp-section-form-grid { grid-template-columns: 1fr; }
    .mrp-seating-actions { align-items: stretch; }
    .mrp-seating-actions .mrp-button { width: 100%; }
}

.mrp-seating-table .mrp-seating-row-cell {
    vertical-align: middle;
    text-align: center;
    font-weight: 700;
    background: #f2f2f2;
}

.mrp-seating-logo-form {
    margin: 16px 0;
}

.mrp-seating-logo-label {
    font-weight: 700;
    margin-bottom: 7px;
}

.mrp-seating-logo-picker {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.mrp-seating-logo-preview {
    width: 180px;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.mrp-seating-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.mrp-seating-logo-preview span {
    color: #666;
    font-size: .9em;
}

.mrp-seating-logo-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mrp-absence-report-table .mrp-absence-mark {
    min-width: 48px;
    height: 44px;
    font-weight: 400;
    font-size: 20px;
    line-height: 1;
}
.mrp-absence-check {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 400;
}
.mrp-absence-mark span { font-weight: 400; }
