* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Brand identity colors — overridden per-request by views/layout.php (and the other layout
   entry points) from BRAND_COLOR_PRIMARY / BRAND_COLOR_PRIMARY_DARK (config/app.php), which are
   resolved from config/brands/{slug}.php based on the BRAND env var. These defaults are the
   fallback if that override is ever bypassed. */
:root {
    --brand-primary: #1D857D;
    --brand-primary-dark: #37634C;
    --brand-danger: #A8351B;
    --brand-danger-dark: #862A16;

    /* Full brand palette (brandguidelines/LMS Function Colours.html) — base/deep/tint triples.
       Not yet wired into components beyond --brand-primary/-dark and --brand-danger/-dark above. */
    --brand-green: #37634C;
    --brand-green-deep: #123F2A;
    --brand-green-tint: #96edb7;

    --brand-teal: #1D857D;
    --brand-teal-deep: #005F58;
    --brand-teal-tint: #DDF4F1;

    --brand-rust: #A8351B;
    --brand-rust-deep: #75220E;
    --brand-rust-tint: #FFE5DC;

    --brand-black: #000000;
    --brand-black-soft: #2B2B2B;
    --brand-black-tint: #EDEDED;

    --brand-white: #FFFFFF;
    --brand-white-off: #FAFAF9;
    --brand-white-grey: #F2F1EF;

    /* Functional colors — one per action type */
    --brand-edit: #386CA0;
    --brand-edit-deep: #0E4778;
    --brand-edit-tint: #E1F0FF;

    --brand-result: #D9B24F;
    --brand-result-deep: #AF8A1C;
    --brand-result-tint: #fbebc3;

    --brand-copy: #9D486C;
    --brand-copy-deep: #732248;
    --brand-copy-tint: #FFE6EF;

    --brand-email: #876F59;
    --brand-email-deep: #614B35;
    --brand-email-tint: #F5EDE6;

    --brand-bundle: #725195;
    --brand-bundle-deep: #4E2D6D;
    --brand-bundle-tint: #F3EAFF;

    --brand-delete: #A8351B;
    --brand-delete-deep: #75220E;
    --brand-delete-tint: #ffdbcf;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    -webkit-user-select: none;
    user-select: none;
}

/* Re-enable text selection on actual content and form controls */
p, li, td, th, h1, h2, h3, h4, h5, h6, span, label, blockquote, pre, code,
input, textarea, select, option,
[contenteditable="true"], [contenteditable="true"] * {
    -webkit-user-select: text;
    user-select: text;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--brand-primary-dark);
    color: white;
    margin-bottom: 2rem;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

nav a:hover {
    background: #166159;
}

/* User dropdown in nav */
.nav-dropdown {
    display: inline-block;
    position: relative;
    margin-left: 1rem;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.3s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0rem;
    white-space: nowrap;
}

.nav-dropdown-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.25rem 0 0;
    white-space: nowrap;
}

.nav-dropdown-chevron {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0 0.25rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    opacity: 0.8;
}

.nav-dropdown-chevron:hover {
    opacity: 1;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
    background: #166159;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

@media (hover: hover) {
    .nav-dropdown:hover .nav-dropdown-menu {
        display: block;
    }
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--brand-primary-dark);
    text-decoration: none;
    padding: 0.65rem 1rem;
    font-size: 0.93rem;
    margin: 0;
    border-radius: 0;
    transition: background 0.15s;
}

/* Fixed-width icon column so menu item labels line up regardless of each icon's own glyph
   width (e.g. fa-users vs fa-file-lines render at different natural widths). */
.nav-dropdown-menu a > i:first-child,
.nav-dropdown-menu-row .nav-dropdown-menu-link > i:first-child {
    width: 1.1rem;
    flex-shrink: 0;
    text-align: center;
}

.nav-dropdown-menu a:hover {
    background: #f0f4f8;
}

/* Row that hosts a nav-dropdown link alongside a separately-clickable badge
   (e.g. "Other Courses" + pending certificate-review count) — mirrors
   .nav-dropdown-menu a's padding/hover so it reads as one menu row. */
.nav-dropdown-menu-row {
    display: flex;
    align-items: center;
    padding: 0;
    transition: background 0.15s;
}

.nav-dropdown-menu-row:hover {
    background: #f0f4f8;
}

.nav-dropdown-menu-row .nav-dropdown-menu-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--brand-primary-dark);
    text-decoration: none;
    padding: 0.65rem 1rem;
    font-size: 0.93rem;
    min-width: 0;
}

.nav-dropdown-menu-row .nav-badge-link {
    background: var(--brand-danger);
    color: white;
    padding: 0.15rem 0.45rem;
    border-radius: 12px;
    font-size: 0.75rem;
    text-decoration: none;
    margin-right: 1rem;
    flex-shrink: 0;
}

.nav-dropdown-menu-row .nav-badge-link:hover {
    background: var(--brand-danger-dark);
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--brand-primary);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    transition: background 0.3s;
}

.btn:hover {
    background: #166159;
}

.btn-danger {
    background: var(--brand-danger);
}

.btn-danger:hover {
    background: var(--brand-danger-dark);
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee;
    color: var(--brand-danger);
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
}

.dashboard-card h3 {
    color: var(--brand-primary-dark);
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    color: #7f8c8d;
}

.btn-small {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--brand-primary);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.6;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #166159;
}

/* Disabled button appearance: dim + not-allowed cursor for clarity */
button[disabled],
.btn[disabled],
.btn:disabled,
button.btn:disabled,
.btn-small[disabled],
.btn-login[disabled],
.btn-submit[disabled],
.submit-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(20%);
}

/* client edit tabs */
.ce-tab {
    background: none;
    border: none;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    cursor: pointer;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.15s;
}

.ce-tab:hover { color: var(--brand-primary); }

.ce-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    font-weight: 600;
}

.ce-panel { display: none; }
.ce-panel.active { display: block; }

/* Responsive YouTube iframes within dashboard/course views */
.dashboard-card iframe.youtube-embed,
.dashboard-card iframe[src*="youtube.com"] {
    width: 100% !important;
    max-width: 720px;
    aspect-ratio: 16/9;
    min-height: clamp(160px, 25vw, 360px);
    display: block;
    border: 0;
}

/* Ensure other media inside cards don't overflow */
.dashboard-card img,
.dashboard-card video,
.dashboard-card embed,
.dashboard-card object {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Page-level tabs that overlap the top edge of a card */
.page-tabs {
    display: inline-flex;
    gap: 0.25rem;
    background: #fff;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.page-tabs .ce-tab {
    padding: 0.45rem 0.9rem;
    background: transparent;
    border-radius: 6px;
    color: #6c757d;
}
.page-tabs .ce-tab.active {
    color: var(--brand-primary);
    font-weight: 600;
}


