:root {
    --lsu-purple: #461D7C;
    --lsu-purple-dark: #2f1354;
    --lsu-gold: #FDD023;
    --text-light: #f5f3f8;
    --text-muted: #c7bcdc;
    --card-bg: #ffffff;
    --page-bg: #f6f5f9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--page-bg);
    color: #1f1f1f;
}

/* Landing page */
.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--lsu-purple) 0%, var(--lsu-purple-dark) 100%);
}

.landing-card {
    text-align: center;
    padding: 3rem 3.5rem;
    max-width: 420px;
}

.landing-logo {
    width: 96px;
    height: 96px;
    margin-bottom: 1rem;
}

.wordmark-champs {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--lsu-gold);
}

.tagline {
    color: var(--text-light);
    font-size: 1.05rem;
    margin: 0.75rem 0 2rem;
}

.blurb {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.btn-signin {
    display: inline-block;
    background: var(--lsu-gold);
    color: var(--lsu-purple-dark);
    font-weight: 700;
    text-decoration: none;
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-signin:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Catalog page */
.catalog {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.catalog h1 {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lsu-purple);
    margin-bottom: 1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-top: 3px solid var(--lsu-gold);
}

.card h2 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--lsu-purple-dark);
}

/* Data sources keep the default gold-topped card; apps get a purple top so
   the two catalog kinds are distinguishable at a glance. */
.card-app {
    border-top-color: var(--lsu-purple);
}

/* Team-hub action shortcuts (dashboard/members/upload) are structurally
   different from the catalog listings below them -- give them a tinted,
   borderless treatment instead of the white gold/purple-topped card. */
.action-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.action-card {
    background: #f1edf7;
    border-radius: 10px;
    border-left: 4px solid var(--lsu-purple);
    padding: 1.1rem 1.3rem;
}

.action-card h2 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lsu-purple-dark);
}

.action-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
}

.card-link {
    color: inherit;
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

.card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-title-row h2 {
    flex: 1;
}

.card p {
    margin: 0;
    font-size: 0.88rem;
    color: #555;
}

.badge {
    display: inline-block;
    background: var(--lsu-purple);
    color: var(--lsu-gold);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin: 0.3rem 0 0.5rem;
}

.card-footer {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid #eee;
}

.subsection-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lsu-purple);
    margin: 0 0 0.4rem;
}

.hint {
    font-size: 0.85rem;
    color: #999;
    margin: 0 0 1rem;
}

.dnd-card {
    position: relative;
    cursor: default;
}

.dnd-card[draggable="true"] {
    cursor: grab;
}

.dnd-card.dragging {
    opacity: 0.4;
}

.card-drag-handle {
    position: absolute;
    top: 0.65rem;
    right: 2.15rem;
    color: #bbb;
    font-size: 0.95rem;
    line-height: 1;
}

.card-remove {
    position: absolute;
    top: 0.6rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
}

.card-remove:hover {
    color: #b00020;
}

.card-add-btn {
    display: inline-block;
    margin-top: 0.75rem;
    background: none;
    border: 1px solid var(--lsu-purple);
    color: var(--lsu-purple);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    cursor: pointer;
}

.card-add-btn:hover {
    background: #f1edf7;
}

.label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 0.35rem;
}

.pill {
    display: inline-block;
    background: #f1edf7;
    color: var(--lsu-purple);
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-right: 0.3rem;
}

.empty {
    color: #999;
    font-size: 0.9rem;
}

/* Admin: users */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link-dark {
    color: var(--lsu-purple);
    text-decoration: none;
    font-size: 0.85rem;
}

.nav-link-dark:hover {
    text-decoration: underline;
}

.section-header h1 {
    margin: 0;
}

.btn-primary {
    display: inline-block;
    background: var(--lsu-purple);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--lsu-purple-dark);
}

.reset-form {
    margin-top: 1.5rem;
}

.btn-reset {
    display: inline-block;
    background: none;
    color: var(--lsu-purple);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--lsu-purple);
    cursor: pointer;
}

.btn-reset:hover {
    background: #f1edf7;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.user-table th,
.user-table td {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    border-bottom: 1px solid #eee;
}

.user-table th {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: #999;
}

.user-table tr:last-child td {
    border-bottom: none;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.row-actions a {
    color: var(--lsu-purple);
    text-decoration: none;
    font-size: 0.85rem;
}

.row-actions form {
    margin: 0;
}

.link-danger {
    color: #b3261e;
    text-decoration: none;
    font-size: 0.85rem;
}

.link-danger-btn {
    background: none;
    border: none;
    color: #b3261e;
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.link-danger-btn:hover {
    text-decoration: underline;
}

.btn-danger {
    display: inline-block;
    background: #b3261e;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background: #8f1e17;
}

.user-form {
    max-width: 420px;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #444;
}

.user-form input[type="text"],
.user-form input[type="email"],
.user-form input[type="url"],
.user-form input[type="date"],
.user-form input[type="file"],
.user-form select {
    padding: 0.5rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    font-family: inherit;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem !important;
}

.readonly-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.9rem;
}

.readonly-field .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
    margin: -0.5rem 0 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.form-actions a {
    color: #777;
    text-decoration: none;
    font-size: 0.85rem;
}

.form-error {
    background: #fdecea;
    color: #b3261e;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}


/* Data source preview */
.preview-frame {
    width: 100%;
    height: 80vh;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.preview-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.preview-video {
    max-width: 100%;
    border-radius: 8px;
}

/* API explorer */
.api-output {
    background: #1f1b2e;
    color: #e6e1f2;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 1.5rem;
}

.role-form {
    display: inline;
    margin-left: 0.5rem;
}

.link-btn {
    background: none;
    border: none;
    color: var(--lsu-purple);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.link-btn:hover {
    text-decoration: underline;
}

.catalog-group-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lsu-purple-dark);
    margin: 1.5rem 0 0.75rem;
}

/* ---- Top bar ---- */
/* Replaces the sidebar: once Apps, Data Sources and the team list moved to
   Home, a 220px full-height column existed to hold two links. */
.topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--lsu-purple);
    color: var(--text-light);
    padding: 0 1.5rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex: 0 0 auto;
}

.topbar-logo { width: 30px; height: 30px; }

.topbar-wordmark {
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--lsu-gold);
}

/* Everything after the brand sits right; the identity block is pushed there so
   account controls stay clear of navigation. */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
}

.topbar-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.9;
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
}

.topbar-link:hover { color: var(--lsu-gold); opacity: 1; }

.topbar-link.is-active {
    border-bottom-color: var(--lsu-gold);
    font-weight: 700;
    opacity: 1;
}

.topbar-identity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding-left: 1.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.topbar-user-name {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.topbar-identity:hover .topbar-user-name,
.topbar-identity.is-active .topbar-user-name { color: var(--lsu-gold); }

.topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 28px;
}

.topbar-avatar-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lsu-purple-dark);
    color: var(--lsu-gold);
    font-size: 0.8rem;
    font-weight: 700;
}

.topbar-signout {
    color: var(--text-light);
    text-decoration: none;
    border: 1px solid var(--text-muted);
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
}

.topbar-signout:hover { border-color: var(--lsu-gold); color: var(--lsu-gold); }

.topbar-toggle { display: none; }

.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page title: large and sentence-case so each page announces itself. */
.content .section-header h1,
.content > h1 {
    font-size: 1.7rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--lsu-purple);
    margin: 0 0 1.25rem;
}

/* ---- Narrow screens: stack the bar's links under the brand ---- */
@media (max-width: 720px) {
    .topbar { flex-wrap: wrap; height: auto; padding: 0.75rem 1rem; }
    .topbar-toggle {
        display: inline-block;
        margin-left: auto;
        font-size: 1.4rem;
        background: none;
        border: none;
        color: var(--lsu-gold);
        cursor: pointer;
    }
    .topbar-nav {
        display: none;
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 0 0.25rem;
    }
    body.nav-open .topbar-nav { display: flex; }
    .topbar-identity {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 0.75rem;
        width: 100%;
    }
}

/* ---- Home: one block per team ---- */
.team-block { margin-bottom: 2rem; }

.team-block-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid #e2e0e8;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

.team-block-title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--lsu-purple);
}

.team-block-header .badge { margin: 0; }

/* Managers get a way through to the member list; it sits at the far end so it
   reads as an action on the team rather than part of its name. */
.team-block-action {
    margin-left: auto;
    color: var(--lsu-purple);
    text-decoration: none;
    font-size: 0.85rem;
}

.team-block-action:hover { text-decoration: underline; }

/* Marks a card that leaves CHAMPS. */
.card-external {
    margin-left: 0.3rem;
    font-size: 0.8em;
    color: #999;
}

/* Only the selected app kind's fields show; the other is hidden via [hidden].
   Restates .user-form's column+gap because .form-hint leans on that gap with a
   negative top margin -- in a plain block fieldset it overlaps the field above. */
.kind-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: none;
    margin: 0;
    padding: 0 0 0 1rem;
    border-left: 2px solid #e2e0e8;
}

.kind-fields[hidden] { display: none; }

/* ---- "Add one" placeholder card ---- */
/* Sits as the last cell of a card grid: a dashed outline reads as a slot
   waiting to be filled rather than as another item already there. */
.card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 104px;
    padding: 1.25rem 1.4rem;
    border: 2px dashed #cfc9dd;
    border-radius: 10px;
    background: none;
    box-shadow: none;
    text-decoration: none;
    color: var(--lsu-purple);
}

.card-placeholder:hover {
    border-color: var(--lsu-purple);
    background: #faf8fd;
}

.card-placeholder-plus {
    font-size: 1.6rem;
    line-height: 1;
    font-weight: 300;
}

.card-placeholder-label {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

/* ---- Inline editing (Users page) ---- */
/* Each control is its own form so it can submit on change; they need to sit
   on one line rather than stacking the way .user-form's labels do. */
.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.inline-checkbox {
    font-size: 0.78rem;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
}

.team-chips {
    list-style: none;
    margin: 0 0 0.35rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.team-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
}

.team-chip-name { min-width: 5.5rem; }

/* .row-actions makes the <td> itself a flex container, which takes the cell
   out of the row box -- harmless when every row was one line tall, visibly
   misaligned now that a row grows with the user's team list. */
.user-table td.row-actions {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
}

.user-table td.row-actions a { margin-right: 0.75rem; }

/* ---- Avatars ---- */
.profile-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 72px;
}

.profile-avatar-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1edf7;
    color: var(--lsu-purple);
    font-size: 1.75rem;
    font-weight: 700;
}
