/* GLANSHIFT 共通スタイル — スマートフォン最優先（仕様書 §14 / §45） */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", sans-serif;
  background: #f0f2f5;
  color: #202124;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  padding-bottom: 88px;
}

a { color: #1a73e8; }

.header {
  background: #1a73e8;
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.header.dark { background: #202124; }

.header h1 {
  font-size: 15px;
  font-weight: 600;
}

.header-sub {
  font-size: 11px;
  opacity: 0.9;
  margin-top: 2px;
}

.header-link {
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.header.dark .header-link { background: #3c4043; }

.container {
  padding: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.container.wide { max-width: 600px; }

.card {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #444;
  border-left: 3px solid #1a73e8;
  padding-left: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.period-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  padding: 8px 6px;
  border: 2px solid #ddd;
  background: #fff;
  color: #555;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
}

.tab-btn .tab-title { font-size: 13px; }
.tab-btn .tab-sub { font-size: 10px; opacity: 0.8; margin-top: 2px; }
.tab-btn.active {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

.date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}

.date-row:last-child { border-bottom: none; }

.date-label { font-size: 13px; font-weight: 500; }
.date-label.sun { color: #d93025; }
.date-label.sat { color: #1a73e8; }

.time-select,
.form-input,
.form-select,
.store-select,
.time-sel {
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
  background: #fff;
}

.time-select { width: 130px; }
.form-input,
.form-select,
.store-select { width: 100%; }

.form-group { margin-bottom: 10px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: bold;
  margin-left: 4px;
  white-space: nowrap;
}

.badge-req { background: #e8f0fe; color: #1a73e8; }
.badge-conf { background: #e6f4ea; color: #137333; }
.badge-chg { background: #fef7e0; color: #b06000; }
.badge-del { background: #fce8e6; color: #c5221f; }
.badge-linked { background: #e6f4ea; color: #137333; }
.badge-unlinked { background: #fef7e0; color: #b06000; }
.badge-leave { background: #feefe3; color: #b06000; }
.badge-retired { background: #fce8e6; color: #c5221f; }

.footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 10px 16px;
  border-top: 1px solid #ddd;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 8px;
  z-index: 90;
  max-width: 600px;
  margin: 0 auto;
}

.submit-btn,
.btn-primary,
.btn-submit {
  width: 100%;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.btn-save { flex: 2; background: #1a73e8; color: #fff; border: none; border-radius: 6px; padding: 12px 6px; font-size: 14px; font-weight: bold; cursor: pointer; }
.btn-export { flex: 1; background: #34a853; color: #fff; border: none; border-radius: 6px; padding: 12px 6px; font-size: 13px; font-weight: bold; cursor: pointer; }
.btn-secondary {
  background: #5f6368;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.btn-line {
  width: 100%;
  background: #06C755;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.submit-btn:disabled,
.btn-primary:disabled,
.btn-submit:disabled,
.btn-save:disabled,
.btn-export:disabled,
.btn-line:disabled,
.btn-save-order:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.select-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.select-label {
  font-size: 12px;
  font-weight: bold;
  width: 45px;
  color: #555;
  flex-shrink: 0;
}

.date-scroll-wrapper {
  overflow-x: auto;
  white-space: nowrap;
  padding: 6px 0 10px 0;
  -webkit-overflow-scrolling: touch;
}

.date-scroll-wrapper::-webkit-scrollbar { display: none; }

.date-pills { display: inline-flex; gap: 6px; }

.date-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #ccc;
  cursor: pointer;
  min-width: 68px;
}

.date-pill.active {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

.date-pill .pill-date { font-size: 12px; font-weight: bold; }
.date-pill .pill-count { font-size: 10px; opacity: 0.85; margin-top: 1px; }
.date-pill.sun:not(.active) { color: #c5221f; border-color: #fce4d6; background: #fff8f6; }
.date-pill.sat:not(.active) { color: #1a73e8; border-color: #ddebf7; background: #f6faff; }

.main-card-header {
  font-size: 14px;
  font-weight: bold;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a73e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.staff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 4px;
}

.staff-row:last-child { border-bottom: none; }
.staff-name {
  font-weight: 600;
  font-size: 13px;
  width: 75px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.req-box {
  font-size: 11px;
  color: #555;
  width: 75px;
  text-align: left;
  line-height: 1.2;
}

.req-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: bold;
  margin-top: 2px;
}

.req-badge.changed { background: #fef7e0; color: #b06000; }
.req-badge.cancelled { background: #fce8e6; color: #c5221f; }

.time-inputs {
  display: flex;
  align-items: center;
  gap: 3px;
}

.time-sel {
  border: 1.5px solid #1a73e8;
  font-weight: bold;
  background: #f4f8ff;
  width: 68px;
  text-align: center;
  padding: 5px 3px;
  font-size: 12px;
}

.view-tabs { display: flex; gap: 6px; margin-bottom: 10px; }

.btn-save-order {
  background: #34a853;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.staff-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 4px;
  gap: 6px;
}

.staff-item.inactive { opacity: 0.75; background: #fafafa; }
.staff-left { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }
.drag-handle { color: #aaa; font-size: 16px; cursor: grab; padding: 4px 6px; }
.staff-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.staff-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.staff-name-btn {
  font-size: 13px;
  font-weight: bold;
  color: #1a73e8;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.staff-sub { font-size: 11px; color: #777; }
.staff-actions { display: flex; gap: 4px; flex-shrink: 0; }

.btn-action {
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-qr { background: #e8f0fe; color: #1a73e8; border-color: #d2e3fc; }
.btn-status-act { background: #e6f4ea; color: #137333; border-color: #ceead6; }
.btn-status-leave { background: #feefe3; color: #b06000; border-color: #fad2cf; }
.btn-status-retire { background: #fce8e6; color: #c5221f; border-color: #fad2cf; }

.overlay,
.preview-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  width: 88%;
  max-width: 340px;
  text-align: center;
}

.modal h3 { font-size: 15px; margin-bottom: 8px; }
.modal p { font-size: 13px; margin: 10px 0; color: #444; }

.modal-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
}

.modal-btn-sub { background: #eee; color: #333; }

.preview-modal-overlay { background: rgba(0, 0, 0, 0.7); z-index: 1000; }

.preview-modal {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 950px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  padding: 12px 16px;
  background: #202124;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-header h3 { font-size: 14px; }

.btn-close-preview {
  background: #5f6368;
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-weight: bold;
}

.matrix-wrapper {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 11px;
}

.matrix-table th,
.matrix-table td {
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  padding: 6px 4px;
  text-align: center;
  min-width: 58px;
}

.matrix-table th.col-staff,
.matrix-table td.col-staff {
  position: sticky;
  left: 0;
  background: #f8f9fa;
  z-index: 5;
  font-weight: bold;
  min-width: 75px;
  max-width: 75px;
  text-align: left;
  padding-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 2px solid #ccc;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  background: #f1f3f4;
  z-index: 6;
  font-weight: bold;
}

.matrix-table thead th.col-staff { z-index: 7; }
.matrix-table th.sun,
.matrix-table td.sun { background: #fff8f6; color: #c5221f; }
.matrix-table th.sat,
.matrix-table td.sat { background: #f6faff; color: #1a73e8; }

.cell-confirmed {
  font-weight: bold;
  color: #1a73e8;
  background: #e8f0fe;
  border-radius: 3px;
  padding: 2px 0;
}

.cell-req { color: #888; font-size: 10px; }
.cell-empty { color: #ccc; }

.matrix-footer-row td {
  position: sticky;
  bottom: 0;
  background: #e8eaed;
  font-weight: bold;
  z-index: 6;
}

.matrix-footer-row td.col-staff { z-index: 7; }

.gate-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 360px;
  text-align: center;
  margin: 40px auto;
}

.gate-card h2 { font-size: 16px; margin-bottom: 8px; }
.gate-card .desc { font-size: 13px; color: #666; line-height: 1.5; }

.text-error { color: #c5221f; font-weight: bold; font-size: 14px; margin-bottom: 8px; }
.text-success { color: #137333; font-weight: bold; font-size: 15px; margin-bottom: 8px; }

.info-box {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  margin-bottom: 20px;
}

.info-row {
  font-size: 13px;
  margin-bottom: 6px;
  display: flex;
}

.info-label { color: #666; width: 70px; flex-shrink: 0; }
.info-val { font-weight: bold; color: #202124; }

.qr-container {
  display: flex;
  justify-content: center;
  padding: 10px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
}

.qr-url-box {
  font-size: 11px;
  color: #666;
  word-break: break-all;
  background: #eee;
  padding: 6px;
  border-radius: 4px;
  text-align: left;
}

.todo-banner {
  background: #fef7e0;
  color: #7a5a00;
  border: 1px solid #f6e7a8;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.locked-select {
  opacity: 0.65;
  pointer-events: none;
  background: #f5f5f5;
}

.confirmed-line {
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
}

.confirmed-line:last-child { border-bottom: none; }

.register-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: 16px;
}

.icon-box {
  width: 52px;
  height: 52px;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  margin: 0 auto 16px auto;
}
