:root {
  --ink: #17172f;
  --muted: #686b82;
  --line: #eee3df;
  --surface: rgba(255, 253, 251, 0.94);
  --bg: #fff8fa;
  --blush: #ffc9d8;
  --sage: #c4e1bb;
  --sage-deep: #6c9b73;
  --danger: #c0394f;
  --shadow: 0 18px 45px rgba(102, 73, 82, 0.10);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 201, 216, 0.55), transparent 34rem),
    radial-gradient(circle at top right, rgba(196, 225, 187, 0.58), transparent 32rem),
    linear-gradient(135deg, var(--bg) 0%, #fbfff8 54%, #fff4f7 100%);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, rgba(255, 201, 216, 0.16), rgba(196, 225, 187, 0.18), rgba(255, 232, 239, 0.16));
  content: "";
  animation: ambientShift 14s ease-in-out infinite alternate;
}

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

button {
  cursor: pointer;
}

a {
  color: #4f7c56;
  font-weight: 700;
  text-decoration: none;
}

.sidebar {
  position: fixed;
  inset: 18px auto 18px 18px;
  z-index: 5;
  width: 230px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar-toggle {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 22px;
}

.brand span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blush), var(--sage));
  font-family: Montserrat, sans-serif;
  font-weight: 900;
}

.brand strong,
h1,
h2 {
  font-family: Montserrat, "Plus Jakarta Sans", sans-serif;
  letter-spacing: 0;
}

nav {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 138px);
  overflow: auto;
  padding-right: 2px;
}

nav a {
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--muted);
  font-weight: 800;
}

nav a.active,
nav a:hover {
  background: #ffe8ef;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(196, 225, 187, 0.5), 0 8px 18px rgba(102, 73, 82, 0.08);
}

.app {
  margin-left: 266px;
  padding: 24px;
}

[data-page] {
  animation: pageIn 0.22s ease both;
}

.nav-collapsed .sidebar {
  transform: translateX(-196px);
}

.nav-collapsed .app {
  margin-left: 70px;
}

.hero,
.panel,
.stats article {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 28px;
  padding: 24px;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

.hero.has-image {
  min-height: 240px;
}

.hero-content,
.hero-actions {
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero p,
.panel-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.95;
  font-weight: 900;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 900;
}

.primary,
.ghost,
.delete {
  min-height: 42px;
  border-radius: 16px;
  padding: 0 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transform: translateY(0);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
}

.primary {
  border: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--blush) 86%, #fff), color-mix(in srgb, var(--sage) 90%, #fff));
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(157, 110, 124, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(102, 73, 82, 0.06);
  backdrop-filter: blur(10px);
}

.delete {
  border: 1px solid #f1c6cd;
  background: #fff0f3;
  color: var(--danger);
}

.primary:hover,
.ghost:hover,
.delete:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(102, 73, 82, 0.13);
  filter: saturate(1.04);
}

.primary:active,
.ghost:active,
.delete:active {
  transform: translateY(1px) scale(0.99);
}

.round {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 12px;
}

.small-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 0.78rem;
}

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

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

.command-bar {
  position: sticky;
  top: 10px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto repeat(5, auto);
  gap: 10px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255, 253, 251, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sync-status {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.sync-status.online {
  border-color: #b9d9ad;
  background: #eef8ea;
  color: #315f39;
}

.sync-status.pending {
  border-color: #f1c6cd;
  background: #fff1f5;
  color: #9a3452;
}

.stats article {
  border-left: 6px solid var(--blush);
  border-radius: 22px;
  padding: 20px;
}

.stats article:nth-child(even) {
  border-left-color: var(--sage);
}

.stats span,
.stats small {
  color: var(--muted);
  font-weight: 800;
}

.stats strong {
  display: block;
  margin: 8px 0 2px;
  font-family: Montserrat, sans-serif;
  font-size: 2.1rem;
  font-weight: 900;
}

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

.panel {
  margin: 18px 0;
  border-radius: 24px;
  padding: 22px;
}

.full {
  min-height: 72vh;
}

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

.actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.toolbar {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.toolbar label {
  flex: 1 1 210px;
}

.compact strong {
  min-width: 160px;
  text-align: center;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 4px rgba(196, 225, 187, 0.45);
}

textarea {
  resize: vertical;
  line-height: 1.35;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--tag-border, var(--line));
  border-radius: 999px;
  padding: 6px 11px;
  background: color-mix(in srgb, var(--tag-bg, #fff) 82%, #fff);
  color: var(--tag-text, var(--ink));
  font-size: 0.78rem;
  font-weight: 800;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(102, 73, 82, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.tag:hover,
.status:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(102, 73, 82, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.tag-button {
  width: 100%;
  min-height: 36px;
  border-radius: 13px;
  text-align: left;
  overflow-wrap: anywhere;
}

.tag.active {
  box-shadow: inset 0 0 0 2px var(--sage-deep);
}

.tag-picker {
  position: absolute;
  z-index: 60;
  width: min(320px, calc(100vw - 24px));
  max-height: 390px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 253, 251, 0.98);
  box-shadow: 0 24px 70px rgba(102, 73, 82, 0.2);
}

.tag-picker-title {
  padding: 8px 10px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tag-picker-list {
  display: grid;
  gap: 5px;
}

.tag-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  border-radius: 10px;
  padding: 5px;
}

.tag-option:hover {
  background: #f7f2ef;
}

.drag-handle,
.dot-menu {
  min-height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9a8b93;
  font-weight: 900;
}

.dot-menu:hover,
.drag-handle:hover {
  background: #fff;
}

.option-pill {
  justify-content: flex-start;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  border-radius: 8px;
}

.tag-row-editor {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 88px auto;
  gap: 8px;
  align-items: center;
}

.tag-row-editor[hidden] {
  display: none;
}

.tag-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 88px auto;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.small {
  margin-top: 6px;
  font-size: 0.72rem;
}

.status.pending {
  border-color: #edd36e;
  background: #fff3bf;
  color: #805400;
}

.status.in-progress {
  border-color: #edd36e;
  background: #fff3bf;
  color: #805400;
}

.status.overdue {
  border-color: #ffb4b4;
  background: #ffe0e0;
  color: #b42318;
}

.status.complete {
  border-color: #aad8b1;
  background: #ddf4df;
  color: #1f7a3f;
}

.status.planning {
  border-color: #f0c9d4;
  background: #ffe8ef;
  color: #9a3452;
}

.status.submitted {
  border-color: #aad8b1;
  background: #ddf4df;
  color: #1f7a3f;
}

.table-shell {
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

th,
td {
  border-right: 1px solid #f0e9e5;
  border-bottom: 1px solid #f0e9e5;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

th {
  background: #fff1f5;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

td:last-child,
th:last-child {
  border-right: 0;
}

tbody tr:hover td {
  background: #fffafb;
}

.assignment-table th:nth-child(1),
.assignment-table td:nth-child(1),
.trans-table th:nth-child(1),
.trans-table td:nth-child(1) {
  width: 4.5%;
}

.assignment-table th:nth-child(2),
.assignment-table td:nth-child(2) {
  width: 13%;
}

.assignment-table th:nth-child(3),
.assignment-table td:nth-child(3) {
  width: 23%;
}

.assignment-table th:nth-child(4),
.assignment-table td:nth-child(4) {
  width: 13%;
}

.assignment-table th:nth-child(5),
.assignment-table td:nth-child(5) {
  width: 11%;
}

.assignment-table th:nth-child(6),
.assignment-table td:nth-child(6) {
  width: 14%;
}

.assignment-table th:nth-child(7),
.assignment-table td:nth-child(7) {
  width: 8%;
}

.assignment-table th:nth-child(8),
.assignment-table td:nth-child(8) {
  width: 9.5%;
}

.assignment-table th:nth-child(9),
.assignment-table td:nth-child(9) {
  width: 4%;
}

.assignment-table th:nth-child(1),
.assignment-table td:nth-child(1),
.assignment-table th:nth-child(9),
.assignment-table td:nth-child(9),
.trans-table th:nth-child(1),
.trans-table td:nth-child(1),
.trans-table th:nth-child(7),
.trans-table td:nth-child(7) {
  padding-right: 4px;
  padding-left: 4px;
  text-align: center;
}

.trans-table th:nth-child(2),
.trans-table td:nth-child(2) {
  width: 15%;
}

.trans-table th:nth-child(3),
.trans-table td:nth-child(3) {
  width: 29%;
}

.trans-table th:nth-child(4),
.trans-table td:nth-child(4) {
  width: 14%;
}

.trans-table th:nth-child(5),
.trans-table td:nth-child(5) {
  width: 15%;
}

.trans-table th:nth-child(6),
.trans-table td:nth-child(6) {
  width: 17%;
}

.trans-table th:nth-child(7),
.trans-table td:nth-child(7) {
  width: 5.5%;
}

td select,
td input,
td textarea {
  min-height: 36px;
  padding: 7px 8px;
  border-color: transparent;
  background: transparent;
  font-size: 0.88rem;
  line-height: 1.35;
}

td textarea {
  min-height: 46px;
  overflow: hidden;
  resize: none;
}

td input[type="date"],
td input[type="time"] {
  font-size: 0.78rem;
}

td select:hover,
td input:hover,
td textarea:hover {
  border-color: var(--line);
  background: #fff8fa;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

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

.weekday-row {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.cal-cell {
  min-height: 122px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  background: #fff;
}

.cal-cell.today {
  box-shadow: inset 0 0 0 2px var(--sage-deep);
}

.cal-cell.muted {
  background: rgba(255, 255, 255, 0.45);
}

.cal-event {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--tag-border, var(--line));
  border-left: 5px solid var(--tag-border, var(--sage));
  border-radius: 12px;
  padding: 5px 6px;
  background: var(--tag-bg, #fff);
  color: var(--tag-text, var(--ink));
  font-size: 0.68rem;
  font-weight: 800;
  text-align: left;
  overflow-wrap: anywhere;
}

.day-list {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fffdfb;
}

.upcoming {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.upcoming span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-grid,
.notes-hub-grid,
.productivity-grid,
.clinical-grid,
.analytics-grid,
.utility-grid,
.project-grid,
.trend-grid,
.integration-grid {
  display: grid;
  gap: 14px;
}

.dashboard-grid,
.productivity-grid,
.clinical-grid,
.notes-hub-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-grid,
.utility-grid,
.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dashboard-grid article,
.notes-hub-grid article,
.productivity-grid article,
.clinical-grid article,
.analytics-grid article,
.utility-grid article,
.project-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(102, 73, 82, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.project-detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--tag-border, var(--sage));
  border-radius: 24px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.project-workspace,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-workspace article,
.feature-grid article {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(102, 73, 82, 0.08);
}

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

.drop-zone {
  display: grid;
  min-height: 96px;
  place-items: center;
  margin-bottom: 12px;
  border: 1px dashed #d8bfc7;
  border-radius: 18px;
  background: #fff8fa;
  color: var(--muted);
  font-weight: 900;
}

.drop-zone.dragging {
  border-color: var(--sage-deep);
  background: #f3fbef;
  color: var(--ink);
}

.project-file-table th,
.project-file-table td {
  min-width: 130px;
  resize: horizontal;
  overflow: auto;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 12px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.kanban-board section {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fff8fa;
}

.kanban-board h4 {
  margin: 0 0 10px;
}

.kanban-board span,
.timeline span {
  display: block;
  margin-bottom: 8px;
  border-radius: 12px;
  padding: 9px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.timeline i {
  display: block;
  height: 7px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blush), var(--sage));
}

.tag-x {
  margin-left: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
}

.feature-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 16px 34px rgba(102, 73, 82, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.feature-card strong {
  font-family: Montserrat, sans-serif;
  font-size: 1.08rem;
}

.feature-card span {
  color: var(--muted);
  line-height: 1.45;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 52px rgba(102, 73, 82, 0.13);
}

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

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

.flashcard-groups section,
.clinical-duty-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff8fa;
}

.clinical-duty-main {
  grid-column: 1 / -1;
}

.clinical-duty-card {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(102, 73, 82, 0.08);
}

.clinical-duty-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-grid article:hover,
.notes-hub-grid article:hover,
.productivity-grid article:hover,
.clinical-grid article:hover,
.analytics-grid article:hover,
.utility-grid article:hover,
.project-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 52px rgba(102, 73, 82, 0.13);
}

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

.schedule-card {
  margin: 0;
}

.schedule-card img {
  width: 100%;
  max-height: 520px;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 14px 30px rgba(102, 73, 82, 0.12);
}

.schedule-panel {
  min-height: 40vh;
}

.schedule-card figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.project-card {
  display: grid;
  gap: 12px;
  border-left: 6px solid var(--tag-border, var(--sage));
}

.project-card p,
.project-card dd {
  color: var(--muted);
}

.project-card dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}

.project-card dt {
  color: var(--muted);
  font-weight: 800;
}

.project-card dd {
  margin: 0;
}

.project-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mini-form {
  display: grid;
  gap: 8px;
}

.metric-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.metric-stack span {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fff8fa;
  color: var(--muted);
  font-weight: 800;
}

.metric-stack strong {
  color: var(--ink);
  font-family: Montserrat, sans-serif;
  font-size: 1.4rem;
}

.flashcard {
  display: grid;
  width: 100%;
  gap: 6px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff8fa;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 22px rgba(102, 73, 82, 0.08);
}

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

.flashcard em {
  color: var(--danger);
  font-style: normal;
  font-weight: 900;
}

.pomodoro-card strong {
  display: block;
  margin: 12px 0;
  font-family: Montserrat, sans-serif;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
}

.pomodoro-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.pomodoro-settings label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.check-row,
.countdown {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fff8fa;
}

.countdown {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.countdown span {
  font-family: Montserrat, sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
}

.wellness-grid {
  display: grid;
  gap: 8px;
}

.wellness-grid span {
  border-radius: 14px;
  padding: 10px;
  background: #eef8ea;
  color: #315f39;
  font-weight: 800;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4e9e7;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blush), var(--sage));
}

.analytics-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.analytics-card strong,
.analytics-grid > article > strong {
  display: block;
  margin: 8px 0;
  font-family: Montserrat, sans-serif;
  font-size: 2rem;
  font-weight: 900;
}

.integration-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.theme-preset {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.theme-preset i {
  height: 28px;
  border-radius: 10px;
}

.theme-preset span {
  grid-column: 1 / -1;
  text-transform: capitalize;
}

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

kbd {
  display: inline-grid;
  min-width: 34px;
  min-height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff8fa;
  font-family: Montserrat, sans-serif;
  font-weight: 900;
}

.card-grid,
.grade-grid,
.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.class-card,
.grade-card,
.note {
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent, var(--blush));
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(102, 73, 82, 0.08);
}

.class-card {
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.class-cover {
  display: grid;
  width: 100%;
  height: 128px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, var(--blush)) 62%, #fff), #fbfff8);
  color: var(--ink);
}

.class-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-cover span {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  font-family: Montserrat, "Plus Jakarta Sans", sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
}

.class-detail-panel[hidden] {
  display: none;
}

.class-detail-hero {
  display: grid;
  grid-template-columns: auto 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent, var(--sage));
  border-radius: 22px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(102, 73, 82, 0.09);
}

.class-detail-cover {
  display: grid;
  height: 120px;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, var(--blush)) 62%, #fff), #fbfff8);
}

.class-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-detail-cover span {
  font-family: Montserrat, "Plus Jakarta Sans", sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
}

.class-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.class-detail-actions {
  margin-top: 14px;
}

.class-detail-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff8fa;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.class-detail-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(102, 73, 82, 0.08);
}

.resource-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.resource-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.resource-item a {
  min-width: 0;
}

.class-card header,
.note header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.class-menu-popover {
  position: absolute;
  z-index: 70;
  display: grid;
  width: 180px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  background: rgba(255, 253, 251, 0.98);
  box-shadow: 0 24px 70px rgba(102, 73, 82, 0.2);
  animation: menuIn 0.14s ease both;
}

.class-menu-popover button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.class-menu-popover button:hover {
  background: #fff1f5;
}

.color-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
}

code {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff8fa;
  color: var(--muted);
  font-family: Montserrat, sans-serif;
  font-weight: 800;
}

.grade-card {
  text-align: center;
}

.grade-card strong {
  display: block;
  margin-top: 8px;
  font-family: Montserrat, sans-serif;
  font-size: 2rem;
  font-weight: 900;
}

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

.study-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.study-grid article {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(102, 73, 82, 0.08);
}

.study-grid h3 {
  margin-bottom: 12px;
}

.study-item {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff8fa;
  color: var(--ink);
  text-align: left;
}

.study-item strong,
.study-item span {
  display: block;
}

.study-item span,
.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(23, 23, 47, 0.28);
  backdrop-filter: blur(5px);
}

.modal {
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(102, 73, 82, 0.2);
}

.modal header,
.modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal header button {
  width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.modal label,
.toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#eventDialog {
  width: min(1060px, calc(100vw - 24px));
}

.event-page {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  border-radius: 24px;
  padding: 22px;
  background: #fbfcfb;
}

.event-page > header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.event-page aside,
.event-page article {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(102, 73, 82, 0.09);
}

.event-page aside {
  border-left: 6px solid var(--tag-border, var(--sage));
}

.event-page h2 {
  margin: 16px 0;
}

.event-page dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
}

.event-page dt {
  color: var(--muted);
}

.event-page dd {
  margin: 0;
}

.event-page section {
  display: grid;
  gap: 16px;
}

.tag-row,
.tag-add {
  display: grid;
  grid-template-columns: 1fr 48px 100px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.tag-add {
  grid-template-columns: 1fr 48px 100px auto;
}

.app,
.sidebar,
.panel,
.stats article,
.hero,
.class-card,
.note,
.grade-card,
.modal,
.cal-cell {
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.panel:hover,
.stats article:hover,
.class-card:hover,
.note:hover,
.grade-card:hover,
.cal-cell:hover,
.study-grid article:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 52px rgba(102, 73, 82, 0.13);
}

@keyframes ambientShift {
  from {
    opacity: 0.55;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0.85;
    transform: translate3d(0, -10px, 0);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1100px) {
  .sidebar {
    position: static;
    width: auto;
    margin: 14px;
  }

  .app,
  .nav-collapsed .app {
    margin-left: 0;
    padding: 14px;
  }

  nav {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .calendar-layout,
  .event-page,
  .study-grid,
  .class-detail-grid,
  .dashboard-grid,
  .productivity-grid,
  .clinical-grid,
  .notes-hub-grid,
  .project-detail-hero,
  .project-workspace,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .command-bar {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .command-bar input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .hero,
  .panel-head,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .two-col,
  .tag-row,
  .tag-add,
  .field-row,
  .resource-form,
  .class-detail-hero,
  .tag-row-editor,
  .tag-create,
  .command-bar,
  .project-card dl,
  .countdown,
  .inline-form,
  .flashcard-groups,
  .pomodoro-settings {
    grid-template-columns: 1fr;
  }

  .class-detail-cover {
    width: 100%;
  }

  .table-shell {
    overflow-x: hidden;
  }

  .assignment-table thead,
  .trans-table thead {
    display: none;
  }

  .assignment-table,
  .assignment-table tbody,
  .assignment-table tr,
  .assignment-table td,
  .trans-table,
  .trans-table tbody,
  .trans-table tr,
  .trans-table td {
    display: block;
    width: 100% !important;
  }

  .assignment-table tr,
  .trans-table tr {
    border-bottom: 1px solid var(--line);
    padding: 10px;
  }

  .assignment-table td,
  .trans-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    border-right: 0;
    padding: 8px 4px;
    text-align: left;
  }

  .assignment-table td::before,
  .trans-table td::before {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .assignment-table td:nth-child(1)::before,
  .trans-table td:nth-child(1)::before {
    content: "Done";
  }

  .assignment-table td:nth-child(2)::before,
  .trans-table td:nth-child(2)::before {
    content: "Course";
  }

  .assignment-table td:nth-child(3)::before {
    content: "Task";
  }

  .assignment-table td:nth-child(4)::before {
    content: "Due";
  }

  .assignment-table td:nth-child(5)::before {
    content: "Type";
  }

  .assignment-table td:nth-child(6)::before,
  .trans-table td:nth-child(6)::before {
    content: "Link";
  }

  .assignment-table td:nth-child(7)::before {
    content: "Notes";
  }

  .assignment-table td:nth-child(8)::before,
  .trans-table td:nth-child(5)::before {
    content: "Status";
  }

  .assignment-table td:nth-child(9)::before,
  .trans-table td:nth-child(7)::before {
    content: "";
  }

  .trans-table td:nth-child(3)::before {
    content: "Topic";
  }

  .trans-table td:nth-child(4)::before {
    content: "Term";
  }
}

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