/* 基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ログインページ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
    font-size: 24px;
}

/* フォーム */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ボタン */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* アラート */
.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-info {
    background-color: #e7f3ff;
    color: #0066cc;
    border: 1px solid #b3d9ff;
}

/* テーブル */
.campaign-table,
.account-table,
.ads-table,
.history-table,
.settings-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.campaign-table th,
.account-table th,
.ads-table th,
.history-table th,
.settings-table th {
    background-color: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.campaign-table td,
.account-table td,
.ads-table td,
.history-table td,
.settings-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.campaign-table tr:hover,
.account-table tr:hover {
    background-color: #f8f9fa;
}

.table-container {
    overflow-x: auto;
}

/* パフォーマンス評価の色分け */
.performance-excellent {
    background-color: #d4edda !important;
}

.performance-good {
    background-color: #d1ecf1 !important;
}

.performance-warning {
    background-color: #fff3cd !important;
}

.performance-poor {
    background-color: #f8d7da !important;
}

.performance-neutral {
    background-color: white;
}

.performance-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 5px;
}

/* フィルタ */
.filters {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-form label {
    font-weight: 500;
    margin-right: 5px;
}

/* メモアイコン */
.note-icon {
    margin-left: 5px;
    cursor: pointer;
    font-size: 16px;
}

/* ヘッダー */
.header {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    color: #667eea;
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.header-nav a:hover {
    text-decoration: underline;
}

.user-info {
    color: #666;
    font-size: 14px;
}

/* フッター */
.footer {
    background: white;
    padding: 20px;
    text-align: center;
    color: #666;
    margin-top: 40px;
    border-top: 1px solid #eee;
}

/* ダッシュボード */
.dashboard-summary {
    margin-top: 20px;
}

/* キャンペーン詳細 */
.campaign-detail {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-header {
    margin-bottom: 20px;
}

.breadcrumb {
    color: #666;
    font-size: 14px;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* タブ */
.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* メトリクスグリッド */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.metric-card h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 16px;
}

.metric-value {
    margin-bottom: 8px;
    font-size: 14px;
}

.target-cpa {
    padding: 15px;
    background: #e7f3ff;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* メモ */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.note-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.note-author {
    color: #666;
    font-size: 12px;
}

.note-text {
    color: #333;
    white-space: pre-wrap;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
}

/* 管理画面 */
.admin-section {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background-color: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: #667eea;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

