:root {
    --primary: #9b654f;
    --primary-dark: #744634;
    --primary-soft: #f2e5df;
    --bg: #f8f5f2;
    --surface: #fffdfb;
    --text: #302925;
    --muted: #756a64;
    --border: #e7ddd7;
    --success: #2d6a45;
    --danger: #a63c35;
    --shadow: 0 10px 30px rgba(70, 47, 37, .07);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    background: radial-gradient(circle at 90% 0, #f1e5df 0, transparent 28rem), var(--bg);
    font-family: Inter, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

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

a {
    color: var(--primary-dark);
    text-underline-offset: 3px;
}

svg {
    display: block;
}

.skip-link {
    position: fixed;
    top: -80px;
    left: 12px;
    z-index: 1000;
    padding: 8px 14px;
    border-radius: 8px;
    color: #fff;
    background: var(--text);
}

.skip-link:focus {
    top: 12px;
}

header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 253, 251, .92);
    backdrop-filter: blur(12px);
}

.header-inner {
    width: 100%;
    max-width: 1180px;
    min-height: 68px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    color: var(--text);
    font-family: Georgia, "Yu Mincho", serif;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
}

.brand::before {
    content: "";
    width: 25px;
    height: 25px;
    margin-right: 9px;
    display: inline-block;
    vertical-align: middle;
    border-radius: 50% 50% 42% 58%;
    background: linear-gradient(145deg, #d6a991, var(--primary));
    box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .72);
}

.customer nav {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
}

.customer nav a,
.customer nav button {
    padding: 7px 10px;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    background: none;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.customer nav a:hover,
.customer nav button:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

nav form {
    margin: 0;
}

main {
    width: 100%;
    max-width: 1180px;
    flex: 1;
    margin: 0 auto;
    padding: 38px 20px 80px;
}

.customer main {
    max-width: 720px;
}

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.35;
}

.customer h1,
.customer h2 {
    font-family: Georgia, "Yu Mincho", serif;
    letter-spacing: .025em;
}

h1 {
    margin-bottom: 20px;
    font-size: clamp(1.55rem, 5vw, 2rem);
}

h2 {
    margin: 32px 0 14px;
    font-size: 1.2rem;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.hero {
    padding: 30px 26px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, #fffdfb, #f8ede7);
    box-shadow: var(--shadow);
}

.hero h1 {
    margin-bottom: 8px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.card {
    margin: 12px 0;
    padding: 18px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 4px 18px rgba(70, 47, 37, .035);
}

.choice-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.btn {
    min-height: 42px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    font-size: .9rem;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}

.btn:hover {
    color: #fff;
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(44, 123, 118, .22);
    outline-offset: 2px;
}

.btn-outline {
    border-color: #c9a491;
    color: var(--primary-dark);
    background: #fff;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.btn-danger {
    border-color: var(--danger);
    background: var(--danger);
}

.btn-sm {
    min-height: 34px;
    padding: 5px 10px;
    font-size: .78rem;
}

.flash {
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid;
    border-radius: 10px;
}

.flash-status {
    border-color: #cbe4d3;
    color: var(--success);
    background: #edf7f0;
}

.flash-error,
.validation-summary-errors {
    margin-bottom: 15px;
    padding: 10px 14px;
    border: 1px solid #efcfcc;
    border-radius: 10px;
    color: var(--danger);
    background: #fff0ef;
}

.validation-summary-valid {
    display: none;
}

label {
    margin-top: 14px;
    display: block;
    font-size: .84rem;
    font-weight: 750;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input:not([type]),
select,
textarea {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
    padding: 9px 11px;
    border: 1px solid #d2c7c0;
    border-radius: 9px;
    color: var(--text);
    background: #fff;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 6px;
    accent-color: var(--primary);
}

table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: .88rem;
}

th,
td {
    padding: 11px 9px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: .8rem;
}

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

dl {
    margin: 0;
}

dt {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

dd {
    margin: 2px 0 16px;
}

.muted {
    color: var(--muted);
    font-size: .86rem;
}

.points {
    color: var(--primary-dark);
    font-family: Georgia, serif;
    font-size: 1.85rem;
    font-weight: bold;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.actions form {
    margin: 0;
}

.steps {
    margin-bottom: 24px;
    padding: 0;
    display: flex;
    gap: 8px;
    list-style: none;
}

.steps li {
    color: #a39790;
    font-size: .75rem;
    font-weight: 700;
}

.steps .active {
    color: var(--primary-dark);
}

footer {
    padding: 22px;
    color: #938780;
    font-size: .75rem;
    text-align: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.form-grid label {
    margin-top: 0;
}

.inline-check {
    margin: 8px 14px 8px 0;
    display: inline-flex;
    align-items: center;
}

.inline-check input {
    width: auto;
}

.cal-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.cal {
    min-width: 600px;
}

.cal th,
.cal td {
    text-align: center;
}

.slot {
    width: 100%;
    padding: 8px;
    display: block;
    color: var(--primary);
    font-weight: bold;
    text-decoration: none;
}

.slot-none {
    color: #cfc5be;
}

/* Admin application shell */
.admin {
    --admin-primary: #246b67;
    --admin-primary-dark: #18514e;
    --admin-primary-soft: #e7f3f1;
    --admin-ink: #172726;
    --admin-muted: #697a78;
    --admin-border: #dfe8e6;
    --admin-canvas: #f4f7f6;
    --admin-surface: #fff;
    --admin-sidebar: #153b39;
    --admin-sidebar-soft: #214b48;
    --admin-danger: #b44a4a;
    --primary: var(--admin-primary);
    --primary-dark: var(--admin-primary-dark);
    --primary-soft: var(--admin-primary-soft);
    --text: var(--admin-ink);
    --muted: var(--admin-muted);
    --border: var(--admin-border);
    background: var(--admin-canvas);
    line-height: 1.55;
}

.admin-authenticated {
    display: block;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 100vh;
    min-height: 620px;
    padding: 24px 18px 18px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(circle at 0 0, rgba(87, 159, 151, .2), transparent 18rem),
        var(--admin-sidebar);
}

.sidebar-brand-row {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand > span:last-child {
    display: grid;
}

.sidebar-brand strong {
    font-family: Georgia, "Yu Mincho", serif;
    font-size: 1.03rem;
    line-height: 1.25;
    letter-spacing: .035em;
}

.sidebar-brand small {
    color: rgba(255, 255, 255, .52);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    color: var(--admin-sidebar);
    background: #fff;
    font-family: Georgia, serif;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}

.admin-nav {
    margin-top: 34px;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.admin-nav .nav-label {
    margin: 0 10px 7px;
    color: rgba(255, 255, 255, .42);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.admin-nav .nav-label-spaced {
    margin-top: 20px;
}

.admin-nav a {
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(255, 255, 255, .7);
    font-size: .86rem;
    font-weight: 650;
    text-decoration: none;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.admin-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.admin-nav a.active {
    border-color: rgba(255, 255, 255, .08);
    color: #fff;
    background: linear-gradient(100deg, rgba(92, 169, 160, .32), rgba(255, 255, 255, .08));
    box-shadow: inset 3px 0 #8ed0c8;
}

.admin-nav svg,
.logout-button svg,
.sidebar-close svg,
.menu-toggle svg,
.btn svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-nav a:first-of-type svg {
    fill: currentColor;
    stroke: none;
}

.sidebar-account {
    margin-top: 18px;
    padding: 14px 10px 3px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.account-avatar {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #527f7b;
    font-size: .8rem;
    font-weight: 800;
}

.account-copy {
    min-width: 0;
    display: grid;
    flex: 1;
}

.account-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy small {
    color: rgba(255, 255, 255, .48);
    font-size: .68rem;
}

.logout-button,
.sidebar-close,
.menu-toggle {
    padding: 7px;
    border: 0;
    border-radius: 8px;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.logout-button {
    color: rgba(255, 255, 255, .6);
}

.logout-button:hover,
.sidebar-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.sidebar-close {
    display: none;
}

.admin-app {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 72px;
    padding: 0 clamp(20px, 3.2vw, 48px);
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--admin-border);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(14px);
}

.menu-toggle {
    display: none;
    color: var(--admin-ink);
}

.topbar-title {
    display: grid;
    line-height: 1.25;
}

.topbar-title span {
    color: var(--admin-muted);
    font-size: .63rem;
    font-weight: 700;
    letter-spacing: .06em;
}

.topbar-title strong {
    color: var(--admin-ink);
    font-size: .88rem;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.today-label {
    color: var(--admin-muted);
    font-size: .78rem;
    font-weight: 650;
}

.admin-main {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 34px clamp(20px, 3.2vw, 48px) 72px;
}

.admin h1,
.admin h2,
.admin h3 {
    font-family: inherit;
    letter-spacing: -.02em;
}

.admin h1 {
    margin: 0;
    color: var(--admin-ink);
    font-size: clamp(1.5rem, 2.5vw, 1.9rem);
    font-weight: 800;
}

.admin h2 {
    margin: 30px 0 12px;
    color: var(--admin-ink);
    font-size: 1.08rem;
    font-weight: 800;
}

.admin h3 {
    color: var(--admin-ink);
    font-size: .95rem;
}

.admin .flash {
    position: relative;
    margin: 0 0 22px;
    padding: 12px 44px 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 11px;
    font-size: .86rem;
    box-shadow: 0 5px 20px rgba(25, 62, 59, .05);
}

.flash-icon {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: currentColor;
    font-size: 0;
}

.flash-icon::after {
    content: "✓";
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.flash-error .flash-icon::after {
    content: "!";
}

.page-header {
    margin-bottom: 25px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.page-header-copy {
    min-width: 0;
}

.page-header-copy > p {
    max-width: 650px;
    margin: 7px 0 0;
    color: var(--admin-muted);
    font-size: .85rem;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.admin .btn {
    min-height: 40px;
    padding: 8px 15px;
    border-color: var(--admin-primary);
    border-radius: 9px;
    background: var(--admin-primary);
    font-size: .82rem;
    font-weight: 750;
    box-shadow: 0 4px 10px rgba(36, 107, 103, .13);
}

.admin .btn:hover {
    border-color: var(--admin-primary-dark);
    background: var(--admin-primary-dark);
    box-shadow: 0 7px 15px rgba(36, 107, 103, .18);
}

.admin .btn-outline,
.admin .btn-secondary {
    border-color: #ccd9d7;
    color: #415a57;
    background: #fff;
    box-shadow: none;
}

.admin .btn-outline:hover,
.admin .btn-secondary:hover {
    border-color: #9bb5b1;
    color: var(--admin-primary-dark);
    background: #f4f9f8;
    box-shadow: none;
}

.admin .btn-danger {
    border-color: #d99c9c;
    color: #9f3939;
    background: #fff7f7;
    box-shadow: none;
}

.admin .btn-danger:hover {
    border-color: var(--admin-danger);
    color: #fff;
    background: var(--admin-danger);
}

.admin .btn-sm {
    min-height: 33px;
    padding: 5px 10px;
    font-size: .75rem;
}

.admin .btn-compact {
    min-height: 38px;
    padding: 7px 13px;
}

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

.stat-card {
    position: relative;
    min-width: 0;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 7px 25px rgba(24, 63, 60, .045);
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--stat-tint, #edf6f5);
}

.stat-card-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stat-label {
    color: var(--admin-muted);
    font-size: .78rem;
    font-weight: 700;
}

.stat-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--stat-color, var(--admin-primary));
    background: var(--stat-tint, var(--admin-primary-soft));
}

.stat-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-value {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    color: var(--admin-ink);
    font-size: 1.75rem;
    font-weight: 820;
    letter-spacing: -.04em;
    line-height: 1.2;
}

.stat-value small {
    margin-left: 3px;
    color: var(--admin-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 0;
}

.stat-note {
    position: relative;
    z-index: 1;
    margin: 7px 0 0;
    color: #82908e;
    font-size: .7rem;
}

.admin .card,
.panel {
    margin: 0 0 18px;
    padding: 21px;
    overflow: visible;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
    box-shadow: 0 7px 25px rgba(24, 63, 60, .04);
}

.panel-header {
    min-height: 42px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-title {
    margin: 0;
    font-size: .98rem;
    font-weight: 800;
}

.panel-subtitle {
    margin: 4px 0 0;
    color: var(--admin-muted);
    font-size: .76rem;
}

.table-card {
    margin-bottom: 18px;
    overflow-x: auto;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
    box-shadow: 0 7px 25px rgba(24, 63, 60, .04);
}

.table-card .panel-header {
    min-width: 620px;
    margin: 0;
    padding: 19px 20px 13px;
}

.admin table {
    min-width: 700px;
    color: var(--admin-ink);
    font-size: .81rem;
}

.admin th,
.admin td {
    padding: 13px 15px;
    border-color: #e8eeed;
    vertical-align: middle;
}

.admin th {
    color: #73827f;
    background: #f7f9f9;
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .025em;
    white-space: nowrap;
}

.admin tbody tr {
    transition: background-color .14s ease;
}

.admin tbody tr:hover {
    background: #f8fbfa;
}

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

.admin td a:not(.btn) {
    color: var(--admin-primary-dark);
    font-weight: 750;
    text-decoration-color: transparent;
    transition: text-decoration-color .15s ease;
}

.admin td a:not(.btn):hover {
    text-decoration-color: currentColor;
}

.cell-primary {
    color: var(--admin-ink);
    font-weight: 750;
}

.cell-secondary {
    margin-top: 2px;
    display: block;
    color: var(--admin-muted);
    font-size: .7rem;
}

.time-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.status-badge {
    min-height: 24px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    color: #296e58;
    background: #e7f5ef;
    font-size: .67rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.status-reserved,
.status-active,
.status-public {
    color: #246d59;
    background: #e6f4ee;
}

.status-visited,
.status-linked {
    color: #35699a;
    background: #eaf2fa;
}

.status-cancelled,
.status-inactive,
.status-private {
    color: #7b8583;
    background: #eef1f0;
}

.status-noshow,
.status-unlinked {
    color: #a64d4d;
    background: #faecec;
}

.source-badge {
    padding: 3px 7px;
    border: 1px solid #dce5e3;
    border-radius: 6px;
    color: #637572;
    background: #fff;
    font-size: .65rem;
    font-weight: 750;
    white-space: nowrap;
}

.empty-state {
    min-height: 210px;
    padding: 30px 18px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--admin-primary);
    background: var(--admin-primary-soft);
    font-size: 1.1rem;
}

.empty-state strong {
    color: var(--admin-ink);
    font-size: .9rem;
}

.empty-state p {
    max-width: 380px;
    margin: 5px 0 16px;
    color: var(--admin-muted);
    font-size: .76rem;
}

.filter-bar {
    margin-bottom: 18px;
    padding: 12px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(24, 63, 60, .03);
}

.filter-bar label {
    min-width: 160px;
    margin: 0;
}

.filter-label {
    margin-bottom: 5px;
    display: block;
    color: var(--admin-muted);
    font-size: .68rem;
    font-weight: 800;
}

.date-pager {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-button {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid #d5dfdd;
    border-radius: 9px;
    color: #49615e;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
}

.icon-button:hover {
    border-color: #a7bbb8;
    color: var(--admin-primary-dark);
    background: #f5f9f8;
}

.icon-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin label {
    color: #344b48;
    font-size: .76rem;
    font-weight: 750;
}

.admin input[type="text"],
.admin input[type="email"],
.admin input[type="password"],
.admin input[type="date"],
.admin input[type="time"],
.admin input[type="number"],
.admin input:not([type]),
.admin select,
.admin textarea {
    min-height: 42px;
    padding: 8px 11px;
    border-color: #cfdad8;
    border-radius: 8px;
    color: var(--admin-ink);
    background: #fff;
    font-size: .82rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.admin input:hover,
.admin select:hover,
.admin textarea:hover {
    border-color: #aabdb9;
}

.admin input:focus,
.admin select:focus,
.admin textarea:focus {
    border-color: var(--admin-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(36, 107, 103, .11);
}

.admin textarea {
    min-height: 100px;
}

.admin input[type="checkbox"],
.admin input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0 7px 0 0;
    accent-color: var(--admin-primary);
}

.admin .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.admin .form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-hint {
    margin: 5px 0 0;
    display: block;
    color: #82908e;
    font-size: .67rem;
    font-weight: 500;
}

.form-section {
    margin-bottom: 19px;
    padding: 22px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 7px 25px rgba(24, 63, 60, .035);
}

.form-section-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #edf1f0;
}

.form-section-header h2 {
    margin: 0;
    font-size: .98rem;
}

.form-section-header p {
    margin: 4px 0 0;
    color: var(--admin-muted);
    font-size: .72rem;
}

.form-actions {
    margin-top: 22px;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    border-top: 1px solid #edf1f0;
}

.admin .inline-check {
    min-height: 34px;
    margin: 8px 15px 8px 0;
    color: #405653;
    font-weight: 650;
}

.check-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 9px;
}

.check-card {
    min-height: 45px;
    margin: 0 !important;
    padding: 10px 12px;
    display: flex !important;
    align-items: center;
    border: 1px solid #dbe4e2;
    border-radius: 9px;
    background: #fbfcfc;
    cursor: pointer;
}

.check-card:hover {
    border-color: #abc0bc;
    background: #f6faf9;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
    gap: 18px;
}

.detail-list {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
    align-items: baseline;
}

.detail-list dt,
.detail-list dd {
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid #edf1f0;
}

.detail-list dt {
    font-size: .7rem;
    font-weight: 750;
}

.detail-list dd {
    color: var(--admin-ink);
    font-size: .82rem;
    font-weight: 650;
}

.detail-list dt:last-of-type,
.detail-list dd:last-of-type {
    border-bottom: 0;
}

.quick-actions {
    display: grid;
    gap: 8px;
}

.quick-action {
    padding: 13px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    color: var(--admin-ink);
    background: #fff;
    font-size: .77rem;
    font-weight: 750;
    text-decoration: none;
}

.quick-action:hover {
    border-color: #abc0bc;
    color: var(--admin-primary-dark);
    background: #f7fbfa;
}

.quick-action-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--admin-primary);
    background: var(--admin-primary-soft);
}

.warning-box {
    margin: 12px 0 16px;
    padding: 12px 14px;
    border: 1px solid #f0d7bd;
    border-radius: 9px;
    color: #8b5c2e;
    background: #fff8ef;
    font-size: .73rem;
}

.admin .points {
    color: var(--admin-primary-dark);
    font-family: inherit;
    font-size: 1.75rem;
    letter-spacing: -.04em;
}

.metric-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.metric-mini {
    padding: 16px;
    border: 1px solid var(--admin-border);
    border-radius: 11px;
    background: #fff;
}

.metric-mini span {
    display: block;
    color: var(--admin-muted);
    font-size: .68rem;
    font-weight: 700;
}

.metric-mini strong {
    margin-top: 4px;
    display: block;
    color: var(--admin-ink);
    font-size: 1.15rem;
}

.admin .actions {
    gap: 9px;
}

.admin .muted {
    color: var(--admin-muted);
    font-size: .75rem;
}

.admin .table-form-input {
    min-width: 110px;
    margin: 0;
}

.admin .table-check {
    text-align: center;
}

.token-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #61716f;
    font-size: .7rem;
}

.point-positive {
    color: var(--admin-primary);
}

.point-negative {
    color: var(--admin-danger);
}

.membership-print-wrap {
    padding: 30px;
    display: grid;
    place-items: center;
    border: 1px dashed #bdceca;
    border-radius: 16px;
    background: #edf3f2;
}

.membership-print-card {
    width: 340px;
    max-width: 100%;
    padding: 24px;
    display: grid;
    justify-items: center;
    overflow: hidden;
    border: 1px solid #d8e3e1;
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(81, 152, 144, .18), transparent 11rem),
        #fff;
    box-shadow: 0 16px 45px rgba(24, 63, 60, .13);
    text-align: center;
}

.membership-card-brand {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.membership-card-brand > span:last-child {
    min-width: 0;
    display: grid;
}

.membership-card-brand strong {
    overflow: hidden;
    color: var(--admin-ink);
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.membership-card-brand small {
    color: var(--admin-muted);
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.membership-card-message {
    margin: 22px 0 10px;
    color: var(--admin-muted);
    font-size: .68rem;
}

.membership-print-card img {
    display: block;
}

.membership-print-card > .token-code {
    width: 100%;
    margin-top: 12px;
    overflow: hidden;
    font-size: .55rem;
    text-overflow: ellipsis;
}

/* Admin login */
.admin-guest {
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 18%, rgba(67, 135, 128, .18), transparent 25rem),
        linear-gradient(135deg, #ecf3f1 0%, #f8faf9 55%, #edf3f2 100%);
}

.login-header {
    position: static;
    padding: 24px clamp(22px, 6vw, 70px);
    border: 0;
    background: transparent;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--admin-ink);
    font-family: Georgia, serif;
    font-weight: 800;
    text-decoration: none;
}

.login-header .sidebar-logo {
    color: #fff;
    background: var(--admin-sidebar);
}

.admin-login-main {
    width: min(100%, 1040px);
    margin: auto;
    padding: 35px 24px 90px;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(100%, 460px);
    padding: clamp(26px, 5vw, 40px);
    border: 1px solid rgba(210, 224, 221, .9);
    border-radius: 20px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 25px 70px rgba(23, 65, 61, .11);
}

.login-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 20px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: var(--admin-primary);
    box-shadow: 0 8px 20px rgba(36, 107, 103, .22);
}

.login-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-card h1 {
    font-size: 1.55rem;
}

.login-lead {
    margin: 8px 0 25px;
    color: var(--admin-muted);
    font-size: .8rem;
}

.login-card label {
    margin-top: 16px;
}

.login-card .btn {
    width: 100%;
    margin-top: 24px;
}

.login-help {
    margin: 20px 0 0;
    color: #81908e;
    font-size: .68rem;
    text-align: center;
}

.admin-backdrop {
    display: none;
}

@media (max-width: 1060px) {
    .admin-shell {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .admin-sidebar {
        padding-right: 14px;
        padding-left: 14px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-105%);
        width: min(300px, 86vw);
        padding: 20px 17px 18px;
        box-shadow: 20px 0 60px rgba(12, 39, 37, .26);
        transition: transform .22s ease;
    }

    .sidebar-close,
    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .admin-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: block;
        visibility: hidden;
        opacity: 0;
        background: rgba(15, 35, 33, .42);
        transition: opacity .22s ease, visibility .22s ease;
    }

    .sidebar-open {
        overflow: hidden;
    }

    .sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .sidebar-open .admin-backdrop {
        visibility: visible;
        opacity: 1;
    }

    .admin-main {
        padding-top: 28px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .header-inner {
        padding: 10px 14px 7px;
        display: block;
    }

    .brand {
        margin-bottom: 6px;
        display: block;
    }

    .customer nav {
        margin: 0 -6px;
    }

    .customer .header-inner nav a,
    .customer .header-inner nav button {
        padding: 8px 7px;
        font-size: .7rem;
    }

    .customer main {
        padding: 28px 13px 60px;
    }

    .choice-card {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 24px 19px;
    }

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

    .admin-topbar {
        height: 64px;
        padding: 0 14px;
    }

    .today-label {
        display: none;
    }

    .topbar-actions {
        gap: 8px;
    }

    .topbar-actions .btn span {
        display: none;
    }

    .topbar-actions .btn {
        width: 38px;
        padding: 0;
    }

    .admin-main {
        padding: 24px 14px 60px;
    }

    .page-header {
        margin-bottom: 19px;
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-header-actions .btn {
        flex: 1;
    }

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

    .stat-card {
        padding: 17px;
    }

    .stat-value {
        font-size: 1.55rem;
    }

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

    .filter-bar label {
        width: 100%;
    }

    .filter-bar .btn {
        width: 100%;
    }

    .admin .form-grid,
    .admin .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .form-section,
    .admin .card,
    .panel {
        padding: 17px;
        border-radius: 12px;
    }

    .form-section-header {
        flex-direction: column;
    }

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

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

    .detail-list {
        grid-template-columns: 100px minmax(0, 1fr);
    }

    .metric-mini-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .admin-sidebar,
    .admin-topbar,
    .page-header-actions,
    .form-actions,
    .admin-backdrop,
    .admin .btn {
        display: none !important;
    }

    .admin-shell {
        display: block;
    }

    .admin-main {
        max-width: none;
        padding: 0;
    }

    .admin,
    .admin .card,
    .panel {
        background: #fff;
        box-shadow: none;
    }

    .membership-print-wrap {
        padding: 0;
        border: 0;
        background: #fff;
    }

    .membership-print-card {
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
