:root {
  --bg: #030913;
  --navy: #061525;
  --dark: #02070e;
  --teal: #26aef6;
  --mint: #4bdfb9;
  --cy: #58e2ff;
  --cy2: #26aef6;
  --green: #4bdfb9;
  --purple: #ad88ff;
  --amber: #ffc47b;
  --red: #ff5c7c;
  --ink: #e6f1ff;
  --muted: #8ea8c7;
  --line: rgba(83, 185, 230, 0.18);
  --line-active: rgba(88, 226, 255, 0.45);
  --paper: rgba(10, 26, 44, 0.92);
  --card: rgba(7, 20, 34, 0.88);
  --glass: linear-gradient(150deg, rgba(15, 36, 55, 0.92), rgba(5, 16, 29, 0.95));
  --gradient-bg: radial-gradient(ellipse 65% 28% at 52% 19%, #082f49 0, transparent 82%), radial-gradient(ellipse 55% 45% at 95% 80%, #102039 0, transparent 80%), #030913;
  --shadow: 0 18px 40px rgba(1, 7, 14, 0.7);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--gradient-bg);
  background-attachment: fixed;
  background-color: var(--bg);
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cy);
  outline-offset: 2px;
}

a {
  color: var(--cy);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

.app-main {
  margin-left: 264px;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 264px;
  background: linear-gradient(180deg, #071728 0%, #030a14 100%);
  border-right: 1px solid var(--line);
  color: #e6f1ff;
  z-index: 40;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--line);
}

.brand b {
  font-size: 16px;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand small {
  display: block;
  color: var(--cy);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.brand-mark {
  background: linear-gradient(135deg, #62eeff, #1ab5ef);
  border-radius: 12px;
  color: #041321;
  font-weight: 850;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 0 16px rgba(88, 226, 255, 0.4);
}

.brand-mark.big {
  width: 64px;
  height: 64px;
  margin: auto;
  font-size: 38px;
  border-radius: 18px;
}

.navigation {
  overflow: auto;
  flex: 1;
  padding: 14px 10px;
}

.nav-group {
  margin: 3px 0;
}

.nav-group > button {
  border: 0;
  background: none;
  color: #b5cbe4;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.15s ease;
}

.nav-group > button:hover,
.nav-group > button.active {
  background: rgba(88, 226, 255, 0.1);
  color: #58e2ff;
}

.nav-arrow {
  font-size: 10px;
  color: var(--muted);
}

.nav-items {
  padding: 2px 4px 6px 14px;
  display: grid;
  gap: 2px;
}

.nav-items button {
  width: 100%;
  border: 0;
  background: none;
  color: #8ea8c7;
  font-size: 13px;
  padding: 7px 12px;
  text-align: left;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.nav-items button:hover,
.nav-items button.active {
  color: #fff;
  background: rgba(38, 174, 246, 0.22);
}

.sidebar-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  background: rgba(2, 7, 14, 0.5);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4bdfb9;
  box-shadow: 0 0 8px #4bdfb9;
}

.mini {
  border: 0;
  background: none;
  color: var(--cy);
  font-size: 12px;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 4px;
}
.mini:hover {
  background: rgba(88, 226, 255, 0.12);
}

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 36px;
  background: rgba(5, 16, 29, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 25;
}

.topbar h1 {
  font-size: 22px;
  letter-spacing: -0.4px;
  margin: 0;
  color: #fff;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 750;
  color: var(--cy);
  margin: 0 0 3px;
  text-transform: uppercase;
}

.header-left, .top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-date {
  font-size: 12px;
  color: var(--muted);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(38, 174, 246, 0.15);
  border: 1px solid rgba(88, 226, 255, 0.4);
  color: var(--cy);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.content {
  max-width: 1420px;
  padding: 28px 36px 20px;
  margin: auto;
  min-height: calc(100vh - 150px);
}

.page-foot {
  padding: 24px 35px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(12px);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 20px;
}

.stat {
  min-height: 140px;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(88, 226, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.stat .metric {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-top: 16px;
  color: #fff;
}

.muted {
  color: var(--muted);
}

.stat .small {
  font-size: 12px;
  color: var(--muted);
}

.stat .metric.green {
  color: var(--cy);
  text-shadow: 0 0 14px rgba(88, 226, 255, 0.35);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
}

.section-header h2 {
  font-size: 18px;
  margin: 0;
  color: #fff;
}

.section-header p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.btn {
  border: 1px solid transparent;
  background: rgba(38, 174, 246, 0.12);
  color: #e6f1ff;
  font-weight: 650;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn.primary {
  background: linear-gradient(115deg, #62eeff, #1ab5ef);
  color: #041321;
  font-weight: 800;
  border: none;
  box-shadow: 0 4px 16px rgba(38, 174, 246, 0.35);
}

.btn.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 22px rgba(88, 226, 255, 0.45);
}

.btn.outline {
  background: rgba(8, 24, 42, 0.6);
  border-color: rgba(83, 185, 230, 0.3);
  color: var(--cy);
}

.btn.outline:hover {
  border-color: var(--cy);
  background: rgba(88, 226, 255, 0.1);
}

.btn.danger {
  background: rgba(255, 92, 124, 0.15);
  border-color: rgba(255, 92, 124, 0.3);
  color: var(--red);
}

.btn.danger:hover {
  background: rgba(255, 92, 124, 0.25);
}

.btn.small {
  padding: 7px 12px;
  font-size: 12px;
}

.btn.full {
  width: 100%;
}

.btn-icon {
  border: 0;
  background: none;
  color: inherit;
  width: 35px;
  height: 35px;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.btn-icon:hover {
  background: rgba(88, 226, 255, 0.12);
}

.pill {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(75, 223, 185, 0.15);
  color: #4bdfb9;
  border: 1px solid rgba(75, 223, 185, 0.3);
  border-radius: 20px;
  font-weight: 650;
}

.pill.bad {
  background: rgba(255, 92, 124, 0.15);
  color: var(--red);
  border-color: rgba(255, 92, 124, 0.3);
}

.pill.warn {
  background: rgba(255, 196, 123, 0.15);
  color: var(--amber);
  border-color: rgba(255, 196, 123, 0.3);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 16, 29, 0.6);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

th {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(8, 24, 42, 0.85);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(83, 185, 230, 0.1);
  font-size: 13px;
  color: #d0e4f7;
}

tbody tr:hover {
  background: rgba(38, 174, 246, 0.07);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar input, .toolbar select {
  min-width: 180px;
  border: 1px solid rgba(83, 185, 230, 0.25);
  border-radius: 8px;
  background: rgba(4, 15, 26, 0.8);
  color: #e6f1ff;
  padding: 9px 12px;
}

.toolbar input:focus, .toolbar select:focus {
  border-color: var(--cy);
}

.toolbar-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions button {
  padding: 5px 10px;
  background: rgba(38, 174, 246, 0.1);
  border: 1px solid rgba(83, 185, 230, 0.2);
  border-radius: 6px;
  font-size: 12px;
  color: #72cbff;
}

.row-actions button:hover {
  background: rgba(38, 174, 246, 0.2);
  color: #fff;
}

.row-actions button.delete {
  color: var(--red);
  border-color: rgba(255, 92, 124, 0.25);
}

.row-actions button.delete:hover {
  background: rgba(255, 92, 124, 0.2);
}

.empty {
  text-align: center;
  padding: 44px 18px;
  color: var(--muted);
}

.empty b {
  display: block;
  color: #fff;
  margin-bottom: 6px;
}

.split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}

.split.equal {
  grid-template-columns: 1fr 1fr;
}

.notice {
  border: 1px solid rgba(83, 185, 230, 0.25);
  border-left: 4px solid var(--cy);
  background: rgba(7, 24, 40, 0.7);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #c0dff8;
  margin: 12px 0;
}

.notice.warn {
  border-left-color: var(--amber);
  background: rgba(40, 30, 10, 0.5);
  color: #ffe4b3;
}

.notice.error {
  border-left-color: var(--red);
  background: rgba(40, 10, 20, 0.5);
  color: #ffccd5;
}

.quick-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-links button {
  background: rgba(7, 20, 34, 0.8);
  border: 1px solid rgba(83, 185, 230, 0.2);
  padding: 8px 14px;
  border-radius: 8px;
  color: #d0e4f7;
  font-size: 13px;
}

.quick-links button:hover {
  border-color: var(--cy);
  color: #fff;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.calendar-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.calendar-controls button {
  border: 1px solid rgba(83, 185, 230, 0.25);
  border-radius: 8px;
  background: rgba(7, 20, 34, 0.8);
  padding: 8px 14px;
  color: #d0e4f7;
}

.calendar-controls button:hover {
  border-color: var(--cy);
  color: #fff;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.calendar-day {
  background: rgba(6, 18, 32, 0.85);
  min-height: 110px;
  padding: 8px;
  overflow: hidden;
}

.calendar-day.faded {
  background: rgba(3, 10, 20, 0.9);
  color: #4a6885;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--cy);
}

.calendar-day-head {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #b5cbe4;
}

.calendar-wday {
  background: rgba(8, 24, 42, 0.95);
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cy);
}

.appointment-chip {
  display: block;
  border: 0;
  background: rgba(38, 174, 246, 0.18);
  color: #7ce0ff;
  border-left: 3px solid var(--cy);
  border-radius: 5px;
  margin: 3px 0;
  padding: 4px 6px;
  text-align: left;
  font-size: 11px;
  width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.appointment-chip.cancelled {
  background: rgba(255, 92, 124, 0.15);
  border-left-color: var(--red);
  color: #ffa3b5;
}

.calendar-list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 10px;
  gap: 12px;
  background: rgba(8, 24, 42, 0.7);
}

.list-row small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 190px;
  border-bottom: 1px solid var(--line);
  padding-top: 12px;
}

.chart-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 6px;
  min-width: 0;
  height: 100%;
}

.chart-bar {
  min-height: 2px;
  background: linear-gradient(180deg, #58e2ff 0%, #1ab5ef 100%);
  width: 65%;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 0 10px rgba(88, 226, 255, 0.3);
}

.chart-column small {
  font-size: 10px;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 16, 29, 0.6);
}

.detail-grid small {
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}

.login-layer, .dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.login-layer {
  background: var(--gradient-bg);
  background-color: var(--bg);
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-panel {
  background: linear-gradient(150deg, rgba(15, 36, 55, 0.96), rgba(5, 16, 29, 0.98));
  border: 1px solid var(--line);
  width: 100%;
  max-width: 420px;
  padding: 36px;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
  backdrop-filter: blur(14px);
}

.login-panel h1 {
  margin: 16px 0 6px;
  color: #fff;
  font-size: 24px;
}

.login-panel p {
  color: var(--muted);
  font-size: 13px;
}

.login-panel label {
  display: block;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #b5cbe4;
  margin: 24px 0 16px;
}

.login-panel input {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(83, 185, 230, 0.3);
  border-radius: 8px;
  background: rgba(3, 12, 22, 0.8);
  color: #fff;
}

.login-panel input:focus {
  border-color: var(--cy);
}

.login-panel .tiny {
  font-size: 11px;
  margin-top: 20px;
  color: var(--muted);
}

.error {
  color: var(--red) !important;
}

.dialog-layer {
  display: flex;
  justify-content: end;
  align-items: stretch;
}

.dialog-shade, .shade {
  background: rgba(1, 6, 12, 0.75);
  backdrop-filter: blur(4px);
  position: fixed;
  inset: 0;
}

.dialog-shade {
  z-index: 1;
}

.dialog-box {
  position: relative;
  z-index: 2;
  background: linear-gradient(160deg, #091e33, #040e1a);
  border-left: 1px solid var(--line);
  width: min(690px, 100%);
  height: 100%;
  overflow: auto;
  padding: 30px;
  color: #e6f1ff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
  font-size: 22px;
  color: #fff;
}

.form-group-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--cy);
  margin: 22px 0 10px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: block;
  font-size: 12px;
  color: #b5cbe4;
  font-weight: 650;
  min-width: 0;
}

.field.full-width {
  grid-column: 1 / -1;
}

.field input, .field select, .field textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(83, 185, 230, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e6f1ff;
  background: rgba(4, 15, 26, 0.85);
  min-height: 42px;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--cy);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input[type=checkbox] {
  width: 20px;
  min-height: 0;
  vertical-align: middle;
}

.field input[type=color] {
  padding: 4px;
  height: 42px;
}

.dialog-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding: 20px 0;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 90;
  background: rgba(8, 24, 42, 0.95);
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 350px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}

.toast.show {
  opacity: 1;
}

.bottom-nav {
  display: none;
}

.mobile-only, .close-menu {
  display: none;
}

.report-intro {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.report-layout {
  display: grid;
  gap: 18px;
}

.highlight {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filters input, .filters select {
  border: 1px solid rgba(83, 185, 230, 0.25);
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(4, 15, 26, 0.85);
  color: #e6f1ff;
}

@media(max-width: 1180px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .split {
    grid-template-columns: 1fr;
  }
}

@media(max-width: 850px) {
  .app-main {
    margin-left: 0;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .shade:not([hidden]) {
    display: block;
    z-index: 35;
  }
  .mobile-only, .close-menu {
    display: inline-flex;
  }
  .topbar {
    height: 72px;
    padding: 12px 18px;
  }
  .topbar h1 {
    font-size: 19px;
  }
  .top-date {
    display: none;
  }
  .content {
    padding: 16px 14px 90px;
  }
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 0 env(safe-area-inset-bottom);
    display: flex;
    background: rgba(5, 16, 29, 0.95);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 30;
    justify-content: space-around;
  }
  .bottom-nav button {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 1px;
    font-size: 10px;
  }
  .bottom-nav button:hover, .bottom-nav button.active {
    color: var(--cy);
  }
  .bottom-nav .bicon {
    font-size: 20px;
  }
  .page-foot {
    display: none;
  }
  .calendar-day {
    min-height: 85px;
    padding: 4px;
  }
  .calendar-day-head {
    font-size: 11px;
  }
  .appointment-chip {
    font-size: 9px;
    padding: 3px;
  }
  .card {
    padding: 16px;
  }
  .dialog-box {
    padding: 18px;
  }
  .top-actions .btn {
    font-size: 11px;
    padding: 7px 10px;
  }
  .topbar .avatar {
    display: none;
  }
}

@media(max-width: 540px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat {
    min-height: 110px;
  }
  .stat .metric {
    font-size: 22px;
    margin-top: 10px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .topbar h1 {
    font-size: 17px;
  }
  .topbar .eyebrow {
    font-size: 9px;
  }
  .calendar-day {
    min-height: 70px;
  }
  .calendar-wday {
    font-size: 10px;
  }
  .calendar-day-head {
    font-size: 10px;
  }
  .chart {
    gap: 4px;
  }
  .top-actions {
    gap: 6px;
  }
  .list-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media(prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
