/* Shared components for nalog.html and admin.html (same world as index.html) */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #C9B8A6 #F1EAE0; }
body { background: #F9F6F0; color: #3A2A22; }
::selection { background: #96584E; color: #F9F6F0; }
input, textarea, select { caret-color: #96584E; }
:focus-visible { outline: 2px solid #96584E; outline-offset: 3px; border-radius: 6px; }
a { text-underline-offset: .28em; text-decoration-thickness: 1px; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
/* Marcellus numerals read as letters (0 → O); figures use Jost instead */
.font-display.tnum { font-family: 'Jost', system-ui, sans-serif; font-weight: 300; letter-spacing: -.01em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; border-radius: 999px; padding: .8rem 1.5rem;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase; line-height: 1.1; white-space: nowrap;
  transition: background-color .4s var(--ease-out), color .4s var(--ease-out), border-color .4s var(--ease-out), opacity .3s; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #96584E; color: #F9F6F0; box-shadow: 0 10px 24px -14px rgba(126, 70, 62, .8); }
.btn-primary:not(:disabled):hover { background: #7E463E; }
.btn-dark { background: #3A2A22; color: #F9F6F0; }
.btn-dark:not(:disabled):hover { background: #5C463A; }
.btn-ghost { border: 1px solid rgba(58, 42, 34, .25); color: #3A2A22; background: transparent; }
.btn-ghost:not(:disabled):hover { border-color: #96584E; color: #96584E; }
.btn-sm { padding: .55rem 1rem; font-size: 12px; letter-spacing: .14em; }
.btn-danger { border: 1px solid rgba(163, 69, 58, .45); color: #A3453A; background: transparent; }
.btn-danger:not(:disabled):hover { background: #A3453A; color: #F9F6F0; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #F9F6F0; border-right-color: transparent; animation: spin .8s linear infinite; }
.btn-ghost.is-busy::after, .btn-danger.is-busy::after { border-color: #96584E; border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Fields */
.label { display: block; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #7A6555; }
.field { width: 100%; border: 0; border-bottom: 1px solid rgba(58, 42, 34, .25); background: transparent; padding: .7rem 0; font-size: 17px; border-radius: 0;
  transition: border-color .4s var(--ease-out); }
.field:focus { outline: none; border-color: #96584E; box-shadow: none; }
.field::placeholder { color: #9A8778; }
.field[aria-invalid="true"] { border-color: #A3453A; }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%233A2A22' stroke-width='1.2'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .2rem center; padding-right: 1.6rem; }
.field-box { border: 1px solid #E3D6C6; border-radius: 14px; padding: .65rem .9rem; background: #F9F6F0; }
.field-box:focus { border-color: #96584E; }

/* Chips */
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: block; border: 1px solid rgba(58, 42, 34, .25); border-radius: 999px; padding: .5rem 1rem; font-size: 15px;
  transition: background-color .4s var(--ease-out), color .4s var(--ease-out), border-color .4s var(--ease-out); }
.chip:hover span { border-color: #96584E; }
.chip input:checked + span { background: #3A2A22; border-color: #3A2A22; color: #F9F6F0; }
.chip input:focus-visible + span { outline: 2px solid #96584E; outline-offset: 3px; }

/* Toggle */
.toggle { position: relative; display: inline-flex; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #E3D6C6; transition: background-color .4s var(--ease-out); pointer-events: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #F9F6F0; box-shadow: 0 1px 3px rgba(58,42,34,.25); transition: transform .4s var(--ease-out); }
.toggle input:checked + span { background: #96584E; }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 2px solid #96584E; outline-offset: 3px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .2rem .65rem; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.badge-booked { background: #EAD9D0; color: #7E463E; }
.badge-attended { background: #E4E8DC; color: #4A5640; }
.badge-no_show { background: #F2DCD7; color: #A3453A; }
.badge-cancelled { background: #EEE8E0; color: #7A6555; text-decoration: line-through; }
.badge-late_cancel { background: #F2DCD7; color: #A3453A; }
.badge-full { background: #3A2A22; color: #F9F6F0; }
.badge-soft { background: #F1EAE0; color: #5C463A; }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(58, 42, 34, .32); opacity: 0; visibility: hidden; transition: opacity .5s var(--ease-out), visibility 0s linear .5s; z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #F9F6F0; z-index: 61; transform: translateX(104%);
  transition: transform .6s var(--ease-out), visibility 0s linear .6s; visibility: hidden; display: flex; flex-direction: column; box-shadow: -30px 0 60px -40px rgba(58, 42, 34, .5); }
.drawer.is-open { transform: none; visibility: visible; transition: transform .6s var(--ease-out); }
.drawer.is-open + .drawer-backdrop, .drawer-backdrop.is-open { opacity: 1; visibility: visible; transition: opacity .5s var(--ease-out); }

/* Toast */
#toasts { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 2rem); }
.toast { pointer-events: auto; background: #3A2A22; color: #F9F6F0; border-radius: 999px; padding: .8rem 1.4rem; font-size: 15px; box-shadow: 0 16px 30px -18px rgba(58,42,34,.7);
  animation: toast-in .5s var(--ease-out); }
.toast.is-error { background: #A3453A; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #F1EAE0 0%, #F7F1E9 50%, #F1EAE0 100%); background-size: 200% 100%; animation: shimmer 1.6s ease-in-out infinite; border-radius: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Mat line (same as landing) */
.mat-line { position: relative; height: 1px; background: currentColor; }
.mat-line::after { content: ""; position: absolute; right: -2px; bottom: -6px; width: 1px; height: 30px; border-radius: 2px; background: currentColor; box-shadow: 0 0 0 .6px currentColor; transform: rotate(32deg); transform-origin: bottom center; }

.fade-in { animation: fade-in .7s var(--ease-out); }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Schedule grid: fullness colors (same family as the site palette) */
.slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 76px; padding: .55rem .4rem;
  border-radius: 16px; text-align: center; line-height: 1.2; transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out); }
.slot .slot-n { font-size: 17px; font-variant-numeric: tabular-nums; }
.slot .slot-t { font-size: 13px; letter-spacing: .02em; }
.slot-free { background: #EFE5D7; color: #3A2A22; }
.slot-near { background: #C9AD92; color: #3A2A22; }
.slot-full { background: #5C463A; color: #F9F6F0; }
.slot-empty { border: 1px dashed #E3D6C6; color: #C9B8A6; }
.slot-past { opacity: .38; }
.slot-mine { box-shadow: 0 0 0 2px #F9F6F0, 0 0 0 4px #96584E; }
button.slot:not(:disabled) { cursor: pointer; }
button.slot:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 12px 22px -14px rgba(58, 42, 34, .6); }
button.slot.slot-mine:not(:disabled):hover { box-shadow: 0 0 0 2px #F9F6F0, 0 0 0 4px #96584E, 0 12px 22px -14px rgba(58, 42, 34, .6); }
.legend-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.legend-dot.slot-free { box-shadow: inset 0 0 0 1px #E3D6C6; }
.legend-dot.slot-mine { box-shadow: 0 0 0 2px #F9F6F0, 0 0 0 3.5px #96584E; }
.sched-scroll { scrollbar-width: thin; }
.sched-time { position: sticky; left: 0; z-index: 1; background: #F9F6F0; }

/* Slot detail sheet */
.sheet { border: 0; padding: 0; background: transparent; margin: auto; width: min(460px, calc(100vw - 2rem)); max-width: none; }
.sheet::backdrop { background: rgba(58, 42, 34, .35); }
.sheet-card { background: #F9F6F0; border: 1px solid #E3D6C6; border-radius: 26px; padding: 1.6rem; box-shadow: 0 30px 60px -30px rgba(58, 42, 34, .55); }
.sheet[open] .sheet-card { animation: fade-in .45s var(--ease-out); }
@media (max-width: 639px) {
  .sheet { margin: auto 0 0; width: 100vw; }
  .sheet-card { border-radius: 26px 26px 0 0; padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); }
}
