:root {
    --alfred-navy: #203a56;
    --alfred-blue: #3273dc;
    --alfred-soft: #f3f6f9;
    --alfred-border: #dce3ea;
    --alfred-text: #243342;
}

html { background: #eef2f6; }
body { min-height: 100vh; color: var(--alfred-text); background: linear-gradient(180deg, #f8fafc 0, #eef2f6 100%); }
.alfred-main { min-height: calc(100vh - 64px); }
.alfred-navbar { background: var(--alfred-navy); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.alfred-navbar .navbar-item, .alfred-navbar .navbar-link { color: rgba(255,255,255,.9); }
.alfred-navbar .navbar-item:hover, .alfred-navbar .navbar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.alfred-brand { font-size: 1.25rem; font-weight: 800; letter-spacing: .01em; gap: .65rem; }
.alfred-brand img { max-height: 38px; width: 46px; object-fit: contain; }
.navbar-burger { color: white; }

.eyebrow, .step-kicker { color: #3273dc; font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.page-heading { max-width: 760px; }
.box, .side-panel, .preview-panel { border: 1px solid var(--alfred-border); box-shadow: 0 10px 28px rgba(32,58,86,.06); }
.side-panel, .preview-panel { background: #fff; border-radius: 12px; padding: 1.5rem; }
.tool-card { height: 100%; border: 1px solid var(--alfred-border); border-radius: 12px; box-shadow: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; overflow: hidden; }
.tool-card.is-disabled { opacity: .65; background: #f7f9fb; }
.tool-card:hover { transform: translateY(-2px); border-color: #a9c5e6; box-shadow: 0 12px 30px rgba(32,58,86,.1); }
.tool-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #eaf2fb; color: var(--alfred-navy); font-weight: 900; font-family: Georgia, serif; }
.privacy-note { border: 1px solid var(--alfred-border); }
.step-number { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--alfred-navy); color: #fff; font-weight: 800; }

.alfred-form input[type="text"],
.alfred-form input[type="password"],
.alfred-form input[type="date"],
.alfred-form input[type="number"],
.alfred-form select,
.alfred-form textarea {
    width: 100%;
    border: 1px solid #b7c3cf;
    border-radius: 7px;
    padding: .65rem .75rem;
    background: white;
    color: var(--alfred-text);
    font-size: 1rem;
    min-height: 2.5rem;
}
.alfred-form input:focus, .alfred-form select:focus, .alfred-form textarea:focus { outline: 2px solid rgba(50,115,220,.18); border-color: var(--alfred-blue); }
.alfred-form .select select { padding-right: 2.5em; }
.file.is-fullwidth .file-label { width: 100%; }
.file.is-fullwidth .file-name { flex: 1; max-width: none; background: #fff; }
.file.is-boxed.is-fullwidth .file-label { align-items: stretch; }
.file.is-boxed.is-fullwidth .file-cta { min-width: 180px; justify-content: center; }
.gap-2 { gap: .5rem; }

.position-list { border-top: 1px solid var(--alfred-border); }
.position-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--alfred-border); }
.position-control { display: flex; align-items: center; gap: .35rem; }
.position-control input { width: 76px !important; text-align: center; padding-inline: .35rem !important; }
.position-unit { color: #6b7280; font-size: .8rem; min-width: 24px; }
.position-step { font-weight: 800; min-width: 38px; }
.action-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem; background: #fff; border: 1px solid var(--alfred-border); border-radius: 12px; box-shadow: 0 10px 28px rgba(32,58,86,.06); }
.action-bar > div { display: flex; gap: .75rem; flex-wrap: wrap; }
.paper-preview { position: relative; width: 100%; background: #fff; border: 1px solid #bfc8d2; box-shadow: 0 8px 20px rgba(0,0,0,.08); overflow: hidden; background-image: linear-gradient(#eef2f6 1px, transparent 1px), linear-gradient(90deg, #eef2f6 1px, transparent 1px); background-size: 10% 10%; }
.paper-preview::before { content: "TOP"; position: absolute; top: .5rem; left: .5rem; color: #9aa5b1; font-size: .65rem; font-weight: 700; }
.preview-line { position: absolute; transform: translate(-50%, -50%); display: block; max-width: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 5px; border-radius: 3px; background: rgba(32,58,86,.9); color: #fff; font-size: clamp(.48rem, 1.2vw, .72rem); line-height: 1.1; }
.position-table input { width: 64px !important; min-height: 2rem !important; padding: .3rem !important; text-align: center; }
.compact-stepper { display: flex; align-items: center; gap: .25rem; }

.login-page { min-height: 100vh; background: linear-gradient(135deg, rgba(29,72,104,.94), rgba(54,45,130,.92)), url("../images/bg_gradient.1f2a641724f2.jpg") center/cover; }
.login-page .section { min-height: 100vh; display: grid; place-items: center; }
.login-shell { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: 1fr 420px; gap: 4rem; align-items: center; }
.login-brand img { width: 180px; margin-bottom: 1.5rem; }
.login-box { padding: 2.25rem; border-radius: 14px; }

@media (min-width: 1024px) { .is-sticky-desktop { position: sticky; top: 88px; } }
@media (max-width: 1023px) {
    .alfred-navbar .navbar-menu { background: var(--alfred-navy); }
    .login-shell { grid-template-columns: 1fr; gap: 2rem; max-width: 480px; }
    .login-brand { text-align: center; }
    .login-brand img { width: 130px; }
}
@media (max-width: 768px) {
    .section { padding: 1.25rem 1rem; }
    .title.is-2 { font-size: 2rem; }
    .position-row { grid-template-columns: 1fr; gap: .4rem; }
    .position-control { justify-content: flex-start; }
    .action-bar { align-items: stretch; flex-direction: column; }
    .action-bar > div, .action-bar .button { width: 100%; }
    .action-bar > div .button { flex: 1; }
    .file.is-boxed.is-fullwidth .file-label { flex-direction: column; }
    .file.is-boxed.is-fullwidth .file-name { border: 1px solid #dbdbdb; min-height: 2.5rem; }
}


/* Dashboard */
.dashboard-heading { max-width: 820px; }
.dashboard-tabs { overflow-x: auto; scrollbar-width: thin; }
.dashboard-tabs ul { flex-wrap: nowrap; }
.dashboard-tabs a { background: #fff; border-color: var(--alfred-border); color: var(--alfred-navy); font-weight: 700; white-space: nowrap; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.dashboard-tabs a:hover { background: #edf5fd; border-color: #9bbce0; transform: translateY(-1px); }
.dashboard-group { scroll-margin-top: 88px; border-radius: 16px; padding: 1.75rem; background: rgba(255,255,255,.94); }
.dashboard-group-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dashboard-count { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 .65rem; border-radius: 999px; background: #edf5fd; color: var(--alfred-navy); font-weight: 800; }
.tool-card { background: #fff; }
.tool-card .card-content { min-height: 286px; display: flex; flex-direction: column; padding: 1.4rem; }
.tool-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.15rem; }
.tool-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(145deg, #eaf3fc, #f7fbff); border: 1px solid #d7e6f5; }
.tool-icon img { width: 28px; height: 28px; opacity: .82; }
.tool-description { flex: 1; margin-bottom: 1.25rem; line-height: 1.5; }
.tool-button { justify-content: space-between; font-weight: 700; border-radius: 9px; transition: background-color .15s ease, transform .15s ease; }
.tool-card:hover .tool-button { background: #dcecff; transform: translateY(-1px); }
.has-certificate-background { background-position: center; background-size: 100% 100%; background-repeat: no-repeat; }
.has-certificate-background::before { display: none; }
.has-certificate-background .preview-line { background: rgba(255,255,255,.85); color: #111827; border: 1px solid rgba(32,58,86,.24); font-weight: 700; }

@media (max-width: 768px) {
    .dashboard-group { padding: 1.15rem; }
    .dashboard-tabs { margin-inline: -1rem; padding-inline: 1rem; }
    .tool-card .card-content { min-height: auto; }
}
/* Instructor certificates use complete background artwork and fixed text positions. */
.instructor-action-bar {
    justify-content: flex-start;
}
