:root {
  color-scheme: light;
  --black: #f4fbff;
  --navy: #ffffff;
  --deep: #07304f;
  --ocean: #087eaa;
  --sky: #0fa7d8;
  --aqua: #10bfa8;
  --aqua-dark: #0a927f;
  --orange: #f5a13a;
  --white: #08283f;
  --muted: #5b7283;
  --blocked: #e5edf3;
  --red: #d84444;
  --line: rgba(8, 126, 170, 0.22);
  --glass: rgba(255, 255, 255, 0.88);
  --shadow: 0 18px 42px rgba(7, 48, 79, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 4%, rgba(47, 230, 195, 0.32), transparent 24rem),
    radial-gradient(circle at 88% 0%, rgba(15, 167, 216, 0.22), transparent 25rem),
    linear-gradient(180deg, #f4fbff 0%, #dff7ff 48%, #f7fcff 100%);
  color: var(--white);
}

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

button {
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.login-shell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  gap: 18px;
  padding: 28px 16px;
}

.login-panel {
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 248, 255, 0.9));
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  width: 122px;
  height: 122px;
  object-fit: cover;
  border: 3px solid var(--sky);
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(47, 230, 195, 0.08);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(1.75rem, 7vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.login-panel p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 12px;
  text-align: left;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--white);
  padding: 10px 12px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(47, 230, 195, 0.14);
}

.primary-action,
.secondary-action,
.danger-action,
.ghost-action,
.icon-action {
  position: relative;
  overflow: hidden;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  text-align: center;
  white-space: normal;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.primary-action {
  background: linear-gradient(135deg, var(--aqua), var(--ocean));
  color: #ffffff;
}

.primary-action::after,
.secondary-action::after,
.ghost-action::after,
.icon-action::after {
  content: "";
  position: absolute;
  inset: -70% auto -70% -38%;
  width: 32%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  opacity: 0;
  transition: transform 360ms ease, opacity 180ms ease;
  pointer-events: none;
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover,
.icon-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(8, 126, 170, 0.14);
}

.primary-action:hover::after,
.secondary-action:hover::after,
.ghost-action:hover::after,
.icon-action:hover::after {
  opacity: 1;
  transform: translateX(420%) rotate(18deg);
}

.primary-action:active,
.secondary-action:active,
.ghost-action:active,
.icon-action:active {
  transform: translateY(0) scale(0.99);
}

.secondary-action {
  border: 1px solid rgba(47, 230, 195, 0.42);
  background: rgba(16, 191, 168, 0.12);
  color: var(--white);
}

.danger-action {
  border: 1px solid rgba(224, 82, 82, 0.5);
  background: rgba(224, 82, 82, 0.16);
  color: var(--white);
}

.ghost-action,
.icon-action {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--white);
}

.text-link {
  margin-top: 12px;
  border: 0;
  background: none;
  color: var(--sky);
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.topbar .ghost-action {
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand img {
  width: 44px;
  height: 44px;
  border: 2px solid var(--sky);
  border-radius: 999px;
  object-fit: cover;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  overflow: hidden;
  max-width: 52vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  color: var(--muted);
  font-size: 0.8rem;
}

.layout {
  display: grid;
  flex: 1;
  gap: 18px;
  width: min(1180px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 18px 14px 44px;
}

.layout > *,
section {
  min-width: 0;
  max-width: 100%;
}

.mode-mobile .layout {
  padding-bottom: 24px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 12px 20px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  text-align: center;
}

.site-footer a {
  color: var(--ocean);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--aqua-dark);
  text-decoration: underline;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  max-width: 100%;
  padding: 4px 0 8px;
}

.mobile-bottom-nav {
  display: none;
}

.tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  max-width: min(172px, 48vw);
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 9px 12px;
  font-weight: 800;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tabs button::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--aqua), var(--sky));
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 160ms ease, transform 160ms ease;
}

.tabs button:hover {
  border-color: rgba(16, 191, 168, 0.5);
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(7, 48, 79, 0.1);
}

.nav-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  line-height: 1;
}

.tabs button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}

.tabs button.active {
  border-color: var(--aqua);
  background: rgba(16, 191, 168, 0.13);
  color: var(--white);
}

.tabs button.active::before {
  opacity: 1;
  transform: scaleX(1);
}

.hero-strip,
.card,
.slot-card,
.table-panel,
.calendar,
.modal-panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.hero-strip {
  display: grid;
  gap: 16px;
  overflow: hidden;
  padding: 18px;
}

.hero-strip p,
.card p,
.muted {
  color: var(--muted);
}

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

.card {
  min-width: 0;
  padding: 14px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover,
.slot-card:hover,
.list-row:hover,
.mobile-agenda-card:hover {
  border-color: rgba(16, 191, 168, 0.34);
  box-shadow: 0 18px 38px rgba(7, 48, 79, 0.13);
  transform: translateY(-2px);
}

.card,
.slot-card,
.list-row,
.mobile-agenda-card {
  overflow-wrap: anywhere;
}

.metric {
  color: var(--aqua);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.metric.ocean {
  color: var(--sky);
}

.metric.orange {
  color: var(--orange);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.action-row button {
  min-width: 0;
}

.notice {
  border-left: 4px solid var(--orange);
  padding: 12px;
  border-radius: 8px;
  background: rgba(245, 161, 58, 0.1);
  color: #7a4a08;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.section-head h2 {
  margin: 0;
}

.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
  padding-bottom: 8px;
}

.day-tabs button {
  flex: 0 0 clamp(88px, 22vw, 118px);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  padding: 10px;
  font-weight: 900;
}

.day-tabs button.active {
  border-color: var(--aqua);
  color: var(--white);
  box-shadow: inset 0 -3px 0 var(--aqua);
}

.slots {
  display: grid;
  gap: 12px;
}

.slot-card {
  overflow: hidden;
  padding: 14px;
}

.slot-card.mine {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(47, 230, 195, 0.1);
}

.slot-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--white);
  font-size: 1.12rem;
  font-weight: 900;
}

.instructor-line {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(150px, auto);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border-top: 1px solid rgba(8, 126, 170, 0.13);
  padding: 9px 0;
}

.instructor-meta {
  display: grid;
  gap: 3px;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 900;
}

.status-free {
  background: rgba(16, 191, 168, 0.14);
  color: #077968;
}

.status-confirmed,
.status-reserved {
  background: rgba(15, 167, 216, 0.18);
  color: var(--sky);
}

.status-unavailable,
.status-blocked,
.status-used {
  background: var(--blocked);
  color: var(--muted);
}

.status-cancelled {
  background: rgba(245, 161, 58, 0.16);
  color: var(--orange);
}

.status-red {
  background: rgba(224, 82, 82, 0.16);
  color: #a82424;
}

.mine-tag {
  background: rgba(16, 191, 168, 0.18);
  color: #077968;
}

.calendar {
  padding: 12px;
}

.calendar-head,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.week-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.calendar-head {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.day-cell {
  min-height: 72px;
  border: 1px solid rgba(62, 199, 243, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 7px;
  text-align: left;
}

.day-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.day-cell.today {
  border-color: var(--sky);
}

.day-cell.mine {
  background: rgba(16, 191, 168, 0.13);
  color: var(--white);
}

.day-cell strong {
  display: block;
  color: var(--white);
}

.day-cell span {
  display: block;
  margin-top: 5px;
  font-size: 0.7rem;
}

.history-list,
.admin-list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(62, 199, 243, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.list-row small {
  color: var(--muted);
}

.editable-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions button {
  min-height: 36px;
  padding: 8px 10px;
}

.table-panel {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid rgba(62, 199, 243, 0.14);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--navy);
  color: var(--white);
}

thead th {
  position: static;
  z-index: 5;
}

tbody th {
  position: static;
  min-width: 140px;
  background: rgba(255, 255, 255, 0.82);
}

td.cell-free {
  color: var(--aqua);
}

td.cell-busy {
  color: var(--sky);
}

td.cell-unavailable {
  color: var(--muted);
  background: rgba(229, 237, 243, 0.82);
}

.admin-table {
  min-width: 1020px;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  min-width: 210px;
}

.admin-table th:first-child,
.admin-table td:first-child {
  width: 150px;
  min-width: 150px;
}

.cell-stack {
  display: grid;
  gap: 8px;
  min-height: 92px;
  align-content: start;
}

.cell-stack > strong,
.cell-stack > span {
  overflow-wrap: anywhere;
}

.admin-table .action-row {
  align-items: stretch;
  gap: 8px;
}

.admin-table .action-row button {
  flex: 1 1 86px;
  min-height: 36px;
  padding: 8px 10px;
}

.admin-agenda-mobile {
  display: none;
}

.mobile-agenda-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: var(--shadow);
  padding: 12px;
}

.mobile-agenda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(8, 126, 170, 0.14);
  padding-bottom: 10px;
}

.mobile-agenda-head strong {
  font-size: 1.45rem;
}

.mobile-agenda-head span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.mobile-agenda-list,
.mobile-agenda-row,
.mobile-agenda-person {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mobile-agenda-row {
  border: 1px solid rgba(8, 126, 170, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 10px;
}

.mobile-agenda-row.is-disabled {
  background: rgba(229, 237, 243, 0.58);
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.mobile-actions button {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
}

.admin-grid {
  display: grid;
  gap: 14px;
}

.registry-grid {
  display: grid;
  gap: 14px;
}

.two-col {
  display: grid;
  gap: 14px;
}

.compact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}

.modal.open {
  display: grid;
}

.modal-panel {
  width: min(100%, 440px);
  padding: 18px;
}

.wide-modal {
  width: min(100%, 680px);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: none;
  max-width: min(92vw, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--white);
  padding: 13px 14px;
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.logo-preview img {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--sky);
}

.system-note {
  margin-top: 14px;
}

.form-note {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.calendar-board {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.calendar-board-head,
.calendar-board-body {
  display: grid;
  grid-template-columns: 76px repeat(6, minmax(138px, 1fr));
  min-width: 920px;
}

.calendar-board-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(246, 253, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.calendar-time-head,
.calendar-day-head,
.calendar-time-label,
.calendar-cell {
  border-right: 1px solid rgba(62, 199, 243, 0.16);
}

.calendar-time-head {
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 12px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.calendar-day-head {
  display: grid;
  gap: 2px;
  min-height: 78px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--white);
  text-align: center;
}

.calendar-day-head span,
.calendar-day-head small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day-head strong {
  font-size: 1.65rem;
  line-height: 1;
}

.calendar-day-head.today strong {
  display: inline-grid;
  place-self: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(62, 199, 243, 0.28);
  color: var(--sky);
}

.calendar-day-head.mine {
  background: rgba(16, 191, 168, 0.12);
}

.calendar-time-label {
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid rgba(62, 199, 243, 0.16);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.calendar-cell {
  min-height: 70px;
  border-top: 1px solid rgba(62, 199, 243, 0.16);
  padding: 5px;
}

.calendar-event {
  display: grid;
  gap: 1px;
  min-height: 48px;
  border-left: 5px solid var(--event-color);
  border-radius: 7px;
  background: color-mix(in srgb, var(--event-color) 18%, white);
  padding: 7px 8px;
  color: var(--white);
  line-height: 1.15;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.calendar-event:hover {
  filter: saturate(1.08);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 18px rgba(7, 48, 79, 0.12);
}

.calendar-event + .calendar-event {
  margin-top: 5px;
}

.calendar-event strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.calendar-event.is-booked {
  background: rgba(62, 199, 243, 0.18);
}

.calendar-event.is-mine {
  background: rgba(16, 191, 168, 0.22);
}

.calendar-event.is-blocked {
  border-left-color: #a9b7c5;
  background: rgba(226, 234, 241, 0.86);
}

.calendar-empty {
  grid-column: 1 / -1;
  margin: 12px;
}

.ticket-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ticket-summary div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.ticket-summary strong {
  color: var(--aqua);
  font-size: 1.7rem;
}

.ticket-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.reports-grid {
  display: grid;
  gap: 14px;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 2fr) 36px;
  gap: 10px;
  align-items: center;
}

.bar-row span {
  overflow: hidden;
  color: var(--white);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(226, 234, 241, 0.88);
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--bar-color));
}

.trend-widget {
  display: grid;
  gap: 8px;
}

.trend-widget svg {
  width: 100%;
  height: auto;
  min-height: 160px;
}

.trend-grid {
  stroke: rgba(62, 199, 243, 0.16);
  stroke-width: 1;
}

.trend-line {
  fill: none;
  stroke: var(--sky);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.trend-widget circle {
  fill: var(--aqua);
  stroke: #fff;
  stroke-width: 3;
}

.trend-widget text {
  fill: var(--white);
  font-size: 14px;
  font-weight: 900;
}

.trend-labels {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(62, 199, 243, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.audit-row div {
  display: grid;
  gap: 4px;
}

.audit-row span,
.audit-row time {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.tide-panel {
  display: grid;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(225, 248, 255, 0.82)),
    radial-gradient(circle at 20% 0%, rgba(16, 191, 168, 0.18), transparent 16rem);
  box-shadow: var(--shadow);
  padding: 16px;
}

.tide-panel.compact {
  margin: 2px 0;
}

.tide-summary {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--aqua-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tide-summary h2 {
  margin-bottom: 4px;
}

.tide-summary p {
  color: var(--muted);
  margin-bottom: 0;
}

.tide-now {
  display: grid;
  min-width: 170px;
  justify-items: end;
  gap: 3px;
  border: 1px solid rgba(8, 126, 170, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px 12px;
}

.tide-now span,
.tide-now small {
  color: var(--muted);
  font-size: 0.78rem;
}

.tide-now strong {
  color: var(--ocean);
  font-size: 1.9rem;
  line-height: 1;
}

.tide-canvas {
  width: 100%;
  height: 260px;
  border: 1px solid rgba(8, 126, 170, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(223, 247, 255, 0.72), rgba(255, 255, 255, 0.72));
}

.compact .tide-canvas {
  height: 190px;
}

.tide-events {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tide-event {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(8, 126, 170, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px;
}

.tide-event span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tide-event strong {
  color: var(--white);
}

.tide-event.alta small {
  color: var(--ocean);
}

.tide-event.baixa small {
  color: var(--aqua-dark);
}

@media (min-width: 780px) {
  .layout {
    width: min(1280px, 100%);
    padding: 26px 24px 56px;
  }

  .mode-desktop .tabs {
    align-items: center;
    gap: 10px;
    overflow: visible;
    padding: 0;
  }

  .mode-desktop .tabs button {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-height: 48px;
    padding: 12px 18px;
  }

  .mode-desktop .tabs .nav-icon {
    font-size: 1rem;
  }

  .hero-strip {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr 1fr;
  }

  .reports-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-wide {
    grid-column: 1 / -1;
  }

  .registry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .admin-grid {
    grid-template-columns: 260px 1fr;
    align-items: start;
  }

  .compact-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-form .full {
    grid-column: 1 / -1;
  }

  .student-panel {
    padding-top: 8px;
  }

  .week-panel .calendar {
    padding: 16px;
  }

  .week-panel .week-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
  }

  .week-panel .day-cell {
    min-height: 98px;
    padding: 14px;
  }

  .week-panel .day-cell strong {
    font-size: 1rem;
  }

  .lesson-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lesson-card {
    align-content: start;
    min-height: 112px;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: center;
    padding: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    max-width: calc(100vw - 142px);
    white-space: normal;
    line-height: 1.15;
    font-size: 0.95rem;
  }

  .topbar .ghost-action {
    min-height: 38px;
    padding: 8px 12px;
  }

  .layout {
    padding-inline: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .instructor-line {
    grid-template-columns: 1fr;
  }

  .instructor-line .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .instructor-line .action-row button {
    width: 100%;
    min-height: 44px;
  }

  .calendar {
    padding: 8px;
  }

  .calendar-head,
  .calendar-grid {
    gap: 4px;
  }

  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day-cell {
    min-height: 58px;
    padding: 5px;
  }

  .day-cell span {
    font-size: 0.62rem;
  }

  .editable-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button {
    flex: 1 1 120px;
  }

  .ticket-summary {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .trend-labels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .audit-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 20% 0%, rgba(47, 230, 195, 0.38), transparent 18rem),
      linear-gradient(180deg, #f4fbff 0%, #dff7ff 42%, #f8fdff 100%);
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-inline: -10px;
    padding: 8px 10px;
    overflow: visible;
    border-bottom: 1px solid rgba(8, 126, 170, 0.14);
    background: rgba(244, 251, 255, 0.94);
    backdrop-filter: blur(14px);
  }

  .tabs button {
    min-height: 38px;
    max-width: none;
    width: 100%;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .site-footer {
    display: grid;
    width: min(100% - 20px, 520px);
    padding-bottom: calc(126px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 32px rgba(7, 48, 79, 0.18);
    padding: 7px;
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    min-height: 44px;
    min-width: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
  }

  .mobile-bottom-nav .nav-icon {
    font-size: 1rem;
  }

  .mobile-bottom-nav button span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav button.active {
    background: linear-gradient(135deg, rgba(16, 191, 168, 0.22), rgba(15, 167, 216, 0.16));
    color: var(--white);
  }

  .hero-strip {
    padding: 14px;
  }

  .hero-strip h1 {
    font-size: 1.35rem;
    line-height: 1.08;
  }

  .hero-strip p {
    font-size: 0.96rem;
    line-height: 1.35;
  }

  .slot-card,
  .card,
  .tide-panel {
    border-radius: 8px;
  }

  .slots {
    grid-template-columns: 1fr;
  }

  .action-row {
    width: 100%;
  }

  .action-row button {
    flex: 1 1 136px;
  }

  .day-tabs {
    margin-inline: -10px;
    padding: 0 10px 8px;
  }

  .day-tabs button {
    flex-basis: clamp(92px, 29vw, 116px);
    min-height: 48px;
    padding: 8px;
  }

  .slot-time {
    display: grid;
    justify-items: start;
    font-size: 1rem;
  }

  .slot-time .tag {
    margin-top: 2px;
  }

  .tide-summary {
    display: grid;
  }

  .tide-now {
    justify-items: start;
    min-width: 0;
  }

  .tide-canvas,
  .compact .tide-canvas {
    height: 210px;
  }

  .tide-events {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-panel {
    display: none;
  }

  .admin-agenda-mobile {
    display: grid;
    gap: 12px;
  }
}

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

  .primary-action:hover,
  .secondary-action:hover,
  .ghost-action:hover,
  .icon-action:hover,
  .tabs button:hover,
  .card:hover,
  .slot-card:hover,
  .list-row:hover,
  .mobile-agenda-card:hover,
  .calendar-event:hover {
    transform: none;
  }
}
