@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

/* =====================================================
   共通設定
===================================================== */
input,
textarea,
select,
button {
    font-family: inherit;
    font-size: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Noto Sans JP", sans-serif;
}

/* =====================================================
   ログイン画面専用
===================================================== */
body.login-page {
    background: linear-gradient(135deg, #74b9ff, #a29bfe);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: #ffffff;
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 460px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-container input,
.login-container button {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.6rem;
}

body.login-page form {
    display: block;
}

body.login-page label {
    display: block;
    margin-bottom: 0.5rem;
}

body.login-page input,
body.login-page button {
    display: block;
    width: 100%;
}


/* =====================================================
   マスタ画面専用（最重要）
===================================================== */
body.master-page {
    background: linear-gradient(135deg, #74b9ff, #a29bfe);
    display: block;          /* ← flex 完全排除 */
    height: auto;            /* ← 100vh 禁止 */
    overflow-y: auto;        /* ← 縦スクロール復活 */
}

/* =====================================================
   コンテナ
===================================================== */
.container {
    margin: 2rem auto;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.container-460 {
    max-width: 460px;
}

.container-700 {
    max-width: 700px;
}

.container-1400 {
    max-width: 1400px;
}

/* =====================================================
   見出し
===================================================== */
.container h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
}

button[type="submit"] {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin: 1rem auto 0;
    border-radius: 0.5rem;
    background: #0984e3;
    color: #fff;
    border: none;
    cursor: pointer;
}

button[type="submit"]:hover {
    background: #74b9ff;
}

/* =====================================================
   検索フォーム
===================================================== */
.search-area {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-area label {
    font-weight: bold;
}

.search-area input,
.search-area select {
    padding: 0.4rem 0.6rem;
    min-width: 180px;
}

.search-area button {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

/* =====================================================
   一覧テーブル（取引先一覧）
===================================================== */
table.list-table {
    width: 100%;
    border-collapse: collapse;
}

table.list-table th,
table.list-table td {
    border: 1px solid #dcdde1;
    padding: 0.6rem 0.8rem;
    text-align: left;
    white-space: nowrap;
}

table.list-table th {
    background: #f1f2f6;
    font-weight: bold;
}

.list-table thead th {
    position: sticky;
    top: 0;
    background: #f1f2f6;
    z-index: 2;
}

.list-table th:nth-child(1),
.list-table td:nth-child(1) {
    width: 140px; /* 取引先コード */
}

.list-table th:nth-child(2),
.list-table td:nth-child(2) {
    width: auto;  /* 会社名 */
}

.list-table th:nth-child(4),
.list-table td:nth-child(4) {
    width: 80px;  /* ステータス */
    text-align: center;
}

/* 行 hover（重要） */
table.list-table tbody tr {
    cursor: pointer;                 /* ← pointer 復活 */
    transition: background-color 0.15s;
}

table.list-table tbody tr:hover {
    background-color: #dfe6e9;       /* ← hover 背景 */
}

table.list-table tbody tr:hover td {
    text-decoration: none;
}

table.list-table tbody tr:hover td:nth-child(2) {
    text-decoration: underline;
}

.list-table td a {
    color: inherit;
    text-decoration: none;
}

.list-table tbody tr:hover td a {
    text-decoration: underline;
}

.status.active {
    color: #2d3436;
    font-weight: bold;
}

.status.inactive {
    color: #b2bec3;
}

/* =====================================================
   取引先詳細テーブル
===================================================== */
/* 詳細テーブルの基本デザイン */
.detail-table {
    width: 100%;
    border-collapse: collapse; /* 罫線を1本にまとめる */
    margin-top: 1.5rem; font-size: 15px;
}

/* 見出しセル */
.detail-table th {
    background: #f5f5f5;
    padding: 10px;
    text-align: right;
    width: 180px;
    border: 1px solid #ccc;
    font-weight: bold;
}

/* 値セル */
.detail-table td {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: left;
}

.action-area {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* ===============================
   編集画面 UI（業務標準）
=============================== */

/* テーブル全体 */
.detail-table {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    border-collapse: separate;
    border-spacing: 0 12px;
}

/* 左ラベル列 */
.detail-table th {
    width: 180px;
    text-align: left;
    padding: 10px;
    font-weight: 600;
    vertical-align: middle;
    color: #333;
}

/* 右入力列 */
.detail-table td {
    padding: 10px;
}

/* 入力系 */
.detail-table input[type="text"],
.detail-table textarea,
.detail-table select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: 0.2s;
}

/* フォーカス時 */
.detail-table input:focus,
.detail-table textarea:focus,
.detail-table select:focus {
    border-color: #74b9ff;
    outline: none;
    box-shadow: 0 0 4px rgba(116,185,255,0.4);
}

/* textarea */
.detail-table textarea {
    min-height: 100px;
    resize: vertical;
}

/* ===============================
   ボタンエリア
=============================== */

.form-buttons {
    text-align: center;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;   /* ← ボタン間の距離 */
}

.form-buttons button,
.form-buttons a {
    display: inline-block;
    padding: 10px 24px;
    margin: 0;
    font-size: 15px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
}

/* 保存ボタン */
.btn-save {
    background-color: #0984e3;
    color: #fff;
}

.btn-save:hover {
    background-color: #0873c4;
}

/* 戻るボタン */
.btn-back {
    background-color: #b2bec3;
    color: #fff;
}

.btn-back:hover {
    background-color: #95a5a6;
}

/* =====================================================
   フッター
===================================================== */
.footer {
    margin-top: 2rem;
    text-align: right;
}

.footer a {
    text-decoration: none;
    color: #0984e3;
}

.footer a:hover {
    text-decoration: underline;
}

