*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    color: #1f2933;
    background: #f5f6f7;
    line-height: 1.5;
}

h1,
h2 {
    margin: 0;
    letter-spacing: -0.01em;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: #6b7280;
}

.lede {
    margin: 6px 0 0;
    color: #4b5563;
}

.app {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #e5e7eb;
    border-right: 1px solid #d1d5db;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand h1 {
    font-size: 18px;
    margin-top: 4px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    background: #f5f6f7;
    border: 1px solid #d1d5db;
    color: #1f2933;
    padding: 12px 12px;
    border-radius: 10px;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.menu-item.active {
    background: #dfe3e8;
    border-color: #cbd0d6;
    box-shadow: inset 0 0 0 1px #cbd0d6;
}

.menu-item:hover {
    background: #e9ecef;
}

.status {
    margin-top: auto;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 10px 12px;
    color: #374151;
    background: #f5f6f7;
    font-weight: 600;
    text-align: center;
}

.status.success {
    border-color: #7dd3b0;
    color: #0f5132;
    background: #eafaf1;
}

.status.error {
    border-color: #f2b8b5;
    color: #7f1d1d;
    background: #fef2f2;
}

.status.neutral {
    border-color: #d1d5db;
    color: #374151;
    background: #f5f6f7;
}

.dot {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.dot.online {
    background: #eafaf1;
    color: #0f5132;
}

.dot.offline {
    background: #fef2f2;
    color: #7f1d1d;
}

.notifications-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notifications-list li {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    font-weight: 600;
}

.notifications-list small {
    display: block;
    color: #6b7280;
    font-weight: 500;
}

.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: #111827;
    color: #f9fafb;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.25);
    min-width: 240px;
    max-width: 340px;
    animation: toast-in 0.2s ease-out;
}

.toast-title {
    font-weight: 700;
}

.toast-meta {
    color: #d1d5db;
    font-size: 13px;
    margin-top: 4px;
}

.toast.fade-out {
    animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.content {
    padding: 28px clamp(16px, 3vw, 36px);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.panel-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 18px 20px;
    box-shadow: 0 10px 24px rgba(31, 41, 51, 0.04);
}

.panel-header {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: #1f2933;
}

input,
textarea,
select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font: inherit;
    background: #f8fafc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.25);
    background: #ffffff;
}

.btn {
    border: 1px solid #d1d5db;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #1f2933;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    justify-self: start;
}

.btn:hover {
    background: #e5e7eb;
}

.btn:active {
    transform: translateY(0);
}

.btn.ghost {
    background: transparent;
    border-color: #d1d5db;
}

.hint {
    color: #6b7280;
    font-weight: 400;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
}

th {
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #4b5563;
}

.muted td {
    color: #6b7280;
    text-align: center;
}

.muted-text {
    color: #6b7280;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2f3;
    color: #374151;
    font-weight: 700;
    font-size: 12px;
    margin: 2px 4px 2px 0;
}

.tag.success {
    background: #eafaf1;
    color: #0f5132;
}

.tag.error {
    background: #fef2f2;
    color: #7f1d1d;
}

/* Enrollment progress indicator */
.enrollment-progress {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.enrollment-progress.hidden {
    display: none;
}

.enrollment-progress h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #4b5563;
}

.enrollment-progress ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.enrollment-progress li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #6b7280;
}

.enrollment-progress li::before {
    content: "\25CB";
    font-size: 14px;
    color: #9ca3af;
}

.enrollment-progress li.completed {
    color: #0f5132;
}

.enrollment-progress li.completed::before {
    content: "\2713";
    color: #22c55e;
}

.enrollment-progress li.failed {
    color: #7f1d1d;
}

.enrollment-progress li.failed::before {
    content: "\2717";
    color: #ef4444;
}

.enrollment-progress li.in-progress {
    color: #1f2933;
}

.enrollment-progress li.in-progress::before {
    content: "\25D4";
    color: #3b82f6;
    animation: spin 1s linear infinite;
}

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

.list-panel {
    min-height: 260px;
}

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

    .sidebar {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .menu {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .status {
        margin-top: 0;
        margin-left: auto;
    }
}

@media (max-width: 640px) {
    .menu-item {
        flex: 1 1 120px;
    }

    select[multiple] {
        min-height: 120px;
    }
}
