/* ============================================
   rikonportal 業者管理システム スタイル
   カラー: #4bc5c8（rikonportal.comと統一）
   ============================================ */

:root {
    --primary:     #4bc5c8;
    --primary-dark:#35a8b0;
    --primary-light:#e8f8f9;
    --primary-bg:  #f0fafb;
    --primary-border: #b8e8ea;
    --text:        #333;
    --text-muted:  #888;
    --white:       #fff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    background: var(--primary-bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ヘッダー */
.site-header {
    background: #fff;
    border-bottom: 3px solid var(--primary);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(75,197,200,.12);
    line-height: 0;
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    gap: 16px;
    padding: 0;
}
.site-logo {
    display: block;
    line-height: 0;
    font-size: 0;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.site-logo img {
    height: 40px;
    width: auto;
}
.site-logo-text {
    font-size: 15px;
    font-weight: bold;
    color: var(--primary-dark);
    white-space: nowrap;
}
.header-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-nav a {
    font-size: 13px;
    color: #555;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .2s;
}
.header-nav a:hover { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.badge {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}

/* メインコンテナ */
.container {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 16px;
}
.container-sm {
    max-width: 560px;
    margin: 32px auto;
    padding: 0 16px;
}

/* カード */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    margin-bottom: 20px;
}
.card-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-border);
}

/* ページタイトル */
.page-hero {
    background: linear-gradient(135deg, #3bb5c0, #4bc5c8);
    color: #fff;
    padding: 32px 20px;
    text-align: center;
    margin-bottom: 32px;
}
.page-hero h1 { font-size: 24px; margin-bottom: 8px; }
.page-hero p { font-size: 14px; opacity: .9; }

/* フォーム */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 6px;
}
.form-label .required {
    color: var(--primary-dark);
    font-size: 11px;
    background: var(--primary-light);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(75,197,200,.15);
}
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 12px; color: #888; margin-top: 4px; }

/* ボタン */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-align: center;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-outline {
    background: #fff;
    color: var(--primary-dark);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-gray { background: #f0f0f0; color: #555; }
.btn-gray:hover { background: #e0e0e0; text-decoration: none; }

/* アラート */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { background: #f0faf0; border-left: 4px solid #27ae60; color: #1a7a40; }
.alert-error   { background: #fff5f5; border-left: 4px solid #e74c3c; color: #9b2a2a; }
.alert-info    { background: var(--primary-light); border-left: 4px solid var(--primary); color: var(--primary-dark); }
.alert-warn    { background: #fff8e6; border-left: 4px solid #f5c518; color: #7a6000; }

/* 案件カード */
.inquiry-card {
    background: #fff;
    border: 1px solid var(--primary-border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: box-shadow .2s, transform .2s;
}
.inquiry-card:hover {
    box-shadow: 0 4px 16px rgba(75,197,200,.15);
    transform: translateY(-1px);
}
.inquiry-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag {
    display: inline-block;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: bold;
}
.tag-category { background: var(--primary-light); color: var(--primary-dark); }
.tag-area { background: #e8f4fd; color: #2980b9; }
.tag-urgent { background: #fff8e6; color: #e67e22; }
.tag-closed { background: #f0f0f0; color: #888; }

.inquiry-content {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.inquiry-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
    flex-wrap: wrap;
    gap: 8px;
}
.contact-slots { display: flex; gap: 4px; align-items: center; }
.slot { width: 14px; height: 14px; border-radius: 50%; background: #ddd; display: inline-block; }
.slot.filled { background: var(--primary); }

/* メッセージ */
.message-list { display: flex; flex-direction: column; gap: 16px; }
.message-bubble {
    max-width: 72%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
}
.message-bubble.from-biz {
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.message-bubble.from-user {
    background: #f0f0f0;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}
.message-time { font-size: 11px; color: #aaa; margin-top: 4px; }
.message-limit-note {
    font-size: 12px;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 6px;
    margin-top: 4px;
    display: inline-block;
}

/* スレッドリスト */
.thread-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--primary-border);
    cursor: pointer;
    transition: background .15s;
}
.thread-item:hover { background: var(--primary-light); }
.thread-item.unread { background: #f0fbfc; }
.thread-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #35a8b0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}
.thread-info { flex: 1; min-width: 0; }
.thread-name { font-weight: bold; font-size: 15px; margin-bottom: 2px; }
.thread-preview { font-size: 13px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-meta { text-align: right; font-size: 12px; color: #aaa; white-space: nowrap; }
.unread-dot { width: 10px; height: 10px; background: var(--primary); border-radius: 50%; margin-top: 4px; margin-left: auto; }

/* ステータスバッジ */
.status-badge { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: bold; }
.status-open    { background: #f0faf0; color: #27ae60; }
.status-closed  { background: #f0f0f0; color: #888; }
.status-pending { background: #fff8e6; color: #e67e22; }
.status-expired { background: #f0f0f0; color: #aaa; }

/* 文字数カウンター */
.char-count { font-size: 12px; color: #888; text-align: right; margin-top: 4px; }
.char-count.over { color: #e74c3c; font-weight: bold; }

/* グリッド */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* フッター */
.site-footer {
    background: #2c3e50;
    color: #aaa;
    text-align: center;
    padding: 24px;
    font-size: 13px;
    margin-top: 48px;
}
.site-footer a { color: #ccc; }

/* ユーティリティ */
.text-center { text-align: center; }
.text-muted { color: #888; font-size: 13px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.divider { border: none; border-top: 1px solid var(--primary-border); margin: 24px 0; }

/* レスポンシブ */
@media (max-width: 600px) {
    .card { padding: 20px 16px; }
    .page-hero h1 { font-size: 20px; }
    .message-bubble { max-width: 88%; }
}
