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

.drm-portal-sidebar {
    background: linear-gradient(180deg, #313843 0%, #262d35 100%);
    color: #fff;
    padding: 28px 22px;
    position: sticky;
    top: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.drm-portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.drm-portal-logo {
    width: 48px;
    height: 48px;
    background: #2457e6;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(36, 87, 230, 0.35);
}

.drm-portal-brand strong,
.drm-portal-brand span {
    display: block;
}

.drm-portal-brand span {
    color: rgba(255,255,255,.66);
    font-size: .92rem;
    margin-top: 2px;
}

.drm-portal-nav {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.drm-portal-nav a {
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255,255,255,.78);
    font-weight: 600;
    transition: .18s ease;
    border: 1px solid transparent;
}

.drm-portal-nav a:hover,
.drm-portal-nav a.is-active {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-color: rgba(255,255,255,.08);
}

.drm-portal-sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
}

.drm-user-chip {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 14px;
}

.drm-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #2457e6;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.drm-user-chip strong,
.drm-user-chip span {
    display: block;
}

.drm-user-chip span {
    color: rgba(255,255,255,.72);
    font-size: .83rem;
}

.drm-sidebar-logout {
    color: rgba(255,255,255,.76);
    font-weight: 600;
}

.drm-portal-main {
    background: #f4f7fb;
    padding: 34px;
}

.drm-portal-topbar {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

.drm-portal-topbar h1 {
    margin: 0;
    font-size: clamp(1.65rem, 2vw, 2.25rem);
    letter-spacing: -0.03em;
    color: #132238;
}

.drm-portal-topbar p {
    margin: 6px 0 0;
    color: #64748b;
}

.drm-sidebar-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid #d7e1f1;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
}

.drm-section-block {
    margin-top: 22px;
}

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

.drm-section-head h2 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: -0.03em;
}

.drm-progress {
    height: 10px;
    background: #e5edf8;
    border-radius: 999px;
    overflow: hidden;
    margin: 14px 0 8px;
}

.drm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2457e6 0%, #4f83ff 100%);
    border-radius: inherit;
}

.drm-checklist {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.drm-checklist-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    background: #f9fbff;
    border: 1px solid #dce6f5;
    border-radius: 14px;
    padding: 12px 14px;
}

.drm-checklist-item strong {
    color: #64748b;
    font-size: .84rem;
}

.drm-checklist-item input {
    width: 18px;
    height: 18px;
    accent-color: #2457e6;
}

.drm-course-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 10px;
}

.drm-course-note {
    border: 1px dashed #cbd7ec;
    background: #f9fbff;
    border-radius: 14px;
    padding: 14px;
    margin-top: 14px;
}

.drm-calendar-list {
    display: grid;
    gap: 14px;
}

.drm-calendar-item {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    border: 1px solid #dce6f5;
    background: #ffffff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 18px 42px rgba(36, 87, 230, 0.05);
}

.drm-calendar-date strong,
.drm-calendar-date span {
    display: block;
}

.drm-calendar-date span {
    color: #64748b;
    margin-top: 4px;
}

.drm-form-feedback {
    margin-top: 12px;
    color: #2457e6;
    font-weight: 600;
}

.drm-question-form {
    display: grid;
    gap: 14px;
}

.drm-question-form label,
.drm-login-form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    color: #0f172a;
}

.drm-question-form input,
.drm-question-form textarea,
.drm-login-form input {
    width: 100%;
    border: 1px solid #d7e1f1;
    border-radius: 14px;
    min-height: 48px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}

.drm-question-form textarea {
    min-height: 140px;
}

.drm-inline-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
}

.drm-inline-check input {
    width: auto;
    min-height: 0;
}

.drm-login-card {
    max-width: 580px;
    margin: 0 auto;
}

.drm-alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.drm-alert-error {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

@media (max-width: 1024px) {
    .drm-portal-shell {
        grid-template-columns: 1fr;
    }

    .drm-portal-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .22s ease;
        z-index: 999;
    }

    .drm-portal-shell.is-sidebar-open .drm-portal-sidebar {
        transform: translateX(0);
    }

    .drm-sidebar-toggle {
        display: inline-grid;
        place-items: center;
    }

    .drm-portal-main {
        padding: 24px 16px 40px;
    }

    .drm-calendar-item {
        grid-template-columns: 1fr;
    }

    .drm-checklist-item {
        grid-template-columns: 22px minmax(0, 1fr);
    }

    .drm-checklist-item strong {
        grid-column: 2;
    }
}

.drm-grid-2,
.drm-grid-4 {
    display: grid;
    gap: 18px;
}

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

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

.drm-card,
.drm-page-card {
    background: #fff;
    border: 1px solid #dce6f5;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 16px 40px rgba(36, 87, 230, 0.05);
}

.drm-card h3,
.drm-card h2 {
    margin-top: 0;
    color: #132238;
}

.drm-card h3 {
    margin-bottom: 10px;
}

.drm-card ul {
    margin: 10px 0 0 18px;
}

.drm-meta {
    color: #64748b;
}

.drm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
}

.drm-btn-primary {
    background: #2457e6;
    color: #fff;
}

.drm-btn-ghost {
    background: #fff;
    color: #2457e6;
    border-color: #cfe0ff;
}

.drm-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}

.drm-badge-primary {
    color: #1d4ed8;
    background: #dbeafe;
}

.drm-badge-success {
    color: #166534;
    background: #dcfce7;
}

.drm-badge-warning {
    color: #92400e;
    background: #fef3c7;
}

.drm-badge-muted {
    color: #475569;
    background: #e2e8f0;
}

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

.drm-inline-link {
    color: #2457e6;
    font-weight: 700;
}

.drm-site-shell {
    padding: 38px 20px;
}

.drm-page-card {
    max-width: 720px;
}

.drm-kicker {
    display: inline-block;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
    color: #2457e6;
}

.drm-page-title {
    margin: 0 0 18px;
    color: #132238;
}

.drm-course-content {
    margin-top: 18px;
}

.drm-course-content :last-child {
    margin-bottom: 0;
}

.drm-session-detail-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
}

.drm-session-register-row {
    margin-top: 14px;
}

@media (max-width: 1200px) {
    .drm-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .drm-grid-2,
    .drm-grid-4,
    .drm-session-detail-grid {
        grid-template-columns: 1fr;
    }
}


/* --- Full-screen portal app shell refresh --- */
html, body {
    height: 100%;
}

body.drm-portal-fullscreen-page {
    overflow: hidden;
}

body.drm-portal-fullscreen-page.logged-in.admin-bar .drm-portal-shell,
body.drm-portal-fullscreen-page .drm-portal-shell {
    min-height: 100dvh;
    width: 100%;
}

body.drm-portal-fullscreen-page.logged-in.admin-bar .drm-portal-shell {
    min-height: calc(100dvh - 32px);
}

.drm-portal-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: 100dvh;
    width: 100%;
    background: #f9fafb;
}

.drm-portal-sidebar {
    background: #2f3640;
    color: #fff;
    padding: 16px 0;
    min-height: 100dvh;
    height: 100dvh;
    border-right: 1px solid rgba(255,255,255,.06);
}

.drm-portal-brand {
    gap: 10px;
    margin: 0;
    padding: 0 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.drm-portal-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #1e40af;
    box-shadow: none;
}

.drm-portal-brand strong { font-size: .875rem; }
.drm-portal-brand span { font-size: .7rem; color: rgba(255,255,255,.72); }

.drm-portal-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 14px 0;
}

.drm-portal-nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 18px;
    border-radius: 0;
    border-left: 3px solid transparent;
    color: rgba(255,255,255,.78);
    font-size: .92rem;
    font-weight: 600;
}

.drm-portal-nav a:hover,
.drm-portal-nav a.is-active {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-color: #2563eb;
}

.drm-portal-sidebar-footer {
    margin-top: auto;
    padding: 14px 18px 0;
    border-top: 1px solid rgba(255,255,255,.08);
}

.drm-user-chip,
.drm-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drm-user-chip {
    padding: 0;
    margin-bottom: 10px;
    background: transparent;
}

.drm-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
}

.drm-user-chip strong,
.drm-user-pill strong {
    display: block;
    font-size: .8125rem;
    color: inherit;
}

.drm-user-chip span,
.drm-user-pill span {
    display: block;
    font-size: .7rem;
    color: inherit;
    opacity: .72;
}

.drm-sidebar-logout {
    display: inline-block;
    color: rgba(255,255,255,.82);
    font-size: .8125rem;
}

.drm-portal-main {
    min-width: 0;
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    background: #f9fafb;
}

body.drm-portal-fullscreen-page.logged-in.admin-bar .drm-portal-main {
    height: calc(100dvh - 32px);
    min-height: calc(100dvh - 32px);
}

.drm-portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 60px;
    padding: 0 20px;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex: 0 0 auto;
}

.drm-portal-topbar-left,
.drm-portal-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drm-portal-topbar h1 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.2;
    color: #111827;
}

.drm-portal-topbar p {
    margin: 2px 0 0;
    font-size: .82rem;
    color: #6b7280;
}

.drm-user-pill {
    padding: 5px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
}

.drm-portal-content {
    flex: 1 1 auto;
    overflow: auto;
    padding: 28px 32px;
}

.drm-card,
.drm-page-card {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.drm-section-block {
    margin-top: 0;
    margin-bottom: 18px;
}

.drm-section-head {
    margin-bottom: 14px;
}

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

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

.drm-calendar-item {
    grid-template-columns: 140px minmax(0, 1fr) auto;
    border-radius: 10px;
    border-color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.drm-checklist-item {
    background: #fff;
    border-color: #e5e7eb;
    border-radius: 10px;
}

.drm-login-card {
    max-width: 520px;
}

@media (max-width: 1024px) {
    .drm-portal-shell {
        grid-template-columns: 1fr;
    }

    .drm-portal-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform .22s ease;
        z-index: 999;
    }

    body.drm-portal-fullscreen-page.logged-in.admin-bar .drm-portal-sidebar {
        top: 32px;
        height: calc(100dvh - 32px);
    }

    .drm-portal-main,
    body.drm-portal-fullscreen-page.logged-in.admin-bar .drm-portal-main {
        height: 100dvh;
        min-height: 100dvh;
    }

    .drm-portal-content {
        padding: 20px 16px 28px;
    }
}

.drm-alert-success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.drm-admin-form {
    display: grid;
    gap: 14px;
}

.drm-admin-form label,
.drm-admin-fieldset legend {
    display: grid;
    gap: 8px;
    font-weight: 700;
    color: #111827;
}

.drm-input,
.drm-admin-form textarea,
.drm-admin-form select,
.drm-admin-form input[type="text"],
.drm-admin-form input[type="email"],
.drm-admin-form input[type="url"],
.drm-admin-form input[type="date"],
.drm-admin-form input[type="time"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 11px 13px;
    background: #fff;
    font: inherit;
    color: #111827;
}

textarea.drm-input {
    min-height: 120px;
    resize: vertical;
}

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

.drm-admin-fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
}

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

.drm-check-option {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
}

.drm-check-option input {
    width: 16px;
    height: 16px;
    min-height: 0;
}

.drm-admin-list {
    display: grid;
    gap: 12px;
}

.drm-admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.drm-admin-list-item > div {
    min-width: 0;
}

.drm-admin-list-item strong,
.drm-admin-list-item span {
    display: block;
}

.drm-admin-list-item span {
    color: #6b7280;
    font-size: .86rem;
    margin-top: 4px;
}

.drm-admin-list-stack {
    align-items: flex-start;
}

.drm-admin-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.drm-spacer-top {
    margin-top: 14px;
}

.drm-admin-table-wrap {
    overflow: auto;
}

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

.drm-admin-table th,
.drm-admin-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.drm-admin-table th {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
}

@media (max-width: 960px) {
    .drm-admin-field-grid,
    .drm-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .drm-admin-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.drm-course-admin-shell { align-items: start; }
.drm-tight-head { margin-bottom: 10px; }
.drm-admin-form { display: grid; gap: 14px; }
.drm-admin-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.drm-select-chip-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.drm-select-chip { display: block; cursor: pointer; }
.drm-select-chip input { display:none; }
.drm-select-chip span { display:block; padding: 14px; border-radius: 14px; border:1px solid #dce6f5; background:#fff; }
.drm-select-chip strong, .drm-select-chip small { display:block; }
.drm-select-chip small { color:#64748b; margin-top:4px; }
.drm-select-chip input:checked + span { border-color:#2457e6; box-shadow: inset 0 0 0 1px #2457e6; background:#eff6ff; }
.drm-task-library-list, .drm-track-card-grid, .drm-course-library-grid, .drm-course-flow-list { display:grid; gap:14px; }
.drm-task-library-item { padding:14px; border:1px solid #dce6f5; border-radius:14px; background:#f9fbff; }
.drm-task-library-item strong, .drm-task-library-item span { display:block; }
.drm-task-library-item span { margin-top:4px; color:#64748b; font-size:.92rem; }
.drm-track-card-grid, .drm-course-library-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.drm-track-card .drm-mini-list { margin:14px 0 0; padding-left:18px; color:#475569; display:grid; gap:6px; }
.drm-course-library-grid { align-items: stretch; }
.drm-course-card { background:#fff; border:1px solid #dce6f5; border-radius:18px; overflow:hidden; box-shadow: 0 16px 36px rgba(36,87,230,.06); display:flex; flex-direction:column; }
.drm-course-card-cover { min-height:140px; display:flex; align-items:flex-end; padding:18px; color:#fff; font-weight:800; font-size:1.25rem; }
.drm-course-card-cover span { background:rgba(255,255,255,.14); padding:10px 12px; border-radius:14px; backdrop-filter: blur(10px); }
.drm-course-card-body { padding:18px; display:grid; gap:12px; }
.drm-course-card-body h3 { margin:0; font-size:1.12rem; color:#132238; }
.drm-course-card-meta-row, .drm-course-card-stats { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.drm-course-card-stats { color:#64748b; font-size:.9rem; }
.drm-course-detail-hero { display:grid; grid-template-columns: 260px minmax(0,1fr); gap:0; overflow:hidden; padding:0; }
.drm-course-detail-cover { min-height:100%; background-size:cover; background-position:center; }
.drm-course-detail-body { padding:26px; }
.drm-course-builder-card { overflow: visible; }
.drm-builder-toolbar { display:flex; flex-wrap:wrap; gap:10px; padding:14px; background:#f8fbff; border:1px dashed #c9d8f0; border-radius:16px; }
.drm-course-builder-canvas { display:grid; gap:14px; margin-top:16px; }
.drm-builder-block { border:1px solid #dce6f5; border-radius:16px; background:#fff; padding:16px; display:grid; gap:12px; box-shadow:0 10px 24px rgba(16,24,40,.04); }
.drm-builder-block-head, .drm-question-toolbar { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.drm-builder-block-head strong, .drm-builder-block-head span { display:block; }
.drm-builder-block-head span { font-size:.82rem; color:#64748b; text-transform:capitalize; margin-top:4px; }
.drm-link-button { background:none; border:none; color:#2457e6; font-weight:600; cursor:pointer; padding:0; }
.drm-link-button:hover { text-decoration:underline; }
[data-url-field].is-hidden, .drm-quiz-editor.is-hidden { display:none; }
.drm-question-list { display:grid; gap:12px; }
.drm-question-editor { border:1px solid #e2e8f0; border-radius:14px; padding:14px; background:#fafcff; display:grid; gap:12px; }
.drm-choice-editor { display:grid; gap:8px; }
.drm-choice-row { display:grid; grid-template-columns: minmax(0,1fr) auto; gap:10px; align-items:center; }
.drm-input { width:100%; border:1px solid #d7e1f1; border-radius:12px; padding:12px 14px; background:#fff; font:inherit; }
.drm-input:focus { outline:none; border-color:#2457e6; box-shadow:0 0 0 3px rgba(36,87,230,.12); }
.drm-inline-check { display:flex; gap:10px; align-items:center; color:#334155; font-weight:500; }
.drm-course-builder-block { background:#fff; border:1px solid #dce6f5; border-radius:18px; padding:18px; box-shadow:0 16px 34px rgba(15,23,42,.05); }
.drm-course-builder-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:12px; }
.drm-course-builder-head span { color:#64748b; font-size:.84rem; text-transform:capitalize; }
.drm-rich-copy p:last-child { margin-bottom:0; }
.drm-video-frame { position:relative; padding-top:56.25%; border-radius:16px; overflow:hidden; margin-bottom:12px; background:#0f172a; }
.drm-video-frame iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.drm-quiz-block { display:grid; gap:14px; }
.drm-quiz-question { padding:12px 0; border-top:1px solid #eef2f7; }
.drm-quiz-question:first-child { border-top:none; padding-top:0; }
.drm-quiz-choice { display:flex; gap:10px; align-items:flex-start; margin-top:8px; color:#334155; }
.drm-session-register-form { display:grid; gap:14px; margin-top:14px; }
.drm-form-feedback { color:#2457e6; font-weight:600; }

@media (max-width: 1080px) {
  .drm-track-card-grid, .drm-course-library-grid, .drm-grid-2, .drm-admin-field-grid, .drm-select-chip-grid, .drm-course-detail-hero { grid-template-columns: 1fr; }
  .drm-course-detail-cover { min-height:180px; }
}

@media (max-width: 780px) {
  .drm-portal-shell { grid-template-columns: 1fr; }
  .drm-portal-sidebar { position: fixed; z-index: 30; width: 300px; transform: translateX(-100%); transition: transform .22s ease; }
  .drm-portal-shell.is-sidebar-open .drm-portal-sidebar { transform: translateX(0); }
  .drm-sidebar-toggle { display: inline-grid; place-items: center; }
  .drm-portal-main { padding: 20px; }
  .drm-calendar-item { grid-template-columns: 1fr; }
}

.drm-progress{height:10px;background:#e2e8f0;border-radius:999px;overflow:hidden;margin:14px 0 18px}.drm-progress span{display:block;height:100%;background:#2563eb;border-radius:999px}.drm-final-quiz-block{margin-top:18px}.drm-admin-list-item{text-decoration:none;color:inherit}.drm-admin-list-item:hover{background:#f8fbff}.drm-select-chip span{display:flex;flex-direction:column}.drm-admin-list-stack span{display:block}.drm-portal-nav a{white-space:nowrap}.drm-course-builder-canvas .drm-question-editor{background:#f8fafc;border:1px solid #dce6f5;border-radius:16px;padding:14px}.drm-checklist-item span{flex:1}.drm-checklist-item strong{margin-left:auto}

/* --- Row-layout cleanup pass --- */
.drm-row-table th:last-child,
.drm-row-table td:last-child {
    text-align: right;
}

.drm-row-table td .drm-inline-actions {
    justify-content: flex-end;
}

.drm-admin-panel-form {
    max-width: 1100px;
}

.drm-course-card-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.drm-month-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #111827;
    font-weight: 700;
}

.drm-month-calendar-head,
.drm-month-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.drm-month-calendar-weekday {
    padding: 10px 12px;
    font-size: .78rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.drm-month-day {
    min-height: 120px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 10px;
}

.drm-month-day.is-outside {
    background: #f8fafc;
}

.drm-month-day-number {
    font-size: .85rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.drm-month-events {
    display: grid;
    gap: 6px;
}

.drm-month-event {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.3;
}

@media (max-width: 1200px) {
    .drm-course-card-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .drm-month-calendar-head,
    .drm-month-calendar-grid,
    .drm-course-card-grid-3 {
        grid-template-columns: 1fr;
    }

    .drm-row-table th:last-child,
    .drm-row-table td:last-child {
        text-align: left;
    }

    .drm-row-table td .drm-inline-actions {
        justify-content: flex-start;
    }
}


/* --- AI Course Studio --- */
.drm-ai-studio-hero { border: 1px solid #dbe7fb; background: linear-gradient(135deg,#f8fbff 0%,#ffffff 100%); }
.drm-ai-draft-meta { display:flex; flex-wrap:wrap; gap:10px; margin-top: 14px; }
.drm-ai-section-list { display:grid; gap:16px; margin-top:18px; }
.drm-ai-section-card { border:1px solid #dce6f5; border-radius:16px; padding:18px; background:#fbfdff; }
.drm-ai-block-list { margin:10px 0 0 18px; color:#334155; display:grid; gap:8px; }
.drm-json-textarea { min-height: 260px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .9rem; }

.drm-admin-table-wrap { overflow-x: auto; }
.drm-row-table th, .drm-row-table td { white-space: nowrap; }
.drm-row-table td:first-child { white-space: normal; }

.drm-link-button {
  border: 0;
  background: transparent;
  color: #2457e6;
  font-weight: 700;
  cursor: pointer;
}
.drm-link-button-danger { color: #111827; }

body.drm-panel-open { overflow: hidden; }
.drm-panel {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}
.drm-panel.is-open { display: block; }
.drm-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
}
.drm-panel-dialog {
  position: absolute;
  top: 0;
  right: 0;
  width: min(720px, 100vw);
  height: 100%;
  background: #fff;
  box-shadow: -20px 0 40px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
}
.drm-panel-dialog-wide { width: min(980px, 100vw); }
.drm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid #e5e7eb;
}
.drm-panel-head h2 { margin: 0; font-size: 1.2rem; }
.drm-panel-close {
  border: 0;
  background: #eff6ff;
  color: #1e40af;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.4rem;
  cursor: pointer;
}
.drm-panel-body {
  padding: 22px;
  overflow: auto;
}

.drm-module-canvas {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}
.drm-module-card {
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #f8fbff;
  padding: 16px;
}
.drm-module-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.drm-module-head strong, .drm-module-head span { display:block; }
.drm-module-head span { color: #64748b; font-size: .84rem; margin-top: 4px; }
.drm-module-blocks { display: grid; gap: 12px; margin-top: 12px; }
.drm-builder-block {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}
.drm-builder-block-head,
.drm-question-toolbar,
.drm-tight-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.drm-builder-block-head span,
.drm-question-toolbar span { display:block; color:#64748b; font-size:.8rem; }
.drm-choice-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; margin-bottom:8px; }
.drm-question-editor {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  margin-top: 10px;
}
.drm-admin-panel-form .drm-input,
.drm-admin-panel-form textarea,
.drm-admin-panel-form select {
  width: 100%;
}
.is-hidden { display: none !important; }

@media (max-width: 900px) {
  .drm-panel-dialog, .drm-panel-dialog-wide { width: 100vw; }
  .drm-row-table th, .drm-row-table td { white-space: normal; }
  .drm-choice-row { grid-template-columns: 1fr; }
}
