/* Panel chrome on top of Pico. Keep later screens on this layout. */

:root {
    --app-header-height: 3.5rem;
}

body.layout-login {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-shell {
    width: 100%;
    max-width: 28rem;
}

.login-card {
    margin: 0;
}

.login-card h1 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.login-card header p {
    margin-bottom: 0;
    color: var(--pico-muted-color, #596b7a);
}

body.layout-app {
    min-height: 100vh;
    margin: 0;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--app-header-height);
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--pico-muted-border-color, #d1d5db);
}

.app-brand {
    font-weight: 600;
    text-decoration: none;
}

.app-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.app-user form {
    display: inline;
    margin: 0;
}

button.app-logout,
.app-logout {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.app-nav a {
    text-decoration: none;
}

.app-main {
    padding: 1.25rem;
    max-width: 72rem;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-header h1 {
    margin: 0;
}

.empty-state {
    color: var(--pico-muted-color, #596b7a);
}

.table-wrap {
    overflow-x: auto;
}

.table-actions,
.form-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.table-actions form,
.form-secondary-actions form {
    display: inline;
    margin: 0;
}

.table-actions button,
.form-secondary-actions button {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    width: auto;
}

.table-actions .danger,
.form-secondary-actions .danger,
a.danger {
    color: var(--pico-del-color, #b91c1c);
}

.badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    background: var(--pico-muted-border-color, #d1d5db);
}

.badge-ok {
    background: #d1fae5;
}

.badge-warning {
    background: #fef3c7;
}

.form-secondary-actions {
    margin-top: 1.5rem;
}

.generated-password {
    display: block;
    font-size: 1.1rem;
    word-break: break-all;
    margin: 1rem 0;
}

.audit-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.audit-filters .filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.audit-logs-updated {
    color: var(--pico-muted-color, #596b7a);
    font-size: 0.9rem;
    min-height: 1.25rem;
}

.audit-logs-updated.is-stale {
    color: var(--pico-del-color, #b91c1c);
}

.audit-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-user {
        width: 100%;
        justify-content: space-between;
    }
}
