/* B-management ユニット共通スタイル */

/* ユニットカラー変数 */
:root {
    --unit-color: #4a90e2;
    --unit-color-light: #6ba3e8;
    --unit-color-dark: #3a7bc8;
    --unit-color-accent: #8bb5ed;
    --unit-color-bg: #f8fbff;
    --unit-color-border: #acaaaa;
    --unit-color-text: #2D2D2D;
    --unit-color-text-light: #666666;
    --unit-color-success: #28A745;
    --unit-color-warning: #FFC107;
    --unit-color-danger: #DC3545;
    --unit-color-info: #17A2B8;
}

/* 共通コンテナ */
.unit-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 共通セクション */
.unit-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    border: 1px solid var(--unit-color-border);
    background: linear-gradient(135deg, #ffffff 0%, var(--unit-color-bg) 100%);
}

.unit-section h2 {
    margin: 0 0 25px 0;
    color: var(--unit-color);
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid var(--unit-color);
    padding-bottom: 10px;
}

.unit-section h3 {
    color: var(--unit-color-text);
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
}

/* 共通フォーム */
.unit-form {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--unit-color-border);
    margin-bottom: 25px;
}


.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h2 {
    margin: 0 0 20px 0;
    color: var(--unit-color);
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h2 i {
    font-size: 1.1em;
}


.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--unit-color-text);
}



.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--unit-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}



.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}


/* 共通ボタン */



.btn-primary {
    background: var(--unit-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--unit-color-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--unit-color-success);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--unit-color-warning);
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--unit-color-danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-info {
    background: var(--unit-color-info);
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
}


/* 共通テーブル */
.unit-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.unit-table th,
.unit-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.unit-table th {
    background: var(--unit-color-bg);
    color: var(--unit-color);
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

/* 共通カード */
.unit-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--unit-color-border);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.unit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.unit-card-header {
    background: linear-gradient(135deg, var(--unit-color), var(--unit-color-light));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unit-card-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.unit-card-content {
    padding: 20px;
}

.unit-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* 共通グリッド */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

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

@media (max-width: 768px) {
    .unit-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
}

@media (max-width: 480px) {
    .unit-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .unit-container {
        padding: 15px;
    }
    
    .unit-section,
    .unit-form {
        padding: 20px;
    }
}

/* 共通ユーティリティ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--unit-color-text-light);
}

.font-weight-bold {
    font-weight: 600;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* 共通アラート */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 共通バッジ */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--unit-color);
    color: white;
}

.badge-success {
    background: var(--unit-color-success);
    color: white;
}

.badge-warning {
    background: var(--unit-color-warning);
    color: #212529;
}

.badge-danger {
    background: var(--unit-color-danger);
    color: white;
}

.badge-info {
    background: var(--unit-color-info);
    color: white;
}

/* 共通ローディング */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--unit-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 共通アイコン */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--unit-color-bg);
    color: var(--unit-color);
    font-size: 1.2em;
}

.icon-lg {
    width: 60px;
    height: 60px;
    font-size: 1.5em;
}

.icon-sm {
    width: 30px;
    height: 30px;
    font-size: 1em;
}

/* 共通ページネーション */
.pagination {
    margin: 20px 0;
    text-align: center;
}

.pagination-info {
    margin-bottom: 15px;
    color: var(--unit-color-text-light);
    font-size: 13px;
}

.pagination-nav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 4px;
    background: white;
    color: #495057;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.pagination-btn:hover {
    background: #e9ecef;
    color: var(--unit-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-btn-current {
    background: var(--unit-color) !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

.pagination-btn-disabled {
    background: #f8f9fa !important;
    color: #dee2e6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.pagination-btn-disabled:hover {
    background: #f8f9fa !important;
    color: #dee2e6 !important;
    transform: none !important;
}

.pagination-btn i {
    font-size: 11px;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
}

/* ページネーション レスポンシブ対応 */
@media (max-width: 768px) {
    .pagination-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .pagination-ellipsis {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .pagination-nav {
        gap: 1px;
        padding: 3px;
    }
}

