/* ===========================================
   b-common.css - B系管理画面共通スタイル
   =========================================== */

/* ===========================================
   識別用ヘッダー帯（B系専用）
   =========================================== */
.system-identifier {
  background: #1B5E4A;
  color: white;
  padding: 14px 24px;
  text-align: center;
  flex-shrink: 0;
}

.system-identifier-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-identifier-main {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.system-identifier-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}

.system-identifier-actions {
  font-size: 12px;
}

.logout-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.logout-link:hover {
  text-decoration: underline;
}

/* ===========================================
   レイアウトコンテナ
   =========================================== */
.layout-container {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ===========================================
   サイドバー（B系専用）
   =========================================== */
.sidebar {
  width: 240px;
  background: #234F42;
  color: white;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: rgba(255,255,255,0.95);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-nav-item {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  transition: all 0.2s;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  border-left: 3px solid #6FCF97;
  padding-left: 17px;
}

.sidebar-nav-item .nav-icon {
  display: inline-block;
  width: 20px;
  margin-right: 10px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 16px;
}

.sidebar-notice {
  padding: 16px;
  border-top: none;
}

.sidebar-notice-text {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
}

/* ===========================================
   メインエリア
   =========================================== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

/* ===========================================
   メインコンテナ（準フル幅・左寄せ）
   =========================================== */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  width: 100%;
  margin-left: 0;
  margin-right: auto;
  padding: 24px 32px;
}

/* ===========================================
   ページヘッダー
   =========================================== */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: #2C3E50;
  margin-bottom: 8px;
}

.page-description {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
}

/* ===========================================
   コンテンツグリッド
   =========================================== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

/* ===========================================
   サマリーカードグリッド
   =========================================== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.summary-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 4px solid #1B5E4A;
}

.summary-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 12px;
}

.summary-card-value {
  font-size: 28px;
  font-weight: 600;
  color: #1B5E4A;
  margin-bottom: 8px;
}

.summary-card-value span {
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-left: 4px;
}

.summary-card-breakdown {
  font-size: 12px;
  color: #888;
  line-height: 1.6;
}

.summary-card-breakdown .active {
  color: #1B5E4A;
}

.summary-card-breakdown .inactive {
  color: #999;
}

/* ===========================================
   セクションカード
   =========================================== */
.section-card {
  background: white;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

.section-header {
  background: #FAFAFA;
  padding: 14px 20px;
  border-bottom: 1px solid #EEE;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #2C3E50;
}

.section-link {
  font-size: 12px;
  color: #1B5E4A;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover {
  text-decoration: underline;
}

.section-link::after {
  content: "→";
}

.section-body {
  padding: 20px;
}

.section-body.no-padding {
  padding: 0;
}

/* ===========================================
   データテーブル
   =========================================== */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #EEE;
}

.data-table th {
  background: #FAFAFA;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

.data-table td {
  font-size: 13px;
  color: #333;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #F8F9FA;
}

/* ===========================================
   ステータスバッジ
   =========================================== */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.active {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-badge.inactive {
  background: #F5F5F5;
  color: #888;
}

.status-badge.pending {
  background: #FFF8E1;
  color: #F57C00;
}

.status-badge.scheduled {
  background: #E3F2FD;
  color: #1565C0;
}

.status-badge.cancelled {
  background: #FFEBEE;
  color: #C62828;
}

.status-badge.stopped {
  background: #FFEBEE;
  color: #C62828;
}

/* ===========================================
   ナビゲーションカード
   =========================================== */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.nav-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

.nav-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.nav-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.nav-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #2C3E50;
  margin-bottom: 6px;
}

.nav-card-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
}

/* ===========================================
   ボタン
   =========================================== */
.btn-edit {
  display: inline-block;
  padding: 6px 12px;
  background: #F5F5F5;
  border: 1px solid #DDD;
  border-radius: 4px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit:hover {
  background: #EEEEEE;
  border-color: #CCC;
}

.btn-primary {
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: #1B5E4A;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #247A5E;
}

.btn-primary:active {
  background: #144536;
}

.btn-secondary {
  padding: 12px 20px;
  background: #F5F5F5;
  color: #333;
  border: 1px solid #DDD;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #EEEEEE;
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #1B5E4A;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-new:hover {
  background: #247A5E;
}

.btn-save {
  display: inline-block;
  padding: 10px 20px;
  background: #1B5E4A;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-save:hover {
  background: #247A5E;
}

/* 操作ボタングループ */
.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 利用停止ボタン */
.btn-suspend {
  display: inline-block;
  padding: 6px 10px;
  background: #FFF3E0;
  border: 1px solid #FFB74D;
  border-radius: 4px;
  font-size: 11px;
  color: #E65100;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-suspend:hover {
  background: #FFE0B2;
}

/* 利用再開ボタン */
.btn-resume {
  display: inline-block;
  padding: 6px 10px;
  background: #E8F5E9;
  border: 1px solid #81C784;
  border-radius: 4px;
  font-size: 11px;
  color: #2E7D32;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-resume:hover {
  background: #C8E6C9;
}

/* QR発行ボタン */
.btn-qr {
  display: inline-block;
  padding: 6px 10px;
  background: #E3F2FD;
  border: 1px solid #64B5F6;
  border-radius: 4px;
  font-size: 11px;
  color: #1565C0;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-qr:hover {
  background: #BBDEFB;
}

/* ===========================================
   フォーム
   =========================================== */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-of-type {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.form-label .required {
  color: #C62828;
  font-size: 11px;
  margin-left: 4px;
}

.form-label .optional {
  color: #888;
  font-size: 11px;
  margin-left: 4px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #DDD;
  border-radius: 6px;
  background: #FAFAFA;
  color: #333;
  transition: border-color 0.2s, background 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #1B5E4A;
  background: white;
}

.form-input::placeholder {
  color: #AAA;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #DDD;
  border-radius: 6px;
  background: #FAFAFA;
  color: #333;
  transition: border-color 0.2s, background 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: #1B5E4A;
  background: white;
}

/* ===========================================
   注意文言
   =========================================== */
.form-notice {
  background: #F8F9FA;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 16px;
}

.form-notice-text {
  font-size: 11px;
  color: #666;
  line-height: 1.7;
}

.page-notice {
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 6px;
  padding: 14px 16px;
  margin-top: 20px;
}

.page-notice-text {
  font-size: 12px;
  color: #6D4C00;
  line-height: 1.7;
}

/* ===========================================
   フッター
   =========================================== */
.admin-footer {
  background: #FAFAFA;
  border-top: 1px solid #E0E0E0;
  padding: 20px 32px;
  margin-top: auto;
}

.footer-notice {
  max-width: 1200px;
  text-align: left;
}

.footer-notice p {
  font-size: 11px;
  color: #888;
  line-height: 1.8;
  margin-bottom: 4px;
}

.footer-notice p:last-child {
  margin-bottom: 0;
}

.footer-notice strong {
  color: #666;
}

/* ===========================================
   モバイル用ナビゲーション
   =========================================== */
.mobile-nav {
  display: none;
  background: #234F42;
  padding: 12px 16px;
}

.mobile-nav-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  margin-bottom: 10px;
}

.mobile-nav-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-nav-item {
  display: inline-block;
  padding: 8px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.85);
  font-size: 12px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

.mobile-nav-notice {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}

/* ===========================================
   アクションバー
   =========================================== */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.action-bar-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-label {
  font-size: 12px;
  color: #666;
}

.filter-select {
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #DDD;
  border-radius: 4px;
  background: white;
  color: #333;
}

/* キャンセル理由（テーブル内） */
.cancel-reason {
  font-size: 11px;
  color: #888;
}

/* ===========================================
   モーダル
   =========================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-header {
  background: #1B5E4A;
  padding: 16px 20px;
  color: white;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 24px 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #EEE;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer .btn-secondary {
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
}

.modal-footer .btn-primary {
  width: auto;
  flex: 1;
  max-width: 200px;
}

/* 条件付き表示グループ */
.conditional-group {
  display: none;
}

.conditional-group.visible {
  display: block;
}

/* ===========================================
   端末登録用QRコードブロック
   =========================================== */
.qr-section {
  margin-top: 20px;
}

.qr-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

.qr-card-header {
  background: #FAFAFA;
  padding: 14px 20px;
  border-bottom: 1px solid #EEE;
}

.qr-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #2C3E50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-card-title::before {
  content: "📱";
  font-size: 16px;
}

.qr-card-body {
  padding: 20px;
}

.qr-description {
  font-size: 13px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 20px;
}

.qr-display-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: #FAFAFA;
  border: 1px solid #E8E8E8;
  border-radius: 8px;
  margin-bottom: 20px;
}

.qr-code-placeholder {
  width: 200px;
  height: 200px;
  background: white;
  border: 2px dashed #CCC;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
}

/* ダミーQRコードパターン（SVG風デザイン） */
.qr-code-placeholder::before {
  content: "";
  width: 160px;
  height: 160px;
  background: 
    linear-gradient(90deg, #333 25%, transparent 25%, transparent 75%, #333 75%),
    linear-gradient(#333 25%, transparent 25%, transparent 75%, #333 75%),
    linear-gradient(90deg, transparent 33%, #333 33%, #333 66%, transparent 66%),
    linear-gradient(transparent 33%, #333 33%, #333 66%, transparent 66%);
  background-size: 40px 40px, 40px 40px, 20px 20px, 20px 20px;
  background-position: 0 0, 120px 120px, 60px 0, 0 60px;
  opacity: 0.15;
}

.qr-code-placeholder::after {
  content: "QR";
  position: absolute;
  font-size: 32px;
  font-weight: 700;
  color: #1B5E4A;
  opacity: 0.6;
}

.qr-instruction {
  font-size: 12px;
  color: #666;
  text-align: center;
}

.qr-status {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #E8E8E8;
}

.qr-issued-date {
  font-size: 12px;
  color: #888;
  text-align: center;
  margin-top: 4px;
}

.qr-action {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.btn-qr-reissue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: #1B5E4A;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-qr-reissue:hover {
  background: #247A5E;
}

.btn-qr-reissue:active {
  background: #144536;
}

.btn-qr-reissue::before {
  content: "🔄";
  font-size: 14px;
}

.qr-caution {
  background: #FFF8E7;
  border: 1px solid #F5DEB3;
  border-radius: 6px;
  padding: 12px 14px;
}

.qr-caution-text {
  font-size: 11px;
  color: #8B7355;
  line-height: 1.8;
}

/* ===========================================
   警告・注意ボックス
   =========================================== */
.warning-box {
  background: #FFF3E0;
  border: 1px solid #FFB74D;
  border-radius: 6px;
  padding: 14px 16px;
  margin-top: 16px;
}

.warning-box-title {
  font-size: 13px;
  font-weight: 600;
  color: #E65100;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.warning-box-text {
  font-size: 12px;
  color: #6D4C00;
  line-height: 1.7;
}

.info-box {
  background: #E3F2FD;
  border: 1px solid #64B5F6;
  border-radius: 6px;
  padding: 14px 16px;
  margin-top: 16px;
}

.info-box-title {
  font-size: 13px;
  font-weight: 600;
  color: #1565C0;
  margin-bottom: 6px;
}

.info-box-text {
  font-size: 12px;
  color: #0D47A1;
  line-height: 1.7;
}

/* ===========================================
   設定項目（契約・制限設定用）
   =========================================== */
.setting-row {
  display: flex;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid #EEE;
}

.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-row:first-child {
  padding-top: 0;
}

.setting-label {
  width: 200px;
  flex-shrink: 0;
}

.setting-label-main {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.setting-label-sub {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}

.setting-value {
  flex: 1;
}

.setting-current {
  font-size: 24px;
  font-weight: 600;
  color: #1B5E4A;
  margin-bottom: 8px;
}

.setting-current span {
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-left: 4px;
}

.setting-detail {
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
}

/* アプキー専用バッジ */
.appkey-badge {
  display: inline-block;
  background: #E3F2FD;
  color: #1565C0;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===========================================
   ログイン画面用スタイル
   =========================================== */
.login-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 440px;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.system-name {
  font-size: 18px;
  font-weight: 600;
  color: #2C3E50;
  line-height: 1.4;
  margin-bottom: 4px;
}

.system-sub {
  font-size: 12px;
  color: #666;
}

.login-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.login-card-header {
  background: #1B5E4A;
  padding: 20px 24px;
  text-align: center;
}

.login-card-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
}

.login-card-description {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
}

.login-card-body {
  padding: 28px 24px;
}

.login-notice {
  background: #F1F8F5;
  border: 1px solid #A5D6C3;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 24px;
}

.login-notice-title {
  font-size: 13px;
  font-weight: 600;
  color: #1B5E4A;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-notice-title::before {
  content: "📋";
  font-size: 14px;
}

.login-notice-text {
  font-size: 12px;
  color: #4A6D5C;
  line-height: 1.8;
}

.login-notice-text strong {
  color: #1B5E4A;
}

.role-clarification {
  background: #FAFAFA;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 24px;
}

.role-clarification-item {
  font-size: 11px;
  color: #666;
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.role-clarification-item:last-child {
  margin-bottom: 0;
}

.role-clarification-item::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: #999;
}

.login-button {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: #1B5E4A;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.login-button:hover {
  background: #247A5E;
}

.login-button:active {
  background: #144536;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
}

.login-footer-text {
  font-size: 11px;
  color: #888;
  line-height: 1.7;
}

/* ===========================================
   レスポンシブ対応
   =========================================== */

/* タブレット（768px〜1024px） */
@media screen and (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }

  .sidebar-title {
    font-size: 12px;
  }

  .sidebar-nav-item {
    padding: 10px 16px;
    font-size: 12px;
  }

  .main-container {
    max-width: none;
    padding: 20px 24px;
  }

  .summary-grid {
    gap: 12px;
  }

  .summary-card {
    padding: 16px;
  }

  .summary-card-value {
    font-size: 24px;
  }

  .nav-cards {
    gap: 12px;
  }

  .nav-card {
    padding: 16px;
  }

  .content-grid {
    grid-template-columns: 1fr 320px;
    gap: 20px;
  }

  .admin-footer {
    padding: 16px 24px;
  }
}

/* タブレット（〜900px） */
@media screen and (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: block;
  }
}

/* タブレット縦（〜768px） */
@media screen and (max-width: 768px) {
  .system-identifier {
    padding: 12px 20px;
  }

  .system-identifier-main {
    font-size: 14px;
  }

  .system-identifier-sub {
    font-size: 11px;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  /* モーダル - タブレット */
  .modal-content {
    max-width: 420px;
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-title {
    font-size: 15px;
  }

  .modal-body {
    padding: 20px 18px;
  }

  .modal-footer {
    padding: 14px 18px;
  }

  .main-container {
    padding: 16px;
  }

  .page-title {
    font-size: 18px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
  }

  .summary-card-title {
    margin-bottom: 0;
    min-width: 100px;
  }

  .summary-card-value {
    font-size: 22px;
    margin-bottom: 0;
    min-width: 80px;
  }

  .summary-card-breakdown {
    flex: 1;
  }

  .nav-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nav-card {
    flex-direction: row;
    text-align: left;
    padding: 14px 16px;
    gap: 14px;
  }

  .nav-card-icon {
    margin-bottom: 0;
    font-size: 24px;
  }

  .nav-card-content {
    flex: 1;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .admin-footer {
    padding: 16px 20px;
  }

  .footer-notice {
    text-align: center;
  }

  /* ログイン画面 */
  .login-wrapper {
    padding: 20px;
  }

  .login-container {
    max-width: 400px;
  }

  .login-card-body {
    padding: 24px 20px;
  }

  .system-name {
    font-size: 16px;
  }
}

/* スマートフォン（〜600px） */
@media screen and (max-width: 600px) {
  .main-container {
    padding: 16px;
  }

  .page-title {
    font-size: 18px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-bar-left {
    flex-wrap: wrap;
  }

  .data-table {
    min-width: 500px;
  }

  .modal-content {
    margin: 16px;
    max-width: calc(100% - 32px);
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .modal-footer .btn-primary,
  .modal-footer .btn-secondary {
    width: 100%;
    max-width: none;
    text-align: center;
  }

  .setting-row {
    flex-direction: column;
  }

  .setting-label {
    width: 100%;
    margin-bottom: 12px;
  }

  .section-body {
    padding: 16px;
  }

  .section-body.no-padding {
    padding: 0;
  }
}

/* スマートフォン（〜480px） */
@media screen and (max-width: 480px) {
  .system-identifier {
    padding: 10px 16px;
  }

  .system-identifier-main {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .system-identifier-sub {
    font-size: 10px;
  }

  /* モーダル - スマートフォン */
  .modal-overlay {
    padding: 8px;
  }

  .modal-content {
    margin: 0;
    max-width: 100%;
    max-height: calc(100vh - 16px);
    border-radius: 12px;
  }

  .modal-header {
    padding: 14px 16px;
    border-radius: 12px 12px 0 0;
  }

  .modal-title {
    font-size: 15px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-body .form-group {
    margin-bottom: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    border-radius: 0 0 12px 12px;
  }

  .mobile-nav {
    padding: 10px 12px;
  }

  .mobile-nav-title {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .mobile-nav-items {
    gap: 6px;
  }

  .mobile-nav-item {
    padding: 6px 10px;
    font-size: 11px;
  }

  .mobile-nav-notice {
    font-size: 9px;
  }

  .main-container {
    padding: 12px;
  }

  .page-header {
    margin-bottom: 16px;
  }

  .page-title {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .page-description {
    font-size: 11px;
  }

  .content-grid {
    gap: 16px;
  }

  .summary-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .summary-card-title {
    min-width: auto;
  }

  .summary-card-value {
    min-width: auto;
  }

  .section-card {
    margin-bottom: 16px;
  }

  .section-header {
    padding: 10px 12px;
  }

  .section-title {
    font-size: 13px;
  }

  .section-body.with-padding {
    padding: 16px;
  }

  .data-table {
    font-size: 11px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }

  .status-badge {
    padding: 3px 8px;
    font-size: 10px;
  }

  .btn-edit {
    padding: 5px 10px;
    font-size: 11px;
  }

  .form-input {
    padding: 9px 10px;
    font-size: 16px; /* iOS拡大防止 */
  }

  .btn-primary {
    padding: 11px 16px;
    font-size: 13px;
  }

  .form-notice {
    padding: 10px 12px;
  }

  .form-notice-text {
    font-size: 10px;
  }

  .footer-notice p {
    font-size: 10px;
  }

  .nav-card {
    padding: 12px 14px;
  }

  .nav-card-icon {
    font-size: 20px;
  }

  .nav-card-title {
    font-size: 13px;
  }

  .nav-card-desc {
    font-size: 10px;
  }

  /* QRブロック レスポンシブ */
  .qr-card-header {
    padding: 12px 16px;
  }

  .qr-card-title {
    font-size: 13px;
  }

  .qr-card-body {
    padding: 16px;
  }

  .qr-description {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .qr-display-area {
    padding: 20px 12px;
    margin-bottom: 16px;
  }

  .qr-code-placeholder {
    width: 180px;
    height: 180px;
  }

  .qr-code-placeholder::before {
    width: 140px;
    height: 140px;
  }

  .qr-instruction {
    font-size: 11px;
  }

  .qr-status {
    font-size: 12px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .qr-issued-date {
    font-size: 11px;
  }

  .btn-qr-reissue {
    padding: 11px 20px;
    font-size: 13px;
  }

  .qr-caution {
    padding: 10px 12px;
  }

  .qr-caution-text {
    font-size: 10px;
  }

  /* ログイン画面 */
  .login-wrapper {
    padding: 16px;
    justify-content: flex-start;
    padding-top: 24px;
  }

  .login-container {
    max-width: 100%;
  }

  .login-header {
    margin-bottom: 20px;
  }

  .system-name {
    font-size: 15px;
  }

  .system-sub {
    font-size: 11px;
  }

  .login-card-header {
    padding: 16px 20px;
  }

  .login-card-title {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .login-card-description {
    font-size: 11px;
  }

  .login-card-body {
    padding: 20px 16px;
  }

  .login-notice {
    padding: 12px 14px;
    margin-bottom: 20px;
  }

  .login-notice-title {
    font-size: 12px;
  }

  .login-notice-text {
    font-size: 11px;
  }

  .role-clarification {
    padding: 10px 12px;
    margin-bottom: 20px;
  }

  .role-clarification-item {
    font-size: 10px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-label {
    font-size: 12px;
  }

  .login-button {
    padding: 13px 18px;
    font-size: 14px;
  }

  .login-footer-text {
    font-size: 10px;
  }
}

/* ===========================================
   フォーム操作ボタン（編集画面共通）
   =========================================== */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.form-actions-main {
  flex: 1;
}

.form-actions-main .btn-primary {
  width: 100%;
}

.form-actions-sub {
  flex-shrink: 0;
}

/* ===========================================
   フォーム操作ボタン（モバイル対応）
   =========================================== */
@media screen and (max-width: 640px) {

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions-main {
    width: 100%;
  }

  .form-actions-sub {
    display: flex;
    gap: 12px;
    width: 100%;
  }

  .form-actions-sub .btn-secondary {
    flex: 1;
    text-align: center;
  }
}
