/* =========================================
   Modern Admin Layout CSS
   ========================================= */

/* ===== リセット軽量版 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ===== ヘッダー ===== */
#header {
    background: #1e3a8a;
    color: #fff;
    padding: 18px 30px;
    font-size: 20px;
    font-weight: 600;
}

/* ===== 全体レイアウト ===== */
#contents {
    max-width: 1100px;
    margin: 40px auto;
    display: flex;
    gap: 30px;
    text-align: left;
}

/* ===== ナビゲーション ===== */
.nav {
    width: 200px;
}

.nav ul {
    padding: 0;
    margin: 0;
}

.nav li {
    list-style: none;
    margin-bottom: 10px;
}

.nav a {
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    background: #ffffff;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.nav a:hover {
    background: #e0e7ff;
}

.nav .select a {
    background: #1e3a8a;
    color: #fff;
}

/* ===== メインカード ===== */
#main {
    flex: 1;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    flex: 1;
    margin-top: 0;       /* 元々余白がない場合 */
    padding-top: 20px;   /* ナビと被らない余白を追加 */}

/* ===== 見出し ===== */
.header1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ===== フォーム ===== */
form#frm_a table {
    width: 100%;
}

input.txt,
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

input.submit,
.btn_mini {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

input.submit:hover,
.btn_mini:hover {
    background: #1d4ed8;
}

/* ===== テーブル ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    background: #f3f4f6;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

/* ===== 削除ボタン風リンク ===== */
a[href*="flag=1"] img {
    opacity: 0.6;
}

a[href*="flag=1"]:hover img {
    opacity: 1;
}

/* ===== フッター ===== */
#footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #777;
}

/* ===== スマホ対応 ===== */
@media (max-width: 768px) {

    #contents {
        flex-direction: column;
        margin: 20px;
    }

    .nav {
        width: 100%;
    }

    .nav ul {
        display: flex;
        gap: 10px;
    }

    .nav li {
        flex: 1;
    }

    #main {
        padding: 20px;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    th {
        background: none;
        padding: 10px 0;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
    }
}


/* ===== レイアウト ===== */
#contents {
    max-width: 1100px;
    margin: 40px auto;
    display: flex;
    align-items: flex-start;   /* 上揃え */
    gap: 30px;
}

/* ===== ナビ（左固定縦並び） ===== */
.nav {
    width: 220px;
    flex-shrink: 0;            /* 縮まないように */
}

.nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav li {
    margin-bottom: 12px;
}

.nav a {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    background: #ffffff;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: 0.2s;
}

/* ホバー */
.nav a:hover {
    background: #e0e7ff;
}

/* 選択中 */
.nav .select a {
    background: #1e3a8a;
    color: #fff;
}

/* ===== メイン ===== */
#main {
    flex: 1;
}


/* ===== 古いfloatレイアウトを無効化 ===== */

.top #contents #wrapper .nav,
#main {
    float: none !important;
}

/* ===== 新レイアウト ===== */

#contents {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.nav {
    width: 220px;
    flex-shrink: 0;
}

#main {
    flex: 1;
}

/* ===== ナビ縦並び ===== */

.nav ul {
    margin: 0;
    padding: 0;
}

.nav li {
    list-style: none;
    margin-bottom: 12px;
}

.nav a {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.nav .select a {
    background: #1e3a8a;
    color: #fff;
}


/* ===== wrapperをFlexに ===== */
#contents #wrapper {
    display: flex !important;
    align-items: flex-start;
    gap: 30px;
}

/* ===== 古いfloatを無効化 ===== */
#contents #wrapper .nav,
#main {
    float: none !important;
    width: auto !important;
}

/* ===== ナビ縦並び ===== */
.nav {
    flex-shrink: 0;
    width: 220px;
}

.nav ul {
    margin: 0;
    padding: 0;
}

.nav li {
    list-style: none;
    margin-bottom: 12px;
}

.nav a {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.nav .select a {
    background: #1e3a8a;
    color: #fff;
}

/* ===== メインを横に広げる ===== */
#main {
    flex: 1;
}


/* ヘッダー全体 */
#header {
    position: relative;      /* 相対位置にして内部を右寄せ可能に */
    padding: 15px 20px;
    background: url(../img/header/bg_header01.png) repeat-x left top;
    color: #fff;
    font-size: 14pt;
    font-weight: bold;
}

/* 「管理者 ログアウト」を右寄せ */
#head {
    position: absolute;
    top: 15px;               /* ヘッダー内の縦位置 */
    right: 20px;             /* ヘッダー内の右端 */
    font-size: 12pt;
    color: #fff;
}
#head a {
    color: #fff;
    text-decoration: underline;
    margin-left: 10px;
}


#main .header1 {
    margin-top: 0;
    padding: 15px 10px;
    background-color: #5A5CA8; /* 紫 */
    color: #fff;
    border-radius: 6px;
}


/* ヘッダー全体をFlexに */
#header {
    display: flex;
    justify-content: space-between; /* 左右に分ける */
    align-items: center;            /* 縦中央揃え */
    padding: 15px 20px;
    background: url(../img/header/bg_header01.png) repeat-x left top;
    color: #fff;
    font-size: 14pt;
    font-weight: bold;
}

/* 左側の見出し */
#header h1 {
    font-size: 16pt;
    margin: 0;
}

/* 右側のログアウト */
#head {
    position: static; /* もはや絶対配置は不要 */
    font-size: 12pt;
    color: #fff;
}
#head a {
    color: #fff;
    text-decoration: underline;
    margin-left: 10px;
}


/* 横並び */
#frm_a .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

#frm_a .filter-item {
  display: flex;
  flex-direction: column;
}

#frm_a .filter-item label {
  font-weight: bold;
  margin-bottom: 4px;
}

/* ボタンだけ高さ揃え */
#frm_a .filter-item input.btn_mini {
  margin-top: auto;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

#frm_a .filter-item input.btn_mini:hover {
  background: #1d4ed8;
}

/* スマホ対応: 縦並び */
@media (max-width: 768px) {
  #frm_a .filter-row {
    flex-direction: column;
    gap: 10px;
  }
}


/* ===============================
   スマホ時 テーブルをカード化
   =============================== */
@media (max-width: 768px) {

  table {
    border-collapse: separate;
  }

  table tr {
    display: block;
    background: #fff;
    margin-bottom: 15px;        /* レコード間の余白 */
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  }

  table td {
    display: block;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #eee;
  }

  table td:last-child {
    border-bottom: none;        /* 最後は線なし */
  }

  /* 項目名を目立たせる */
  table td::before {
    font-weight: bold;
    color: #555;
    display: block;
    margin-bottom: 3px;
  }
}


table td::before {
  content: attr(label);
  font-weight: bold;
  font-size: 12px;
  color: #1e3a8a;
}
