:root {
    --app-primary: initial;
    --app-secondary: initial;
    --app-accent: initial;
    --app-bg: initial;
    --app-surface: initial;
    --app-text: initial;
    --app-muted: initial;
    --app-border: initial;
    --app-sidebar-bg: initial;
    --app-sidebar-text: initial;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    background: var(--app-sidebar-bg);
    color: var(--app-sidebar-text);
    min-height: 100vh;
    width: 270px;
}

.app-sidebar a {
    border-radius: 6px;
    color: var(--app-sidebar-text);
    display: block;
    padding: .65rem .85rem;
    text-decoration: none;
}

.app-sidebar a:hover,
.app-sidebar a.active {
    background: rgba(255, 255, 255, .12);
}

.app-logo {
    max-height: 46px;
    max-width: 180px;
    object-fit: contain;
}

.app-content {
    min-width: 0;
}

.app-header {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
}

.app-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
}

.app-footer {
    color: var(--app-muted);
    font-size: .875rem;
}

.dashboard-filter {
    min-width: min(100%, 520px);
}

.dashboard-kpi .display-6 {
    line-height: 1;
}

.dashboard-table {
    max-height: 620px;
}

.dashboard-table th {
    white-space: nowrap;
}

.dashboard-metric-row {
    align-items: center;
    border-bottom: 1px solid var(--app-border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .6rem 0;
}

.dashboard-metric-row:last-child {
    border-bottom: 0;
}

.courses-table {
    max-height: 680px;
}

.courses-table th {
    white-space: nowrap;
}

.courses-table th a {
    color: inherit;
    text-decoration: none;
}

.courses-teachers {
    max-width: 280px;
}

.courses-url {
    max-width: 320px;
}

.courses-url code {
    display: inline-block;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.courses-detail-row {
    align-items: baseline;
    border-bottom: 1px solid var(--app-border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .55rem 0;
}

.courses-detail-row:last-child {
    border-bottom: 0;
}

.students-table {
    max-height: 680px;
}

.students-table th {
    white-space: nowrap;
}

.students-table th a {
    color: inherit;
    text-decoration: none;
}

.students-url {
    max-width: 340px;
}

.students-url code {
    display: inline-block;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.teachers-table,
.categories-table {
    max-height: 680px;
}

.teachers-table th,
.categories-table th {
    white-space: nowrap;
}

.teachers-table th a,
.categories-table th a {
    color: inherit;
    text-decoration: none;
}

.teachers-courses {
    max-width: 520px;
}

.reports-table {
    max-height: 680px;
}

.reports-table th {
    white-space: nowrap;
}

.reports-table th a {
    color: inherit;
    text-decoration: none;
}

.reports-url {
    display: inline-block;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.exports-notes {
    padding-left: 1rem;
}

.exports-notes li {
    margin-bottom: .5rem;
}

.admin-users-table th {
    white-space: nowrap;
}

.admin-actions {
    min-width: 360px;
}

.admin-actions form {
    display: inline-flex;
    gap: .35rem;
    margin: .15rem 0;
    vertical-align: middle;
}

.admin-password-input {
    width: 170px;
}

.admin-scope-select {
    min-height: 260px;
}

.audit-table th {
    white-space: nowrap;
}

.audit-context {
    display: inline-block;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.settings-grid {
    display: grid;
    gap: 1rem;
}

.settings-color {
    min-width: 100%;
}

.settings-connection {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 1rem;
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block !important;
    }

    .app-sidebar {
        min-height: auto;
        width: 100%;
    }
}
