@charset "utf-8";

:root {
  --crm-navy: #082f55;
  --crm-navy-deep: #062643;
  --crm-navy-soft: #123d63;
  --crm-teal: #0f8990;
  --crm-teal-dark: #0a7077;
  --crm-teal-soft: #e5f5f5;
  --crm-canvas: #f4f7fa;
  --crm-surface: #ffffff;
  --crm-border: #d7e0e8;
  --crm-border-soft: #e8edf2;
  --crm-text: #1c2b39;
  --crm-muted: #697887;
  --crm-danger: #d92d20;
  --crm-warning: #ee8b14;
  --crm-success: #179a55;
  --crm-info: #1672d4;
  --crm-radius: 8px;
  --crm-shadow: 0 1px 2px rgba(8, 47, 85, 0.05), 0 8px 24px rgba(8, 47, 85, 0.04);
  --crm-sidebar-width: 248px;
  --crm-sidebar-collapsed-width: 72px;
  --crm-topbar-height: 62px;
}

html,
body {
  background: var(--crm-canvas);
}

body,
button,
input,
select,
textarea,
.form-control,
.form-select,
.btn {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body.app-body {
  color: var(--crm-text);
  background: var(--crm-canvas);
  font-size: 14px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-workspace {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--crm-canvas);
}

.app-workspace--standalone {
  width: 100%;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex !important;
  flex: 0 0 var(--crm-sidebar-width);
  flex-direction: column;
  width: var(--crm-sidebar-width) !important;
  height: 100vh;
  color: #fff;
  border: 0 !important;
  background-color: var(--crm-navy) !important;
  background-image: none !important;
  box-shadow: none;
  overflow: hidden;
  z-index: 1035;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.app-sidebar-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 132px;
  padding: 22px 48px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.app-sidebar-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #fff;
}

.app-sidebar-brand:hover {
  color: #fff;
  text-decoration: none;
}

.app-sidebar-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 26px;
}

.app-sidebar-brand strong {
  display: block;
  margin-top: 1px;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.app-sidebar-brand small {
  display: block;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.app-sidebar-collapse {
  position: absolute;
  top: 16px;
  right: 12px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, transform 0.2s ease;
}

.app-sidebar-collapse:hover,
.app-sidebar-collapse:focus-visible {
  color: #fff;
  background: rgba(15, 137, 144, 0.92);
  outline: none;
}

.app-sidebar-nav {
  flex: 1 1 auto;
  padding: 16px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  scrollbar-width: thin;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 2px 0;
  padding: 10px 13px;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.app-sidebar-link > i:first-child {
  flex: 0 0 20px;
  width: 20px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  text-align: center;
}

.app-sidebar-link:hover,
.app-sidebar-link:focus,
.app-sidebar-link.is-active,
.app-nav-group[open] > .app-sidebar-link {
  color: #fff;
  background: rgba(15, 137, 144, 0.92);
  text-decoration: none;
}

.app-nav-group {
  margin: 2px 0;
}

.app-nav-group > summary {
  list-style: none;
}

.app-nav-group > summary::-webkit-details-marker {
  display: none;
}

.app-nav-chevron {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  transition: transform 0.16s ease;
}

.app-nav-group[open] .app-nav-chevron {
  transform: rotate(180deg);
}

.app-nav-children {
  margin: 4px 0 7px 20px;
  padding-left: 17px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.app-nav-children a {
  display: block;
  padding: 8px 8px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1.3;
}

.app-nav-children a:hover,
.app-nav-children a:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.app-sidebar-footer {
  flex: 0 0 auto;
  padding: 12px 8px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.app-sidebar-environment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 650;
}

.app-sidebar-environment i {
  color: #4ade80;
  font-size: 7px;
}

@media (min-width: 992px) {
  .app-sidebar.is-collapsed {
    flex-basis: var(--crm-sidebar-collapsed-width);
    width: var(--crm-sidebar-collapsed-width) !important;
  }

  .app-sidebar.is-collapsed .app-sidebar-header {
    align-items: center;
    min-height: 132px;
    padding: 18px 9px;
  }

  .app-sidebar.is-collapsed .app-sidebar-brand {
    justify-content: center;
    width: 100%;
  }

  .app-sidebar.is-collapsed .app-sidebar-brand-text,
  .app-sidebar.is-collapsed .app-sidebar-link > span,
  .app-sidebar.is-collapsed .app-nav-chevron,
  .app-sidebar.is-collapsed .app-nav-children,
  .app-sidebar.is-collapsed .app-sidebar-environment {
    display: none;
  }

  .app-sidebar.is-collapsed .app-sidebar-collapse {
    top: auto;
    right: 21px;
    bottom: 15px;
  }

  .app-sidebar.is-collapsed .app-sidebar-collapse i {
    transform: rotate(180deg);
  }

  .app-sidebar.is-collapsed .app-sidebar-link {
    justify-content: center;
    gap: 0;
    padding-right: 10px;
    padding-left: 10px;
  }

  .app-sidebar.is-collapsed .app-sidebar-link > i:first-child {
    flex-basis: 22px;
    width: 22px;
    font-size: 18px;
  }

  .app-sidebar.is-collapsed .app-sidebar-footer {
    padding-bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .app-sidebar-collapse {
    transition: none;
  }
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1025;
  display: flex;
  align-items: center;
  min-height: var(--crm-topbar-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--crm-border);
  background: rgba(255, 255, 255, 0.97);
}

.app-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 12px;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  color: var(--crm-navy);
  background: #fff;
}

.app-topbar-school {
  color: var(--crm-text);
  font-size: 15px;
  font-weight: 720;
}

.app-topbar-school:hover {
  color: var(--crm-teal-dark);
  text-decoration: none;
}

.app-topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  color: var(--crm-text);
  font-size: 13px;
  font-weight: 620;
}

.app-topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--crm-border);
  border-radius: 50%;
  color: var(--crm-navy);
  background: #fff;
}

.app-main {
  flex: 1 0 auto;
}

.app-content {
  padding: 22px 24px 30px;
}

.app-page-header {
  min-height: auto;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-page-header h1 {
  color: #111820;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.app-footer {
  color: var(--crm-muted);
  border-top: 1px solid var(--crm-border);
  background: #fff;
  box-shadow: none;
  font-size: 12px;
}

.app-copyright-band {
  color: var(--crm-muted);
  background: #f7f9fb;
}

/* Dashboard */
.crm-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  gap: 16px;
}

.crm-panel {
  min-width: 0;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
  overflow: hidden;
}

.crm-panel--profiles {
  grid-column: 1 / -1;
}

.crm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--crm-border);
}

.crm-panel-header h2 {
  margin: 0;
  color: #17212b;
  font-size: 17px;
  font-weight: 740;
  letter-spacing: -0.01em;
}

.crm-panel-header p {
  margin: 4px 0 0;
  color: var(--crm-muted);
  font-size: 12px;
  line-height: 1.35;
}

.crm-panel-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: var(--crm-teal-dark);
  font-size: 12.5px;
  font-weight: 700;
}

.crm-table {
  margin: 0;
  color: var(--crm-text);
  font-size: 12.5px;
  --bs-table-striped-bg: #fafbfd;
  --bs-table-hover-bg: #f0f8f8;
}

.crm-table > :not(caption) > * > * {
  padding: 10px 14px;
  border-bottom-color: var(--crm-border-soft);
  vertical-align: middle;
}

.crm-table thead th {
  color: #586775;
  background: #fafbfd;
  font-size: 11.5px;
  font-weight: 720;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.crm-table tfoot th {
  color: var(--crm-text);
  background: #fafbfd;
  font-weight: 750;
}

.crm-number {
  color: #263746;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.crm-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: #8b99a6;
}

.crm-status-dot--1 { background: var(--crm-success); }
.crm-status-dot--2 { background: var(--crm-info); }
.crm-status-dot--3 { background: var(--crm-warning); }
.crm-status-dot--4 { background: var(--crm-danger); }
.crm-status-dot--5 { background: #8b99a6; }
.crm-status-dot--6 { background: #7654cc; }

.crm-quality-list {
  display: flex;
  flex-direction: column;
}

.crm-quality-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  min-height: 51px;
  padding: 9px 16px;
  color: var(--crm-text);
  border-bottom: 1px solid var(--crm-border-soft);
}

.crm-quality-row:last-child {
  border-bottom: 0;
}

.crm-quality-row:hover {
  color: var(--crm-teal-dark);
  background: #f7fbfb;
  text-decoration: none;
}

.crm-quality-icon {
  color: #a1adb8;
  text-align: center;
}

.crm-quality-icon.has-errors {
  color: var(--crm-warning);
}

.crm-quality-name {
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.35;
}

.crm-quality-count {
  color: var(--crm-danger);
  font-variant-numeric: tabular-nums;
}

.crm-quality-chevron {
  color: #9aa7b3;
  font-size: 9px;
}

.crm-table-search {
  position: relative;
  flex: 0 1 300px;
  margin: 0;
}

.crm-table-search i {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 2;
  color: #7c8b98;
  transform: translateY(-50%);
}

.crm-table-search .form-control {
  height: 36px;
  min-height: 36px;
  padding-left: 34px;
  border-color: var(--crm-border);
  font-size: 12.5px;
}

.crm-empty {
  padding: 24px !important;
  color: var(--crm-muted);
  text-align: center;
}

/* Shared controls, tables and forms */
.btn {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: none;
}

.btn:hover {
  transform: none;
}

.btn-primary,
.btn-info {
  border-color: var(--crm-teal);
  background: var(--crm-teal);
}

.btn-primary:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-info:focus {
  border-color: var(--crm-teal-dark);
  background: var(--crm-teal-dark);
}

.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 38px;
  border-color: var(--crm-border);
  border-radius: 6px;
  color: var(--crm-text);
  font-size: 13px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--crm-teal);
  box-shadow: 0 0 0 3px rgba(15, 137, 144, 0.12);
}

.form-label {
  color: #4e5d6b;
  font-size: 12px;
  font-weight: 700;
}

.dataTables_wrapper {
  padding: 0;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  background: #fff;
  box-shadow: var(--crm-shadow);
  overflow: auto;
}

.dataTables_wrapper > .row {
  margin-right: 0;
  margin-left: 0;
  padding-right: 12px;
  padding-left: 12px;
}

.dataTables_scroll,
.dataTables_scrollBody {
  border-radius: 0;
}

table.data_table_xs {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 12px;
}

table.data_table_xs > :not(caption) > * > * {
  padding: 8px 10px;
}

table.data_table_xs > thead > tr > th,
table.data_table_xs > tfoot > tr > th {
  color: #4b5b69;
  background: #f5f8fa;
  font-size: 11px;
}

.dt-column-filter-input {
  min-width: 84px;
  height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--crm-border);
  border-radius: 5px;
  background: #fff;
  font-size: 11px;
}

.app-table-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-content,
.card {
  border-color: var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow);
}

.modal-header,
.modal-footer,
.card-header {
  border-color: var(--crm-border);
  background: #f8fafb;
}

.alert {
  border-radius: var(--crm-radius);
  box-shadow: none;
}

/* Login */
body.login-bg {
  background: var(--crm-canvas) !important;
}

.crm-login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.1fr);
  min-height: 100vh;
}

.crm-login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 72px);
  color: #fff;
  background: var(--crm-navy);
}

.crm-login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
}

.crm-login-logo i {
  font-size: 34px;
}

.crm-login-logo strong {
  display: block;
  font-size: 28px;
  letter-spacing: 0.03em;
}

.crm-login-logo span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.crm-login-message {
  max-width: 470px;
}

.crm-login-message h1 {
  color: #fff;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.crm-login-message p {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.65;
}

.crm-login-brand-footer {
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
}

.crm-login-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  background: #fff;
}

.crm-login-card {
  width: min(100%, 520px);
}

.crm-login-card h2 {
  margin: 0 0 7px;
  color: var(--crm-text);
  font-size: 26px;
  letter-spacing: -0.02em;
}

.crm-login-card > p {
  margin: 0 0 28px;
  color: var(--crm-muted);
}

.crm-login-section {
  padding: 20px 0;
  border-top: 1px solid var(--crm-border-soft);
}

.crm-login-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.crm-login-section h3 {
  margin: 0 0 12px;
  color: var(--crm-text);
  font-size: 15px;
}

.crm-login-section .btn {
  width: 100%;
  min-height: 44px;
}

.crm-staff-form {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  background: #f8fafb;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    display: flex !important;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 0.22s ease-in-out, visibility 0.22s;
  }

  .app-sidebar.show,
  .app-sidebar.showing {
    visibility: visible;
    transform: none;
  }

  .app-content {
    padding: 18px 16px 26px;
  }

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

  .crm-panel--profiles {
    grid-column: auto;
  }

  .crm-login-shell {
    grid-template-columns: 1fr;
  }

  .crm-login-brand {
    min-height: 270px;
    padding: 32px;
  }

  .crm-login-message h1 {
    margin-top: 40px;
  }

  .crm-login-brand-footer {
    margin-top: 28px;
  }
}

@media (max-width: 575.98px) {
  .app-topbar {
    min-height: 56px;
    padding: 0 14px;
  }

  .app-topbar-school {
    max-width: 190px;
    font-size: 12.5px;
    line-height: 1.2;
  }

  .app-topbar-user > span:not(.app-topbar-avatar) {
    display: none;
  }

  .app-content {
    padding: 16px 12px 22px;
  }

  .app-page-header h1 {
    font-size: 22px;
  }

  .crm-dashboard {
    gap: 12px;
  }

  .crm-panel-header {
    align-items: flex-start;
    min-height: 60px;
    padding: 13px 14px;
  }

  .crm-panel-header h2 {
    font-size: 15px;
  }

  .crm-panel-link {
    font-size: 0;
  }

  .crm-panel-link i {
    font-size: 13px;
  }

  .crm-table-search {
    flex-basis: 150px;
  }

  .crm-panel--profiles .crm-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .crm-panel--profiles .crm-table-search {
    flex-basis: auto;
    width: 100%;
  }

  .crm-table > :not(caption) > * > * {
    padding: 9px 10px;
  }

  .crm-quality-row {
    padding-right: 12px;
    padding-left: 12px;
  }

  .crm-login-brand {
    min-height: 230px;
    padding: 25px 22px;
  }

  .crm-login-message h1 {
    margin-top: 30px;
    font-size: 30px;
  }

  .crm-login-message p {
    font-size: 13px;
  }

  .crm-login-content {
    align-items: flex-start;
    padding: 28px 20px 38px;
  }
}

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