@font-face { font-family: 'Titillium Web'; src: url('titillium-web-400.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Titillium Web'; src: url('titillium-web-600.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Titillium Web'; src: url('titillium-web-700.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --blue: #004765;
  --cyan: #17BADD;
  --yellow: #FDC501;
  --ink: #17313d;
  --muted: #6b8088;
  --line: #dbe7eb;
  --surface: #f5f9fa;
  --white: #fff;
  --danger: #c43d4b;
  font-family: 'Titillium Web', sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); font-size: 16px; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #002e42; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 250px; background: var(--blue); color: #fff; padding: 24px 18px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; margin: 2px 12px 36px; font-size: 22px; font-weight: 700; }
.brand img { width: 46px; height: 46px; object-fit: contain; background: #fff; border-radius: 10px; padding: 5px; }
.brand-mark { background: var(--yellow); color: var(--blue); border-radius: 10px; width: 46px; height: 46px; display: grid; place-items: center; font-weight: 700; }
.nav-label { color: #8bb7c5; text-transform: uppercase; font-size: 12px; letter-spacing: .12em; margin: 22px 12px 8px; }
.nav-link { display: flex; gap: 12px; align-items: center; color: #eaf8fb; padding: 11px 12px; border-radius: 10px; margin: 3px 0; }
.nav-link:hover, .nav-link.active { background: rgba(23,186,221,.22); color: #fff; }
.nav-link .icon { width: 20px; text-align: center; font-size: 18px; }
.main { flex: 1; min-width: 0; }
.topbar { min-height: 76px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; }
.topbar h1 { margin: 0; font-size: 27px; font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cyan); color: #fff; display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.content { padding: 30px 34px 54px; max-width: 1600px; margin: auto; }
.menu-toggle { display: none; border: 0; background: transparent; color: var(--blue); font-size: 24px; }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.appointment-layout { align-items: start; }
.appointment-layout > .card { min-width: 0; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 5px 20px rgba(0,71,101,.04); }
.card h2, .card h3 { margin: 0 0 15px; font-weight: 600; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-header h2 { margin: 0; }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; width: 100px; height: 100px; border-radius: 50%; background: var(--cyan); opacity: .1; right: -28px; top: -35px; }
.stat .number { font-size: 38px; font-weight: 700; color: var(--blue); line-height: 1; }
.stat .label { color: var(--muted); margin-top: 7px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9px; min-height: 42px; padding: 8px 15px; background: var(--blue); color: #fff; font-weight: 600; }
.button:hover { color: #fff; background: #00374e; }
.button.secondary { background: #e9f5f8; color: var(--blue); }
.button.secondary:hover { background: #d4edf3; }
.button.yellow { background: var(--yellow); color: var(--blue); }
.button.danger { background: #fdecee; color: var(--danger); }
.button.small { min-height: 32px; padding: 5px 10px; font-size: 14px; }
.button.icon-button { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 8px; font-size: 15px; }
.button.icon-button .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; margin-bottom: 5px; }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { width: 100%; min-height: 42px; border: 1px solid #c9dbe0; border-radius: 9px; padding: 10px 12px; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus, .rich-editor:focus { outline: 3px solid rgba(23,186,221,.2); border-color: var(--cyan); }
textarea { min-height: 110px; resize: vertical; }
.rich-editor { min-height: 110px; border: 1px solid #c9dbe0; border-radius: 9px; padding: 10px 12px; background: #fff; }
.editor-toolbar { display: flex; gap: 5px; margin-bottom: 6px; }
.editor-toolbar button { border: 1px solid var(--line); background: #f8fbfc; border-radius: 6px; min-width: 30px; height: 30px; color: var(--blue); }
.file-input { border: 1px dashed #9fc3cd; background: #f8fcfd; padding: 11px; border-radius: 9px; width: 100%; }
.preview-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.preview { position: relative; width: 82px; height: 65px; border-radius: 8px; overflow: hidden; background: #e8f2f4; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview small { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.55); color: #fff; text-align: center; }
.image-remove { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--danger); font-weight: 400; cursor: pointer; }
.image-remove input { accent-color: var(--danger); }
.image-manager { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px; }
.image-item { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.image-item-actions { display: flex; gap: 4px; }
.image-control-button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfc; color: var(--blue); cursor: pointer; line-height: 1; }
.image-control-button:hover { border-color: var(--cyan); background: #eefafd; }
.image-control-button.image-remove-button { color: var(--danger); }
.table-wrap { overflow-x: auto; }
.appointments-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.appointments-table { min-width: 760px; }
.scent-sauna-table { min-width: 520px; }
.appointments-table td:first-child { min-width: 235px; }
.event-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.event-actions form { display: inline-flex; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font-size: 13px; text-align: left; text-transform: uppercase; letter-spacing: .04em; padding: 11px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.entity-name { font-weight: 600; }
.entity-sub { color: var(--muted); font-size: 14px; }
.thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: #e6f1f4; vertical-align: middle; }
.badge { display: inline-block; border-radius: 100px; padding: 3px 9px; background: #e7f7fa; color: #08738a; font-size: 13px; font-weight: 600; }
.badge.yellow { background: #fff6cd; color: #8b6900; }
.badge.gray { background: #edf1f2; color: #6d7e83; }
.badge.red { background: #fdecee; color: var(--danger); }
.badge.status-icon { width: 30px; height: 30px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; font-size: 14px; }
.badge.status-active { background: #e5f7eb; color: #168044; }
.badge.status-inactive { background: #fde8eb; color: #c43d4b; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters > * { flex: 1 1 150px; }
.filters .button { flex: 0 0 auto; }
.next-event { border-left: 5px solid var(--yellow); }
.next-event .event-time { font-size: 30px; font-weight: 700; color: var(--blue); }
.event-meta { display: flex; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.range-row { display: flex; align-items: center; gap: 12px; }
input[type=range] { accent-color: var(--cyan); flex: 1; }
.range-value { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 700; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 11px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; margin: 0; padding: 7px 11px; border: 1px solid #c9dbe0; border-radius: 999px; background: #f8fbfc; cursor: pointer; }
.checks label:hover { border-color: var(--cyan); background: #eefafd; }
.checks input { margin: 0; accent-color: var(--blue); }
.checks input:disabled { cursor: not-allowed; }
.checks label:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.round-list { display: grid; gap: 10px; }
.rounds-field { margin-top: 16px; }
.round-row { display: block; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f8fbfc; }
.round-row strong { display: block; color: var(--blue); margin-bottom: 8px; }
.round-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.alert { padding: 12px 15px; border-radius: 9px; margin-bottom: 18px; }
.alert.success { background: #e9f8ef; color: #167443; }
.alert.error { background: #fff0f1; color: #a9313d; }
.alert.info { background: #eaf7fa; color: #126b7a; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--blue), #086783); }
.login-box { width: min(430px, 100%); background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 20px 70px rgba(0,0,0,.2); }
.login-box .brand { color: var(--blue); margin: 0 0 30px; justify-content: center; }
.login-box .brand-mark { text-align: center; }
.login-box h1 { text-align: center; color: var(--blue); margin: 0 0 20px; }
.login-box form { display: grid; gap: 10px; }
.login-box .button { width: 100%; min-height: 44px; margin-top: 8px; border-radius: 9px; border: 0; }
.login-box .form-grid { gap: 12px; }
.login-box .alert { margin-bottom: 8px; }
.login-foot { text-align: center; margin-top: 18px; font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0 !important; }
.settings-card { display: flex; align-items: center; gap: 14px; }
.settings-card .settings-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #e8f7fa; color: var(--blue); font-size: 20px; }
@media (max-width: 950px) {
  .sidebar { position: fixed; z-index: 10; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle { display: inline-block; }
  .topbar { padding: 0 20px; gap: 12px; }
  .topbar h1 { font-size: 22px; }
  .content { padding: 22px 20px 40px; }
  .grid-3 { grid-template-columns: 1fr; }
  .appointment-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .topbar .user-chip span { display: none; }
  .card { padding: 17px; border-radius: 13px; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  td.actions-cell { justify-content: flex-start; }
  td.actions-cell::before { display: none; }
  .appointments-table { display: table; min-width: 760px; }
  .appointments-table thead { display: table-header-group; }
  .appointments-table tbody { display: table-row-group; }
  .appointments-table tr { display: table-row; border-bottom: 0; padding: 0; }
  .appointments-table th, .appointments-table td { display: table-cell; padding: 13px 10px; border-bottom: 1px solid var(--line); }
  .appointments-table td::before { display: none; }
  .round-selects { grid-template-columns: 1fr; }
}
