/* SIW Booking — สีแบรนด์จากโลโก้ Siam Inter Wellness (กรมท่า / ฟ้าอมเขียว / ทอง)
 * ใช้กับหน้าจอง (.siw-ui) และ Dashboard (.siw-dash) — ไม่กระทบหน้าอื่นของเว็บไซต์ */
.siw-ui, .siw-dash {
    --siw-navy: #1b2d5b;
    --siw-navy-2: #2b4580;
    --siw-teal: #138a9b;
    --siw-teal-soft: #e5f3f5;
    --siw-gold: #c9a13b;
    --siw-gold-soft: #fbf3df;
    --siw-ok: #1e7f4b;
    --siw-ok-soft: #e6f4ec;
    --siw-low: #b45f06;
    --siw-low-soft: #fdf0dd;
    --siw-off: #9aa3ae;
    --siw-off-soft: #f1f3f5;
    --siw-line: #e2e7ee;
    --siw-muted: #667085;
    --siw-radius: 14px;
}

/* ปุ่มหลักใช้สีแบรนด์แทนสีธีมเว็บไซต์ */
.siw-ui .btn-primary, .siw-dash .btn-primary {
    --bs-btn-bg: var(--siw-navy); --bs-btn-border-color: var(--siw-navy);
    --bs-btn-hover-bg: var(--siw-navy-2); --bs-btn-hover-border-color: var(--siw-navy-2);
    --bs-btn-active-bg: var(--siw-navy-2); --bs-btn-active-border-color: var(--siw-navy-2);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--siw-off); --bs-btn-disabled-border-color: var(--siw-off);
}
.siw-ui .btn-outline-primary, .siw-dash .btn-outline-primary {
    --bs-btn-color: var(--siw-navy); --bs-btn-border-color: var(--siw-navy);
    --bs-btn-hover-bg: var(--siw-navy); --bs-btn-hover-border-color: var(--siw-navy); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--siw-navy); --bs-btn-active-border-color: var(--siw-navy); --bs-btn-active-color: #fff;
}
.siw-ui .btn-success {
    --bs-btn-bg: var(--siw-ok); --bs-btn-border-color: var(--siw-ok);
    --bs-btn-hover-bg: #17683d; --bs-btn-hover-border-color: #17683d;
}
.siw-ui a:not(.btn):not(.siw-time):not(.siw-day) { color: var(--siw-teal); }
.siw-ui .card { border-color: var(--siw-line); border-radius: var(--siw-radius); }
.siw-ui .form-control:focus, .siw-ui .form-select:focus {
    border-color: var(--siw-teal); box-shadow: 0 0 0 .2rem rgba(19, 138, 155, .18);
}

/* ส่วนหัว */
.siw-hero {
    background: linear-gradient(135deg, var(--siw-navy) 0%, var(--siw-navy-2) 60%, var(--siw-teal) 100%);
    color: #fff; border-radius: var(--siw-radius); padding: 18px 20px; margin-bottom: 18px;
    position: relative; overflow: hidden;
}
.siw-hero::after {
    content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px;
    border-radius: 50%; border: 18px solid rgba(201, 161, 59, .35);
}
.siw-hero h1 { color: #fff; font-size: 1.35rem; font-weight: 700; margin: 0; }
.siw-hero .sub { color: rgba(255, 255, 255, .8); font-size: .9rem; }
.siw-hero .btn-hero {
    position: relative; z-index: 1; color: #fff; border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 999px; font-size: .85rem; padding: 4px 12px; white-space: nowrap;
}
.siw-hero .btn-hero:hover { background: rgba(255, 255, 255, .15); color: #fff; }

/* แถบขั้นตอน */
.siw-steps { display: flex; list-style: none; padding: 0; margin: 0 0 20px; gap: 6px; }
.siw-steps li { flex: 1 1 0; text-align: center; font-size: .78rem; color: var(--siw-off); }
.siw-steps li::before {
    content: ""; display: block; height: 5px; border-radius: 999px; background: var(--siw-line); margin-bottom: 6px;
}
.siw-steps li.done { color: var(--siw-teal); }
.siw-steps li.done::before { background: var(--siw-teal); }
.siw-steps li.now { color: var(--siw-navy); font-weight: 700; }
.siw-steps li.now::before { background: var(--siw-gold); }

.siw-title { font-size: 1.1rem; font-weight: 700; color: var(--siw-navy); margin-bottom: 4px; }
.siw-label { font-weight: 700; color: var(--siw-navy); margin-bottom: 8px; display: block; }

/* ปุ่มเลือกวัน */
.siw-days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.siw-day {
    flex: 0 0 auto; min-width: 64px; text-align: center; border: 1.5px solid var(--siw-line); border-radius: 12px;
    padding: 6px 8px; background: #fff; color: var(--siw-navy); cursor: pointer; user-select: none; text-decoration: none;
    line-height: 1.15; transition: border-color .15s, background .15s;
}
.siw-day:hover { border-color: var(--siw-teal); color: var(--siw-navy); }
.siw-day .top { font-size: .75rem; color: var(--siw-muted); display: block; }
.siw-day .num { font-size: 1.3rem; font-weight: 700; display: block; }
.siw-day .mon { font-size: .72rem; color: var(--siw-muted); display: block; }
.siw-day input { position: absolute; opacity: 0; pointer-events: none; }
.siw-day.active, .siw-day:has(input:checked) { background: var(--siw-navy); border-color: var(--siw-navy); color: #fff; }
.siw-day.active .top, .siw-day.active .mon,
.siw-day:has(input:checked) .top, .siw-day:has(input:checked) .mon { color: rgba(255, 255, 255, .8); }
.siw-day:has(input:focus-visible) { outline: 2px solid var(--siw-gold); outline-offset: 2px; }
.siw-other-date { max-width: 220px; display: none; }
.siw-date-block:has(#siw_date_other_radio:checked) .siw-other-date { display: block; }

/* การ์ดสาขา */
#siw_branch_picker .siw-branch-item { border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
#siw_branch_picker .siw-branch-item:hover,
#siw_branch_picker .siw-branch-item:focus-within { border-color: var(--siw-teal); box-shadow: 0 0 0 1px var(--siw-teal); }
#siw_branch_picker .siw-branch-item .fw-bold { color: var(--siw-navy); }

/* ตารางเวลา */
.siw-room { margin-bottom: 14px; }
.siw-room-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.siw-room-head .name { font-weight: 700; color: var(--siw-navy); }
.siw-room-head .meta { font-size: .8rem; color: var(--siw-muted); }
.siw-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.siw-time {
    display: block; border-radius: 12px; padding: 9px 6px; text-align: center; text-decoration: none;
    border: 1.5px solid transparent; line-height: 1.2; transition: transform .1s, box-shadow .15s;
}
.siw-time .t { font-size: 1.15rem; font-weight: 700; display: block; font-variant-numeric: tabular-nums; }
.siw-time .s { font-size: .74rem; display: block; }
.siw-time.ok { background: var(--siw-ok-soft); border-color: #bfe3cd; color: var(--siw-ok); }
.siw-time.low { background: var(--siw-low-soft); border-color: #f4d3a4; color: var(--siw-low); }
.siw-time.off { background: var(--siw-off-soft); color: var(--siw-off); cursor: not-allowed; }
a.siw-time:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(27, 45, 91, .12); }
.siw-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--siw-muted); margin-bottom: 12px; }
.siw-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ตัวเลือกประเภท */
.siw-option { display: block; border: 1.5px solid var(--siw-line); border-radius: var(--siw-radius); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.siw-option:has(input[type=radio]:checked) { border-color: var(--siw-navy); box-shadow: 0 0 0 1px var(--siw-navy); background: #fbfcfe; }
.siw-option .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.siw-option .name { font-weight: 700; color: var(--siw-navy); }
.siw-option .price { font-weight: 700; color: var(--siw-navy); white-space: nowrap; }
.siw-option .desc { font-size: .85rem; color: var(--siw-muted); }
.siw-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--siw-line); border-radius: 999px; overflow: hidden; }
.siw-stepper button { border: 0; background: var(--siw-off-soft); width: 44px; height: 44px; font-size: 1.4rem; line-height: 1; color: var(--siw-navy); }
.siw-stepper button:disabled { color: var(--siw-off); }
.siw-stepper input { width: 56px; height: 44px; border: 0; text-align: center; font-size: 1.15rem; font-weight: 700; color: var(--siw-navy); -moz-appearance: textfield; }
.siw-stepper input::-webkit-outer-spin-button, .siw-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.siw-hint { background: var(--siw-gold-soft); color: #7a5b12; border-radius: 10px; padding: 8px 12px; font-size: .85rem; }

/* สรุปคำสั่งจอง */
.siw-summary { border: 1px solid var(--siw-line); border-radius: var(--siw-radius); overflow: hidden; margin-bottom: 16px; background: #fff; }
.siw-summary .row-i { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--siw-line); }
.siw-summary .row-i .k { color: var(--siw-muted); }
.siw-summary .row-i .v { text-align: right; }
.siw-summary .total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; background: var(--siw-navy); color: #fff; }
.siw-summary .total .amt { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.siw-save { color: var(--siw-ok); font-weight: 700; }
.siw-strike { text-decoration: line-through; color: var(--siw-off); margin-right: 6px; }

/* Dashboard */
.siw-dash .card { border-color: var(--siw-line); border-radius: var(--siw-radius); }
.siw-dash .kpi.net, .siw-dash .siw-hero-card {
    background-color: var(--siw-navy) !important;
    background-image: linear-gradient(135deg, var(--siw-navy) 0%, var(--siw-navy-2) 70%, var(--siw-teal) 100%) !important;
    border-color: var(--siw-navy) !important; color: #fff !important;
    --bs-card-bg: transparent; --bs-card-color: #fff;
}
.siw-dash .kpi.net *, .siw-dash .siw-hero-card * { color: #fff !important; }
.siw-dash .kpi.net .muted, .siw-dash .siw-hero-card .muted { color: rgba(255, 255, 255, .8) !important; }
.siw-dash .kpi.net .v, .siw-dash .siw-hero-card .v { font-size: 2rem; font-weight: 700; }
.siw-dash .chips a.btn { border-radius: 999px; }
.siw-dash .chips a.btn-dark { background: var(--siw-navy); border-color: var(--siw-navy); }
.siw-dash .bars .bar { background: var(--siw-teal) !important; }
.siw-dash .bars .bar.we { background: var(--siw-gold) !important; }
.siw-dash .meter span { background: var(--siw-teal) !important; }
.siw-dash h1, .siw-dash .fw-bold { color: var(--siw-navy); }
.siw-code { font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: 2rem; font-weight: 700; letter-spacing: 1px; color: var(--siw-navy); }
.siw-qr-dialog { border: 0; border-radius: 18px; padding: 24px; text-align: center; max-width: 92vw; }
.siw-qr-dialog::backdrop { background: rgba(15, 25, 50, .6); }
