:root {
  --accent: #FF3B30;
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --send-bg: var(--accent);
  --send-hover: #E0352B;
  --radius-lg: 18px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-mid: 420ms;
  --dur-slow: 780ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

body.theme-dark {
  /* Hint browsers to render native controls (select dropdown, etc.) in dark mode */
  color-scheme: dark;
  --bg: #212121;
  --text: #FFFFFF;
  --muted: #A7B0BD;
  --muted2: #6A6F75;
  --sidebar-bg: #171717;
  --sidebar-border: #333333;
  --card-bg: #2B2B2B;
  --card-border: #3F3F46;
  --card-hover: #3F3F46;
  --input-bg: #2F2F2F;
  --input-text: #FFFFFF;
  --tool-bg: #2F2F2F;
  --tool-border: #444;
  --tool-hover: #383838;
  --topbar-border: rgba(255, 255, 255, 0.06);
  --link: #7DB3FF;
  --ai-bg: #000000;
  --ai-border: #000000;
  --user-bg: #2A1A1A;
  --user-text: #E6EDF6;
  --copy-hover: #242A38;
  --temp-hover-bg: rgba(255, 59, 48, 0.15);
  --temp-hover-border: #FF3B30;
  --outline-hover-bg: #2A1A1A;
}

body.theme-light {
  /* Hint browsers to render native controls (select dropdown, etc.) in light mode */
  color-scheme: light;
  --bg: #FFFFFF;
  --text: #111216;
  --muted: #6A6F75;
  --muted2: #9CA3AF;
  --sidebar-bg: #F9FAFB;
  --sidebar-border: #E5E7EB;
  --card-bg: #FFFFFF;
  --card-border: #E4E4E7;
  --card-hover: #F4F4F5;
  --input-bg: #F4F4F4;
  --input-text: #111216;
  --tool-bg: #FFFFFF;
  --tool-border: #E5E7EB;
  --tool-hover: #F0F2F5;
  --topbar-border: rgba(0, 0, 0, 0.06);
  --link: #0B69C7;
  --ai-bg: #FFFFFF;
  --ai-border: #E5E7EB;
  --user-bg: #FFFAFA;
  --user-text: #111216;
  --copy-hover: #F2F3F6;
  --temp-hover-bg: #FFF0EF;
  --temp-hover-border: #FF3B30;
  --outline-hover-bg: #FFF0EF;
}

.app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px;
  gap: 12px;
  transition: width var(--dur) var(--ease-out);
  overflow: hidden;
}

.sidebarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebarToggle {
  width: 40px;
  height: 40px;
  border-radius: 14px;
}

/* Collapsed sidebar */
.sidebar.collapsed {
  width: 84px;
  padding: 18px 10px;
}

.sidebar.collapsed .logoText {
  display: none;
}

.sidebar.collapsed .btnText {
  display: none;
}

.sidebar.collapsed .navText {
  display: none;
}

.sidebar.collapsed .navBtn {
  justify-content: center;
  padding: 12px 10px;
}

.sidebar.collapsed .navIcon {
  width: 100%;
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .newDialogBtn {
  justify-content: center;
}

.sidebar.collapsed .userMeta,
.sidebar.collapsed .userChevron {
  display: none;
}

.sidebar.collapsed .userCard {
  justify-content: center;
}

.sidebar.collapsed .sidebarTop {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar.collapsed .sidebarTop::-webkit-scrollbar {
  display: none;
}

.sidebarTop {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}

.sidebarTop::-webkit-scrollbar {
  width: 4px;
}

.sidebarTop::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}

.sidebarTop::-webkit-scrollbar-track {
  background: transparent;
}

.logoRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
}

.logoRow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 16px;
}

.logoMark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .logoMark {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.logoTitle {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.logoSub {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 2px;
}

.btn {
  appearance: none;
  border: none;
  background: var(--tool-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: var(--tool-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--send-bg);
  color: white;
}

.btn.primary:hover {
  background: var(--send-hover);
}

.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.outline:hover {
  background: var(--outline-hover-bg);
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
}

body.theme-light .btn.ghost {
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .btn.ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

.newDialogBtn {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 12px 14px;
}

.newDialogBtn .btnIcon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.newDialogBtn .btnText {
  font-size: 15px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.navBtn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px 12px 18px;
  border: none;
  background: transparent;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 600;
  color: #9CA3AF;
  cursor: pointer;
}

body.theme-light .navBtn {
  color: #6B7280;
}

.navBtn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

body.theme-light .navBtn:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
}

.navBtn.active {
  background: #2A2F3D;
  color: #FFFFFF;
  font-weight: 800;
  border: 1px solid #4B5563;
  border-left: 4px solid var(--accent);
}

body.theme-light .navBtn.active {
  background: #FFFFFF;
  color: #111216;
  border: 1px solid #E5E7EB;
  border-left: 4px solid var(--accent);
}

.navIcon {
  width: 28px;
  text-align: center;
  font-size: 20px;
}

.navText {
  flex: 1;
}

.sidebarBottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.userCard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
}

body.theme-light .userCard {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.userAvatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .userAvatar {
  background: rgba(0, 0, 0, 0.04);
}

.userName {
  font-weight: 800;
}

.userRole {
  font-size: 12px;
  color: var(--muted2);
}

.userMeta {
  flex: 1;
  min-width: 0;
}

.userChevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.userCard:hover {
  background: rgba(255, 255, 255, 0.07);
}

body.theme-light .userCard:hover {
  background: rgba(0, 0, 0, 0.05);
}

.center {
  flex: 1;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Pages */
.page {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pageHeader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
}

.hdrIcon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-light .hdrIcon {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.hdrTitle {
  font-size: 24px;
  font-weight: 800;
}

.hdrSub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.hdrText {
  flex: 1;
}

.hdrActions {
  display: flex;
  gap: 10px;
}

.pageBody {
  padding: 0 20px 20px 20px;
  overflow: auto;
}

/* Chat */
.chatTopBar {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--topbar-border);
  gap: 12px;
}

.titleBubble {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  cursor: default;
}

.titleBubble:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-light .titleBubble:hover {
  background: rgba(0, 0, 0, 0.05);
}

.titleName {
  font-size: 20px;
  font-weight: 800;
}

.titleVersion {
  font-size: 20px;
  font-weight: 600;
  color: var(--muted2);
}

.toolBtn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid var(--tool-border);
  background: var(--tool-bg);
  cursor: pointer;
  user-select: none;
  font-size: 18px;
}

.toolBtn:hover {
  background: var(--tool-hover);
}

#btnTempChat {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-light #btnTempChat {
  border: 1px solid rgba(0, 0, 0, 0.1);
}

#btnTempChat:hover {
  background: var(--temp-hover-bg);
  border: 1px solid var(--temp-hover-border);
}

.chatStack {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.ornament {
  width: 280px;
  height: 280px;
  object-fit: contain;
  opacity: 0.95;
}

.welText {
  font-size: 32px;
  font-weight: 800;
  margin-top: 15px;
}

.welSub {
  font-size: 19px;
  font-weight: 600;
  color: var(--muted);
}

.welDesc {
  font-size: 15px;
  color: var(--muted2);
  max-width: 620px;
  white-space: pre-line;
}

.chatListWrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chatListToolbar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px 0 16px;
}

.chatList {
  flex: 1;
  overflow: auto;
  padding: 10px 12px 16px 12px;
}

/* Messages */
.msgRow {
  width: 100%;
  display: flex;
  padding: 6px 10px 2px 10px;
}

.msgRow.user {
  justify-content: flex-end;
}

.msgRow.ai {
  justify-content: flex-start;
}

.bubble {
  max-width: min(1000px, 92%);
  padding: 10px 14px 6px 14px;
  border-radius: 16px;
  position: relative;
}

.bubble.ai {
  background: var(--ai-bg);
  border: 1px solid var(--ai-border);
}

.bubble.user {
  background: var(--user-bg);
  border: 1px solid var(--accent);
  color: var(--user-text);
}

.msgBody {
  font-size: 15px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.msgBody a {
  color: var(--link);
  text-decoration: none;
}

.msgBody a:hover {
  text-decoration: underline;
}

/* Styled link chip for URLs in chat messages */
.msgLink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  margin: 1px 2px;
  border-radius: 20px;
  background: rgba(11, 105, 199, 0.10);
  border: 1px solid rgba(11, 105, 199, 0.25);
  color: var(--link);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
  vertical-align: middle;
  transition: background 0.15s, border-color 0.15s;
  max-width: 100%;
  overflow-wrap: break-word;
}

.msgLink:hover {
  background: rgba(11, 105, 199, 0.18);
  border-color: rgba(11, 105, 199, 0.5);
  text-decoration: none;
}

body.theme-dark .msgLink {
  background: rgba(125, 179, 255, 0.12);
  border-color: rgba(125, 179, 255, 0.28);
  color: #7DB3FF;
}

body.theme-dark .msgLink:hover {
  background: rgba(125, 179, 255, 0.22);
  border-color: rgba(125, 179, 255, 0.5);
}

/* Debug placeholder icons — SVG colour */
.debugPlaceholderIcon svg {
  color: var(--muted);
  opacity: 0.6;
}

/* Avatar SVG inherit colour */
.userAvatar svg,
.profileAvatar svg {
  display: block;
  color: var(--muted);
}

/* Markdown bits */
.mdCode {
  margin: 10px 0 6px 0;
  padding: 10px 12px;
  border-radius: 12px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

body.theme-light .mdCode {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.mdCode code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  white-space: pre;
}

.mdInline {
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

body.theme-light .mdInline {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.msgTs {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted2);
  text-align: right;
}

.aiTools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 8px 16px;
}

.copyBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
}

.copyBtn .ico {
  width: 18px;
  height: 18px;
}

.copyBtn:hover {
  background: var(--copy-hover);
}

.typing {
  color: var(--muted2);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-light .typing {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* File results card (like FileResultCard) */
.fileCard {
  margin: 10px 16px;
  padding: 12px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-light .fileCard {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.fileCardTitle {
  font-weight: 800;
  margin-bottom: 10px;
}

.fileRow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 12px;
}

.filePath {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fileRow:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.theme-light .fileRow:hover {
  background: rgba(0, 0, 0, 0.04);
}

.fileBtns {
  display: flex;
  gap: 8px;
}

.smallToolBtn {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid var(--tool-border);
  background: var(--tool-bg);
  cursor: pointer;
}

.smallToolBtn:hover {
  background: var(--tool-hover);
}

/* Attachment preview */
.previewFrame {
  padding: 6px 20px 0 20px;
}

.previewInner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: transparent;
}

.previewThumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  border: 1px solid #777;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.02);
}

.previewThumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.previewName {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
}

.previewDel {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 10px;
  background: var(--danger);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.previewDel:hover {
  background: var(--danger-hover);
}

/* Input bar */
.inputBar {
  padding: 0 20px 20px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sendStack {
  /* Keep the input row compact: the send button sits in-flow,
     and the trash button floats above it (does not affect layout). */
  position: relative;
  width: 44px;
  height: 44px;
}

/* Place the trash button right above the send button without moving the input */
#btnClearChat {
  position: absolute;
  top: -52px;
  /* 44px button + 8px gap */
  left: 0;
  z-index: 2;
}

.chatInput {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--input-bg);
  color: var(--input-text);
  padding: 10px 14px;
  outline: none;
  font-size: 15px;
}

.chatInput:focus {
  border-color: var(--accent);
  background: var(--bg);
}

body.theme-light .chatInput:focus {
  background: #FFFFFF;
}

.hiddenInput {
  display: none;
}

.sendBtn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--send-bg);
  color: white;
  font-weight: 800;
  cursor: pointer;
  font-size: 18px;
}

.sendBtn:hover {
  background: var(--send-hover);
}

.sendBtn.stop {
  background: var(--danger);
}

.sendBtn.stop:hover {
  background: var(--danger-hover);
}

/* Lists / Cards */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.cardTitle {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 12px;
}

.cardHint {
  font-size: 13px;
  color: var(--muted2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cardHint code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .cardHint code {
  background: rgba(0, 0, 0, 0.04);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.formRow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formRow label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 700;
}

.formRow input,
.formRow select {
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

body.theme-light .formRow input,
body.theme-light .formRow select {
  background: #FFFFFF;
  border: 1px solid var(--card-border);
  color: var(--text);
}

.formRow input:focus,
.formRow select:focus {
  border-color: var(--accent);
}

.formActions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.tabBtn {
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding: 10px 8px;
  cursor: pointer;
  color: var(--muted2);
  font-weight: 800;
}

body.theme-light .tabBtn {
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.tabBtn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Services page (desktop-like) */
.servicesHeaderTabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 6px 0 18px 0;
}

.servHeaderBtn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 18px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: background var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out), border var(--dur-mid) var(--ease-out);
}

.servHeaderBtn:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.theme-light .servHeaderBtn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.servHeaderBtn:active {
  transform: translateY(1px);
}

.servHeaderBtn.active {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

body.theme-light .servHeaderBtn.active {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.servHeaderInner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.servHeaderIcon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-light .servHeaderIcon {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.servHeaderTitle {
  font-weight: 900;
  font-size: 16px;
}

.servHeaderSub {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 2px;
}

.servTabsSep {
  width: 1px;
  background: rgba(255, 255, 255, 0.10);
  align-self: stretch;
  margin: 8px 12px;
}

body.theme-light .servTabsSep {
  background: rgba(0, 0, 0, 0.10);
}

.servicesPane {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  animation: paneFadeIn var(--dur-mid) var(--ease-out) both;
}

@keyframes paneFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.servicesCard {
  width: min(560px, 100%);
  margin: 0 auto;
}

.servicesUserLabel {
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 12px;
}

.svcForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.svcLabel {
  font-size: 13px;
  font-weight: 900;
  color: var(--muted2);
  margin: 2px 0 4px 0;
}

.svcFieldWrap {
  width: 100%;
}

.svcField {
  width: 100%;
  height: 48px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border var(--dur-mid) var(--ease-out), background var(--dur-mid) var(--ease-out);
}

/* Make <select> look like the desktop combobox and fix unreadable options */
select.svcField {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
}

body.theme-dark select.svcField {
  background-image: url("/static/assets/custom/icons/arrow_down_dark.png");
}

body.theme-light select.svcField {
  background-image: url("/static/assets/custom/icons/arrow_down_light.png");
}

/* Dropdown list (limited styling support, but helps on Chromium/Windows) */
body.theme-dark select.svcField option {
  background-color: #2B2B2B;
  color: #FFFFFF;
}

body.theme-light select.svcField option {
  background-color: #FFFFFF;
  color: #111216;
}

/* Remove default arrow in old Edge/IE */
select.svcField::-ms-expand {
  display: none;
}

body.theme-light .svcField {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.svcField:focus {
  border-color: var(--accent);
}

.reqItem {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
}

body.theme-light .reqItem {
  background: #FFFFFF;
  border: 1px solid var(--card-border);
}

.reqHead {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.reqUserRow {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.reqUserIcon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}

body.theme-light .reqUserIcon {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.reqUserName {
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reqDate {
  font-size: 12px;
  color: var(--muted2);
  white-space: nowrap;
}

.reqMeta {
  margin-top: 6px;
  color: var(--muted2);
  font-size: 13px;
}

.reqDocType {
  margin-top: 10px;
  font-weight: 900;
}

.reqDocType.red {
  color: var(--accent);
}

.reqDocType.green {
  color: #22C55E;
}

.reqStatusLine {
  margin-top: 8px;
  font-weight: 700;
}

.status {
  font-weight: 900;
}

.status.approved {
  color: #22C55E;
}

.status.refused {
  color: var(--accent);
}

.status.new {
  color: var(--muted);
}


.reqActions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.servicesRefreshWrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .sidebar {
    width: 240px;
  }
}


/* Request cards */
.reqCard {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

body.theme-light .reqCard {
  background: #FFFFFF;
  border: 1px solid var(--card-border);
}

.reqRow1 {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.reqType {
  font-weight: 800;
}

.reqDate {
  font-size: 12px;
  color: var(--muted2);
  white-space: nowrap;
}

.reqStatus {
  margin-top: 6px;
  font-weight: 600;
}

.reqActions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn.green {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22C55E;
}

.btn.green:hover {
  background: rgba(34, 197, 94, 0.25);
  border: 1px solid rgba(34, 197, 94, 0.6);
}

.btn.red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #EF4444;
}

.btn.red:hover {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.6);
}

/* Settings switch */
.settingRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-light .settingRow {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.settingRow:last-child {
  border-bottom: none;
}

.settingName {
  font-weight: 800;
}

.settingSub {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 4px;
}

.switch {
  position: relative;
  width: 52px;
  height: 28px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}

body.theme-light .slider {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.slider:before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 2px;
  background: #FFFFFF;
  border-radius: 999px;
  transition: .2s;
}

.switch input:checked+.slider {
  background: rgba(255, 59, 48, 0.25);
  border-color: rgba(255, 59, 48, 0.5);
}

.switch input:checked+.slider:before {
  transform: translateX(24px);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modalBack {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modalCard {
  position: relative;
  width: min(420px, 92vw);
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 18px;
  box-shadow: var(--shadow);
}

.modalTitle {
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 12px;
}

.hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted2);
  white-space: pre-line;
}

/* Toast */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  bottom: auto;
  right: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  z-index: 60;
}

body.theme-light .toast {
  background: rgba(17, 18, 22, 0.85);
}


/* --- Auth screen (login/register) --- */
.authScreen {
  /* smoother auth animations */
  --dur-fast: 260ms;
  --dur-mid: 620ms;
  --dur-slow: 1150ms;
  --auth-reveal: 1250ms;

  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

/* Dark (default) look close to desktop */
body.theme-dark .authScreen {
  background:
    radial-gradient(900px circle at 30% 10%, rgba(255, 59, 48, 0.16), transparent 55%),
    radial-gradient(700px circle at 80% 25%, rgba(255, 255, 255, 0.06), transparent 55%),
    #0b0e14;
}

/* Light theme: still stylish, but readable */
body.theme-light .authScreen {
  background:
    radial-gradient(900px circle at 30% 10%, rgba(255, 59, 48, 0.10), transparent 55%),
    radial-gradient(700px circle at 80% 25%, rgba(0, 0, 0, 0.04), transparent 55%),
    #F4F6FA;
}

.authContent {
  width: min(430px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* Brand block (logo + animated AI Gul text) */
.authBrandCenter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform var(--dur-slow) var(--ease-out);
  transform: translateY(0);
}

.authLogo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}

/* Typing-like animation for the title */
.authBrandText {
  font-weight: 900;
  font-size: 36px;
  letter-spacing: 0.2px;
  line-height: 1;
}

body.theme-dark .authBrandText {
  color: #fff;
}

body.theme-light .authBrandText {
  color: #111216;
}

.authBrandText span {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--accent);
  width: 0;
  animation: authReveal 900ms var(--ease-out) forwards, authCaret 750ms steps(1) infinite;
}

.authScreen.ready .authBrandText span {
  border-right: none;
  width: auto;
  animation: none;
}

@keyframes authReveal {
  from {
    width: 0;
    opacity: 0.35;
  }

  to {
    width: 6.5ch;
    opacity: 1;
  }
}

@keyframes authCaret {
  50% {
    border-color: transparent;
  }
}

/* Bubble */
.authBubble {
  width: 100%;
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
  will-change: transform, opacity, max-height;

  max-height: 0;
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out),
    max-height var(--dur-slow) var(--ease-out),
    padding var(--dur-slow) var(--ease-out);
}

/* Bubble colors */
body.theme-dark .authBubble {
  background: rgba(18, 20, 26, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}

body.theme-light .authBubble {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.18);
}

/* After splash -> show */
.authScreen.ready .authBubble {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  max-height: 520px;
  padding: 18px;
}

.authScreen.ready .authBrandCenter {
  transform: translateY(-10px);
}

/* Register mode expands the bubble a bit */
.authScreen.ready .authBubble.mode-register {
  max-height: 600px;
}

.authBubbleTitle {
  text-align: center;
  font-weight: 900;
  font-size: 20px;
  margin: 2px 0 14px;
}

body.theme-dark .authBubbleTitle {
  color: #fff;
}

body.theme-light .authBubbleTitle {
  color: #101114;
}

/* Inputs */
.authForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.authFadeIn {
  animation: authFadeIn var(--dur-mid) var(--ease-out) both;
}

.authFadeOut {
  animation: authFadeOut var(--dur-mid) var(--ease-out) both;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.authInput input {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
  outline: none;
  font-size: 14px;
}

/* Same look for role <select> in registration */
.authInput select {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text);
}

body.theme-dark .authInput select {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.theme-light .authInput select {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #0f1013;
}

body.theme-dark .authInput input {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.theme-light .authInput input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #0f1013;
}

/* Prevent Chrome autofill from turning fields white */
.authInput input:-webkit-autofill,
.authInput input:-webkit-autofill:hover,
.authInput input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
  box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.22) inset !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .authInput input:-webkit-autofill,
body.theme-light .authInput input:-webkit-autofill:hover,
body.theme-light .authInput input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f1013;
  box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.03) inset !important;
  border: 1px solid rgba(0, 0, 0, 0.10);
}


.authInput input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.18);
}

.authInput select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.18);
}

/* Password row */
.authPassRow {
  position: relative;
}

.authPassRow input {
  padding-right: 52px;
}

.passToggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.theme-light .passToggle {
  border-color: rgba(0, 0, 0, 0.10);
}

.passToggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .passToggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Links in bubble */
.authLinkBtn {
  margin-top: 10px;
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  color: inherit;
}

body.theme-light .authLinkBtn {
  border-color: rgba(0, 0, 0, 0.10);
}

.authLinkBtn:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .authLinkBtn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Primary auth buttons (orange like before, but keep the same size) */
.authBubble .authSubmit {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  padding: 0 14px;
  font-weight: 900;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #FFFFFF;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.authBubble .authSubmit:hover {
  background: var(--send-hover);
}

.authBubble .authSubmit:active {
  transform: translateY(1px);
}

/* Checkbox row */
.authRow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

body.theme-dark .check {
  color: rgba(255, 255, 255, 0.72);
}

body.theme-light .check {
  color: rgba(0, 0, 0, 0.62);
}

.check input {
  width: 16px;
  height: 16px;
}

/* Hint inside auth bubble */
#loginHint,
#regHint {
  margin-top: 8px;
  font-size: 13px;
  white-space: pre-line;
}

/* small screens */
@media (max-width: 520px) {
  .authLogo {
    width: 108px;
    height: 108px;
  }

  .authBrandText {
    font-size: 32px;
  }
}

/* --- Icons & brand images (from desktop assets) --- */
.logoImg {
  width: 44px;
  height: 44px;
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}

.ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.navIcon .ico {
  width: 28px;
  height: 28px;
}

.hdrIcon .ico {
  width: 34px;
  height: 34px;
}

.toolBtn.iconOnly,
.sendBtn.iconOnly {
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolBtn.iconOnly {
  padding: 10px;
}

.sendBtn.iconOnly {
  padding: 10px 16px;
}

/* Debug Tab Styles (Kazakh only) */
.debugTabsNav {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.debugTabBtn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--muted2);
  font-weight: 700;
  font-size: 14px;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.debugTabBtn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

body.theme-light .debugTabBtn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.debugTabBtn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

body.theme-light .debugTabBtn.active {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.debugContent {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.debugPane {
  animation: paneFadeIn var(--dur-mid) var(--ease-out) both;
}

.debugPlaceholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.debugPlaceholderIcon {
  font-size: 48px;
  opacity: 0.5;
  margin-bottom: 8px;
}

.debugPlaceholderText {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.debugPlaceholderDesc {
  font-size: 14px;
  color: var(--muted2);
  max-width: 400px;
}

/* Payment receipt upload */
.fileRow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.fileHint {
  font-size: 12px;
  color: var(--muted2);
}

.receiptPreview {
  margin-top: 6px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .receiptPreview {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
}

.receiptImg {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
}

.receiptPill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

body.theme-light .receiptPill {
  background: #FFFFFF;
  border: 1px solid var(--card-border);
}

/* --- Profile page --- */
.profileTop {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profileAvatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 20px;
}

.profileMeta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profileName {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}

.profileRole {
  font-size: 13px;
  color: var(--muted2);
  font-weight: 700;
}

.profileGroup {
  font-size: 13px;
  color: var(--muted2);
}

/* Profile logout button */
.profileLogoutActions {
  justify-content: flex-end;
}

.profileLogoutBtn {
  min-width: 210px;
  padding: 12px 18px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

@media (max-width: 520px) {
  .profileLogoutBtn {
    width: 100%;
  }
}


/* --- Additional Classes XLSX canvas --- */
.canvasToolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.canvasToolbarRight {
  display: flex;
  align-items: center;
  gap: 12px;
}

.canvasSelectWrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvasLabel {
  font-size: 12px;
  font-weight: 900;
  color: var(--muted2);
}

.canvasSelect {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
}

body.theme-light .canvasSelect {
  background: #FFFFFF;
  border: 1px solid var(--card-border);
}

.sheetWrap {
  margin-top: 12px;
  width: 100%;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  min-height: 360px;
  max-height: 72vh;
}

body.theme-light .sheetWrap {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--card-border);
}

.sheetLoading {
  padding: 16px;
  color: var(--muted2);
  font-weight: 700;
}

.xlTable {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

.xlCell {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.25;
  white-space: pre-wrap;
  vertical-align: middle;
}

body.theme-light .xlCell {
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.xlEditable {
  cursor: text;
}

.xlEditable:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent) inset;
}

/* Additional classes canvas: cell selection should be GREEN (not accent). */
#pageAdditionalClasses .xlEditable:focus {
  outline: 2px solid #00B050;
  outline-offset: -2px;
  box-shadow: none;
}

#pageAdditionalClasses .xlSelected {
  outline: 2px solid #00B050;
  outline-offset: -2px;
}

/* Already filled cells must look inactive */
#pageAdditionalClasses .xlLocked {
  cursor: default;
}

#pageAdditionalClasses .xlFilled.xlLocked {
  opacity: 0.92;
}

.xlDirty {
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.7) inset;
}

/* Alias (existing markup uses btnDanger in a few places) */
.btn.btnDanger {
  background: rgba(255, 59, 48, 0.14);
  border: 1px solid rgba(255, 59, 48, 0.35);
  color: #FF3B30;
}

.btn.btnDanger:hover {
  background: rgba(255, 59, 48, 0.2);
}
}


/* ------------------------------
   Makeup / Absence ("Отработка")
   ------------------------------ */

.makeupGrid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 980px) {
  .makeupGrid {
    grid-template-columns: 1fr;
  }
}

.makeupTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.makeupTopLeft {
  min-width: 220px;
}

.makeupFilters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.formRow.compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.formRow.compact label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 600;
}

.formRow.compact select {
  height: 40px;
  border-radius: 12px;
}

.makeupCalendarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .makeupCalendarHeader {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
}

.makeupCalMonth {
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 15px;
}

.makeupWeekdays {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  font-size: 12px;
  color: var(--muted2);
  font-weight: 700;
  text-align: center;
}

.makeupCalendar {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.makeupDay {
  position: relative;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

body.theme-light .makeupDay {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
}

.makeupDay:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .makeupDay:hover {
  background: rgba(0, 0, 0, 0.05);
}

.makeupDay.outMonth {
  opacity: 0.35;
}

.makeupDay.today {
  border-color: rgba(255, 59, 48, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12);
}

.makeupDay.missed {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
}

.makeupDay.missed:hover {
  background: rgba(239, 68, 68, 0.22);
}

.makeupDay.selected {
  border-color: rgba(255, 59, 48, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.18);
}

.makeupDay.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.makeupDay.submitted::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  /* Pending review (default) */
  background: rgba(148, 163, 184, 0.85);
}

body.theme-light .makeupDay.submitted::after {
  background: rgba(100, 116, 139, 0.75);
}

.makeupDay.submitted.approved::after {
  background: rgba(34, 197, 94, 0.9);
}

.makeupDay.submitted.rejected::after {
  background: rgba(245, 158, 11, 0.92);
}

.makeupLegend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 700;
}

.legendItem {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legendDot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legendDot.missed {
  background: rgba(239, 68, 68, 0.85);
}

.legendDot.selected {
  background: rgba(255, 59, 48, 0.85);
}

.legendDot.submitted {
  /* Pending review */
  background: rgba(148, 163, 184, 0.85);
}

body.theme-light .legendDot.submitted {
  background: rgba(100, 116, 139, 0.75);
}

.legendDot.approved {
  background: rgba(34, 197, 94, 0.9);
}

.legendDot.rejected {
  background: rgba(245, 158, 11, 0.92);
}

.makeupDivider {
  height: 1px;
  margin: 14px 0;
  background: rgba(255, 255, 255, 0.08);
}

body.theme-light .makeupDivider {
  background: rgba(0, 0, 0, 0.08);
}

.makeupMiniTitle {
  font-size: 13px;
  margin-bottom: 6px;
}

.makeupHistoryHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.makeupHistoryClose {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted2);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.makeupHistoryClose:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

body.theme-light .makeupHistoryClose {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
}

body.theme-light .makeupHistoryClose:hover {
  background: rgba(0, 0, 0, 0.05);
}

.makeupHistoryClosed {
  margin-top: 8px;
}

.btn.sm {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 12px;
}

.makeupStatusPill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  white-space: nowrap;
}

body.theme-light .makeupStatusPill {
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.03);
}

.makeupStatusPill.new {
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.makeupStatusPill.approved {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.makeupStatusPill.rejected {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.makeupSubControls {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.makeupSubRow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.makeupSubRow label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 700;
}

.makeupSubRow select {
  height: 40px;
  border-radius: 12px;
}

.makeupTextarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .makeupTextarea {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
}

.makeupSubActions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.makeupSubCommentView {
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
}

body.theme-light .makeupSubCommentView {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
}

.makeupSelected {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .makeupSelected {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
}

.makeupSelectedLabel {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 700;
  margin-bottom: 8px;
}

.makeupSelectedList {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.makeupSubmissions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.makeupSubCard {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

body.theme-light .makeupSubCard {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
}

.makeupSubTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.makeupSubTitle {
  font-weight: 900;
  font-size: 13px;
}

.makeupSubMeta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.35;
}

.makeupSubLink {
  font-weight: 800;
  font-size: 12px;
  color: var(--link);
  text-decoration: none;
}

.makeupSubLink:hover {
  text-decoration: underline;
}

.makeupDivider {
  height: 1px;
  width: 100%;
  margin: 14px 0;
  background: rgba(255, 255, 255, 0.08);
}

body.theme-light .makeupDivider {
  background: rgba(0, 0, 0, 0.08);
}

.makeupMiniTitle {
  margin-top: 2px;
  font-size: 13px;
}

.makeupStatusPill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  user-select: none;
}

body.theme-light .makeupStatusPill {
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.03);
}

.makeupStatusPill.new {
  color: rgba(148, 163, 184, 0.95);
}

.makeupStatusPill.approved {
  color: rgba(34, 197, 94, 0.95);
}

.makeupStatusPill.rejected {
  color: rgba(245, 158, 11, 0.98);
}

.makeupSubControls {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.makeupSubRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.makeupSubRow label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 700;
}

.makeupSubRow select {
  height: 40px;
  border-radius: 12px;
  min-width: 160px;
}

.makeupTextarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

body.theme-light .makeupTextarea {
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.02);
}

.makeupSubActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn.sm {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 12px;
}

.makeupSubCommentView {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

body.theme-light .makeupSubCommentView {
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.02);
}

.icoRotateLeft {
  transform: rotate(90deg);
}

.icoRotateRight {
  transform: rotate(-90deg);
}

/* Read-only document wrapper (e.g. pedagogical load for teacher role) */
.readonlyDoc {
  cursor: default;
}

/* Pedagogical load (multi-doc list) */
.pedLoadGrid {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.pedLoadGrid > .card {
  flex: 1;
}

#pedLoadListCard {
  flex: 0 0 320px;
}

.pedLoadList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pedLoadItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
  user-select: none;
}

.pedLoadItem:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

body.theme-light .pedLoadItem:hover {
  border-color: rgba(0, 0, 0, 0.12);
}

.pedLoadItem.active {
  outline: 2px solid var(--accent);
}

.pedLoadName {
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.pedLoadChevron {
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.pedLoadDocBar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .pedLoadGrid {
    flex-direction: column;
  }

  #pedLoadListCard {
    flex: 1;
  }
}

/* ================================================================
   SCHEDULE VIEW — Academic poster / printable card design
   Palette: white · light-gray · graphite · soft-red accent
   ================================================================ */

/* ── Outer container ── */
.schedPretty {
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border: 1.5px solid rgba(229, 57, 53, 0.18);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

body.theme-dark .schedPretty {
  background: #1c1c1e;
  border-color: rgba(229, 57, 53, 0.22);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ── Header ── */
.schedPrettyHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 20px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.theme-dark .schedPrettyHead {
  background: #232325;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.schedPrettyLeft {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.schedPrettyLogo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.schedLogoImg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.schedPrettyTitleBlock {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.schedPrettyTitle {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #1a1a1a;
  line-height: 1.15;
}

body.theme-dark .schedPrettyTitle {
  color: #f0f0f0;
}

.schedPrettyType {
  font-size: 12px;
  color: #9e9e9e;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Date pill (right side of header) ── */
.schedDateBadge {
  background: #e53935;
  border-radius: 14px;
  padding: 8px 20px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(229, 57, 53, 0.3);
  letter-spacing: 0.3px;
}

body.theme-dark .schedDateBadge {
  background: #c62828;
  box-shadow: 0 3px 12px rgba(198, 40, 40, 0.35);
}

/* ── Warning bar ── */
.schedWarning {
  padding: 12px 28px;
  background: rgba(229, 57, 53, 0.06);
  color: #c62828;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid rgba(229, 57, 53, 0.08);
}

body.theme-dark .schedWarning {
  background: rgba(229, 57, 53, 0.1);
  color: #ef9a9a;
}

/* ── Shift section ── */
.schedShift {
  display: flex;
  flex-direction: column;
}

.schedShiftTitle {
  font-weight: 800;
  font-size: 12px;
  color: #9e9e9e;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 28px 4px;
}

body.theme-dark .schedShiftTitle {
  color: #757575;
}

/* ── Lessons list ── */
.schedLessons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px 20px;
}

/* ── Single lesson card ── */
.lessonCard {
  display: flex;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid #ececec;
  background: #f4f4f5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

body.theme-dark .lessonCard {
  background: #2a2a2c;
  border-color: #3a3a3c;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.lessonCard:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  border-color: rgba(229, 57, 53, 0.3);
  transform: translateY(-1px);
}

body.theme-dark .lessonCard:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  border-color: rgba(229, 57, 53, 0.4);
}

/* ── Left: time column ── */
.lessonTime {
  min-width: 110px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.lessonPair {
  font-size: 10px;
  font-weight: 800;
  color: #b0b0b0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

body.theme-dark .lessonPair {
  color: #6e6e6e;
}

.lessonRange {
  font-size: 19px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

body.theme-dark .lessonRange {
  color: #f0f0f0;
}

.lessonBreak {
  font-size: 11px;
  color: #bdbdbd;
  font-weight: 600;
  margin-top: 2px;
}

body.theme-dark .lessonBreak {
  color: #616161;
}

/* ── Center: info column ── */
.lessonInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.lessonSubjectRow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lessonSubjectCode {
  font-size: 16px;
  font-weight: 900;
  color: #1a1a1a;
  line-height: 1.25;
}

body.theme-dark .lessonSubjectCode {
  color: #f0f0f0;
}

/* ── Lesson type badge ── */
.lessonTypeBadge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: #757575;
  color: #fff;
}

.lessonTypeBadge.practice {
  background: #6d6d6d;
}

.lessonTypeBadge.lecture {
  background: #8d8d8d;
}

.lessonTypeBadge.consult {
  background: #a0a0a0;
}

/* ── Description / teacher-group line ── */
.lessonMain {
  font-size: 13px;
  font-weight: 600;
  color: #757575;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-dark .lessonMain {
  color: #9e9e9e;
}

.lessonSub {
  font-size: 13px;
  color: #9e9e9e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-dark .lessonSub {
  color: #757575;
}

/* ── Room / location row ── */
.lessonRoomRow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}

.lessonRoomPrefix {
  font-size: 16px;
  font-weight: 900;
  color: #616161;
  letter-spacing: 0.5px;
}

body.theme-dark .lessonRoomPrefix {
  color: #9e9e9e;
}

.lessonRoomNumber {
  font-size: 18px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: 0.3px;
}

body.theme-dark .lessonRoomNumber {
  color: #f0f0f0;
}

/* ── Right: teacher name ── */
.lessonMeta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex-shrink: 0;
}

.lessonTeacherName {
  font-size: 13px;
  font-weight: 800;
  color: #1a1a1a;
  text-align: right;
  white-space: nowrap;
}

body.theme-dark .lessonTeacherName {
  color: #e0e0e0;
}

/* ── Footer ── */
.schedFooter {
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #c0c0c0;
  font-weight: 600;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  background: #fff;
  letter-spacing: 0.2px;
}

body.theme-dark .schedFooter {
  border-top-color: rgba(255, 255, 255, 0.05);
  background: #232325;
  color: #4a4a4a;
}

/* ── Empty state ── */
.schedEmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  gap: 10px;
}

.schedEmptyIcon {
  font-size: 52px;
  line-height: 1;
  opacity: 0.7;
}

.schedEmptyTitle {
  font-size: 16px;
  font-weight: 800;
  color: #9e9e9e;
}

body.theme-dark .schedEmptyTitle {
  color: #757575;
}

.schedEmptySub {
  font-size: 13px;
  color: #c0c0c0;
  font-weight: 600;
}

body.theme-dark .schedEmptySub {
  color: #4a4a4a;
}

/* ── Badge (generic) ── */
.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

body.theme-light .badge {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: #0f1013;
}

/* ── Schedule card inside chat bubbles ── */
.bubble .schedPretty {
  margin: -8px -10px;
  border-radius: 16px;
  border: none;
}

.bubble .schedPrettyHead {
  padding: 16px 18px 14px;
}

.bubble .schedLessons {
  padding: 8px 12px 14px;
  gap: 8px;
}

.bubble .lessonCard {
  padding: 14px 16px;
  gap: 14px;
}

.bubble .lessonTime {
  min-width: 90px;
}

.bubble .lessonRange {
  font-size: 16px;
}

.bubble .schedPrettyTitle {
  font-size: 17px;
}

.bubble .schedDateBadge {
  font-size: 13px;
  padding: 6px 14px;
}

/* ── Responsive: mobile ── */
@media (max-width: 640px) {
  .schedPrettyHead {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 20px 16px;
  }
  .lessonCard {
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
  }
  .lessonTime {
    min-width: unset;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }
  .lessonMeta {
    justify-content: flex-start;
  }
  .schedLessons {
    padding: 10px 14px 16px;
  }
}


/* ================================================================
   SCHEDULE EDITOR — Interactive grid for admin
   ================================================================ */

/* ── Editor container ── */
.schedEditor {
  border-radius: 20px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

body.theme-dark .schedEditor {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ── Toolbar ── */
.schedEditorToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
  gap: 12px;
  flex-wrap: wrap;
}

.schedShiftTabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  padding: 3px;
}

body.theme-dark .schedShiftTabs {
  background: rgba(255, 255, 255, 0.06);
}

.schedShiftTab {
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.schedShiftTab:hover {
  color: var(--text);
}

.schedShiftTab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

.schedEditorActions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Date picker row ── */
.schedDateRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schedDateInput {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.schedDateInput:focus {
  border-color: var(--accent);
}

body.theme-dark .schedDateInput {
  color-scheme: dark;
}

.schedWeekBadge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.12), rgba(229, 57, 53, 0.06));
  color: var(--accent);
  border: 1px solid rgba(229, 57, 53, 0.15);
}

.schedDownloadBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 12px;
}

.schedClearBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 12px;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.schedClearBtn:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: #ef4444 !important;
}

/* ── Lesson type badges inside cells ── */
.schedLtBadge {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
  margin-top: 2px;
}

.schedLtBadge.online {
  background: rgba(255, 193, 7, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.schedLtBadge.practice {
  background: rgba(158, 158, 158, 0.15);
  color: #757575;
  border: 1px solid rgba(158, 158, 158, 0.25);
}

/* ── Lesson type cell backgrounds ── */
.schedCell.filled.lt-online {
  background: rgba(255, 235, 59, 0.12);
  border-color: rgba(255, 193, 7, 0.3);
}

body.theme-dark .schedCell.filled.lt-online {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.25);
}

.schedCell.filled.lt-practice {
  background: rgba(189, 189, 189, 0.12);
  border-color: rgba(158, 158, 158, 0.3);
}

body.theme-dark .schedCell.filled.lt-practice {
  background: rgba(158, 158, 158, 0.1);
  border-color: rgba(158, 158, 158, 0.2);
}

/* ── Replacement (Замена) type ── */
.schedLtBadge.replacement {
  background: rgba(244, 67, 54, 0.2);
  color: #ef5350;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.schedCell.filled.lt-replacement {
  background: rgba(244, 67, 54, 0.08);
  border-color: rgba(244, 67, 54, 0.25);
}

body.theme-dark .schedCell.filled.lt-replacement {
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.2);
}

/* Replaced teacher - red strikethrough */
.schedCellReplacedTeacher {
  font-size: 9px;
  color: #ef5350;
  text-decoration: line-through;
  opacity: 0.8;
}

/* Add/Remove teacher2 button */
.schedAddTeacher2Btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--accent, #6366f1);
  background: transparent;
  color: var(--accent, #6366f1);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  transition: all 0.15s;
}
.schedAddTeacher2Btn:hover {
  background: var(--accent, #6366f1);
  color: #fff;
}

.schedRemoveTeacher2Btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #ef5350;
  background: transparent;
  color: #ef5350;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  transition: all 0.15s;
}
.schedRemoveTeacher2Btn:hover {
  background: #ef5350;
  color: #fff;
}

/* ── Grid wrapper (scrollable) ── */
.schedGridWrap {
  overflow-x: auto;
  padding: 16px;
}

/* ── Grid table ── */
.schedGrid {
  display: grid;
  grid-template-columns: 90px repeat(4, minmax(180px, 1fr));
  gap: 4px;
  min-width: 820px;
}

/* Zoom modes */
.schedEditor[data-zoom="compact"] .schedGrid {
  grid-template-columns: 70px repeat(4, minmax(130px, 1fr));
  gap: 3px;
  min-width: 600px;
  font-size: 11px;
}

.schedEditor[data-zoom="wide"] .schedGrid {
  grid-template-columns: 110px repeat(4, minmax(240px, 1fr));
  gap: 7px;
  min-width: 1080px;
}

/* ── Classroom row header ── */
.schedClassroomCell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--card-border);
  font-weight: 900;
  font-size: 11px;
  color: var(--text);
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}

body.theme-dark .schedClassroomCell {
  background: rgba(255, 255, 255, 0.04);
}

.schedEditor[data-zoom="compact"] .schedClassroomCell {
  font-size: 9px;
  padding: 4px 2px;
}

.schedEditor[data-zoom="wide"] .schedClassroomCell {
  font-size: 13px;
  padding: 8px 6px;
}

.schedDayHeader {
  padding: 10px 8px;
  text-align: center;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.3px;
  border-radius: 10px;
  background: rgba(229, 57, 53, 0.06);
  border: 1px solid rgba(229, 57, 53, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.schedTimePairHdr {
  font-size: 13px;
  font-weight: 900;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.schedTimeRangeHdr {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

body.theme-dark .schedDayHeader {
  background: rgba(229, 57, 53, 0.1);
  border-color: rgba(229, 57, 53, 0.15);
}

.schedEditor[data-zoom="compact"] .schedDayHeader {
  padding: 6px 4px;
  font-size: 10px;
}

.schedEditor[data-zoom="wide"] .schedDayHeader {
  padding: 14px 10px;
  font-size: 13px;
}

/* ── Time column (pair slot) ── */
.schedTimeSlot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--card-border);
  gap: 2px;
}

body.theme-dark .schedTimeSlot {
  background: rgba(255, 255, 255, 0.03);
}

.schedTimePair {
  font-weight: 900;
  font-size: 13px;
  color: var(--accent);
}

.schedTimeRange {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.schedEditor[data-zoom="compact"] .schedTimePair { font-size: 11px; }
.schedEditor[data-zoom="compact"] .schedTimeRange { font-size: 9px; }
.schedEditor[data-zoom="wide"] .schedTimePair { font-size: 15px; }
.schedEditor[data-zoom="wide"] .schedTimeRange { font-size: 12px; }

/* ── Empty cell ── */
.schedCell {
  position: relative;
  min-height: 72px;
  border-radius: 12px;
  border: 1.5px dashed rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.01);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.theme-dark .schedCell {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.01);
}

.schedCell:hover {
  border-color: rgba(229, 57, 53, 0.3);
  background: rgba(229, 57, 53, 0.03);
  transform: scale(1.01);
}

body.theme-dark .schedCell:hover {
  border-color: rgba(229, 57, 53, 0.35);
  background: rgba(229, 57, 53, 0.06);
}

.schedEditor[data-zoom="compact"] .schedCell { min-height: 54px; border-radius: 8px; }
.schedEditor[data-zoom="wide"] .schedCell { min-height: 96px; border-radius: 14px; }

.schedCellPlus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
  font-weight: 300;
  transition: all 0.2s ease;
}

body.theme-dark .schedCellPlus {
  background: rgba(255, 255, 255, 0.06);
}

.schedCell:hover .schedCellPlus {
  background: rgba(229, 57, 53, 0.12);
  color: var(--accent);
  transform: scale(1.1);
}

/* ── Filled cell ── */
.schedCell.filled {
  border-style: solid;
  border-color: var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 8px 10px;
  gap: 3px;
}

body.theme-dark .schedCell.filled {
  background: #2a2a2c;
  border-color: #3a3a3c;
}

.schedCell.filled:hover {
  border-color: rgba(229, 57, 53, 0.4);
  box-shadow: 0 3px 12px rgba(229, 57, 53, 0.08);
}

.schedCellTeacher {
  font-weight: 800;
  font-size: 12px;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedCellSubject {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedCellGroup {
  font-size: 11px;
  color: var(--accent);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedCellRoom {
  font-size: 10px;
  color: var(--muted2);
  font-weight: 600;
}

.schedCellDel {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease;
}

.schedCell.filled:hover .schedCellDel {
  display: flex;
}

.schedCellDel:hover {
  background: rgba(239, 68, 68, 0.25);
}

.schedEditor[data-zoom="compact"] .schedCellTeacher { font-size: 10px; }
.schedEditor[data-zoom="compact"] .schedCellSubject { font-size: 9px; }
.schedEditor[data-zoom="compact"] .schedCellGroup { font-size: 9px; }
.schedEditor[data-zoom="compact"] .schedCell.filled { padding: 5px 6px; gap: 1px; }
.schedEditor[data-zoom="wide"] .schedCellTeacher { font-size: 14px; }
.schedEditor[data-zoom="wide"] .schedCellSubject { font-size: 13px; }
.schedEditor[data-zoom="wide"] .schedCellGroup { font-size: 12px; }

/* ── Cell editor popup ── */
.schedCellEditorPopup {
  position: fixed;
  z-index: 9999;
  min-width: 280px;
  max-width: 340px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: schedPopupIn 0.2s ease;
}

body.theme-dark .schedCellEditorPopup {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes schedPopupIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.schedPopupTitle {
  font-weight: 900;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}

.schedPopupRoomBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(229, 57, 53, 0.08);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 2px;
}

body.theme-dark .schedPopupRoomBadge {
  background: rgba(229, 57, 53, 0.15);
}

.schedPopupField {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.schedPopupLabel {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schedPopupInput {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.schedPopupInput:focus {
  border-color: var(--accent);
}

.schedPopupSelect {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239e9e9e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

.schedPopupSelect:focus {
  border-color: var(--accent);
}

/* ── Autocomplete dropdown ── */
.schedAutoList {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 10;
  margin-top: 4px;
}

body.theme-dark .schedAutoList {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.schedAutoItem {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

body.theme-dark .schedAutoItem {
  border-bottom-color: rgba(255, 255, 255, 0.04);
}

.schedAutoItem:last-child {
  border-bottom: none;
}

.schedAutoItem:hover,
.schedAutoItem.highlighted {
  background: rgba(229, 57, 53, 0.08);
}

.schedAutoItem mark {
  background: rgba(229, 57, 53, 0.2);
  color: var(--accent);
  font-weight: 900;
  border-radius: 2px;
  padding: 0 1px;
}

.schedAutoEmpty {
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ── Popup buttons ── */
.schedPopupBtns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.schedPopupBtns .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
}

/* ── Overlay ── */
.schedOverlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: transparent;
}

/* ── Zoom control in header ── */
.schedZoomControl {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 2px;
}

body.theme-dark .schedZoomControl {
  background: rgba(255, 255, 255, 0.06);
}

.schedZoomBtn {
  width: 34px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.schedZoomBtn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

body.theme-dark .schedZoomBtn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.schedZoomBtn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(229, 57, 53, 0.3);
}

/* ── Corner header cell ── */
.schedCornerCell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 8px;
}

.schedCornerCell svg {
  opacity: 0.3;
}

/* ── Loading state ── */
.schedGridLoading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  grid-column: 1 / -1;
}


/* Pedagogical load: pagination under teachers list */
.pedLoadPager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 8px 4px;
  justify-content: center;
}

.pagerBtn {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
}

.pagerBtn:hover {
  transform: translateY(-1px);
}

.pagerBtn.active {
  border-color: var(--accent);
  background: var(--temp-hover-bg);
}

/* Exchange journal */
.exchangeFormCard .cardTitle,
.exchangeTableCard .cardTitle {
  margin-bottom: 6px;
}

.exchangeForm {
  margin-top: 14px;
}

.exchangeGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.exFieldWide {
  grid-column: 1 / -1;
}

.exLabel {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

.exTextarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  resize: vertical;
  font-family: inherit;
}

body.theme-light .exTextarea {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
}

.exTextarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--temp-hover-bg);
  border-color: var(--accent);
}

.exchangeActions {
  justify-content: flex-start;
  gap: 10px;
}

.exchangeTableTop {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.exchangeTableWrap {
  margin-top: 14px;
  border-radius: 14px;
  overflow: auto;
  border: 1px solid var(--card-border);
}

.exchangeTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}

.exchangeTable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 12px;
  border-bottom: 1px solid var(--card-border);
}

body.theme-light .exchangeTable thead th {
  background: rgba(0, 0, 0, 0.03);
}

.exchangeTable tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
  font-size: 13px;
}

.exchangeTable tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

body.theme-light .exchangeTable tbody tr:hover td {
  background: rgba(0, 0, 0, 0.03);
}

.exNo,
.exCount {
  white-space: nowrap;
  font-weight: 800;
}

.exReasonCell {
  min-width: 240px;
}

.exActionsTh,
.exActionsTd {
  width: 110px;
  text-align: center;
}

.iconBtn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
}

.iconBtn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.04);
}

body.theme-light .iconBtn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.iconBtn.danger {
  border-color: rgba(255, 59, 48, 0.35);
}

.iconBtn.danger:hover {
  border-color: rgba(255, 59, 48, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12);
}

/* Mobile */
@media (max-width: 920px) {
  .exchangeGrid {
    grid-template-columns: 1fr;
  }
}

.accessDeniedBox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .42);
}

.accessDeniedPanel {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.accessDeniedTitle {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.accessDeniedText {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 16px;
}

/* ===================== Teachers Page ===================== */

/* Stats row */
.tchStatsRow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.tchStatCard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tchStatCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

body.theme-light .tchStatCard:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.tchStatIcon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  flex-shrink: 0;
}

.tchStatIconTotal {
  background: linear-gradient(135deg, rgba(255,59,48,0.15) 0%, rgba(255,59,48,0.05) 100%);
  color: #FF3B30;
}
.tchStatIconExp {
  background: linear-gradient(135deg, rgba(52,199,89,0.15) 0%, rgba(52,199,89,0.05) 100%);
  color: #34C759;
}
.tchStatIconSubj {
  background: linear-gradient(135deg, rgba(0,122,255,0.15) 0%, rgba(0,122,255,0.05) 100%);
  color: #007AFF;
}
.tchStatIconDept {
  background: linear-gradient(135deg, rgba(175,82,222,0.15) 0%, rgba(175,82,222,0.05) 100%);
  color: #AF52DE;
}

.tchStatValue {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.tchStatLabel {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* Filter card */
.tchFilterCard {
  margin-bottom: 16px;
  padding: 16px 20px !important;
}

.tchFilters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.tchFilterGroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 150px;
}

.tchFilterGroupSmall {
  flex: 0 0 80px;
  min-width: 70px;
}

.tchFilterLabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tchFilterInput,
.tchFilterSelect {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.tchFilterInput:focus,
.tchFilterSelect:focus {
  border-color: var(--accent);
}

.tchFilterInputSmall {
  width: 100%;
}

.tchFilterBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  height: 38px;
}

/* Table */
.tchTableCard {
  padding: 0 !important;
  overflow: hidden;
}

.tchTableTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.tchTableTitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.tchTableActions {
  display: flex;
  gap: 8px;
}

.tchTableWrap {
  overflow-x: auto;
}

.tchTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tchTable thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.tchTable th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--card-bg);
  border-bottom: 2px solid var(--card-border);
  white-space: nowrap;
}

.tchTable td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.tchTable tbody tr {
  transition: background 0.12s;
}

.tchTable tbody tr:hover {
  background: var(--card-hover);
}

.tchThNum { width: 44px; text-align: center; }
.tchThName { min-width: 200px; }
.tchThStatus { width: 100px; text-align: center; }
.tchThActions { width: 100px; text-align: center; }

.tchTable td:first-child { text-align: center; color: var(--muted); font-weight: 600; }

.tchNameCell {
  font-weight: 700;
  cursor: pointer;
}

.tchNameCell:hover {
  color: var(--accent);
}

.tchSubjCell {
  max-width: 200px;
}

.tchSubjTag {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 3px 2px 0;
  border-radius: 20px;
  background: rgba(0,122,255,0.1);
  color: var(--link);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

body.theme-dark .tchSubjTag {
  background: rgba(125,179,255,0.12);
  color: #7DB3FF;
}

.tchContactCell {
  font-size: 13px;
}

.tchContactRow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  color: var(--muted);
}

.tchContactRow svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Status badges */
.tchBadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tchBadge--active {
  background: rgba(52,199,89,0.12);
  color: #34C759;
}

.tchBadge--archived {
  background: rgba(255,159,10,0.12);
  color: #FF9F0A;
}

.tchBadge--dismissed {
  background: rgba(255,59,48,0.12);
  color: #FF3B30;
}

.tchBadgeDot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Actions */
.tchActionsCell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tchActionBtn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}

.tchActionBtn:hover {
  background: var(--card-hover);
  color: var(--text);
}

.tchActionBtn--danger:hover {
  background: rgba(255,59,48,0.1);
  color: #FF3B30;
}

/* Pager */
.tchPager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
}

.tchPagerBtn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  background: transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s, border-color 0.12s;
}

.tchPagerBtn:hover {
  background: var(--card-hover);
}

.tchPagerBtn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.tchPagerInfo {
  font-size: 13px;
  color: var(--muted);
  margin: 0 8px;
}

/* Category badge */
.tchQualBadge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tchQualBadge--pedagog { background: rgba(90,200,250,0.12); color: #5AC8FA; }
.tchQualBadge--moderator { background: rgba(52,199,89,0.12); color: #34C759; }
.tchQualBadge--expert { background: rgba(0,122,255,0.12); color: #007AFF; }
.tchQualBadge--master { background: rgba(175,82,222,0.12); color: #AF52DE; }
.tchQualBadge--researcher { background: rgba(255,149,0,0.12); color: #FF9500; }
.tchQualBadge--none { background: rgba(142,142,147,0.12); color: #8E8E93; }

/* Modal */
.tchModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tchModalOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.tchModalContent {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: tchModalIn 0.25s ease;
}

.tchReportContent {
  width: min(720px, calc(100vw - 40px));
}

@keyframes tchModalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.tchModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.tchModalTitle {
  font-size: 20px;
  font-weight: 800;
}

.tchModalClose {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
}

.tchModalClose:hover {
  background: var(--card-hover);
  color: var(--text);
}

.tchModalBody {
  padding: 20px 24px 24px;
}

/* Form */
.tchFormRow {
  margin-bottom: 14px;
}

.tchFormGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tchFormLabel {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.tchFormInput {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.tchFormInput:focus {
  border-color: var(--accent);
}

.tchFormHint {
  min-height: 18px;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 8px;
}

.tchFormActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* Report */
.tchReportBody {
  max-height: 70vh;
  overflow-y: auto;
}

.tchReportLoading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.tchReportSection {
  margin-bottom: 20px;
}

.tchReportSectionTitle {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tchReportGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.tchReportItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
}

.tchReportItemLabel {
  font-size: 13px;
  font-weight: 600;
}

.tchReportItemValue {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}

.tchReportBarRow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tchReportBarLabel {
  width: 160px;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

.tchReportBar {
  flex: 1;
  height: 24px;
  border-radius: 12px;
  background: var(--input-bg);
  overflow: hidden;
  position: relative;
}

.tchReportBarFill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.tchReportBarCount {
  font-size: 13px;
  font-weight: 700;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .tchStatsRow {
    grid-template-columns: repeat(2, 1fr);
  }
  .tchFilters {
    flex-direction: column;
  }
  .tchFilterGroup {
    min-width: 100%;
  }
  .tchFilterGroupSmall {
    flex: 1;
    min-width: 100%;
  }
  .tchFormGrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .tchStatsRow {
    grid-template-columns: 1fr;
  }
}

/* ===================== Practice Page ===================== */

/* Stats row */
.prcStatsRow {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.prcStatCard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.prcStatCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

body.theme-light .prcStatCard:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.prcStatCardWarn {
  border-color: rgba(255,159,10,0.25);
}

.prcStatIcon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

.prcStatIconTotal {
  background: linear-gradient(135deg, rgba(0,122,255,0.15) 0%, rgba(0,122,255,0.05) 100%);
  color: #007AFF;
}
.prcStatIconActive {
  background: linear-gradient(135deg, rgba(52,199,89,0.15) 0%, rgba(52,199,89,0.05) 100%);
  color: #34C759;
}
.prcStatIconContract {
  background: linear-gradient(135deg, rgba(255,149,0,0.15) 0%, rgba(255,149,0,0.05) 100%);
  color: #FF9500;
}
.prcStatIconDirection {
  background: linear-gradient(135deg, rgba(255,59,48,0.15) 0%, rgba(255,59,48,0.05) 100%);
  color: #FF3B30;
}
.prcStatIconFree {
  background: linear-gradient(135deg, rgba(90,200,250,0.15) 0%, rgba(90,200,250,0.05) 100%);
  color: #5AC8FA;
}
.prcStatIconSpec {
  background: linear-gradient(135deg, rgba(175,82,222,0.15) 0%, rgba(175,82,222,0.05) 100%);
  color: #AF52DE;
}

.prcStatValue {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.prcStatLabel {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Filter card */
.prcFilterCard {
  margin-bottom: 16px;
  padding: 16px 20px !important;
}

.prcFilters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.prcFilterGroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 130px;
}

.prcFilterLabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prcFilterInput,
.prcFilterSelect {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.prcFilterInput:focus,
.prcFilterSelect:focus {
  border-color: var(--accent);
}

/* Table */
.prcTableCard {
  padding: 0 !important;
  overflow: hidden;
}

.prcTableTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.prcTableTitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.prcTableWrap {
  overflow-x: auto;
}

.prcTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.prcTable thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.prcTable th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--card-bg);
  border-bottom: 2px solid var(--card-border);
  white-space: nowrap;
}

.prcTable td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.prcTable tbody tr {
  transition: background 0.12s;
}

.prcTable tbody tr:hover {
  background: var(--card-hover);
}

.prcThNum { width: 44px; text-align: center; }
.prcThName { min-width: 180px; }
.prcThDoc { width: 100px; text-align: center; }
.prcThStatus { width: 100px; text-align: center; }
.prcThActions { width: 80px; text-align: center; }

.prcTable td:first-child { text-align: center; color: var(--muted); font-weight: 600; }

/* Doc badges */
.prcDocBadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.12s;
}

.prcDocBadge:hover {
  opacity: 0.8;
}

.prcDocBadge--yes {
  background: rgba(52,199,89,0.12);
  color: #34C759;
}

.prcDocBadge--no {
  background: rgba(255,59,48,0.12);
  color: #FF3B30;
}

/* Pager */
.prcPager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
}

/* Problems section */
.prcProblemsRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.prcProblemCard {
  padding: 16px 20px !important;
}

.prcProblemHeader {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.prcProblemTitle {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.prcProblemCount {
  font-size: 14px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,59,48,0.12);
  color: #FF3B30;
}

.prcProblemList {
  max-height: 200px;
  overflow-y: auto;
  font-size: 13px;
}

.prcProblemItem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: background 0.12s;
}

.prcProblemItem:hover {
  background: var(--card-hover);
}

.prcProblemName {
  font-weight: 600;
  flex: 1;
}

.prcProblemGroup {
  color: var(--muted);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 1200px) {
  .prcStatsRow {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .prcStatsRow {
    grid-template-columns: repeat(2, 1fr);
  }
  .prcFilters {
    flex-direction: column;
  }
  .prcFilterGroup {
    min-width: 100%;
  }
  .prcProblemsRow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .prcStatsRow {
    grid-template-columns: 1fr;
  }
}

/* ===================== Practice Sub-Tabs ===================== */
.prcTabs {
  display: flex;
  gap: 4px;
  padding: 0 20px 0;
  margin-bottom: 0;
}

.prcTabBtn {
  padding: 10px 22px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.prcTabBtn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

body.theme-light .prcTabBtn:hover {
  background: rgba(0,0,0,0.03);
}

.prcTabBtn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

.prcTabPane {
  flex: 1;
  overflow: auto;
}

/* ===================== Partners Page ===================== */

/* Loading state */
.prcPartnersLoading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.prcLoadingSpinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: prcSpin 0.8s linear infinite;
}

@keyframes prcSpin {
  to { transform: rotate(360deg); }
}

.prcLoadingText {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}

/* Error state */
.prcPartnersError {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px !important;
  text-align: center;
}

.prcErrorIcon {
  font-size: 36px;
}

.prcErrorText {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}

/* Stats row for partners */
.ptnStatsRow {
  grid-template-columns: repeat(4, 1fr);
}

/* Free enterprises button */
.ptnFreeBtn {
  margin-bottom: 16px;
}

.ptnFreeBtnAction {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(52,199,89,0.25);
}

.ptnFreeBtnAction:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52,199,89,0.35);
}

.ptnFreeBtnAction.active {
  background: linear-gradient(135deg, #FF9500 0%, #FF9F0A 100%);
  box-shadow: 0 4px 16px rgba(255,149,0,0.25);
}

.ptnFreeBtnAction.active:hover {
  box-shadow: 0 8px 24px rgba(255,149,0,0.35);
}

/* Table name cell clickable */
.ptnNameCell {
  font-weight: 700;
  cursor: pointer;
  transition: color 0.12s;
}

.ptnNameCell:hover {
  color: var(--accent);
}

/* Load bar in table */
.ptnLoadBarInline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ptnLoadBarSmall {
  width: 60px;
  height: 8px;
  border-radius: 4px;
  background: var(--input-bg);
  overflow: hidden;
}

.ptnLoadBarSmallFill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.ptnLoadBarSmallFill.low {
  background: #34C759;
}

.ptnLoadBarSmallFill.medium {
  background: #FF9500;
}

.ptnLoadBarSmallFill.high {
  background: #FF3B30;
}

.ptnLoadPercent {
  font-size: 12px;
  font-weight: 700;
  min-width: 35px;
}

/* Free slots badge */
.ptnFreeBadge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.ptnFreeBadge--has {
  background: rgba(52,199,89,0.12);
  color: #34C759;
}

.ptnFreeBadge--none {
  background: rgba(255,59,48,0.12);
  color: #FF3B30;
}

/* Detail modal */
.ptnDetailGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.ptnDetailItem {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
}

.ptnDetailItem.full {
  grid-column: 1 / -1;
}

.ptnDetailItemLabel {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.ptnDetailItemValue {
  font-size: 15px;
  font-weight: 600;
}

.ptnDetailSection {
  margin-bottom: 16px;
}

.ptnDetailSectionTitle {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.ptnLoadBar {
  height: 12px;
  border-radius: 6px;
  background: var(--input-bg);
  overflow: hidden;
  margin-bottom: 6px;
}

.ptnLoadBarFill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #34C759, #30D158);
  transition: width 0.4s ease;
}

.ptnLoadBarLabel {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.ptnDetailStudentsList {
  max-height: 240px;
  overflow-y: auto;
}

.ptnStudentItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: background 0.12s;
}

.ptnStudentItem:hover {
  background: var(--card-hover);
}

.ptnStudentName {
  font-weight: 600;
  font-size: 14px;
}

.ptnStudentGroup {
  font-size: 12px;
  color: var(--muted);
}

.ptnStudentPeriod {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* Responsive */
@media (max-width: 1200px) {
  .ptnStatsRow {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .ptnStatsRow {
    grid-template-columns: 1fr 1fr;
  }
  .ptnDetailGrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .ptnStatsRow {
    grid-template-columns: 1fr;
  }
  .prcTabs {
    padding: 0 10px;
  }
  .prcTabBtn {
    padding: 8px 14px;
    font-size: 13px;
  }
}

