/*
 * Nobatino visual refinement layer
 * Shared by the public booking flow and every admin screen.
 */
:root {
  --primary: #0071e3;
  --primary-dark: #0066cc;
  --primary-light: #edf6ff;
  --deep: #1d1d1f;
  --soft: #f2f7fd;
  --border: rgba(29, 29, 31, 0.1);
  --bg: #f5f5f7;
  --white: #fff;
  --muted: #6e6e73;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --background: #f5f5f7;
  --surface: #fff;
  --success: #248a3d;
  --warning: #b25000;
  --danger: #d70015;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-card: 24px;
  --radius: 24px;
  --shadow-soft:
    0 1px 2px rgba(0, 0, 0, 0.02), 0 10px 32px rgba(0, 0, 0, 0.045);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.02), 0 14px 44px rgba(0, 0, 0, 0.055);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  background: var(--background);
  color-scheme: light;
  scroll-padding-top: 88px;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text-primary);
  font-family:
    Vazirmatn,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Tahoma,
    Arial,
    sans-serif;
  font-feature-settings:
    "kern" 1,
    "ss01" 1;
  letter-spacing: -0.012em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(0, 113, 227, 0.16);
}
button,
input,
textarea,
select {
  letter-spacing: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  touch-action: manipulation;
}

*:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.32);
  outline-offset: 3px;
}

.container {
  width: min(1120px, calc(100% - 40px));
}

.card {
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.btn {
  min-height: 46px;
  padding-inline: 19px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms var(--ease-out),
    opacity 180ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: scale(0.975);
}
.btn:disabled {
  opacity: 0.5;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 14px rgba(0, 113, 227, 0.16);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 7px 18px rgba(0, 113, 227, 0.2);
}
.btn-secondary {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.btn-secondary:hover:not(:disabled) {
  background: #e1f0ff;
}
.btn-ghost {
  border-color: rgba(29, 29, 31, 0.12);
  background: rgba(255, 255, 255, 0.78);
}
.btn-ghost:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(29, 29, 31, 0.2);
}
.btn-danger {
  background: #fff1f2;
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: #ffe7ea;
}

.icon-btn,
.row-actions button,
.calendar-close {
  border-color: rgba(29, 29, 31, 0.1);
  background: rgba(255, 255, 255, 0.82);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms var(--ease-out);
}
.icon-btn:hover:not(:disabled),
.row-actions button:hover:not(:disabled),
.calendar-close:hover:not(:disabled) {
  border-color: rgba(29, 29, 31, 0.18);
  background: #fff;
}
.icon-btn:active:not(:disabled),
.row-actions button:active:not(:disabled) {
  transform: scale(0.94);
}

.field {
  gap: 8px;
}
.field label {
  color: #333336;
  font-size: 13px;
  font-weight: 650;
}
.input,
.select,
.textarea {
  min-height: 50px;
  border: 1px solid rgba(29, 29, 31, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.018);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: rgba(29, 29, 31, 0.24);
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}
.input::placeholder,
.textarea::placeholder {
  color: #98989d;
  opacity: 1;
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(215, 0, 21, 0.08);
}
.textarea {
  min-height: 112px;
  line-height: 1.75;
}
.helper {
  color: var(--text-secondary);
  line-height: 1.7;
}
.error {
  color: var(--danger);
}

.badge {
  padding: 5px 10px;
  font-weight: 700;
}
.badge-success {
  background: #ecf8ef;
  color: #17692b;
}
.badge-warning {
  background: #fff5e8;
  color: #914900;
}
.badge-danger {
  background: #fff0f1;
  color: #b50012;
}
.badge-info {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* Public booking */
.public-nav {
  border-bottom-color: rgba(0, 0, 0, 0.07);
  background: rgba(250, 250, 252, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.nav-inner {
  min-height: 68px;
}
.brand {
  gap: 11px;
  font-weight: 750;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(0, 113, 227, 0.16);
}
.brand small {
  color: var(--text-secondary);
  font-weight: 500;
}
.booking-page {
  padding: 32px 0 132px;
}
.booking-layout {
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 18px;
}
.booking-main {
  padding: 30px;
}
.booking-summary {
  top: 88px;
  padding: 22px;
}
.booking-progress {
  margin-bottom: 28px;
}
.step-count {
  margin-bottom: 9px;
  color: var(--text-secondary);
}
.stepper {
  height: 52px;
}
.step-dot {
  color: #929297;
  font-weight: 550;
}
.step-dot:not(:last-child)::after {
  background: #e2e2e7;
}
.step-indicator {
  border-color: #d9d9df;
  background: #fff;
}
.step-dot.active .step-indicator {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.09);
}
.step-dot.done .step-indicator {
  border-color: var(--primary);
  background: var(--primary);
}
.step-panel.active {
  animation: premium-enter 320ms var(--ease-out);
}
.panel-title {
  margin-bottom: 7px;
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.035em;
}
.panel-subtitle {
  margin-bottom: 26px;
  color: var(--text-secondary);
  line-height: 1.75;
}
.date-toolbar {
  margin-bottom: 14px;
}
.date-toolbar h2 {
  font-weight: 700;
}
.calendar-trigger {
  color: var(--primary);
}
.calendar-trigger:hover {
  background: var(--primary-light);
}
.date-scroll {
  gap: 12px;
  padding-block: 5px 16px;
}
.choice-card {
  min-width: 130px;
  width: 130px;
  flex-basis: 130px;
  border-color: rgba(29, 29, 31, 0.1);
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.02),
    0 7px 22px rgba(0, 0, 0, 0.035);
  transition:
    transform 200ms var(--ease-out),
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}
.choice-card:hover:not(:disabled) {
  border-color: rgba(0, 113, 227, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.065);
}
.choice-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow:
    0 0 0 1px var(--primary),
    0 10px 28px rgba(0, 113, 227, 0.1);
}
.choice-card.unavailable:disabled {
  background: #efeff1;
  border-color: transparent;
}
.next-step-note {
  margin-top: 17px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f5f5f7;
}
.service-grid {
  gap: 14px;
}
.service-card {
  padding: 20px;
  border-color: rgba(29, 29, 31, 0.1);
  border-radius: 19px;
  transition:
    transform 200ms var(--ease-out),
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}
.service-card:hover {
  border-color: rgba(0, 113, 227, 0.4);
  transform: translateY(-1px);
}
.service-card:active {
  transform: scale(0.985);
}
.service-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow:
    0 0 0 1px var(--primary),
    0 9px 24px rgba(0, 113, 227, 0.08);
}
.slots {
  gap: 10px;
}
.time-slot {
  min-height: 46px;
  border-color: rgba(29, 29, 31, 0.11);
  border-radius: 13px;
  transition:
    transform 180ms var(--ease-out),
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}
.time-slot:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.time-slot:active:not(:disabled) {
  transform: scale(0.96);
}
.time-slot.selected {
  border-color: var(--primary);
  background: var(--primary);
}
.bank-card {
  border-radius: 22px;
  background: #1d1d1f;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
}
.bank-card::after {
  opacity: 0.5;
}
.upload-box {
  border: 1px dashed rgba(0, 113, 227, 0.35);
  border-radius: 18px;
  background: #f7fbff;
}
.summary-head {
  border-bottom-color: var(--border);
}
.summary-row {
  color: var(--text-secondary);
}
.summary-row strong {
  color: var(--text-primary);
}
.success-details {
  background: #f5f5f7;
}
.booking-controls {
  margin-top: 32px;
}
.mobile-booking-bar {
  border-top-color: rgba(0, 0, 0, 0.08);
  background: rgba(250, 250, 252, 0.86);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.045);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}
.mobile-booking-bar .btn-primary {
  box-shadow: 0 5px 15px rgba(0, 113, 227, 0.16);
}
.calendar-backdrop,
.modal-backdrop {
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(4px);
}
.calendar-dialog,
.modal {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 26px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18);
}
.calendar-dialog {
  transition:
    transform 300ms var(--ease-out),
    opacity 220ms ease;
}
.calendar-day {
  border-radius: 11px;
}
.calendar-day:hover:not(:disabled) {
  background: var(--primary-light);
}
.mini-footer {
  border-top-color: rgba(0, 0, 0, 0.07);
  color: var(--text-secondary);
}

/* Admin */
.admin-body {
  background: var(--background);
}
.sidebar {
  width: 264px;
  border-left-color: rgba(0, 0, 0, 0.075);
  padding: 20px 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.sidebar .brand {
  padding: 2px 9px 24px;
}
.side-nav {
  gap: 5px;
}
.side-link {
  min-height: 46px;
  border-radius: 13px;
  color: #4d4d52;
  font-weight: 600;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms var(--ease-out);
}
.side-link:hover {
  background: #f5f5f7;
  color: var(--text-primary);
}
.side-link:active {
  transform: scale(0.985);
}
.side-link.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.nav-icon {
  color: inherit;
}
.sidebar-foot {
  border-top-color: var(--border);
}
.sidebar-foot button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
}
.admin-main {
  margin-right: 264px;
}
.topbar {
  height: 72px;
  border-bottom-color: rgba(0, 0, 0, 0.07);
  padding-inline: 30px;
  background: rgba(250, 250, 252, 0.8);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}
.topbar h1 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.admin-content {
  max-width: 1480px;
  padding: 30px 30px 110px;
}
.kpi-grid {
  gap: 18px;
}
.kpi {
  padding: 23px;
}
.kpi-icon,
.feature-icon,
.avatar {
  border-radius: 13px;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.kpi-label {
  color: var(--text-secondary);
  font-weight: 600;
}
.kpi-value {
  margin-top: 16px;
  font-size: 26px;
  letter-spacing: -0.035em;
}
.dashboard-grid {
  gap: 18px;
  margin-top: 18px;
}
.widget {
  padding: 24px;
}
.widget-head {
  margin-bottom: 21px;
}
.widget-head h2 {
  font-weight: 700;
}
.chart-bar {
  border-radius: 9px 9px 3px 3px;
  background: var(--primary);
  transition:
    opacity 180ms ease,
    transform 180ms var(--ease-out);
}
.chart-bar:hover {
  filter: none;
  opacity: 0.82;
  transform: translateY(-2px);
}
.toolbar {
  padding: 15px;
  margin-bottom: 18px;
}
.table-card {
  border-radius: 22px;
}
.data-table th,
.data-table td {
  padding: 16px 18px;
  border-bottom-color: rgba(29, 29, 31, 0.075);
}
.data-table th {
  background: #fafafa;
  color: var(--text-secondary);
  font-weight: 650;
}
.data-table tbody tr {
  transition: background-color 150ms ease;
}
.data-table tbody tr:hover {
  background: #fafafa;
}
.avatar {
  border-radius: 50%;
}
.page-head {
  margin-bottom: 23px;
}
.page-head h2 {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.page-head p {
  color: var(--text-secondary);
}
.service-admin-grid {
  gap: 18px;
}
.admin-service,
.settings-section,
.report-card {
  padding: 24px;
}
.schedule-grid {
  gap: 12px;
}
.schedule-day {
  padding: 18px 20px;
}
.switch span {
  background: #d2d2d7;
}
.switch span::before {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}
.switch input:checked + span {
  background: #34c759;
}
.switch input:focus-visible + span {
  outline: 3px solid rgba(0, 113, 227, 0.32);
  outline-offset: 3px;
}
.modal-backdrop {
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}
.modal {
  transform: translateY(20px) scale(0.98);
  transition: transform 300ms var(--ease-out);
}
.open .modal {
  transform: translateY(0) scale(1);
}
.drawer {
  box-shadow: 16px 0 60px rgba(0, 0, 0, 0.16);
  transition: left 320ms var(--ease-out);
}
.toast-wrap {
  bottom: 24px;
  left: 24px;
}
.toast {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  background: rgba(29, 29, 31, 0.92);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px);
  animation: premium-enter 260ms var(--ease-out);
}
.empty {
  color: var(--text-secondary);
}
.app-loader {
  background: rgba(245, 245, 247, 0.76);
  backdrop-filter: blur(10px);
}
.app-loader-box {
  border-color: rgba(0, 0, 0, 0.07);
  border-radius: 22px;
}
.loader-ring {
  border-color: #dcecff;
  border-top-color: var(--primary);
}
.skeleton-block {
  background: #e9e9ed;
  animation: skeleton-pulse 1.3s ease-in-out infinite alternate;
}

/* Login */
.login-page {
  background: var(--background);
}
.login-art {
  background: #1d1d1f;
  padding: clamp(48px, 8vw, 120px);
}
.login-art::after {
  width: 340px;
  height: 340px;
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.14);
  bottom: -150px;
  left: -100px;
}
.login-art h1 {
  font-size: clamp(42px, 5vw, 66px);
  line-height: 1.18;
  letter-spacing: -0.045em;
}
.login-art p {
  color: #c7c7cc;
  font-size: 17px;
}
.login-form-wrap {
  padding: 40px;
  background: #fff;
}
.login-form {
  width: min(400px, 100%);
}
.login-form h2 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.login-form > p {
  margin-bottom: 32px;
}
.password-toggle {
  left: 7px;
  bottom: 4px;
  color: var(--primary);
  font-weight: 650;
}
.login-options a {
  color: var(--primary);
}
.login-form > .helper {
  margin-top: 20px;
  text-align: center;
}

@keyframes premium-enter {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes skeleton-pulse {
  to {
    opacity: 0.58;
  }
}

@media (max-width: 1050px) {
  .sidebar {
    width: 244px;
  }
  .admin-main {
    margin-right: 244px;
  }
}

@media (max-width: 820px) {
  .container {
    width: min(100% - 28px, 720px);
  }
  .booking-page {
    padding-top: 18px;
  }
  .booking-main {
    padding: 24px;
  }
  .sidebar {
    display: none;
  }
  .admin-main {
    margin-right: 0;
  }
  .topbar {
    height: 64px;
    padding-inline: 18px;
  }
  .admin-content {
    padding: 20px 14px 104px;
  }
  .mobile-nav {
    border-top-color: rgba(0, 0, 0, 0.08);
    background: rgba(250, 250, 252, 0.88);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.04);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
  }
  .mobile-nav a {
    min-height: 45px;
    border-radius: 11px;
  }
  .mobile-nav a.active {
    background: var(--primary-light);
  }
  .drawer {
    border-radius: 0 24px 24px 0;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, 720px);
  }
  .public-nav .nav-inner {
    min-height: 60px;
  }
  .booking-page {
    padding-top: 16px;
  }
  .booking-main {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }
  .booking-progress {
    margin-bottom: 18px;
  }
  .panel-title {
    font-size: 28px;
    line-height: 1.36;
  }
  .panel-subtitle {
    font-size: 14px;
  }
  .choice-card {
    min-width: 126px;
    width: 126px;
    flex-basis: 126px;
  }
  .date-scroll {
    margin-inline: 0;
    padding-inline: 2px;
    scroll-padding-inline: 2px;
  }
  .service-grid {
    grid-template-columns: 1fr;
  }
  .slots {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .field {
    grid-column: 1;
  }
  .mobile-booking-bar {
    min-height: 82px;
    padding-inline: 14px;
  }
  .mobile-booking-bar .btn-primary {
    min-height: 50px;
    border-radius: 14px;
  }
  .calendar-dialog {
    border-radius: 26px 26px 0 0;
  }
  .kpi-grid {
    gap: 12px;
  }
  .kpi {
    padding: 18px;
  }
  .kpi-value {
    font-size: 22px;
  }
  .widget,
  .settings-section,
  .report-card,
  .admin-service {
    padding: 19px;
  }
  .toolbar-group {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-group .select {
    width: 100%;
  }
  .schedule-day {
    grid-template-columns: 1fr auto;
    padding: 17px;
  }
  .shift-fields {
    flex-wrap: wrap;
  }
  .shift-fields .input {
    width: min(120px, calc(50% - 12px));
  }
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }
  .page-head > .btn {
    width: 100%;
  }
  .login-form-wrap {
    padding: max(28px, env(safe-area-inset-top)) 22px
      max(30px, env(safe-area-inset-bottom));
  }
  .login-form h2 {
    font-size: 31px;
  }
  .toast-wrap {
    right: 14px;
    left: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .toast {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 390px) {
  .container {
    width: calc(100% - 24px);
  }
  .step-label {
    font-size: 8px;
  }
  .mobile-summary {
    min-width: 86px;
  }
  .mobile-booking-bar .btn-primary {
    max-width: 168px;
    padding-inline: 11px;
    font-size: 12px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .btn:hover:not(:disabled),
  .choice-card:hover:not(:disabled),
  .service-card:hover,
  .chart-bar:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(29, 29, 31, 0.28);
  }
  .card,
  .input,
  .select,
  .textarea,
  .btn-ghost {
    border-color: var(--border);
  }
}
