/* ============================================================
   BASE  ― リセット・ボディ基本設定
============================================================ */
body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background-color: #f2f5f9;
  color: #333;
  line-height: 2.0;
  margin: 0;
  padding: 0;
}

p {
  margin-bottom: 15px;
}


/* ============================================================
   LAYOUT  ― サイドバー（header）／メインコンテンツ（main）
============================================================ */
header {
  position: fixed;
  left: 0;
  top: 0;
  width: 210px;
  height: 100vh;
  background: #202b39;
  padding: 16px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

main {
  margin-left: 210px;
  padding: 24px 32px;
  min-height: 100vh;
  background: #f2f5f9;
}


/* ============================================================
   HEADER INNER  ― タイトル・日付・ナビ
============================================================ */
header h1 {
  margin: 0 0 4px;
  font-size: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #3a4f66;
}

header h1 a {
  color: #5bc0f5;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 0.05em;
}

header .date-info {
  font-size: 12px;
  color: #a0b4c8;
  line-height: 1.7;
  padding: 8px 4px;
  border-bottom: 1px solid #3a4f66;
}

header .date-info strong {
  font-size: 13px;
}

header .date-info .shipping {
  color: #5bc0f5;
}

header nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

header nav a {
  text-decoration: none;
  color: #c0d0e0;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}

header nav a:hover {
  background: #2e4460;
  color: #fff;
}

header nav a.nav-active {
  background: #2980b9;
  color: #fff;
  font-weight: bold;
}


/* ============================================================
   HEADINGS  ― 見出し
============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 10px;
}

h2 {
  font-size: 18px;
  color: #1e2a3a;
  border-left: 4px solid #4a90d9;
  padding-left: 10px;
  margin-bottom: 16px;
}

h3 {
  font-size: 15px;
  color: #2c3e50;
  margin-top: 24px;
  margin-bottom: 8px;
}

h4 {
  font-size: 13px;
  color: #555;
  margin-top: 16px;
  margin-bottom: 6px;
}


/* ============================================================
   TABLE  ― テーブル共通スタイル
============================================================ */
table {
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
  font-size: 13px;
}

th {
  background: #2c3e50;
  color: #fff;
  padding: 7px 12px;
  font-weight: normal;
  text-align: center;
  border: 1px solid #3a4f66;
}

td {
  border: 1px solid #dde3ea;
  padding: 6px 12px;
  color: #333;
}


tr:hover td {
  background: #eef3fa;
}

/* 在庫不足行 */
.low-stock td {
  background: #fff0f0 !important;
}

.low-stock:hover td {
  background: #ffe4e4 !important;
}


/* ============================================================
   TABLE  ― 休業日カレンダー専用（グローバルスタイルを除外）
============================================================ */
.cal-table th {
  width: 62px;
  padding: 6px;
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
  text-align: center;
  font-size: 13px;
}

.cal-table td {
  width: 62px;
  height: 54px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.cal-table tr:nth-child(even) td         { background: #fff; }
.cal-table tr:hover td                   { background: inherit; }
.cal-table td.sat-cell,
.cal-table tr:nth-child(even) td.sat-cell    { background: #eaf4fb; }
.cal-table td.sun-cell,
.cal-table tr:nth-child(even) td.sun-cell    { background: #fdf0f0; }
.cal-table td.holiday-cell,
.cal-table tr:nth-child(even) td.holiday-cell { background: #fff0c0; }
.cal-table td.empty,
.cal-table tr:nth-child(even) td.empty       { background: #fafafa; }


/* ============================================================
   TABLE  ― 在庫テーブル（stocks-table）
============================================================ */
.stocks-table {
  border-collapse: separate;
  border-spacing: 0;
}

.stocks-table th,
.stocks-table td {
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  padding: 3px 7px;
  text-align: center;
  font-size: 14px;
}

.stocks-table thead th:first-child,
.stocks-table tbody td:first-child {
  border-left: 1px solid #ccc;
}

.stocks-table thead tr:first-child th {
  border-top: 1px solid #ccc;
}

.stocks-table .main-row td {
  background: #fff;
  vertical-align: middle;
}

.stocks-table .sub-row td {
  background: #fafafa;
  font-size: 14px;
  padding: 1px;
}

/* 在庫数 */
.stock-num {
  color: #222;
  font-weight: bold;
  font-size: 18px;
}

/* 品番列：在庫数と同じフォント・左寄せ（ボディのみ） */
.stocks-table tbody td[data-col="0"] {
  font-size: 18px;
  font-weight: bold;
  text-align: left;
}

/* 商品名列：左寄せ（ボディのみ） */
.stocks-table tbody td[data-col="1"] {
  text-align: left;
}

.stocks-table .low .stock-cell {
  background: #ffeb3b !important;
}

.stocks-table .negative .stock-cell {
  background: #e74c3c !important;
  color: #fff;
}

/* 先月末 */
.prev-label { color: #888; font-size: 12px; margin-right: 3px; }
.prev-num   { color: #555; }

/* 入荷 */
.purchase-label {
  color: #2980b9;
  font-size: 12px;
  font-weight: bold;
  margin-right: 4px;
  margin-left: 10px;
}

.purchase-num {
  color: #2980b9;
  font-weight: bold;
}

/* 出荷内訳 */
.sale-total { font-weight: bold; margin: 0px 6px; }
.breakdown  { color: #777; font-size: 12px; }
.normal     { color: #222; }
.overseas   { color: #ffa500; font-weight: bold; }
.express    { color: #e74c3c; font-weight: bold; }
.sep        { color: #bbb; margin: 0 3px; }


/* ============================================================
   MONTH TABS  ― 月タブ切り替え
============================================================ */
.year-label {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 6px;
}

.year-month-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.month-tabs a {
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  font-size: 13px;
  background: #f7f7f7;
}

.month-tabs a.active {
  background: #2980b9;
  color: #fff;
  border-color: #2980b9;
  font-weight: bold;
}


/* ============================================================
   CLOSE BUTTON  ― 月締めボタン
============================================================ */
.close-btn {
  margin-bottom: 14px;
  text-align: right;
}

.closed-badge {
  display: inline-block;
  padding: 5px 14px;
  background: #eaf4e8;
  color: #27ae60;
  border: 1px solid #27ae60;
  border-radius: 4px;
  font-size: 13px;
}


/* ============================================================
   CALENDAR  ― 休業日カレンダー ナビ・日付ボタン
============================================================ */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.cal-nav a {
  padding: 4px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  background: #f7f7f7;
}

.cal-nav .cal-title {
  font-size: 18px;
  font-weight: bold;
}

.cal-table th.sat { color: #2980b9; }
.cal-table th.sun { color: #e74c3c; }

.cal-table td.today-cell {
  outline: 2px solid #4a90d9;
  outline-offset: -3px;
}

/* 日付ボタン（カレンダー専用・グローバルボタンスタイルをリセット） */
.day-btn {
  display: block;
  width: 100%;
  height: 54px;
  background: none !important;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #333;
}

.day-btn:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.day-num {
  display: block;
  font-size: 16px;
}

.sat-cell .day-num  { color: #2980b9; }
.sun-cell .day-num  { color: #e74c3c; }

.holiday-label {
  display: block;
  font-size: 10px;
  color: #c0392b;
  margin-top: 1px;
}

.legend {
  margin-top: 16px;
  font-size: 12px;
  color: #777;
  display: flex;
  gap: 14px;
}

.legend-box {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid #ddd;
  vertical-align: middle;
  margin-right: 3px;
}


/* ============================================================
   FORM  ― フォームパーツ
============================================================ */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  padding: 6px 10px;
  border: 1px solid #c0ccd8;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  background: #fff;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

/* 通常ボタン（.day-btn は除外） */
button[type="submit"]:not(.day-btn),
button:not([disabled]):not(.day-btn) {
  padding: 6px 18px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

button[type="submit"]:not(.day-btn):hover,
button:not([disabled]):not(.day-btn):hover {
  background: #2e78c7;
}

/* 無効ボタン */
button[disabled]:not(.day-btn) {
  padding: 6px 18px;
  background: #b0bcc8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: not-allowed;
}


/* ============================================================
   FLASH  ― フラッシュメッセージ
============================================================ */
.flash {
  list-style: none;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  color: #856404;
  font-size: 13px;
}


/* ============================================================
   FILTER BAR  ― メーカー・セクションフィルター
============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 6px;
  font-size: 13px;
}

.filter-bar label {
  color: #555;
  font-weight: bold;
  white-space: nowrap;
}

.section-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0;
}

.section-tabs a {
  padding: 6px 16px;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  text-decoration: none;
  color: #555;
  font-size: 13px;
  background: #f0f4f8;
}

.section-tabs a:hover {
  background: #e0e8f4;
  text-decoration: none;
}

.section-tabs a.active {
  background: #fff;
  color: #1e2a3a;
  font-weight: bold;
  border-color: #ccc;
  position: relative;
  bottom: -1px;
}


/* ============================================================
   PAGINATION  ― ページネーション
============================================================ */
.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
  margin: 16px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  color: #333;
  background: #f7f7f7;
}

.pagination a:hover {
  background: #e8eef7;
  text-decoration: none;
}

.pagination .current {
  background: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
  font-weight: bold;
}

.pagination .disabled {
  color: #bbb;
  cursor: default;
  border-color: #e0e0e0;
  background: #fafafa;
}


/* ============================================================
   LINK  ― リンク
============================================================ */
a {
  color: #2e78c7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}
