:root {
    --crm-bg: #f4f7fb;
    --crm-surface: #ffffff;
    --crm-surface-soft: #f8fafc;
    --crm-border: #dfe7f1;
    --crm-text: #111827;
    --crm-muted: #6b7280;
    --crm-primary: #2563eb;
    --crm-primary-dark: #1d4ed8;
    --crm-success: #0f9f6e;
    --crm-warning: #d97706;
    --crm-danger: #dc2626;
    --crm-sidebar: #0f172a;
    --crm-sidebar-soft: #1e293b;
    --crm-radius: 8px;
    --crm-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
    --crm-font: "Jost", "Inter", Arial, sans-serif;
}

[data-theme="dark"] {
    --crm-bg: #111827;
    --crm-surface: #1f2937;
    --crm-surface-soft: #172033;
    --crm-border: #334155;
    --crm-text: #e5e7eb;
    --crm-muted: #94a3b8;
    --crm-primary: #10b981;
    --crm-primary-dark: #0f766e;
    --crm-sidebar: #0f172a;
    --crm-sidebar-soft: #243044;
    --crm-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

body.crm-app,
body.crm-auth {
    min-height: 100vh;
    margin: 0;
    background: var(--crm-bg);
    color: var(--crm-text);
    font-family: var(--crm-font);
    font-size: 15px;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.crm-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.crm-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--crm-sidebar);
    color: #e5e7eb;
    padding: 24px 16px;
}

.crm-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 8px 26px;
}

.crm-sidebar-profile {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 14px 12px;
    border: 1px solid rgba(226, 232, 240, 0.12);
    border-radius: var(--crm-radius);
    background: rgba(255, 255, 255, 0.05);
}

.crm-sidebar-profile strong,
.crm-sidebar-profile span span {
    display: block;
}

.crm-sidebar-profile strong {
    color: #ffffff;
    font-size: 14px;
}

.crm-sidebar-profile span span {
    color: #94a3b8;
    font-size: 12px;
}

.crm-sidebar-tools {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.crm-sidebar-search {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid rgba(226, 232, 240, 0.12);
    border-radius: var(--crm-radius);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

.crm-sidebar-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #ffffff;
}

.crm-sidebar-search input::placeholder {
    color: #94a3b8;
}

.crm-brand__mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: var(--crm-radius);
    background: var(--crm-primary);
    color: #ffffff;
    font-weight: 700;
}

.crm-brand__logo {
    width: 88px;
    height: 34px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
    padding: 3px;
}

.crm-brand__name {
    display: block;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.crm-brand__meta {
    color: #94a3b8;
    font-size: 12px;
}

.crm-nav {
    display: grid;
    gap: 22px;
}

.crm-nav__section {
    display: grid;
    gap: 8px;
}

.crm-nav__label {
    padding: 0 10px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.crm-nav__sub-label {
    display: block;
    margin: 8px 10px 2px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.crm-nav__link {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: var(--crm-radius);
    color: #cbd5e1;
    font-weight: 500;
}

.crm-nav__link:hover,
.crm-nav__link.is-active {
    background: var(--crm-sidebar-soft);
    color: #ffffff;
}

.crm-nav__icon {
    width: 22px;
    color: #93c5fd;
    text-align: center;
}

.crm-main {
    min-width: 0;
}

.crm-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--crm-border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .crm-topbar {
    background: rgba(31, 41, 55, 0.94);
}

.crm-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    color: var(--crm-text);
}

.crm-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(440px, 100%);
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
    color: var(--crm-muted);
}

.crm-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--crm-text);
}

.crm-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-notification {
    position: relative;
}

.crm-notification summary {
    position: relative;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    color: var(--crm-muted);
    cursor: pointer;
    list-style: none;
}

.crm-notification summary::-webkit-details-marker {
    display: none;
}

.crm-notification summary span {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 21px;
    height: 21px;
    border: 2px solid var(--crm-surface);
    border-radius: 999px;
    background: var(--crm-danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
}

.crm-notification__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    width: min(360px, calc(100vw - 32px));
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    box-shadow: var(--crm-shadow);
    overflow: hidden;
}

.crm-notification__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-notification__header button,
.crm-notification__item button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.crm-notification__header button {
    color: var(--crm-primary);
    font-size: 12px;
    font-weight: 800;
}

.crm-notification__item button {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 14px 16px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-notification__item button:hover {
    background: var(--crm-surface-soft);
}

.crm-notification__item span,
.crm-notification__item small,
.crm-notification__empty {
    color: var(--crm-muted);
}

.crm-notification__empty {
    padding: 22px 16px;
    text-align: center;
}

.crm-theme-switcher {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-height: 40px;
    padding: 3px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
}

.crm-theme-switcher__button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--crm-muted);
    cursor: pointer;
}

.crm-theme-switcher__button:hover,
.crm-theme-switcher__button.is-active {
    background: var(--crm-surface);
    color: var(--crm-primary);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.crm-user__avatar {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    background: #dbeafe;
    color: var(--crm-primary);
    font-weight: 700;
}

.crm-content {
    padding: 28px;
}

.crm-page-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.crm-kicker {
    margin: 0 0 6px;
    color: var(--crm-primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.crm-page-header h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
}

.crm-page-header p {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--crm-muted);
}

.crm-grid {
    display: grid;
    gap: 18px;
}

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

.crm-grid--two {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.crm-card {
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    box-shadow: var(--crm-shadow);
}

.crm-card__header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.crm-card__body {
    padding: 22px;
}

.crm-stat {
    padding: 20px;
}

.crm-stat__label {
    margin: 0;
    color: var(--crm-muted);
    font-size: 13px;
    font-weight: 600;
}

.crm-stat__value {
    margin: 10px 0 0;
    font-size: 30px;
    font-weight: 700;
}

.crm-stat__meta {
    margin: 8px 0 0;
    color: var(--crm-muted);
    font-size: 13px;
}

.crm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.crm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.crm-filter-bar .crm-search {
    flex: 1 1 280px;
}

.crm-filter-bar select {
    min-height: 42px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    color: var(--crm-text);
    padding: 0 12px;
}

.crm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.crm-tab {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    padding: 0 12px;
    color: var(--crm-muted);
    font-weight: 700;
}

.crm-tab:hover,
.crm-tab.is-active {
    border-color: var(--crm-primary);
    background: rgba(16, 185, 129, 0.1);
    color: var(--crm-primary);
}

.crm-button,
.crm-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--crm-radius);
    cursor: pointer;
    font-weight: 700;
}

.crm-button {
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
}

.crm-button--primary {
    background: var(--crm-primary);
    color: #ffffff;
}

.crm-button--primary:hover {
    background: var(--crm-primary-dark);
}

.crm-button--light {
    border-color: var(--crm-border);
    background: var(--crm-surface);
    color: var(--crm-text);
}

.crm-button--danger {
    background: #fee2e2;
    color: var(--crm-danger);
}

.crm-icon-button {
    width: 38px;
    height: 38px;
    border-color: var(--crm-border);
    background: var(--crm-surface);
    color: var(--crm-muted);
}

.crm-icon-button:hover {
    color: var(--crm-primary);
}

.crm-icon-button--danger {
    color: var(--crm-danger);
}

.crm-table-wrap {
    overflow-x: auto;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
}

.crm-table th,
.crm-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--crm-border);
    text-align: left;
    vertical-align: middle;
}

.crm-table th {
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.crm-table tr:last-child td {
    border-bottom: 0;
}

.crm-person {
    display: flex;
    gap: 12px;
    align-items: center;
}

.crm-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #e0ecff;
    color: var(--crm-primary);
    font-weight: 700;
    overflow: hidden;
}

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

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

.crm-status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
}

.crm-status--success {
    background: #dcfce7;
    color: #047857;
}

.crm-status--warning {
    background: #fef3c7;
    color: #b45309;
}

.crm-status--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.crm-priority {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
}

.crm-priority--hot {
    background: #fee2e2;
    color: #b91c1c;
}

.crm-priority--warm {
    background: #fef3c7;
    color: #b45309;
}

.crm-priority--cold {
    background: #dbeafe;
    color: #1d4ed8;
}

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

.crm-detail-grid span,
.crm-detail-grid strong {
    display: block;
}

.crm-timeline-item {
    border-left: 3px solid var(--crm-border);
    padding: 0 0 16px 14px;
}

.crm-timeline-item:not(:last-child) {
    margin-bottom: 16px;
}

.crm-timeline-item p {
    margin: 8px 0 0;
    color: var(--crm-muted);
}

.crm-kanban {
    display: grid;
    grid-auto-columns: minmax(280px, 320px);
    grid-auto-flow: column;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.crm-kanban__column {
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    box-shadow: var(--crm-shadow);
}

.crm-kanban__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-surface);
}

.crm-kanban__header span {
    display: grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: var(--crm-surface-soft);
    color: var(--crm-muted);
    font-weight: 700;
}

.crm-kanban__cards {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.crm-kanban-card {
    display: grid;
    gap: 6px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
    padding: 12px;
    color: var(--crm-text);
}

.crm-kanban-card span {
    color: var(--crm-muted);
    font-size: 13px;
}

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

.crm-form {
    display: grid;
    gap: 20px;
}

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

.crm-field {
    display: grid;
    gap: 8px;
}

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

.crm-field label {
    font-size: 13px;
    font-weight: 700;
}

.crm-field input,
.crm-field select,
.crm-field textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    color: var(--crm-text);
    padding: 10px 12px;
    outline: 0;
}

[data-theme="dark"] .crm-field input,
[data-theme="dark"] .crm-field select,
[data-theme="dark"] .crm-field textarea {
    color-scheme: dark;
}

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

.crm-field input:focus,
.crm-field select:focus,
.crm-field textarea:focus {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.crm-field__error {
    margin: 0;
    color: var(--crm-danger);
    font-size: 13px;
    font-weight: 600;
}

.crm-alert {
    margin-bottom: 18px;
    border-radius: var(--crm-radius);
    padding: 13px 16px;
    background: #dcfce7;
    color: #047857;
    font-weight: 700;
}

.crm-info-panel {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(16, 185, 129, 0.24);
    border-radius: var(--crm-radius);
    background: rgba(16, 185, 129, 0.08);
    color: var(--crm-text);
    padding: 14px;
}

.crm-info-panel span {
    color: var(--crm-muted);
}

.crm-details summary {
    color: var(--crm-primary);
    cursor: pointer;
    font-weight: 700;
}

.crm-details pre {
    max-width: 420px;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
    color: var(--crm-text);
    padding: 12px;
    white-space: pre-wrap;
}

.crm-truncate {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.crm-inline-actions label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-weight: 600;
}

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

.crm-check-grid label {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
    padding: 0 12px;
    font-weight: 700;
}

.crm-holiday-list {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.crm-holiday-row {
    display: grid;
    grid-template-columns: minmax(160px, 0.35fr) minmax(200px, 1fr) 38px;
    gap: 10px;
    align-items: center;
}

.crm-holiday-row input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    color: var(--crm-text);
    padding: 0 12px;
}

.crm-form-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--crm-border);
}

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

.crm-assignment-grid label,
.crm-assignment-card {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
    padding: 10px 12px;
}

.crm-assignment-grid strong,
.crm-assignment-grid small {
    display: block;
}

.crm-assignment-grid small {
    color: var(--crm-muted);
}

.crm-attendance-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.crm-attendance-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.25fr) minmax(180px, 0.5fr);
    gap: 12px;
    align-items: center;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
    padding: 12px;
}

.crm-attendance-row select,
.crm-attendance-row input,
.crm-filter-bar input[type="date"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    color: var(--crm-text);
    padding: 0 12px;
}

.crm-chat-thread {
    display: grid;
    gap: 14px;
}

.crm-chat-message {
    max-width: 78%;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
    padding: 14px;
}

.crm-chat-message.is-student {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.1);
}

.crm-chat-message.is-staff {
    margin-right: auto;
}

.crm-chat-message div {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.crm-chat-message small,
.crm-chat-message p {
    color: var(--crm-muted);
}

.crm-chat-message p {
    margin: 10px 0;
    white-space: pre-wrap;
}

.crm-certificate-page {
    margin: 0;
    background: #0f172a;
    color: #f8fafc;
    font-family: var(--crm-font);
}

.crm-certificate {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px;
}

.crm-certificate__border {
    position: relative;
    width: min(1120px, 100%);
    aspect-ratio: 1.414 / 1;
    border: 8px solid #10b981;
    background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.22), transparent 32%), #0f172a;
    padding: 56px;
    text-align: center;
    overflow: hidden;
}

.crm-certificate__kicker {
    color: #6ee7b7;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.crm-certificate h1 {
    margin: 10px 0 28px;
    font-size: 52px;
}

.crm-certificate h2 {
    margin: 14px 0;
    color: #ffffff;
    font-size: 46px;
}

.crm-certificate h3 {
    margin: 14px 0 26px;
    color: #6ee7b7;
    font-size: 30px;
}

.crm-certificate__copy,
.crm-certificate__skills {
    color: #cbd5e1;
    font-size: 18px;
}

.crm-certificate__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 26px auto;
    max-width: 840px;
    color: #e2e8f0;
}

.crm-certificate__footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 42px;
    text-align: left;
}

.crm-certificate__footer span {
    display: block;
    color: #94a3b8;
}

.crm-certificate__watermark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(239, 68, 68, 0.2);
    font-size: 120px;
    font-weight: 900;
    transform: rotate(-18deg);
}

.crm-verify-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

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

.crm-alert--danger {
    margin-top: 18px;
    background: #fee2e2;
    color: #991b1b;
}

@media print {
    .crm-certificate {
        min-height: auto;
        padding: 0;
    }

    .crm-certificate__border {
        width: 297mm;
        height: 210mm;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

.crm-empty {
    padding: 42px 24px;
    text-align: center;
}

.crm-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
}

.crm-pagination .pagination {
    display: flex;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.crm-pagination .page-link {
    display: grid;
    min-width: 36px;
    min-height: 36px;
    place-items: center;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
}

.crm-pagination .active .page-link {
    background: var(--crm-primary);
    color: #ffffff;
}

.crm-auth {
    display: block;
    padding: 0;
}

.crm-auth-card {
    width: min(440px, 100%);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    box-shadow: var(--crm-shadow);
    padding: 28px;
}

[data-theme="dark"] .crm-auth-card .crm-brand__name {
    color: var(--crm-text) !important;
}

.crm-auth-card h1 {
    margin: 18px 0 6px;
    font-size: 28px;
}

.crm-auth-card p {
    margin: 0 0 22px;
    color: var(--crm-muted);
}

.crm-recovery-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(130, 49, 211, .08), transparent 32%),
        var(--crm-bg);
}

.crm-recovery-card {
    width: min(500px, 100%);
    padding: 26px;
}

.crm-recovery-brand {
    justify-content: center;
    text-align: center;
    margin-bottom: 18px;
}

.crm-recovery-brand > span {
    display: grid;
    justify-items: center;
}

.crm-recovery-badge {
    min-height: 30px;
    gap: 6px;
    margin-bottom: 18px;
}

.crm-recovery-intro h1 {
    margin: 0 0 8px;
    color: var(--crm-text);
    font-size: clamp(26px, 6vw, 34px);
    line-height: 1.1;
}

.crm-recovery-intro p {
    margin-bottom: 6px;
    line-height: 1.55;
}

.crm-input-icon {
    position: relative;
}

.crm-input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crm-muted);
    font-size: 18px;
    pointer-events: none;
}

.crm-input-icon input {
    padding-left: 46px;
}

.crm-field__hint {
    margin: 8px 0 0 !important;
    color: var(--crm-muted);
    font-size: 12px;
    line-height: 1.4;
}

.crm-field__hint.is-valid {
    color: var(--crm-accent);
}

.crm-field__hint.is-invalid {
    color: #ff0f0f;
}

.crm-button--full {
    width: 100%;
}

.crm-button--gradient {
    background: linear-gradient(135deg, var(--crm-primary), #5f2eea);
    box-shadow: 0 12px 26px rgba(130, 49, 211, .22);
}

.crm-button--soft {
    background: var(--crm-surface-soft);
    color: var(--crm-text);
}

.crm-button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: crm-spin .65s linear infinite;
    display: inline-flex;
    margin-right: 8px;
}

@keyframes crm-spin {
    to { transform: rotate(360deg); }
}

.crm-recovery-success {
    display: none;
    gap: 14px;
    border: 1px solid rgba(0, 185, 41, .22);
    border-radius: var(--crm-radius);
    background: rgba(0, 185, 41, .06);
    padding: 16px;
    margin: 18px 0;
}

.crm-recovery-success.is-visible {
    display: flex;
}

.crm-recovery-success__icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--crm-accent);
    color: #fff;
    font-size: 22px;
}

.crm-recovery-success h2,
.crm-recovery-security h2 {
    margin: 0 0 8px;
    color: var(--crm-text);
    font-size: 17px;
}

.crm-recovery-success p {
    margin-bottom: 4px;
    font-size: 14px;
}

.crm-recovery-success__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.crm-recovery-success__actions .crm-button {
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
}

.crm-recovery-form.is-hidden {
    display: none;
}

.crm-recovery-security {
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-soft);
    padding: 16px;
    margin-top: 20px;
}

.crm-recovery-security ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.crm-recovery-security li {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--crm-muted);
    font-size: 13px;
}

.crm-recovery-security li i {
    color: var(--crm-accent);
}

.crm-recovery-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-top: 1px solid var(--crm-border);
    margin-top: 20px;
    padding-top: 16px;
    color: var(--crm-muted);
    font-size: 13px;
}

.crm-recovery-footer p {
    margin: 0;
    text-align: right;
    font-size: 13px;
}

.crm-recovery-footer a {
    color: var(--crm-primary);
    font-weight: 650;
}

@media (max-width: 575px) {
    .crm-recovery-shell {
        align-items: flex-start;
        padding: 16px;
    }

    .crm-recovery-card {
        padding: 20px;
    }

    .crm-recovery-success {
        flex-direction: column;
    }

    .crm-recovery-success__actions .crm-button,
    .crm-recovery-footer {
        width: 100%;
    }

    .crm-recovery-footer {
        flex-direction: column;
    }

    .crm-recovery-footer p {
        text-align: left;
    }
}

.crm-login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
    min-height: 100vh;
}

.crm-login-marketing {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: clamp(32px, 6vw, 76px);
    background: var(--crm-bg);
}

.crm-login-marketing h1 {
    max-width: 760px;
    margin: 0;
    color: var(--crm-text);
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1;
}

.crm-login-marketing p {
    max-width: 680px;
    margin: 0;
    color: var(--crm-muted);
    font-size: 17px;
}

.crm-login-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 32px;
    align-items: center;
    border: 1px solid var(--crm-border);
    border-radius: 999px;
    background: var(--crm-surface);
    color: var(--crm-primary);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.crm-login-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.crm-login-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.crm-login-stats strong {
    border: 1px solid var(--crm-border);
    border-radius: 999px;
    background: var(--crm-surface);
    padding: 9px 12px;
    font-size: 13px;
}

.crm-login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    background: #0f172a;
    color: #ffffff;
    padding: clamp(28px, 5vw, 58px);
}

.crm-login-panel h2 {
    margin: 0;
    font-size: 34px;
}

.crm-login-panel p {
    margin: 0;
    color: #94a3b8;
}

.crm-login-panel .crm-field label {
    color: #e5e7eb;
}

.crm-login-panel .crm-field input {
    border-color: #334155;
    background: #111827;
    color: #ffffff;
}

.crm-role-chips,
.crm-login-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.crm-role-chips span {
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}

.crm-login-options {
    justify-content: space-between;
    color: #cbd5e1;
    font-size: 14px;
}

.crm-login-shell--auth {
    grid-template-columns: minmax(0, 1fr) minmax(450px, 520px);
    gap: clamp(24px, 4vw, 54px);
    align-items: center;
    padding: clamp(24px, 4vw, 54px);
    background:
        radial-gradient(circle at 16% 18%, rgba(37, 99, 235, .12), transparent 28%),
        radial-gradient(circle at 84% 82%, rgba(130, 49, 211, .10), transparent 28%),
        var(--crm-bg);
}

.crm-login-marketing--auth {
    position: relative;
    min-height: calc(100vh - 108px);
    overflow: hidden;
    border: 1px solid var(--crm-border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .86)),
        var(--crm-surface);
    box-shadow: var(--crm-shadow);
}

[data-theme="dark"] .crm-login-marketing--auth {
    background:
        linear-gradient(135deg, rgba(31, 41, 55, .96), rgba(23, 32, 51, .88)),
        var(--crm-surface);
}

.crm-login-marketing--auth::after {
    position: absolute;
    right: -90px;
    bottom: -110px;
    width: 330px;
    height: 330px;
    border: 34px solid rgba(130, 49, 211, .10);
    border-radius: 50%;
    content: "";
}

.crm-login-brand {
    position: relative;
    z-index: 1;
    width: fit-content;
    padding: 0;
}

.crm-login-brand .crm-brand__name,
.crm-login-card__brand .crm-brand__name {
    color: var(--crm-text);
}

.crm-login-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
}

.crm-login-highlight-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 680px;
}

.crm-login-highlight {
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--crm-border);
    border-radius: 10px;
    background: var(--crm-surface);
    padding: 12px 14px;
    color: var(--crm-text);
    font-weight: 700;
}

.crm-login-highlight i {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: rgba(130, 49, 211, .10);
    color: var(--crm-primary);
    font-size: 16px;
}

.crm-login-visual {
    position: relative;
    z-index: 1;
    max-width: 520px;
    border: 1px solid var(--crm-border);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(130, 49, 211, .10), rgba(37, 99, 235, .08)),
        var(--crm-surface);
    padding: 18px;
}

.crm-login-visual > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 14px;
    align-items: center;
}

.crm-login-visual__icon {
    grid-row: span 2;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 12px;
    background: var(--crm-primary);
    color: #ffffff;
    font-size: 22px;
}

.crm-login-visual strong {
    color: var(--crm-text);
    font-size: 17px;
}

.crm-login-visual p {
    margin: 0;
    font-size: 14px;
}

.crm-login-panel--auth {
    min-height: calc(100vh - 108px);
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--crm-text);
    padding: 0;
}

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

.crm-login-card__brand {
    justify-content: center;
    padding: 0;
    margin-bottom: 20px;
    text-align: center;
}

.crm-login-card__brand > span {
    display: grid;
    justify-items: center;
}

.crm-login-title {
    display: grid;
    gap: 6px;
    margin: 18px 0;
}

.crm-login-panel .crm-login-title h2,
.crm-login-title h2 {
    margin: 0;
    color: var(--crm-text);
    font-size: clamp(28px, 5vw, 36px);
}

.crm-login-panel .crm-login-title p,
.crm-login-title p {
    margin: 0;
    color: var(--crm-muted);
}

.crm-login-card .crm-field label {
    color: var(--crm-text);
}

.crm-login-card .crm-field input {
    min-height: 46px;
    border-color: var(--crm-border);
    background: var(--crm-surface);
    color: var(--crm-text);
}

.crm-password-field--auth > .crm-password-field__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crm-muted);
    pointer-events: none;
}

.crm-password-field--auth input {
    padding-left: 46px;
}

.crm-login-card .crm-login-options {
    color: var(--crm-muted);
}

.crm-checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--crm-muted);
    font-size: 14px;
}

.crm-checkbox-line input {
    width: 16px;
    height: 16px;
    accent-color: var(--crm-primary);
}

.crm-trusted-device {
    margin-top: -6px;
}

.crm-login-security {
    display: grid;
    gap: 8px;
    margin-top: 20px;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    background: var(--crm-surface-soft);
    padding: 16px;
}

.crm-login-security h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--crm-text);
    font-size: 16px;
}

.crm-login-security p {
    margin: 0;
    color: var(--crm-muted);
    font-size: 13px;
}

.crm-login-security ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    color: var(--crm-muted);
    font-size: 13px;
}

.crm-login-security li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-login-security li i,
.crm-login-security h3 i {
    color: var(--crm-primary);
}

.crm-password-field {
    position: relative;
}

.crm-password-field input {
    padding-right: 46px;
}

.crm-password-field button {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 2;
    display: grid;
    width: 34px;
    height: 34px;
    transform: translateY(-50%);
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}

.crm-login-card .crm-password-field button {
    color: var(--crm-muted);
}

.crm-mobile-backdrop {
    display: none;
}

.crm-report-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto;
    gap: 8px 14px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--crm-border);
}

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

.crm-report-row span {
    color: var(--crm-text);
    font-weight: 650;
}

.crm-report-row strong {
    color: var(--crm-muted);
    font-size: 13px;
}

.crm-report-bar {
    grid-column: 1 / -1;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--crm-surface-soft);
}

.crm-report-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--crm-primary), var(--crm-accent));
}

@media (max-width: 1180px) {
    .crm-grid--stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .crm-login-shell--auth {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
        gap: 24px;
    }

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

@media (max-width: 900px) {
    .crm-login-shell {
        grid-template-columns: 1fr;
    }

    .crm-login-panel {
        min-height: 100vh;
    }

    .crm-login-shell--auth {
        display: flex;
        min-height: 100vh;
        align-items: center;
        justify-content: center;
        padding: 18px;
    }

    .crm-login-marketing--auth {
        display: none;
    }

    .crm-login-panel--auth {
        width: 100%;
        min-height: auto;
    }

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

    .crm-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 40;
        width: min(310px, 86vw);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }

    body.crm-sidebar-open .crm-sidebar {
        transform: translateX(0);
    }

    .crm-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: none;
        background: rgba(15, 23, 42, 0.46);
    }

    body.crm-sidebar-open .crm-mobile-backdrop {
        display: block;
    }

    .crm-menu-button {
        display: inline-grid;
        place-items: center;
    }
}

@media (max-width: 767px) {
    .crm-login-shell--auth {
        padding: 16px;
    }

    .crm-login-card {
        padding: 20px;
    }

    .crm-login-card__brand {
        margin-bottom: 16px;
    }

    .crm-login-badge--compact {
        min-height: 28px;
        font-size: 11px;
    }

    .crm-login-title {
        margin: 14px 0;
    }

    .crm-login-security {
        padding: 14px;
    }

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

@media (max-width: 720px) {
    .crm-topbar {
        padding: 14px 18px;
    }

    .crm-search {
        display: none;
    }

    .crm-theme-switcher {
        order: -1;
    }

    .crm-user > div:not(.crm-theme-switcher) {
        display: none;
    }

    .crm-content {
        padding: 22px 16px;
    }

    .crm-page-header {
        display: grid;
    }

    .crm-grid--stats,
    .crm-form-grid,
    .crm-detail-grid,
    .crm-check-grid,
    .crm-assignment-grid,
    .crm-attendance-row {
        grid-template-columns: 1fr;
    }

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

    .crm-chat-message {
        max-width: 100%;
    }

    .crm-card__header,
    .crm-card__body {
        padding: 18px;
    }

    .crm-table th,
    .crm-table td {
        padding: 13px 12px;
    }
}
