.mrj-wrap { max-width: 100%; }
.mrj-card { border: 1px solid #ddd; border-radius: 8px; padding: 16px; margin: 0 0 18px; background: #fff; }
.mrj-notice { padding: 10px 14px; margin: 0 0 16px; border-radius: 6px; }
.mrj-success { background: #e8f7e8; border: 1px solid #83bc83; }
.mrj-error { background: #fdeaea; border: 1px solid #d98b8b; }
.mrj-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.mrj-form-grid label, .mrj-seat-add label, .mrj-date-add label, .mrj-filter-form label { display: flex; flex-direction: column; gap: 4px; }
.mrj-wrap input[type="text"], .mrj-wrap input[type="number"], .mrj-wrap input[type="date"], .mrj-wrap select { width: 100%; min-height: 40px; }
.mrj-wrap button { cursor: pointer; min-height: 40px; padding: 8px 14px; }
.mrj-form-action { display: flex; align-items: end; }
.mrj-section-card { margin-top: 22px; }
.mrj-section-title { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 8px; flex-wrap: wrap; }
.mrj-table { width: 100%; border-collapse: collapse; }
.mrj-table th, .mrj-table td { padding: 8px 10px; border-bottom: 1px solid #ddd; text-align: left; }
.mrj-right { text-align: right !important; }
.mrj-inline-form { display: inline; }
.mrj-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;
}
.mrj-link-button:hover, .mrj-link-button:focus { color: #5f0000 !important; background: transparent !important; }
.mrj-seat-add { display: grid; grid-template-columns: minmax(280px, 520px) auto; gap: 12px; align-items: end; margin-top: 14px; }
.mrj-seat-add button { width: auto; min-width: 150px; }
.mrj-delete-section { margin-top: 18px; text-align: right; }

.mrj-seat-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.mrj-seat-actions .mrj-link-button { white-space: nowrap; }

.mrj-danger { background: #8b0000; color: #fff; border: 0; }
.mrj-date-add, .mrj-filter-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.mrj-date-add label, .mrj-filter-form label { min-width: 220px; }
.mrj-checkbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 14px 0 18px; }
.mrj-checkbox-list label { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid #eee; }
.mrj-checkbox-list input { transform: scale(1.25); }
.mrj-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; }
.mrj-legend span { display: flex; align-items: center; gap: 6px; }
.mrj-code { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; }
.mrj-v { background: #d8f3dc; }
.mrj-a { background: #fff3bf; }
.mrj-o { background: #ffd6d6; }
.mrj-attendance-section { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; margin-bottom: 16px; background: #fff; }
.mrj-attendance-section h4 { margin: 0; padding: 10px 12px; background: #f3f3f3; }
.mrj-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; }
.mrj-place { font-weight: 700; text-align: center; }
.mrj-name { min-width: 0; }
.mrj-status-buttons { display: flex; gap: 4px; }
.mrj-status-button { width: 42px; min-height: 38px !important; padding: 4px !important; border: 1px solid #aaa; background: #fff; opacity: .45; font-weight: 700; }
.mrj-status-button.is-active { opacity: 1; box-shadow: inset 0 0 0 2px #333; }
.mrj-status-button.mrj-v { background: #d8f3dc; }
.mrj-status-button.mrj-a { background: #fff3bf; }
.mrj-status-button.mrj-o { background: #ffd6d6; }
.mrj-sticky-save { position: sticky; bottom: 10px; display: flex; justify-content: flex-end; padding: 10px 0; }
.mrj-sticky-save button { font-weight: 700; }

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

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

.mrj-x { background: #e5d4f7; }
.mrj-status-button.mrj-x { background: #e5d4f7; }
.mrj-timeout-add { display: grid; grid-template-columns: minmax(240px, 1fr) 150px 150px minmax(180px, 260px) auto; gap: 12px; align-items: end; }
.mrj-timeout-add label { display: flex; flex-direction: column; gap: 4px; }
.mrj-timeout-member { background: #f5effb; }
.mrj-timeout-member small { color: #6f42a5; font-weight: 600; }
.mrj-timeout-member input[disabled] { opacity: 1; }
.mrj-timeouts-table { table-layout: fixed; }
.mrj-timeouts-table .mrj-timeout-col-member { width: 230px; }
.mrj-timeouts-table .mrj-timeout-col-from,
.mrj-timeouts-table .mrj-timeout-col-to { width: 148px; }
.mrj-timeouts-table .mrj-timeout-col-reason { width: 260px; }
.mrj-timeouts-table .mrj-timeout-col-action { width: 238px; }
.mrj-timeouts-table .mrj-timeout-date { width: 132px; min-width: 132px; }
.mrj-timeout-reason-cell { min-width: 0; }
.mrj-timeout-reason-cell .mrj-timeout-reason { width: 100%; min-width: 120px; }
.mrj-timeout-action-cell { text-align: right !important; }
.mrj-timeout-action-wrap { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.mrj-timeout-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    min-height: 38px !important;
    padding: 7px 12px !important;
    border: 0 !important;
    border-radius: 8px;
    background: #666;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
}
.mrj-timeout-action-button:hover,
.mrj-timeout-action-button:focus { background: #4d4d4d; color: #fff !important; }

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

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

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

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

.mrj-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;
}
.mrj-button:hover { background: #4d4d4d; color: #fff !important; }
.mrj-report-filter .mrj-sort-reverse { align-self: end; }
.mrj-reset-card form { display: grid; gap: 14px; max-width: 520px; }
.mrj-reset-card label { display: grid; gap: 6px; font-weight: 700; }
.mrj-danger-button { background: #a40000 !important; color: #fff !important; }
.mrj-danger-button:hover { background: #7f0000 !important; color: #fff !important; }

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


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

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

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

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

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

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

.mrj-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;
}

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

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

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

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

.mrj-small-action {
    border: 1px solid #bbb !important;
    background: #f5f5f5 !important;
    color: #222 !important;
    border-radius: 4px !important;
    min-height: 28px !important;
    padding: 3px 8px !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
}
.mrj-small-action:disabled {
    opacity: .35 !important;
    cursor: default !important;
}

.mrj-seat-order-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.mrj-seat-order-status {
    color: #555;
    font-size: .9em;
}
.mrj-absence-entry-table input[type="checkbox"] {
    transform: scale(1.25);
    cursor: pointer;
}
.mrj-absence-entry-table input[type="checkbox"][disabled] {
    cursor: not-allowed;
    opacity: 1;
}
.mrj-absence-entry-cell {
    display: flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    margin: 0;
}
.mrj-absence-entry-cell span {
    font-size: 20px;
    line-height: 1;
}
.mrj-absence-matrix-form {
    padding: 0;
    border: 0;
    background: transparent;
}
.mrj-absence-matrix-form > p {
    margin: 0 0 10px;
}
