:root {
    --bg-color: #15202b;
    --text-color: #ffffff;
    --input-bg: #273340;
    --border-color: #38444d;
    --primary-color: #1d9bf0;
    --primary-hover: #1a8cd8;
    --error-color: #f4212e;
    --success-color: #00ba7c;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

@media (max-width: 600px) {
    body { padding: 1rem; padding-top: 80px; }
    .container.with-header { margin-top: 0 !important; }
    .site-header { padding: 0 1rem; }
}

.container {
    width: 100%;
}
.container-w-800 { max-width: 800px; }
.container-w-900 { max-width: 900px; }
.container-w-1000 { max-width: 1000px; }
.container-w-95p { max-width: 95%; }

h1, h2, h3 { color: var(--text-color); }
.form-group { margin-bottom: 1.2rem; }
label { display: block; margin-bottom: .5rem; font-weight: bold; color: #aab8c2; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 1rem;
}

input:focus, select:focus { outline: none; border-color: var(--primary-color); }
.row { display: flex; gap: 1rem; }
.col { flex: 1; }

button {
    width: 100%;
    padding: 12px;
    cursor: pointer;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background 0.2s;
}

button:hover { background: var(--primary-hover); }
button.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}
button.secondary:hover { background: rgba(29, 155, 240, 0.1); }

.hidden { display: none; }

#message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
    background: #202e3a;
    border: 1px solid var(--border-color);
}

a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary-color); }

table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { border: 1px solid var(--border-color); padding: 14px; text-align: left; }
th { background: #192734; color: #aab8c2; font-weight: bold; }
.status-0 { color: #aab8c2; }
.status-1 { color: var(--success-color); font-weight: bold; }
.status-2 { color: #ffd400; font-weight: bold; }
.menu-item { display: block; padding: 10px; color: var(--text-color); border-radius: 4px; }
.menu-item:hover { background: #273340; text-decoration: none; }

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(21, 32, 43, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    box-sizing: border-box;
}

.site-logo { font-weight: bold; font-size: 1.2rem; color: var(--primary-color); }
.site-logo a { color: var(--primary-color); text-decoration: none; }
.nav-area { position: relative; }
.menu-trigger {
    background: transparent;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    width: auto;
    margin: 0;
}
.menu-trigger:hover { background: rgba(255, 255, 255, 0.1); }
.nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 200px;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.menu-admin-link { color: var(--primary-color); }
.menu-divider { border-color: var(--border-color); margin: 0.5rem 0; }
.menu-logout {
    width: 100%;
    text-align: left;
    background: transparent;
    color: #f4212e;
    padding: 10px;
    border: none;
    margin: 0;
}
.container.with-header { margin-top: 80px; }

.admin-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}
.admin-title { margin: 0; white-space: nowrap; }
.admin-spacer { flex: 1; }
.pill-tabs {
    display: flex;
    gap: 0.5rem;
    background: #192734;
    padding: 5px;
    border-radius: 999px;
    overflow-x: auto;
    max-width: 100%;
}
.admin-card { background: #192734; padding: 1rem; border-radius: 8px; }
.admin-card-lg { padding: 1.5rem; max-width: 800px; margin: 0 auto; }
.admin-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.admin-table-wrap, .overflow-x-auto { overflow-x: auto; }
.nowrap-table { white-space: nowrap; }
.btn-inline { width: auto; }
.btn-manual { padding: 8px 16px; margin-right: 10px; background: #8899a6; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    border: 1px solid var(--border-color);
}
.modal-sm { max-width: 400px; }
.modal-md { max-width: 500px; }
.modal-ml { max-width: 520px; }

.muted-note { font-size: 0.9em; color: #aab8c2; margin-bottom: 1rem; }
.option-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.inline-radio-label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.help-text { display: block; color: #aab8c2; margin-top: 5px; }
.action-row { display: flex; gap: 1rem; margin-top: 1.5rem; }

.search-row { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-input { flex: 999 1 300px; }
.btn-refresh { flex: 1 0 auto; white-space: nowrap; }

.org-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.org-title { margin: 0; }
.org-form-grid { margin-top: 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.no-margin { margin: 0; }
.align-right { text-align: right; }
.mt-075 { margin-top: 0.75rem; }
.mt-1 { margin-top: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.fit-content-wrap {
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #8b98a5;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 999px;
    font-weight: bold;
    margin: 0;
}
.tab-btn.active { background: var(--primary-color); color: white; }
.tab-btn:hover:not(.active) { background: rgba(255, 255, 255, 0.1); }

.text-center { text-align: center; }
.mt-15 { margin-top: 1.5rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-025 { margin-bottom: 0.25rem; }
.muted { color: #8b98a5; }
.muted-sm { color: #8b98a5; font-size: 0.9em; }
.note-sm { display: block; color: #aab8c2; font-size: 0.8em; margin-top: 5px; }
.warn-sm { display: block; color: #ffd400; font-size: 0.8em; margin-top: 5px; }
.btn-chip { width: auto; margin: 0; padding: 8px 14px; }
.btn-chip-md { width: auto; margin: 0; padding: 8px 16px; }
.btn-danger { background: #f4212e; }
.link-muted { color: #8b98a5; }
.link-underlined { text-decoration: underline; }
.inline-actions { display: flex; gap: 1rem; }
.card {
    background: #192734;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.card-prewrap { white-space: pre-wrap; line-height: 1.6; }

.guide-wrap { max-width: 900px; margin: 0 auto; }
.guide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.guide-actions { display: flex; gap: 0.5rem; align-items: center; }
.guide-box { margin-top: 1rem; background: #192734; border: 1px solid var(--border-color); border-radius: 8px; padding: 1.25rem; }
.guide-title { margin-top: 0; }
.guide-list { line-height: 1.8; margin: 0; padding-left: 1.25rem; }
.guide-grid { margin-top: 1rem; display: grid; grid-template-columns: 1fr; gap: 1rem; }

.hero-wrap { text-align: center; margin-top: 3rem; }
.hero-title { color: var(--primary-color); font-size: 2.5rem; margin-bottom: 1rem; }
.hero-subtitle { color: #8b98a5; margin-bottom: 2rem; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; max-width: 400px; margin: 0 auto; }
.hero-buttons a { flex: 1; }

.res-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.res-container { max-width: 1000px; margin: 0 auto; }
.rooms-grid { display: flex; gap: 2rem; flex-wrap: wrap; }
.room-col {
    background: #192734;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    flex: 1;
}
#slots-tatami, #slots-hall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}
.slot-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 50px;
    background: #273340;
    border: 1px solid var(--border-color);
    color: white;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
    font-weight: bold;
    font-size: 0.9em;
}
.slot-btn:hover:not(:disabled) { background: var(--primary-color); border-color: var(--primary-color); }
.slot-btn:disabled { opacity: 0.5; cursor: not-allowed; background: #222; }
.slot-btn.selected { background: var(--primary-color); border-color: var(--primary-color); }
.my-res { margin-top: 3rem; background: #192734; padding: 1rem; border-radius: 8px; }
.calendar-card { background: #192734; border-radius: 8px; padding: 1.5rem; margin-bottom: 2rem; border: 1px solid var(--border-color); }
.hidden-date-input { position: absolute; visibility: hidden; }
.cal-head-center { text-align: center; margin-bottom: 1rem; }
.month-label { margin: 0; font-size: 1.4em; }
.cal-nav { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.cal-nav-btn { padding: 4px 12px; margin: 0; }
.room-title { text-align: center; margin-top: 0; }
.confirm-box { background: #273340; padding: 1rem; border-radius: 4px; margin-bottom: 1rem; }
.price-row { margin-top: 0.5rem; font-size: 1.2em; font-weight: bold; color: var(--success-color); }
.pay-note { font-size: 0.8em; color: #aab8c2; margin-top: 5px; }
.terms-note { margin-top: 10px; font-size: 0.9em; }

.cal-grid-header, .cal-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.cal-grid-header div {
    font-weight: bold;
    font-size: 0.9em;
    padding-bottom: 5px;
    color: #8b98a5;
    border-bottom: 1px solid #38444d;
    margin-bottom: 5px;
}
.cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    border: 1px solid transparent;
    font-size: 1em;
    position: relative;
}
.cal-cell:hover:not(.empty):not(.past):not(.disabled) { background: #273340; }
.cal-cell.selected { background: var(--primary-color) !important; color: white !important; font-weight: bold; }
.cal-cell.today { border: 2px solid var(--primary-color); }
.cal-cell.past, .cal-cell.disabled { opacity: 0.3; cursor: not-allowed; background: rgba(0, 0, 0, 0.2); }
.res-dot { width: 6px; height: 6px; background-color: #ffd400; border-radius: 50%; margin-top: 2px; }
.cal-cell.sun, .cal-grid-header .sun { color: #f4212e; }
.cal-cell.sat, .cal-grid-header .sat { color: #1d9bf0; }

.profile-card { background: #192734; padding: 1rem; border-radius: 8px; border: 1px solid var(--border-color); }
.profile-section { margin-top: 1rem; }
.profile-link-strong { font-weight: bold; }
.profile-res-link {
    font-weight: bold;
    padding: 10px 20px;
    background: var(--success-color);
    color: white;
    border-radius: 999px;
}
.read-only-input { background: #222 !important; cursor: not-allowed; }
.profile-list { list-style: none; padding: 0; }
.profile-list-item { padding: 8px 0; border-bottom: 1px solid #38444d; }
.profile-label { color: #8b98a5; font-size: 0.9em; display: block; }
.profile-value { font-size: 1.1em; }

.status-pending { color: #ffd400; font-weight: bold; }
.status-confirmed { color: var(--success-color); font-weight: bold; }
.status-cancelled { color: #f4212e; text-decoration: line-through; }
.status-unpaid { color: #aab8c2; }
.status-paid { color: var(--primary-color); font-weight: bold; }
.status-member { color: var(--success-color); }
.status-awaiting { color: #ffd400; }
.status-none { color: #8b98a5; }
.text-danger { color: red; }
.text-center-cell { text-align: center; }
.small-muted { color: #aab8c2; }
.btn-mini { padding: 5px 10px; font-size: 0.8em; width: auto; display: inline-block; }
.btn-mini-approve { padding: 4px 8px; font-size: 0.8rem; margin-right: 5px; width: auto; display: inline-block; }
.btn-mini-cancel { padding: 4px 8px; font-size: 0.8rem; width: auto; display: inline-block; }
.btn-mini-paid { padding: 4px 8px; font-size: 0.8rem; margin-left: 5px; width: auto; display: inline-block; background: var(--success-color); border-color: var(--success-color); }
.btn-mini-unpaid { padding: 4px 8px; font-size: 0.8rem; margin-left: 5px; width: auto; display: inline-block; }
.btn-mini-danger { color: #f4212e; border-color: #f4212e; }
.mr-5 { margin-right: 5px; }
.ml-6 { margin-left: 6px; }
.section-title {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .room-col { min-width: 100%; }
    .rooms-grid { flex-direction: column; }
    .date-picker { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 500px) {
    .cal-cell { font-size: 0.9em; }
    .calendar-card { padding: 1rem; }
}
