:root {
  --header-bg: #fff0ae;
  --main-bg: #fffde8;
  --sidebar-bg: #ffffff;
  --text-brown: #9b4e2d;
  --muted-text: #927967;
  --hover-bg: #fff4d4;
  --border: #ead7bd;
  --sidebar-width: 176px;
  --header-height: 122px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  background: var(--main-bg);
  color: #684e3e;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Meiryo", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.logo-brown {
  color: #9b4e2d;
}

.logo-orange {
  color: #ed9b39;
}

.logo-green {
  color: #75bb58;
}

/* 管理側：共通レイアウト */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding-left: 20px;
  background: var(--header-bg);
}

.logo {
  display: flex;
  align-items: center;
  height: 76px;
  padding: 8px 16px;
  font-size: 53px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  z-index: 10000;
  width: var(--sidebar-width);
  overflow: visible;
  background: var(--sidebar-bg);
  transition: width 0.22s ease;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}

.nav-group {
  position: relative;
  width: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--text-brown);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--hover-bg);
}

.nav-icon {
  width: 20px;
  min-width: 20px;
  color: var(--text-brown);
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

.nav-group.has-submenu > .nav-item::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #ffffff;
  content: "";
  opacity: 0;
  transition: opacity 0.15s ease;
}

.nav-group.has-submenu:hover > .nav-item,
.nav-group.has-submenu.is-current > .nav-item {
  position: relative;
  background: #b96845;
  color: #ffffff;
}

.nav-group.has-submenu:hover > .nav-item .nav-icon,
.nav-group.has-submenu.is-current > .nav-item .nav-icon {
  color: #ffffff;
}

.nav-group.has-submenu:hover > .nav-item::before,
.nav-group.has-submenu.is-current > .nav-item::before {
  opacity: 1;
}

.submenu {
  position: absolute;
  top: 0;
  left: 100%;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  width: 180px;
  padding: 7px 0;
  border-radius: 0 8px 8px 0;
  background: #ffffff;
  box-shadow: 5px 6px 16px rgba(112, 72, 43, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.nav-group.has-submenu:hover > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.submenu-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  color: var(--text-brown);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.submenu-item:hover {
  background: #fff1cf;
  color: #8a4023;
}

.nav-group.has-submenu.is-current > .submenu {
  position: static;
  display: flex;
  width: 100%;
  padding: 4px 0 8px;
  border-radius: 0;
  background: #fffaf1;
  box-shadow: none;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav-group.has-submenu.is-current > .submenu .submenu-item {
  min-height: 30px;
  padding: 0 12px 0 43px;
  background: transparent;
  font-size: 12px;
  font-weight: 400;
}

.nav-group.has-submenu.is-current > .submenu .submenu-item.current {
  color: #7f351f;
  font-weight: 700;
}

.nav-group.has-submenu.is-current > .submenu .submenu-item:hover {
  background: #fff1cf;
}

.main-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  margin-top: var(--header-height);
  margin-left: var(--sidebar-width);
  background: var(--main-bg);
  transition: margin-left 0.22s ease;
}

.menu-closed .sidebar {
  width: 54px;
  overflow: visible;
}

.menu-closed .main-content {
  margin-left: 54px;
}

.menu-closed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 0;
}

.menu-closed .nav-item span:not(.nav-icon) {
  display: none;
}

.menu-closed .nav-icon {
  width: auto;
  min-width: auto;
}

.menu-closed .nav-group.has-submenu.is-current > .submenu {
  display: none;
}

.menu-closed .nav-group.has-submenu:hover > .submenu,
.menu-closed .nav-group.has-submenu.is-current:hover > .submenu {
  position: absolute;
  top: 0;
  left: 54px;
  z-index: 10001;
  display: flex;
  width: 180px;
  padding: 7px 0;
  border-radius: 0 8px 8px 0;
  background: #ffffff;
  box-shadow: 5px 6px 16px rgba(112, 72, 43, 0.16);
  opacity: 1;
  visibility: visible;
  transform: none;
}

.menu-closed .nav-group.has-submenu:hover > .submenu .submenu-item,
.menu-closed .nav-group.has-submenu.is-current:hover > .submenu .submenu-item {
  min-height: 38px;
  padding: 0 18px;
  font-size: 13px;
}

/* 管理側：ログイン */
.login-body {
  min-height: 100vh;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: calc(var(--header-height) + 40px) 20px 40px;
}

.login-card {
  width: min(100%, 420px);
  margin-top: -60px;
  padding: 38px 42px 42px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(135, 93, 44, 0.12);
}

.login-card h1 {
  margin: 0 0 28px;
  color: var(--text-brown);
  font-size: 22px;
  text-align: center;
}

.login-form,
.settings-form {
  display: flex;
  flex-direction: column;
}

.login-form label,
.settings-form label {
  margin: 0 0 7px;
  color: var(--text-brown);
  font-size: 14px;
  font-weight: 700;
}

.login-form input,
.settings-form input,
.coupon-create-textarea,
.consume-form-field input,
.consume-form-field select,
.consume-form-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  color: #5c4637;
  background: #fffef9;
}

.login-form input,
.settings-form input {
  height: 46px;
  margin: 0 0 20px;
  padding: 0 14px;
  font-size: 15px;
}

.login-form input:focus,
.settings-form input:focus,
.coupon-create-textarea:focus,
.consume-form-field input:focus,
.consume-form-field select:focus,
.consume-form-field textarea:focus {
  border-color: #c78d64;
  box-shadow: 0 0 0 3px rgba(199, 141, 100, 0.18);
}

.login-error {
  margin: -3px 0 16px;
  color: #c54d3e;
  font-size: 13px;
}

.login-button,
.save-button,
.customer-settings-save {
  border: 0;
  border-radius: 7px;
  background: #9b4e2d;
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.login-button:hover,
.save-button:hover,
.customer-settings-save:hover,
.consume-submit-button:hover,
.grant-submit-button:hover {
  opacity: 0.88;
}

.login-button {
  width: 100%;
  height: 48px;
  margin-top: 3px;
  font-size: 16px;
}

/* 管理側：フォーム共通 */
.settings-content {
  padding: 42px;
}

.settings-container {
  width: min(100%, 760px);
}

.page-title {
  margin: 0 0 28px;
  color: var(--text-brown);
  font-size: 27px;
  font-weight: 700;
}

.settings-card {
  margin-bottom: 24px;
  padding: 28px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(135, 93, 44, 0.10);
}

.settings-card h2 {
  margin: 0 0 24px;
  color: var(--text-brown);
  font-size: 18px;
}

.settings-form {
  gap: 8px;
}

.settings-form input {
  margin-bottom: 12px;
  padding: 0 13px;
}

.save-button {
  align-self: flex-start;
  min-width: 122px;
  height: 44px;
  margin-top: 4px;
  padding: 0 24px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.required-mark {
  display: inline-flex;
  align-items: center;
  height: 19px;
  margin-left: 7px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f5e1d7;
  color: #b34a35;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.form-help {
  margin: -4px 0 9px;
  color: var(--muted-text);
  font-size: 12px;
  line-height: 1.6;
}

.flash-message {
  margin: 0 0 20px;
  padding: 13px 16px;
  border-radius: 7px;
  font-size: 14px;
}

.flash-message.success {
  border: 1px solid #b6d8a8;
  background: #eff9e9;
  color: #4e873b;
}

.flash-message.error {
  border: 1px solid #efbab2;
  background: #fff1ef;
  color: #b94738;
}

/* 管理側：顧客作成 */
.customer-create-card {
  max-width: 620px;
}

.customer-create-button {
  margin-top: 14px;
}

/* 管理側：顧客一覧 */
.customer-list-content {
  padding: 42px;
}

.customer-list-container {
  width: min(100%, 1100px);
}

.page-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.page-heading-row .page-title {
  margin: 0;
}

.page-create-button,
.empty-create-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 18px;
  border-radius: 7px;
  background: #9b4e2d;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.page-create-button:hover,
.empty-create-button:hover {
  opacity: 0.88;
}

.customer-list-card {
  overflow: visible;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(135, 93, 44, 0.10);
}

.customer-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.customer-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: #684e3e;
  font-size: 14px;
}

.customer-table th {
  padding: 15px 18px;
  background: #fff4d9;
  color: var(--text-brown);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.customer-table td {
  padding: 17px 18px;
  border-bottom: 1px solid #f2e7d8;
  vertical-align: middle;
  white-space: nowrap;
}

.customer-table tbody tr:last-child td {
  border-bottom: 0;
}

.customer-table tbody tr:hover {
  background: #fffdf5;
}

.customer-name-cell {
  min-width: 185px;
  color: var(--text-brown);
  font-weight: 700;
}

.customer-name-menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.customer-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-5px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.customer-table tbody tr:hover .customer-inline-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.customer-action-form {
  margin: 0;
}

.customer-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.detail-action {
  background: #fff0cf;
  color: #9a5a19;
}

.delete-action {
  background: #fde5e1;
  color: #b34435;
}

.consume-cell {
  min-width: 150px;
}

.table-action-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.consume-action {
  min-width: 58px;
  background: #e6f3de;
  color: #4f8a3c;
}

.grant-action {
  min-width: 58px;
  background: #fff0cf;
  color: #a7661f;
}

.count-badge,
.point-badge,
.coupon-point-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.count-badge {
  background: #fff0cf;
  color: #a7661f;
}

.point-badge {
  background: #edf7e7;
  color: #5e9b47;
}

.empty-customer-list {
  padding: 70px 24px;
  text-align: center;
}

.empty-customer-list p {
  margin: 0 0 20px;
  color: var(--muted-text);
  font-size: 14px;
}

/* 管理側：顧客詳細 */
.customer-detail-create-style {
  padding: 20px 36px;
}

.customer-detail-create-style .settings-container {
  width: min(100%, 1180px);
  max-width: none;
}

.customer-detail-back-link {
  display: inline-flex;
  margin: 0 0 6px;
  color: var(--text-brown);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.customer-detail-back-link:hover {
  text-decoration: underline;
}

.customer-detail-create-style .page-title {
  margin: 0 0 14px;
  font-size: 24px;
}

.customer-detail-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 22px;
  max-width: none;
  padding: 20px 24px;
}

.customer-detail-card > .form-field {
  min-width: 0;
  margin: 0;
}

.customer-detail-card > .form-field label {
  margin: 0 0 5px;
  font-size: 13px;
}

.customer-detail-card > .form-field input {
  height: 40px;
  margin: 0 0 4px;
  font-size: 14px;
}

.customer-detail-card .form-help {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.4;
}

.customer-detail-card .customer-coupon-field {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #f0e2d4;
}

.owned-coupon-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.owned-coupon-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #f0dfcb;
  border-radius: 8px;
  background: #fffdf8;
}

.owned-coupon-name {
  color: var(--text-brown);
  font-size: 13px;
  font-weight: 700;
}

.owned-coupon-content {
  color: var(--muted-text);
  font-size: 11px;
  line-height: 1.45;
}

.empty-coupon-message {
  margin: 8px 0 0;
  padding: 10px 14px;
  border: 1px dashed #e5cdb7;
  border-radius: 7px;
  color: var(--muted-text);
  font-size: 13px;
  text-align: center;
}

.customer-detail-card > .customer-create-button {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 150px;
  height: 42px;
  margin-top: 4px;
}

/* 管理側：消費・付与モーダル */
body.modal-open {
  overflow: hidden;
}

.consume-modal {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(66, 48, 34, 0.35);
}

.consume-modal.is-open {
  display: flex;
}

.consume-modal-panel {
  position: relative;
  width: min(100%, 440px);
  padding: 30px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(68, 45, 26, 0.24);
}

.grant-modal-panel,
.coupon-grant-modal-panel {
  width: min(100%, 470px);
}

.consume-modal-panel h2 {
  margin: 0 0 8px;
  color: var(--text-brown);
  font-size: 22px;
}

.consume-modal-info {
  margin: 0 0 24px;
  color: var(--muted-text);
  font-size: 13px;
}

.consume-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff4d9;
  color: var(--text-brown);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.consume-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.consume-form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.consume-form-field label {
  color: var(--text-brown);
  font-size: 14px;
  font-weight: 700;
}

.consume-form-field input,
.consume-form-field select {
  height: 44px;
  padding: 0 12px;
  font-size: 14px;
}

.consume-form-field textarea {
  min-height: 86px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.consume-form-help {
  margin: -3px 0 0;
  color: var(--muted-text);
  font-size: 12px;
  line-height: 1.5;
}

.grant-type-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grant-type-section[hidden],
#selectedCustomerField[hidden] {
  display: none;
}

.consume-submit-button,
.grant-submit-button {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.consume-submit-button {
  background: #5e9b47;
}

.grant-submit-button {
  background: #b87c29;
}

/* 管理側：クーポン作成 */
.coupon-create-content {
  padding: 20px 36px;
}

.coupon-create-container {
  width: min(100%, 1180px);
}

.coupon-create-content .page-title,
.coupon-grant-content .page-title {
  margin: 0 0 6px;
  font-size: 24px;
}

.coupon-page-description {
  margin: 0 0 14px;
  color: var(--muted-text);
  font-size: 12px;
  line-height: 1.6;
}

.coupon-create-card {
  max-width: none;
  padding: 20px 24px;
}

.coupon-create-card .settings-form {
  display: grid;
  grid-template-columns: 1.1fr 2fr 0.8fr auto;
  align-items: end;
  gap: 0 16px;
}

.coupon-create-card .form-field {
  margin: 0;
}

.coupon-create-card .form-field label {
  margin: 0 0 5px;
  font-size: 13px;
}

.coupon-create-card .form-field input {
  height: 42px;
  margin: 0;
}

.coupon-create-textarea {
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 9px 12px;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
}

.coupon-create-card .form-help {
  display: none;
}

.coupon-create-card .customer-create-button {
  align-self: end;
  min-width: 150px;
  height: 42px;
  margin: 0;
  white-space: nowrap;
}

/* 管理側：クーポン一覧・付与 */
.coupon-grant-content {
  padding: 28px 42px;
}

.coupon-grant-container {
  width: min(100%, 1050px);
}

.coupon-grant-content .coupon-page-description {
  margin-bottom: 18px;
}

.coupon-grant-list-card {
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(135, 93, 44, 0.10);
}

.coupon-grant-table {
  width: 100%;
  border-collapse: collapse;
  color: #684e3e;
  font-size: 13px;
}

.coupon-grant-table th {
  padding: 9px 16px;
  background: #fff4d9;
  color: var(--text-brown);
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.coupon-grant-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f2e7d8;
  line-height: 1.4;
  vertical-align: middle;
}

.coupon-grant-table tbody tr:last-child td {
  border-bottom: 0;
}

.coupon-grant-table tbody tr:hover {
  background: #fffdf5;
}

.coupon-grant-name {
  width: 28%;
  color: var(--text-brown);
  font-weight: 700;
}

.coupon-grant-content-text {
  width: 57%;
  color: var(--muted-text);
  white-space: pre-wrap;
}

.coupon-point-badge {
  min-width: 48px;
  min-height: 22px;
  background: #fff0cf;
  color: #a7661f;
  font-size: 10px;
}

.coupon-grant-action-head,
.coupon-grant-action-cell {
  width: 132px;
  text-align: right;
}

.coupon-grant-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-5px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.coupon-grant-row:hover .coupon-grant-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.coupon-grant-actions form {
  margin: 0;
}

.coupon-row-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.coupon-row-grant-button {
  background: #fff0cf;
  color: #a7661f;
}

.coupon-row-delete-button {
  background: #fde5e1;
  color: #b34435;
}

.coupon-template-empty {
  padding: 28px 22px;
  border: 1px dashed #e5cdb7;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted-text);
  font-size: 13px;
  text-align: center;
}

/* 管理側：ログイン設定 */
.login-settings-page {
  padding: 20px 36px;
}

.login-settings-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: min(100%, 1100px);
  max-width: none;
}

.login-settings-container .page-title,
.login-settings-container .flash-message {
  grid-column: 1 / -1;
}

.login-settings-page .page-title {
  margin: 0 0 16px;
  font-size: 24px;
}

.login-settings-page .flash-message {
  margin: 0 0 12px;
  padding: 10px 14px;
}

.login-settings-container .settings-card {
  margin: 0;
  padding: 22px 24px;
}

.login-settings-container .settings-card h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

.login-settings-container .settings-form {
  gap: 6px;
}

.login-settings-container .settings-form label {
  margin-top: 0;
  font-size: 13px;
}

.login-settings-container .settings-form input {
  height: 42px;
  margin-bottom: 10px;
}

.login-settings-container .save-button {
  height: 40px;
  margin-top: 4px;
}

/* 顧客側：ログイン */
.customer-login-body {
  min-height: 100vh;
  background: var(--main-bg);
}

.customer-login-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  background: var(--header-bg);
}

.customer-login-logo,
.customer-logo {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
  white-space: nowrap;
}

.customer-login-main {
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 84px);
  padding: 46px 20px;
}

.customer-login-card {
  width: min(100%, 430px);
  align-self: flex-start;
  padding: 28px 22px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(135, 93, 44, 0.12);
}

.customer-login-card h1 {
  margin: 0 0 9px;
  color: var(--text-brown);
  font-size: 22px;
  text-align: center;
}

.customer-login-description {
  margin: 0 0 25px;
  color: var(--muted-text);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.customer-login-form {
  display: flex;
  flex-direction: column;
}

.customer-login-form label {
  margin: 0 0 7px;
  color: var(--text-brown);
  font-size: 13px;
  font-weight: 700;
}

.customer-login-form input {
  width: 100%;
  height: 46px;
  margin: 0 0 18px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  color: #5c4637;
  background: #fffef9;
  font-size: 16px;
}

.customer-login-form input:focus,
.customer-form-field input:focus {
  border-color: #c78d64;
  box-shadow: 0 0 0 3px rgba(199, 141, 100, 0.18);
}

.customer-login-error {
  margin: -3px 0 16px;
  color: #b94738;
  font-size: 13px;
}

.customer-login-button {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: #9b4e2d;
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}

/* 顧客側：アプリ画面 */
.customer-app-body {
  min-height: 100vh;
  background: var(--main-bg);
}

.customer-header {
  position: sticky;
  top: 0;
  z-index: 5000;
  display: grid;
  grid-template-columns: 54px 1fr 76px;
  align-items: stretch;
  height: 74px;
  background: var(--header-bg);
}

.customer-menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 54px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.customer-menu-toggle span {
  display: block;
  width: 23px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-brown);
}

.customer-header .customer-logo {
  position: absolute;
  top: 21px;
  left: 50%;
  transform: translateX(-50%);
}

.customer-header-name {
  align-self: end;
  padding: 0 10px 10px 0;
  color: var(--text-brown);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.customer-main {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 24px 16px 42px;
}

.customer-page-heading {
  margin-bottom: 18px;
}

.customer-page-heading h1 {
  margin: 0 0 5px;
  color: var(--text-brown);
  font-size: 22px;
}

.customer-page-heading p {
  margin: 0;
  color: var(--muted-text);
  font-size: 12px;
  line-height: 1.6;
}

.customer-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 26px;
}

.customer-status-card {
  min-height: 104px;
  padding: 16px 8px 12px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(135, 93, 44, 0.09);
  text-align: center;
}

.customer-status-label {
  display: block;
  min-height: 30px;
  color: var(--muted-text);
  font-size: 11px;
  line-height: 1.45;
}

.customer-status-card strong {
  display: block;
  margin-top: 7px;
  color: var(--text-brown);
  font-size: 25px;
  line-height: 1;
}

.customer-status-card small {
  margin-left: 2px;
  font-size: 12px;
}

.customer-section-heading {
  margin-bottom: 10px;
}

.customer-section-heading h2 {
  margin: 0;
  color: var(--text-brown);
  font-size: 17px;
}

.customer-coupon-list,
.customer-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.customer-coupon-card {
  padding: 15px;
  border: 1px solid #f0dfcb;
  border-radius: 11px;
  background: #ffffff;
}

.customer-coupon-card h3 {
  margin: 0;
  color: var(--text-brown);
  font-size: 15px;
}

.customer-coupon-card p {
  margin: 7px 0 0;
  color: var(--muted-text);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.customer-empty-card {
  padding: 26px 16px;
  border: 1px dashed #e5cdb7;
  border-radius: 10px;
  background: #fffdf8;
  color: var(--muted-text);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.customer-history-item {
  padding: 14px 15px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 11px rgba(135, 93, 44, 0.07);
}

.customer-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-history-type {
  color: var(--text-brown);
  font-size: 12px;
  font-weight: 700;
}

.customer-history-top time {
  color: var(--muted-text);
  font-size: 10px;
  white-space: nowrap;
}

.customer-history-item p {
  margin: 7px 0 0;
  color: #684e3e;
  font-size: 13px;
  line-height: 1.55;
}

.customer-settings-card {
  padding: 21px 18px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 5px 17px rgba(135, 93, 44, 0.10);
}

.customer-settings-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.customer-form-field {
  display: flex;
  flex-direction: column;
}

.customer-form-field label {
  margin-bottom: 7px;
  color: var(--text-brown);
  font-size: 13px;
  font-weight: 700;
}

.customer-form-field input {
  width: 100%;
  height: 45px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  color: #5c4637;
  background: #fffef9;
  font-size: 16px;
}

.customer-form-field p {
  margin: 6px 0 0;
  color: var(--muted-text);
  font-size: 11px;
  line-height: 1.5;
}

.customer-settings-save {
  width: 100%;
  height: 47px;
  margin-top: 3px;
  border-radius: 8px;
}

/* 顧客側：スライドメニュー */
.customer-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: none;
  background: rgba(57, 41, 29, 0.34);
}

.customer-menu-overlay.is-open {
  display: block;
}

.customer-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 8000;
  width: min(80vw, 290px);
  background: #ffffff;
  box-shadow: 6px 0 20px rgba(70, 45, 24, 0.16);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
}

.customer-drawer.is-open {
  transform: translateX(0);
}

.customer-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: 0 14px 0 20px;
  background: var(--header-bg);
  color: var(--text-brown);
  font-size: 15px;
  font-weight: 700;
}

.customer-menu-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-brown);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.customer-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 9px 0;
}

.customer-drawer-item {
  display: flex;
  align-items: center;
  min-height: 51px;
  padding: 0 20px;
  border-left: 4px solid transparent;
  color: var(--text-brown);
  font-size: 14px;
  text-decoration: none;
}

.customer-drawer-item.current {
  border-left-color: #b96845;
  background: #fff7e5;
  font-weight: 700;
}

.customer-drawer-item.logout {
  margin-top: 12px;
  color: #b34435;
}

.customer-menu-open {
  overflow: hidden;
}

/* レスポンシブ */
@media (max-width: 1050px) {
  .customer-detail-card,
  .owned-coupon-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 950px) {
  .coupon-create-card .settings-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .coupon-create-card .customer-create-button {
    width: 100%;
  }
}

@media (max-width: 800px) {
  .login-settings-container {
    display: block;
  }

  .login-settings-page,
  .customer-list-content,
  .coupon-create-content,
  .coupon-grant-content,
  .customer-detail-create-style {
    padding: 24px 16px;
  }

  .login-settings-container .settings-card {
    margin-bottom: 18px;
  }

  .login-settings-container .save-button {
    width: 100%;
  }
}

@media (max-width: 700px) {
  :root {
    --header-height: 92px;
    --sidebar-width: 210px;
  }

  .header {
    padding-left: 10px;
  }

  .logo {
    height: 58px;
    padding: 6px 12px;
    font-size: 37px;
  }

  .sidebar {
    box-shadow: 4px 0 12px rgba(89, 55, 24, 0.08);
  }

  .main-content {
    margin-left: 0;
  }

  .login-main {
    padding: calc(var(--header-height) + 24px) 16px 24px;
  }

  .login-card {
    margin-top: -30px;
    padding: 30px 24px;
  }

  .settings-content {
    padding: 24px 16px;
  }

  .page-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-create-button {
    width: 100%;
  }

  .customer-detail-card,
  .owned-coupon-list {
    grid-template-columns: 1fr;
  }

  .customer-detail-card > .customer-create-button,
  .customer-create-button {
    width: 100%;
  }

  .customer-table th,
  .customer-table td {
    padding: 14px 15px;
  }

  .coupon-grant-list-card {
    overflow-x: auto;
  }

  .coupon-grant-table {
    min-width: 620px;
  }

  .coupon-grant-action-head,
  .coupon-grant-action-cell {
    width: 118px;
  }

  .coupon-create-card .settings-form {
    grid-template-columns: 1fr;
  }

  .customer-login-main {
    padding: 36px 16px;
  }
}

@media (min-width: 641px) {
  .customer-login-main {
    padding-top: 80px;
  }

  .customer-main {
    padding-right: 24px;
    padding-left: 24px;
  }
}

/* 顧客画面：スマホ用ヘッダー調整 */
@media (max-width: 700px) {
  .customer-header {
    position: relative;
    min-height: 118px;
    padding: 16px 20px 12px;
    box-sizing: border-box;
  }

  .customer-logo {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(29px, 8.5vw, 40px);
    line-height: 1;
    letter-spacing: 0.05em;
    white-space: nowrap;
  }

  .customer-header-name {
    position: absolute;
    right: 20px;
    bottom: 13px;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
  }
}

/* 顧客画面：ヘッダー最終調整 */
@media (max-width: 700px) {
  .customer-header {
    min-height: 104px !important;
    padding: 12px 16px 10px !important;
  }

  .customer-logo {
    top: 18px !important;
    font-size: 28px !important;
    letter-spacing: 0.02em !important;
  }

  .customer-header-name {
    right: 16px !important;
    bottom: 12px !important;
    font-size: 14px !important;
  }
}

/* 顧客画面：コンパクトヘッダー */
@media (max-width: 700px) {
  .customer-header {
    min-height: 78px !important;
    height: 78px !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
  }

  .customer-logo {
    top: 11px !important;
    font-size: 20px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  .customer-header-name {
    right: 14px !important;
    bottom: 10px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

/* 顧客画面：ヘッダー配置最終調整 */
@media (max-width: 700px) {
  .customer-header {
    height: 64px !important;
    min-height: 64px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
  }

  .customer-logo {
    top: 10px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
  }

  .customer-header > button,
  .customer-menu-button,
  .customer-menu-toggle,
  .customer-hamburger {
    top: 10px !important;
    left: 16px !important;
    transform: none !important;
  }

  .customer-header-name {
    right: 14px !important;
    bottom: 7px !important;
    font-size: 11px !important;
    line-height: 1 !important;
  }
}
