:root {
  --bg: #F4F7FC; --surface: #FFFFFF; --surface-2: #F8FAFD; --border: #DFE6F0; --border-2: #EDF1F7;
  --text: #203A61; --muted: #66768D; --ink-2: #405675;
  --side: #1C3555; --side-text: #CBD8E9; --side-active: #2B486D;
  --gold: #2B5EC8; --gold-ink: #254F9F; --gold-soft: #EDF3FF; --gold-line: #CDDCF9;
  --ok: #2F5A33; --ok-soft: #E5F0E4; --warn: #9A3412; --warn-soft: #FBEDE8; --info: #1F3346; --info-soft: #E3EBF2;
  --radius: 14px; --shadow: 0 8px 30px rgba(28, 53, 85, .09);
  --font: 'Segoe UI', Arial, sans-serif; --display: 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; background: var(--side); color: var(--side-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--gold); color: #FFFFFF; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 20px; flex-shrink: 0; }
.brand-name { color: #FFFFFF; font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: #A6BBD4; }
.nav { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; overflow-y: auto; }
.nav a { height: 42px; border-radius: 10px; padding: 0 12px; display: flex; align-items: center; gap: 12px; font-weight: 500; }
.nav a:hover { background: #254367; }
.nav a.active { background: var(--side-active); color: #FFFFFF; font-weight: 700; }
.nav svg { flex-shrink: 0; }
.side-foot { border-top: 1px solid var(--side-active); padding: 14px 6px 0; display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex-grow: 1; min-width: 0; }
.side-foot .who b { display: block; color: #FFFFFF; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { font-size: 12px; color: #A6BBD4; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; flex-shrink: 0; }
.side .icon-btn { background: transparent; border-color: #2B486D; color: var(--side-text); }

.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.top { min-height: 72px; padding: 12px 28px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); background: #F8FAFD; flex-wrap: wrap; }
.top h1 { font-family: var(--display); font-size: 24px; }
.top .sub { font-size: 13px; color: var(--muted); }
.top .grow { flex-grow: 1; }
.content { padding: 20px 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.imp-bar { background: var(--gold-soft); border-bottom: 1px solid var(--gold-line); color: var(--gold-ink); padding: 8px 28px; font-size: 14px; display: flex; gap: 12px; align-items: center; }
.imp-bar button { border: 0; background: transparent; color: var(--gold-ink); font-weight: 700; text-decoration: underline; }

/* ---------- elements ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card.pad { padding: 18px 20px; }
.card-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-title .grow { flex-grow: 1; }
.dark-card { background: #203A61; color: #FFFFFF; border-radius: var(--radius); padding: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .grow { flex-grow: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--display); font-size: 28px; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.dark-card .stat span { color: #BDD0E7; }

.btn { height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--text); border-color: var(--text); color: #FFFFFF; }
.btn.primary:hover { background: #2B486D; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #FFFFFF; }
.btn.danger { color: var(--warn); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { color: var(--gold-ink); font-weight: 700; background: none; border: 0; padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field select, .field textarea { height: 40px; border-radius: 10px; border: 1px solid #D7DFEC; background: #fff; padding: 0 12px; font-size: 14px; font-weight: 400; color: var(--text); width: 100%; }
.field textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 70px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
input.sw { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 12px; background: #CBD5E4; position: relative; margin: 0; cursor: pointer; flex-shrink: 0; transition: background .15s; }
input.sw::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 9px; background: #fff; transition: inset-inline-start .15s; }
input.sw:checked { background: var(--text); }
input.sw:checked::after { inset-inline-start: 19px; }
input.sw:disabled { opacity: .5; }
input.cb { accent-color: var(--text); width: 18px; height: 18px; margin: 0; }
.toggle-row { display: flex; align-items: center; gap: 12px; min-height: 50px; border-top: 1px solid var(--border-2); }
.toggle-row .t { flex-grow: 1; display: flex; flex-direction: column; }
.toggle-row .t b { font-weight: 600; font-size: 14px; }
.toggle-row .t span { font-size: 12px; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #EDF2F9; color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); }
.chip.info { background: var(--info-soft); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; background: currentColor; }
.seg { display: inline-flex; background: #EDE8DF; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 8px; border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--text); font-weight: 700; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 12px 16px; }
.tbl td { padding: 12px 16px; border-top: 1px solid var(--border-2); font-size: 14px; vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #FDFBF7; }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 18, 16, .45); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal-head { padding: 18px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-2); }
.modal-head h2 { font-size: 18px; flex-grow: 1; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border-2); display: flex; gap: 10px; justify-content: flex-start; }
.toasts { position: fixed; bottom: 20px; left: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--text); color: #FFFFFF; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; max-width: 380px; }
.toast.err { background: var(--warn); }
.error-box { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note-box { background: var(--gold-soft); border: 1px solid var(--gold-line); color: #294F87; border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.55; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--side); padding: 20px; }
.login { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-family: var(--display); font-size: 28px; }

/* ---------- calendar ---------- */
.cal-layout { display: flex; gap: 18px; align-items: flex-start; }
.cal { flex-grow: 1; min-width: 0; overflow: hidden; }
.cal-head { display: flex; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: #fff; z-index: 2; }
.cal-time-col { width: 58px; flex-shrink: 0; position: relative; }
.cal-col-head { flex: 1 1 0; min-width: 140px; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-inline-start: 1px solid var(--border-2); }
.avatar { width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.cal-body { display: flex; position: relative; overflow-y: auto; max-height: calc(100vh - 250px); }
.cal-col { flex: 1 1 0; min-width: 140px; position: relative; border-inline-start: 1px solid var(--border-2); }
.cal-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #F6F8FC 0 6px, #EAF0F8 6px 12px); }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border-2); }
.cal-hour { position: absolute; right: 8px; font-size: 12px; color: var(--muted); transform: translateY(-50%); }
.cal-slot { position: absolute; left: 0; right: 0; cursor: pointer; }
.cal-slot:hover { background: rgba(43, 94, 200, .08); }
.appt { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 3px 8px; overflow: hidden; cursor: pointer; font-size: 12px; line-height: 1.35; border: 1px solid #C7D8F8; background: #E9F0FD; color: #23477F; z-index: 1; text-align: start; }
.appt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.pending { background: #fff; border: 1.5px dashed #557FC7; }
.appt.completed { background: #EDF1F6; border-color: #DBE2ED; color: #596B83; }
.appt.no_show { background: var(--warn-soft); border-color: #F0C9BC; color: var(--warn); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #C2410C; z-index: 3; pointer-events: none; }
.cal-side { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }

/* ---------- hours editor ---------- */
.day-row { display: flex; align-items: center; gap: 14px; min-height: 54px; border-top: 1px solid var(--border-2); flex-wrap: wrap; padding: 6px 0; }
.day-row .dname { width: 60px; font-weight: 700; }
.shift { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #D7DFEC; border-radius: 9px; padding: 3px 6px; background: #fff; direction: ltr; }
.shift input { border: 0; width: 118px; height: 28px; font-size: 14px; padding: 0 4px; }
.shift button { border: 0; background: none; color: var(--muted); padding: 0 4px; font-size: 16px; }

.qr-box { width: 260px; height: 260px; border: 1px solid var(--border); border-radius: 16px; display: grid; place-items: center; background: #fff; overflow: hidden; }
.qr-box img { width: 240px; height: 240px; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; line-height: 1.5; }
.steps .n { width: 28px; height: 28px; flex-shrink: 0; border-radius: 14px; background: var(--text); color: #FFFFFF; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

@media (max-width: 1100px) {
  .cal-layout { flex-direction: column; }
  .cal-side { width: 100%; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .nav { flex-direction: row; overflow-x: auto; flex-basis: 100%; }
  .nav a { white-space: nowrap; }
  .side-foot { border: 0; padding: 0; }
  .content, .top { padding-left: 16px; padding-right: 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* KOL visual language: navy, clear surfaces, blue actions and a coral accent. */
:root { --blue: #2B5EC8; --coral: #FF7968; }
:focus-visible { outline: 3px solid #6B97EA; outline-offset: 3px; }
.btn { transition: background .15s, box-shadow .15s; }
.btn.primary, .btn.gold { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover, .btn.gold:hover { background: #244FA9; border-color: #244FA9; }
.card { box-shadow: 0 3px 14px #203a6105; }
.card.pad { padding: 22px; }
.stat { gap: 10px; border-top: 3px solid #D4E2FC; }
.stat b { color: #203A61; font-size: 32px; letter-spacing: -1px; }
.top { background: #fff; min-height: 84px; }
.top h1 { font-size: 25px; letter-spacing: -.5px; }
.top .sub { margin-top: 5px; }
.content { padding-top: 26px; gap: 22px; }
.side { background: linear-gradient(165deg,#203D61,#192F4B); padding-top: 28px; gap: 32px; }
.side .brand-mark { background: #34567B; color: #fff; border: 1px solid #5B7594; }
.nav { gap: 6px; }
.nav a { height: 46px; }
.nav a.active { background: #31547E; color: #fff; box-shadow: inset -3px 0 var(--coral); }
.tbl th { background: #F8FAFD; color: #66768D; }
.tbl td { padding-top: 15px; padding-bottom: 15px; }
.empty { padding: 64px 24px; }
.login-wrap { min-height: 100svh; padding: 32px; background: radial-gradient(ellipse at 85% 10%,#E7EFFB,transparent 60%),#F4F7FC; }
.login-shell { width: min(1120px,100%); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid #E5EAF2; border-radius: 28px; box-shadow: 0 18px 65px #203a6110; }
.login-hero { position: relative; overflow: hidden; background: linear-gradient(145deg,#203D61,#19304E); color: #fff; padding: 46px; display: flex; flex-direction: column; gap: 42px; }
.login-hero::after { content: ''; position: absolute; width: 350px; height: 350px; border: 1px solid #ffffff09; border-radius: 50%; left: -190px; bottom: -140px; box-shadow: 0 0 0 44px #ffffff03,0 0 0 88px #ffffff02; pointer-events: none; }
.login-brand { display: flex; align-items: center; gap: 14px; font-size: 34px; font-weight: 700; width: fit-content; }
.torim-logo { display: block; height: auto; object-fit: contain; background: #fff; border-radius: 12px; }
.login-logo { width: 250px; max-width: 100%; }
.sidebar-logo { width: 180px; max-width: 100%; }
.platform-brand { display: grid; gap: 8px; min-width: 0; }
.login-brand-symbol { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: #FFFFFF0E; color: #FF9687; border: 1px solid #ffffff20; }
.login-brand small { display: block; font-size: 11px; letter-spacing: .4px; font-weight: 400; color: #BCD0E7; margin-top: 3px; }
.eyebrow { font-size: 12px; color: #72829A; font-weight: 500; }
.login-hero .eyebrow { color: #B2C9E4; }
.login-story h1 { font-size: clamp(36px,4vw,52px); line-height: 1.22; letter-spacing: -1.4px; margin: 18px 0; }
.coral-dot { color: var(--coral); }
.login-story p { color: #C4D3E6; line-height: 1.9; font-size: 15px; margin: 0; }
.login-features { display: flex; flex-direction: column; gap: 12px; }
.login-feature { display: flex; gap: 16px; align-items: center; padding: 17px 18px; border-radius: 14px; border: 1px solid #ffffff18; background: #ffffff07; }
.login-feature > span { color: #91B7F0; }
.login-feature b { font-size: 14px; display: block; margin-bottom: 4px; }
.login-feature div span { color: #B7CBE2; font-size: 12px; }
.login-hero-foot { display: flex; gap: 12px; font-size: 11px; color: #B4C8E0; margin-top: auto; flex-wrap: wrap; }
.login-hero-foot span { color: var(--coral); }
.login-panel { display: grid; align-items: center; padding: 52px; background: #fff; }
.login { max-width: none; padding: 0; gap: 22px; border-radius: 0; }
.login-heading { margin-bottom: 12px; }
.login-heading h2 { font-size: 31px; color: #203A61; letter-spacing: -.8px; margin: 12px 0 9px; }
.login-heading p { color: #718099; font-size: 14px; margin: 0; line-height: 1.6; }
.login .field { gap: 8px; color: #536680; }
.login .field input { height: 48px; border-color: #DFE5EE; }
.login .field input::placeholder { color: #8B9AB0; }
.password-wrap { position: relative; }
.login .password-wrap input { padding-right: 66px; }
.password-toggle { position: absolute; top: 7px; right: 7px; height: 34px; padding: 0 10px; background: #F2F6FC; color: #3D608C; border: 0; border-radius: 6px; font-size: 11px; font-weight: 600; }
.login-submit { height: 49px; justify-content: space-between; margin-top: 5px; box-shadow: 0 5px 14px #2b5ec81c; }
.login-invite { font-size: 12px; color: #6B7D95; margin: 2px 0 0; line-height: 1.9; }
.login-security { display: flex; align-items: center; gap: 8px; border-top: 1px solid #EDF1F7; padding-top: 20px; color: #718199; font-size: 11px; }
.skip-link { position: fixed; top: -100px; right: 20px; z-index: 100; padding: 12px 20px; background: #fff; color: #203A61; border-radius: 8px; }
.skip-link:focus { top: 12px; }
@media(max-width: 1000px) { .login-hero { padding: 34px; } .login-panel { padding: 36px; } }
@media(max-width: 700px) {
 .login-wrap { padding: 16px; align-items: start; }
 .login-shell { grid-template-columns: 1fr; border-radius: 22px; }
 .login-hero { padding: 26px; gap: 24px; }
 .login-brand { font-size: 28px; }
 .login-story h1 { font-size: 34px; margin: 12px 0; }
 .login-story h1 br { display: none; }
 .login-story h1 br::after { content: ' '; }
 .login-features, .login-hero-foot, .login-story > .eyebrow { display: none; }
 .login-story p { font-size: 13px; line-height: 1.7; }
 .login-panel { padding: 30px 26px; }
 .login-heading h2 { font-size: 27px; }
 .login { gap: 19px; }
 .content { padding: 18px 14px 28px; }
 .top { padding: 16px; }
 .side { gap: 18px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
