/* アラートスタイル */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

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

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

/* ボタンスタイル */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    margin: 0.5rem 0;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-warning {
    background-color: #ffa500;
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

/* ページコンテナ */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ユーザー情報 */
.user-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.user-info p {
    margin: 5px 0;
}

/* ローディング表示 */
.loading {
    text-align: center;
    padding: 50px 0;
    color: #666;
}

/* コンテンツエリア */
.content {
    margin-top: 30px;
}

/* デバッグ情報 */
.debug-info {
    margin-top: 20px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 5px;
}

/* ログインページ */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.login-form {
    margin-top: 1rem;
}

/* フォームグループ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.readonly-field {
    background-color: #f0f0f0 !important;
    cursor: not-allowed !important;
}

/* ログインページ用ボタン拡張 */
.login-form .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* アラート拡張 */
.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* フォームテキスト */
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.text-muted {
    color: #6c757d;
}

/* フォームフッター */
.form-footer {
    margin-top: 1rem;
    text-align: center;
}

.form-footer a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
}

/* 管理画面レイアウト */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 3.5rem);
    background-color: #f8f9fa;
}

/* サイドバー */
.sidebar {
    width: 250px;
    background-color: #fff;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

/* 対象テナント選択 */
.target-tenant-selector {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1rem;
    padding: 1rem;
}

.selector-header {
    margin-bottom: 0.5rem;
}

.selector-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selector-body {
    position: relative;
}

.selector-loading {
    padding: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.current-tenant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.current-tenant:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.25);
}

.tenant-name {
    font-weight: 500;
    color: #212529;
    flex: 1;
}

.dropdown-arrow {
    color: #6c757d;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.tenant-dropdown {
    position: relative;
}

.tenant-list {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.tenant-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f1f1f1;
}

.tenant-item:last-child {
    border-bottom: none;
}

.tenant-item:hover {
    background-color: #f8f9fa;
}

.tenant-item.selected {
    background-color: #e7f3ff;
    color: #007bff;
}

.tenant-icon {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* メニューグループ */
.menu-group {
    margin-bottom: 1.5rem;
}

.menu-group-title {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* メニューリスト */
.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: #495057;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.menu-link:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.menu-item.active .menu-link {
    background-color: #e7f3ff;
    color: #007bff;
    border-left: 3px solid #007bff;
    padding-left: calc(1rem - 3px);
}

.menu-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    width: 1.5rem;
    display: inline-block;
}

.menu-text {
    font-size: 0.95rem;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: #212529;
}

.content-body {
    background-color: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-body h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #212529;
}

/* ダッシュボードカード */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    opacity: 0.9;
}

.dashboard-card .stat {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

.dashboard-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.dashboard-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .main-content {
        padding: 1rem;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}