/* ===== 一覧ページ ===== */
.staff-management {
    max-width: 100%;
}

.facilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.facility-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.card-title {
    flex: 1;
}

.card-title .title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.card-title h3 {
    margin: 4px 0 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
}

.category-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #0073aa;
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
    font-weight: 500;
}

.recruiting-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    border-radius: 3px;
    font-weight: 600;
    text-align: center;
}

.recruiting-badge.urgent {
    background: #dc3545;
    color: #fff;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
}

.recruiting-badge.ongoing {
    background: #ffc107;
    color: #000;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.card-actions {
    display: flex;
    gap: 6px;
}

.facility-notes {
    padding: 8px 16px;
    background: #fffbcc;
    border-bottom: 1px solid #e5e5e5;
    font-size: 13px;
    color: #555;
}

.no-positions {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.positions-table thead th {
    background: #f8f9fa;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
    font-size: 11px;
    white-space: nowrap;
}

.positions-table tbody td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
}

.positions-table tbody tr:last-child td {
    border-bottom: none;
}

.positions-table tbody tr:hover {
    background: #f8f9fa;
}

.col-name {
    font-weight: 500;
    color: #23282d;
    min-width: 100px;
}

.col-num {
    text-align: center;
    width: 45px;
    font-family: 'Courier New', monospace;
}

.col-status {
    text-align: center;
    width: 70px;
    font-size: 11px;
    font-weight: 600;
}

.col-status.status-urgent {
    background: #ffe6e6;
    color: #dc3545;
}

.col-status.status-ongoing {
    background: #fff8e1;
    color: #856404;
}

.col-status.status-none {
    color: #999;
}

.col-notes {
    color: #666;
    font-size: 11px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shortage {
    background: #fff3cd;
    color: #856404;
    font-weight: 600;
}

.severe-shortage {
    background: #f8d7da;
    color: #721c24;
    font-weight: 600;
}

/* ===== 編集ページ ===== */
.staff-edit {
    max-width: 1200px;
}

.edit-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.edit-section h2 {
    margin-top: 0;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.required {
    color: #dc3232;
    font-weight: bold;
}

#positions-container {
    margin-top: 15px;
}

.position-row {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 12px;
    position: relative;
}

.position-fields {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 10px;
}

.field {
    display: flex;
    flex-direction: column;
}

.field-wide {
    grid-column: span 2;
}

.field label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.field input,
.field select,
.field textarea {
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.button-remove {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc3232;
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.button-remove:hover {
    background: #a00;
}

/* レスポンシブ対応 */
@media (max-width: 1400px) {
    .facilities-grid {
        grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    }
}

@media (max-width: 1200px) {
    .facilities-grid {
        grid-template-columns: 1fr;
    }
    
    .position-fields {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .position-fields {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .field-wide {
        grid-column: span 2;
    }
}

/* WordPress標準ボタンの調整 */
.button-small {
    padding: 4px 8px;
    font-size: 12px;
    height: auto;
    line-height: 1.4;
}

/* ===== フロントエンド表示 ===== */
.staff-management-frontend {
    max-width: 100%;
    padding: 20px 0;
}

.staff-management-frontend .facilities-container {
    max-width: 100%;
}

.staff-management-frontend .category-section {
    margin-bottom: 30px;
}

.staff-management-frontend .category-header {
    background: #0073aa;
    color: #fff;
    padding: 10px 15px;
    margin: 0 0 15px 0;
    font-size: 16px;
    border-radius: 4px;
}

.staff-management-frontend .facility-card-inline {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.staff-management-frontend .facility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
}

.staff-management-frontend .facility-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.staff-management-frontend .facility-title h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #23282d;
}

.staff-management-frontend .facility-notes-inline {
    padding: 8px 16px;
    background: #fffbcc;
    border-bottom: 1px solid #e5e5e5;
    font-size: 13px;
    color: #555;
}

.staff-management-frontend .no-positions-inline {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.staff-management-frontend .positions-table-inline {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.staff-management-frontend .positions-table-inline thead th {
    background: #f8f9fa;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
    font-size: 12px;
}

.staff-management-frontend .positions-table-inline tbody td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.staff-management-frontend .positions-table-inline .col-name {
    text-align: left;
    font-weight: 500;
}

.staff-management-frontend .no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

@media (max-width: 768px) {
    .staff-management-frontend .positions-table-inline {
        font-size: 11px;
    }
    
    .staff-management-frontend .col-notes {
        max-width: 100px;
    }
}

/* ===== インライン編集スタイル ===== */
.staff-management-inline .facilities-container {
    max-width: 100%;
}

.category-section {
    margin-bottom: 20px;
}

.category-header {
    background: #0073aa;
    color: #fff;
    padding: 8px 12px;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.facility-card-inline {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.facility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.facility-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.facility-title h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #23282d;
}

.facility-actions {
    display: flex;
    gap: 4px;
}

.facility-notes-inline {
    padding: 6px 12px;
    background: #fffbcc;
    border-bottom: 1px solid #e5e5e5;
    font-size: 11px;
    color: #555;
    line-height: 1.4;
}

.no-positions-inline {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 12px;
}

.positions-table-inline {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.positions-table-inline thead th {
    background: #f8f9fa;
    padding: 6px 4px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
    font-size: 10px;
    line-height: 1.2;
}

.positions-table-inline tbody td {
    padding: 6px 4px;
    border-bottom: 1px solid #eee;
    text-align: center;
    line-height: 1.3;
}

.positions-table-inline .col-name {
    text-align: left;
    font-weight: 500;
    font-size: 12px;
}

.positions-table-inline .col-num {
    width: 35px;
}

.positions-table-inline .col-status {
    width: 55px;
    font-size: 10px;
}

.positions-table-inline .col-notes {
    max-width: 120px;
    font-size: 10px;
}

.col-actions {
    width: 55px;
}

.button-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    text-decoration: none;
    transition: transform 0.2s;
}

.button-icon:hover {
    transform: scale(1.15);
}

.button-small {
    padding: 3px 6px !important;
    font-size: 11px !important;
    height: auto !important;
    line-height: 1.3 !important;
}

.add-position-form,
.edit-row {
    background: #f0f8ff;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.inline-edit-form {
    background: #fff;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.inline-fields {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-size: 10px;
    font-weight: 600;
    color: #555;
    margin-bottom: 3px;
    line-height: 1.2;
}

.field-group input,
.field-group select {
    font-size: 12px;
    padding: 3px 5px;
    border: 1px solid #ccc;
    border-radius: 2px;
}

.field-wide {
    grid-column: span 2;
}

.inline-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.inline-actions .button {
    padding: 4px 10px;
    font-size: 12px;
    height: auto;
}

/* 1列表示（狭い画面） */
@media (max-width: 1400px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .inline-fields {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .inline-fields {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .positions-table-inline {
        font-size: 10px;
    }
    
    .positions-table-inline thead th {
        padding: 4px 2px;
        font-size: 9px;
    }
    
    .positions-table-inline tbody td {
        padding: 4px 2px;
    }
}

/* ===== フロントエンド表示 ===== */
.staff-management-frontend {
    max-width: 100%;
    padding: 20px 0;
}

.staff-management-frontend .facilities-container {
    max-width: 100%;
}

.staff-management-frontend .category-section {
    margin-bottom: 20px;
}

.staff-management-frontend .category-header {
    background: #0073aa;
    color: #fff;
    padding: 8px 12px;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
}

.staff-management-frontend .category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.staff-management-frontend .facility-card-inline {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.staff-management-frontend .facility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.staff-management-frontend .facility-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.staff-management-frontend .facility-title h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #23282d;
}

.staff-management-frontend .facility-notes-inline {
    padding: 6px 12px;
    background: #fffbcc;
    border-bottom: 1px solid #e5e5e5;
    font-size: 11px;
    color: #555;
    line-height: 1.4;
}

.staff-management-frontend .no-positions-inline {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 12px;
}

.staff-management-frontend .positions-table-inline {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.staff-management-frontend .positions-table-inline thead th {
    background: #f8f9fa;
    padding: 6px 4px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
    font-size: 10px;
    line-height: 1.2;
}

.staff-management-frontend .positions-table-inline tbody td {
    padding: 6px 4px;
    border-bottom: 1px solid #eee;
    text-align: center;
    line-height: 1.3;
}

.staff-management-frontend .positions-table-inline .col-name {
    text-align: left;
    font-weight: 500;
    font-size: 12px;
}

.staff-management-frontend .no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

@media (max-width: 1400px) {
    .staff-management-frontend .category-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .staff-management-frontend .positions-table-inline {
        font-size: 10px;
    }
    
    .staff-management-frontend .positions-table-inline thead th {
        padding: 4px 2px;
        font-size: 9px;
    }
    
    .staff-management-frontend .positions-table-inline tbody td {
        padding: 4px 2px;
    }
    
    .staff-management-frontend .col-notes {
        max-width: 80px;
    }
}

