/* ==========================================
   1. ログイン画面のスタイル
   ========================================== */
.cmaic-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    background: #f0f2f5;
    border-radius: 12px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2271b1;
    font-size: 24px;
}

.login-error {
    background: #fff0f0;
    color: #d63638;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #d63638;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #135e96;
}

/* ==========================================
   2. レイアウト・共通
   ========================================== */
.cmaic-wrap, .cmaic-form-wrap { 
    max-width: 850px; 
    margin: 30px auto 60px; 
    font-family: "Helvetica Neue", Arial, sans-serif; 
}

.cmaic-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
}

.cmaic-backlink { margin-bottom: 20px; }
.cmaic-backlink a { text-decoration: none; color: #666; font-size: 14px; }
.cmaic-backlink a:hover { color: #2271b1; }

.cmaic-label-bold { display: block; font-weight: bold; margin-bottom: 8px; color: #444; }
.cmaic-sub-label { font-size: 0.8em; color: #666; font-weight: normal; }
.cmaic-note { font-size: 11px; color: #888; margin-top: 8px; }
.cmaic-divider { margin: 40px 0; border: 0; border-top: 2px dashed #eee; }
.cmaic-center-text { text-align: center; font-size: 14px; color: #888; margin-bottom: 10px; }

/* ==========================================
   3. 一覧テーブル
   ========================================== */
.cmaic-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden; }
.cmaic-table th { background: #f4f7f9; padding: 15px; text-align: left; color: #333; }
.cmaic-table td { padding: 15px; border-top: 1px solid #eee; }
.td-date { color: #888; font-size: 0.9em; }
.td-empty { text-align: center; color: #999; padding: 40px !important; }
.btn-delete-user {
  background: #d00;
  color: #fff;
  border: 0;
  border-radius: 3px;
  padding: 5px 10px;
}

/* ==========================================
   4. ボタン類
   ========================================== */
.header-right { display: flex; align-items: center; gap: 10px; }

.btn-new { background: #4caf50; color: #fff !important; padding: 10px 20px; border-radius: 5px; text-decoration: none; font-weight: bold; transition: opacity 0.2s; }
.btn-new:hover { opacity: 0.8; }

.btn-logout { color: #d63638; text-decoration: none; font-size: 14px; }

.btn-edit { color: #2271b1; text-decoration: none; font-weight: bold; margin-right: 15px; }
.btn-delete { background: none; border: none; color: #d63638; cursor: pointer;font-size: 16px; font-weight: bold; padding: 0; }

.btn-save { 
    width: 100%; 
    padding: 18px; 
    background: #2271b1; /* 保存ボタンをWPカラーに統一 */
    color: #fff; 
    border: none; 
    border-radius: 6px; 
    font-size: 18px; 
    font-weight: bold;
    cursor: pointer; 
    transition: background 0.3s;
}
.btn-save:hover { background: #135e96; }

/* ==========================================
   5. フォーム・入力エリア
   ========================================== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 8px; color: #444; }
.form-group textarea, .form-group input[type="text"], .form-group input[type="password"], .form-group input[type="email"] { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    box-sizing: border-box;
}

/* 音声入力コントロール */
.voice-input-controls {
    margin-bottom: 20px;
    background: #fff8e1;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ffe082;
}
.voice-label { margin-top: 0; font-weight: bold; color: #f57c00; }
.voice-btn-group { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn-voice-start { background: #f39c12; color: #fff; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-voice-file { background: #3498db; color: #fff; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; display: inline-block; font-weight: bold; }
.btn-voice-start:hover, .btn-voice-file:hover { opacity: 0.9; }

#voice-status { font-size: 12px; font-weight: bold; color: #666; }

/* 事前情報エリア */
.cmaic-context-area {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
}
#cmaic-context { width: 100%; border: 1px solid #ddd; border-radius: 4px; padding: 8px; }

/* 事前情報エリアの強調 */
.cmaic-context-area.active-highlight {
    background-color: #f0f7ff;
    border: 2px solid #0073aa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cmaic-info-box.mini {
    background-color: #fff;
    border-left: 4px solid #ffba00;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.cmaic-info-box.mini p {
    margin: 0;
    color: #444;
}

.cmaic-sub-label {
    font-weight: normal;
    font-size: 0.85em;
    color: #666;
}

/* ヒアリングメモ専用 */
#cmaic-memo { height: 250px; border: 2px solid #ccc; }

/* ==========================================
   6. AI操作ボックス
   ========================================== */
.ai-box { background: #eef7ff; padding: 20px; border-radius: 8px; margin-bottom: 25px; border: 1px solid #cce5ff; }
.ai-box-title { font-weight: bold; margin-bottom: 10px; color: #0056b3; }
.ai-checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.ai-checkbox-group label { font-size: 14px; font-weight: normal; cursor: pointer; }

.btn-ai { 
    background: #2271b1; 
    color: #fff; 
    border: none; 
    padding: 12px 25px; 
    border-radius: 5px; 
    cursor: pointer; 
    font-weight: bold; 
    width: 100%;
}
.btn-ai:hover { background: #135e96; }
#ai-status { margin-top: 10px; font-size: 13px; }

/* ==========================================
   7. タブシステム
   ========================================== */
.cmaic-item-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 0; }

.item-tab-link {
    padding: 10px 15px;
    border: 1px solid #ccc;
    background: #f1f1f1;
    cursor: pointer;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
    transition: all 0.2s;
}

.item-tab-link.active {
    background: #2271b1 !important;
    color: white !important;
    border-color: #2271b1;
    font-weight: bold;
}

.item-tab-link:hover:not(.active) {
    background: #e5e5e5;
}

.cmaic-tab-content-wrapper {
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    background: #fff;
    margin-bottom: 30px;
}

.item-tab-content label { font-weight: bold; display: block; margin-bottom: 10px; }

/* タブ内テキストエリア */
.item-tab-content textarea {
    width: 100%;
    height: 350px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    font-size: 15px;
    line-height: 1.6;
    box-sizing: border-box;
}

/* 保存状態表示 */
#save-status { margin-top: 10px; font-weight: bold; text-align: center; }

/* ==========================================
   8. アニメーション & 動的ステータス
   ========================================== */
@keyframes aiPulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
.ai-loading { animation: aiPulse 1.8s infinite; }

@keyframes aiDots { 0% { content: ''; } 33% { content: '.'; } 66% { content: '..'; } 100% { content: '...'; } }
.dots::after { content: ''; animation: aiDots 2s infinite; }

.is-recording { background: #e74c3c !important; color: white !important; border-color: #c0392b !important; }

/* プログレスバーのレイアウト */
#ai-ui-container { width: 100%; max-width: 450px; margin: 15px 0; text-align: left; }
#ai-progress-wrapper { 
    width: 100%; 
    background-color: #f3f3f3; 
    border: 1px solid #ccc; 
    border-radius: 10px; 
    overflow: hidden; 
    height: 20px; 
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); 
    display: block; 
    box-sizing: border-box; 
}
#ai-progress-bar { 
    width: 5%; 
    height: 100%; 
    background-color: #2ecc71; 
    transition: width 0.5s ease-in-out; 
}
#ai-status-text-area { min-height: 1.5em; margin-top: 8px; }
#ai-status-text { font-size: 0.9em; color: #555; font-weight: bold; display: inline-block; }

/* 管理画面用タブ */
.admin-tab-nav { display: flex; gap: 5px; margin-bottom: 20px; border-bottom: 2px solid #2271b1; }
.admin-tab-btn { padding: 10px 20px; border: none; background: #eee; cursor: pointer; border-radius: 5px 5px 0 0; }
.admin-tab-btn.active { background: #2271b1; color: #fff; }

/* フォームボックス */
.admin-form-box { background: #f9f9f9; padding: 20px; border-radius: 8px; border: 1px solid #ddd; }
.form-row { display: flex; gap: 15px; margin-bottom: 15px; }
.btn-sub { font-size: 12px; padding: 5px 10px; margin-top: 5px; cursor: pointer; }

/* 追加：説明文のボックス */
.cmaic-info-box {
    background-color: #f0f6fb;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #3c434a;
    font-size: 0.95em;
    line-height: 1.5;
}

/* 追加：入力欄の下の注釈 */
.field-note {
    font-size: 0.8em;
    color: #d63638; /* 注意を促す赤色系 */
    margin: 0 0 5px 0;
}

/* 追加：パスワード入力欄と自動生成ボタンの横並び調整 */
.pass-input-group {
    display: flex;
    gap: 10px;
}
.pass-input-group input {
    flex: 1;
}

/* 既存のフォーム調整 */
.admin-form-box {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 30px;
}
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}
.form-group {
    flex: 1;
}
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.cmaic-label-bold.emphasis {
  color: #d63638;
}

/* 編集モード用の背景色など */
.editing-row {
    background-color: #fff8e5 !important;
}
.btn-edit-staff {
    background: #2271b1;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
}

/* モーダル全体の背景（暗幕） */
.cmaic-modal {
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* モーダルの箱 */
.cmaic-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}
.close-modal:hover { color: #000; }

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

.cmaic-table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    text-align: center;
}
.cmaic-table td {
    text-align: center;
    vertical-align: middle;
}
.cmaic-table td:first-child {
    text-align: left; /* 名前だけ左寄せ */
}