:root {
    /* Soft Health palette (2026-08 refresh) */
    --brand-red:       #5A9E7F;   /* accent: セージグリーン */
    --brand-red-hover: #4A8A6A;
    --brand-red-bg:    #EAF3ED;
    --btn-bg:          #5A9E7F;
    --btn-bg-hover:    #4A8A6A;
    --alert:           #E07856;   /* テラコッタ (警告色) */
    --alert-bg:        #FBEDE6;
    --text:            #2D3436;
    --text-muted:      #6B7280;
    --border:          #E5E1DA;
    --surface:         #FFFFFF;
    --surface-bg:      #FAF7F2;
    --table-header-bg: #F5F1E9;
    --error-text:      #C4491F;
    --error-bg:        #FBEDE6;
    --shadow-soft:     0 2px 8px rgba(45,52,54,0.06), 0 1px 3px rgba(45,52,54,0.04);
    --shadow-strong:   0 4px 16px rgba(45,52,54,0.08), 0 2px 6px rgba(45,52,54,0.05);
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
    background: var(--surface-bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* ヘッダー: フル幅の赤バー、内側 max-width 900px */
header {
    background: var(--brand-red);
    color: #fff;
    padding: 12px 16px;
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.pharmacy-badge {
    color: #fff;
    font-size: 14px;
    opacity: 0.9;
    white-space: nowrap;
}
header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}
header h1 a {
    color: #fff;
    text-decoration: none;
}
header h1 a:hover {
    opacity: 0.85;
}
header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
    font-size: 14px;
}
header nav a {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background-color 0.15s, box-shadow 0.15s;
}
header nav a:hover {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
    text-decoration: none;
}
header nav a.active {
    background: #fff;
    color: var(--brand-red);
    font-weight: 700;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* 取引ステータスバッジ */
.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 4px;
    font-size: 12px; font-weight: 600;
    background: var(--brand-red-bg); color: var(--brand-red);
}
.status-badge.status-received {
    background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7;
}
tr.row-received, .card.row-received {
    background: #f1f8e9;
}
header nav a.active:hover {
    background: #fff;
    color: var(--brand-red);
}

/* コンテンツ本体: max-width 900 中央寄せ */
main {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 16px;
}

/* リンク (本体側) */
a {
    color: var(--brand-red);
    text-decoration: underline;
}
a:hover {
    color: var(--brand-red-hover);
}

/* テーブル */
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px;
}
th, td {
    border: 1px solid var(--border);
    padding: 8px;
    text-align: left;
}
th {
    background: var(--table-header-bg);
    font-weight: 600;
}

/* フォーム */
form { margin: 20px 0; }
label { display: inline-block; margin: 4px 0; }
input, textarea, select {
    padding: 8px 12px;
    margin-right: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: inherit;
    background: var(--surface);
    color: var(--text);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--brand-red);
    outline-offset: 1px;
    border-color: var(--brand-red);
}

/* ボタン (アクセントカラーのピル型) */
button {
    background: var(--btn-bg);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(90,158,127,0.25);
    transition: background-color 0.15s, transform 0.05s, box-shadow 0.15s;
}
button:hover {
    background: var(--btn-bg-hover);
    box-shadow: 0 2px 6px rgba(90,158,127,0.35);
}
button:active { transform: translateY(1px); }

/* ヘッダー内のログアウト用テキストボタン (透明背景・白テキスト) */
.link-button {
    background: transparent;
    color: #fff;
    border: none;
    padding: 0;
    border-radius: 0;
    font-weight: normal;
    text-decoration: underline;
    cursor: pointer;
}
.link-button:hover {
    background: transparent;
    opacity: 0.85;
}

/* エラー表示 */
.error {
    color: var(--error-text);
    padding: 8px 12px;
    background: var(--error-bg);
    border-radius: 4px;
    border: 1px solid #fcc;
}

/* 見出し */
h2 {
    margin-top: 24px; font-size: 22px;
    padding-left: 10px; border-left: 4px solid var(--brand-red);
}
h3 { margin-top: 20px; font-size: 18px; color: var(--brand-red); font-weight: 700; }

/* サジェスト ドロップダウン内の「もっと表示」ボタン */
#medicine_suggest .load-more {
    background: var(--brand-red-bg) !important;
    color: var(--brand-red);
}
#medicine_suggest .load-more:hover {
    background: #ffdada !important;
}
