:root {
  --ink: #11131a;
  --muted: #777c8a;
  --line: #e8e9ee;
  --soft: #f5f6f8;
  --panel: #ffffff;
  --sidebar: #14151a;
  --sidebar-2: #1d1f26;
  --accent: #a8ff35;
  --accent-dark: #72c900;
  --danger: #e05263;
  --warning: #f3a530;
  --blue: #5275f1;
  --shadow: 0 18px 60px rgba(20, 22, 30, .12);
  font-family: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 18px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .18em; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 800; font-size: 16px; text-decoration: none; letter-spacing: -.02em; }
.brand em { color: var(--accent); font-size: 9px; font-style: normal; letter-spacing: .15em; vertical-align: top; }
.brand-light { color: white; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #10120d; font-size: 14px; font-weight: 800; transform: skew(-5deg); }

/* Login */
.login-page { min-height: 100vh; background: #fafafa; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .9fr) minmax(500px, 1.1fr); }
.login-copy { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 46px 6vw 42px; color: white; background: var(--sidebar); }
.login-copy::before { content: ''; position: absolute; width: 460px; height: 460px; right: -170px; top: 22%; border: 1px solid rgba(168,255,53,.18); border-radius: 50%; box-shadow: 0 0 0 75px rgba(168,255,53,.025), 0 0 0 150px rgba(168,255,53,.018); }
.login-copy::after { content: 'S1'; position: absolute; right: -45px; bottom: -120px; color: rgba(255,255,255,.025); font-size: 380px; font-weight: 800; letter-spacing: -.12em; }
.login-copy > * { position: relative; z-index: 1; }
.login-copy__body { margin: auto 0; max-width: 580px; padding: 80px 0; }
.login-copy h1 { margin: 0 0 30px; font-size: clamp(52px, 5.2vw, 86px); line-height: .95; letter-spacing: -.065em; }
.login-copy__body > p:last-child { max-width: 460px; color: #9a9da7; font-size: 17px; line-height: 1.7; }
.login-copy__footer { display: flex; align-items: center; gap: 12px; color: #717580; font-size: 12px; }
.login-copy__footer span { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px rgba(168,255,53,.1); }
.login-form-wrap { display: grid; place-items: center; padding: 40px; background: #fbfbfc; }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 0 0 10px; font-size: 36px; letter-spacing: -.045em; }
.login-card > .muted { margin: 0 0 36px; font-size: 14px; }
.field { display: block; margin: 0 0 20px; color: #555a67; font-size: 12px; font-weight: 700; }
.field > span:first-child { display: block; margin-bottom: 9px; }
.input-wrap { display: flex; align-items: center; height: 54px; border: 1px solid #dddfe5; border-radius: 11px; background: white; transition: .2s; }
.input-wrap:focus-within { border-color: #9bdc42; box-shadow: 0 0 0 4px rgba(168,255,53,.12); }
.input-wrap svg { width: 19px; margin-left: 17px; fill: none; stroke: #9297a2; stroke-width: 1.7; }
.input-wrap input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; padding: 0 14px; background: transparent; }
.password-toggle { border: 0; padding: 10px 15px; background: none; color: #757a85; font-size: 11px; font-weight: 700; }
.button { border: 0; border-radius: 10px; padding: 13px 18px; font-weight: 800; font-size: 13px; transition: transform .15s, opacity .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button-primary { background: var(--accent); color: #171a12; }
.button-dark { background: var(--sidebar); color: white; }
.button-soft { background: var(--soft); color: var(--ink); }
.button-danger { background: #fff0f2; color: #c93c50; }
.button-wide { display: flex; justify-content: space-between; width: 100%; padding: 17px 20px; margin-top: 10px; }
.form-error { min-height: 20px; margin: -5px 0 8px; color: var(--danger); font-size: 12px; }
.login-note { text-align: center; color: #a2a5ad; font-size: 11px; margin-top: 25px; }
.mobile-brand { display: none; }

/* Application shell */
.app-page { background: var(--soft); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 18px; color: white; background: var(--sidebar); }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 28px; }
.sidebar-close { display: none; }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { margin: 22px 13px 8px; color: #595d68; font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; height: 45px; border: 0; border-radius: 9px; padding: 0 13px; color: #90949f; background: transparent; text-align: left; font-size: 13px; font-weight: 600; }
.nav-item > span { width: 18px; color: #777c87; text-align: center; font-size: 17px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.04); }
.nav-item.is-active { color: #151712; background: var(--accent); }
.nav-item.is-active > span { color: #151712; }
.nav-item b { min-width: 23px; margin-left: auto; padding: 3px 6px; border-radius: 9px; background: rgba(0,0,0,.13); text-align: center; font-size: 9px; }
.sidebar-footer { display: grid; grid-template-columns: 37px 1fr 28px; align-items: center; gap: 10px; margin-top: auto; padding: 16px 8px 2px; border-top: 1px solid #292b31; }
.admin-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #171a12; background: var(--accent); font-size: 13px; font-weight: 800; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 11px; }
.sidebar-footer small { margin-top: 3px; color: #656a74; font-size: 9px; }
.logout-mini { border: 0; background: none; color: #686c76; font-size: 18px; }
.main { min-width: 0; }
.topbar { height: 100px; display: flex; align-items: center; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(18px); }
.breadcrumbs { margin: 0 0 4px; color: #a1a4ad; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: white; color: #707580; font-size: 18px; }
.menu-button { display: none; margin-right: 15px; }
.live-pill { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #e4eed8; border-radius: 9px; color: #5f7442; background: #f7fbf1; font-size: 10px; font-weight: 800; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #79c91d; box-shadow: 0 0 0 4px rgba(121,201,29,.12); }
.live-pill.is-offline { color: #9a4855; background: #fff5f6; border-color: #f4dde1; }
.live-pill.is-offline i { background: var(--danger); }
.content { padding: 30px 34px 45px; }
.loading { min-height: 450px; display: grid; place-content: center; justify-items: center; gap: 16px; color: #8b8f99; font-size: 12px; }
.loading i { width: 28px; height: 28px; border: 2px solid #dde0e5; border-top-color: var(--accent-dark); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard and data */
.view-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 23px; }
.view-heading h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.035em; }
.view-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric { position: relative; min-height: 140px; padding: 21px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.metric.metric-dark { color: white; background: var(--sidebar); border-color: var(--sidebar); }
.metric.metric-dark::after { content: ''; position: absolute; right: -26px; bottom: -44px; width: 130px; height: 130px; border: 24px solid rgba(168,255,53,.11); border-radius: 50%; }
.metric-label { display: flex; align-items: center; gap: 8px; color: #888d98; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.metric-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-dark); }
.metric-value { display: block; margin-top: 20px; font-size: 29px; font-weight: 800; letter-spacing: -.055em; }
.metric-note { display: block; margin-top: 7px; color: #9a9ea8; font-size: 10px; }
.metric-dark .metric-note { color: #6f737c; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px,.75fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: white; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 65px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 13px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.text-button { border: 0; padding: 5px; color: #6c7280; background: none; font-size: 10px; font-weight: 800; }
.quick-actions { padding: 13px; }
.quick-action { display: flex; align-items: center; gap: 13px; width: 100%; border: 0; border-radius: 9px; padding: 13px 10px; background: white; text-align: left; }
.quick-action:hover { background: var(--soft); }
.quick-action span:first-child { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; background: #f0f5e9; color: #73a52f; }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: 11px; }
.quick-action small { margin-top: 3px; color: #9a9da5; font-size: 9px; }
.quick-action b { margin-left: auto; color: #a4a7ae; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 42px; padding: 0 16px; color: #a0a4ad; background: #fafafb; text-align: left; font-size: 8px; letter-spacing: .09em; text-transform: uppercase; }
.data-table td { height: 59px; padding: 9px 16px; border-top: 1px solid #f0f1f3; font-size: 10px; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr[data-order-id] { cursor: pointer; }
.data-table tbody tr:hover { background: #fbfcfa; }
.cell-main { display: block; font-size: 11px; font-weight: 800; }
.cell-sub { display: block; margin-top: 4px; color: #9296a0; font-size: 9px; }
.badge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 10px; padding: 5px 8px; font-size: 8px; font-weight: 800; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { color: #5f9822; background: #f0f8e8; }
.badge-yellow { color: #b77914; background: #fff6e4; }
.badge-red { color: #bd5361; background: #fff0f2; }
.badge-blue { color: #526fc5; background: #edf1ff; }
.badge-gray { color: #7c818b; background: #f0f1f3; }
.table-wrap { overflow-x: auto; }
.empty-state { display: grid; place-items: center; min-height: 250px; padding: 35px; text-align: center; color: var(--muted); font-size: 12px; }
.empty-state b { display: block; margin-bottom: 7px; color: var(--ink); font-size: 15px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.search { position: relative; flex: 1; max-width: 430px; }
.search input, .select, .modal input, .modal select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 13px; outline: 0; background: white; font-size: 11px; }
.search input { padding-left: 38px; }
.search::before { content: '⌕'; position: absolute; left: 14px; top: 8px; color: #9da1ab; font-size: 19px; }
.select { width: auto; min-width: 160px; }
.schedule-grid { display: grid; grid-template-columns: repeat(7, minmax(130px,1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.day-column { min-width: 130px; }
.day-title { margin: 0 0 9px; padding: 0 4px; font-size: 10px; }
.day-title strong { display: block; font-size: 13px; }
.day-title span { color: var(--muted); }
.slot-card { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0 0 7px; border: 1px solid var(--line); border-left: 3px solid #9cd84e; border-radius: 8px; padding: 9px; background: white; text-align: left; font-size: 10px; }
.slot-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.slot-card.is-booked { border-left-color: var(--blue); background: #f6f8ff; }
.slot-card.is-reserved { border-left-color: var(--warning); }
.slot-card.is-blocked { border-left-color: #a5a8b0; opacity: .6; }

/* Modal and feedback */
.modal-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-layer[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13,14,18,.68); backdrop-filter: blur(4px); }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 15px; padding: 30px; background: white; box-shadow: var(--shadow); }
.modal-close { position: absolute; right: 18px; top: 15px; border: 0; background: none; color: #8c9098; font-size: 24px; }
.modal h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.035em; }
.modal-kicker { color: var(--accent-dark); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 25px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.detail-grid div { padding: 13px 15px; border-bottom: 1px solid var(--line); }
.detail-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-grid small, .detail-grid strong { display: block; }
.detail-grid small { margin-bottom: 5px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.detail-grid strong { font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { color: #666b76; font-size: 10px; font-weight: 700; }
.form-grid label > span { display: block; margin-bottom: 7px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 200; transform: translateY(25px); opacity: 0; border-radius: 10px; padding: 13px 17px; color: white; background: #202229; box-shadow: var(--shadow); font-size: 11px; font-weight: 700; pointer-events: none; transition: .25s; }
.toast.is-visible { transform: none; opacity: 1; }
.toast.is-error { background: #b84151; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .quick-actions { display: grid; grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 760px) {
  .login-shell { display: block; }
  .login-copy { display: none; }
  .login-form-wrap { min-height: 100vh; padding: 28px; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 70px; font-size: 13px; font-weight: 800; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(280px, 86vw); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: none; }
  .sidebar-close, .menu-button { display: grid; }
  .sidebar-close { color: white; border-color: #30323a; background: transparent; }
  .topbar { height: 82px; padding: 0 18px; }
  .content { padding: 22px 17px 35px; }
  .live-pill { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 122px; padding: 17px; }
  .metric-value { font-size: 23px; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; max-width: none; }
  .select { flex: 1; }
  .quick-actions { grid-template-columns: 1fr; }
  .data-table th, .data-table td { padding-left: 12px; padding-right: 12px; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .detail-grid div:nth-child(odd) { border-right: 0; }
  .modal { padding: 25px 20px; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 110px; }
  .metric-value { margin-top: 14px; }
  .topbar h1 { font-size: 20px; }
}
