/* Estilos base de Trabia 360. Los colores cumplen contraste AA (4,5:1) sobre su fondo. */
:root {
    --t360-ink: #1b2430;
    --t360-ink-soft: #4a5565;
    --t360-surface: #ffffff;
    --t360-surface-alt: #f3f5f8;
    --t360-line: #c9d1dc;
    --t360-brand: #0b4a8f;
    --t360-brand-ink: #ffffff;
    --t360-focus: #b35c00;
    --t360-danger-surface: #fdecea;
    --t360-danger-ink: #8a1c13;
    --t360-warning-surface: #7a3e00;
    --t360-warning-ink: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

body {
    margin: 0;
    color: var(--t360-ink);
    background: var(--t360-surface-alt);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    margin: 0 0 1rem;
}

h2 {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 1.5rem 0 0.5rem;
}

a {
    color: var(--t360-brand);
}

:focus-visible {
    outline: 3px solid var(--t360-focus);
    outline-offset: 2px;
}

main:focus {
    outline: none;
}

.t360-skip {
    position: absolute;
    left: 0.5rem;
    top: -4rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--t360-surface);
    color: var(--t360-brand);
    border: 2px solid var(--t360-brand);
    border-radius: 0.25rem;
}

.t360-skip:focus {
    top: 0.5rem;
}

.t360-impersonation {
    padding: 0.75rem 1rem;
    background: var(--t360-warning-surface);
    color: var(--t360-warning-ink);
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.t360-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    background: var(--t360-brand);
    color: var(--t360-brand-ink);
}

.t360-brand {
    font-size: 1.125rem;
    font-weight: 700;
}

.t360-user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.t360-body {
    display: flex;
    flex-direction: column;
}

.t360-nav {
    background: var(--t360-surface);
    border-bottom: 1px solid var(--t360-line);
}

.t360-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0.5rem;
}

.t360-nav a {
    display: block;
    min-height: 2.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.25rem;
    color: var(--t360-ink);
    text-decoration: none;
}

.t360-nav a:hover {
    background: var(--t360-surface-alt);
}

.t360-nav a.active {
    background: var(--t360-brand);
    color: var(--t360-brand-ink);
}

main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 1rem 3rem;
}

.t360-card {
    background: var(--t360-surface);
    border: 1px solid var(--t360-line);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    max-width: 48rem;
}

.t360-button,
.t360-header-button {
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font: inherit;
    cursor: pointer;
}

.t360-button {
    background: var(--t360-brand);
    color: var(--t360-brand-ink);
    border: 2px solid var(--t360-brand);
    text-decoration: none;
    display: inline-block;
}

.t360-header-button {
    background: transparent;
    color: var(--t360-brand-ink);
    border: 2px solid var(--t360-brand-ink);
}

.t360-problem {
    background: var(--t360-danger-surface);
    color: var(--t360-danger-ink);
    border: 1px solid var(--t360-danger-ink);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    max-width: 48rem;
}

.t360-problem h2 {
    margin-top: 0;
}

.t360-problem a {
    color: var(--t360-danger-ink);
}

.t360-problem-reference {
    font-size: 0.875rem;
}

.t360-loading {
    color: var(--t360-ink-soft);
}

.t360-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem 1.5rem;
    margin: 0;
}

.t360-details dt {
    font-weight: 600;
    color: var(--t360-ink-soft);
}

.t360-details dd {
    margin: 0 0 0.75rem;
    overflow-wrap: anywhere;
}

.t360-list {
    margin: 0;
    padding-left: 1.25rem;
}

.t360-standalone {
    max-width: 40rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.t360-button-secondary {
    background: var(--t360-surface);
    color: var(--t360-brand);
}

.t360-button-danger {
    background: var(--t360-danger-ink);
    border-color: var(--t360-danger-ink);
    color: #ffffff;
}

.t360-button:disabled {
    opacity: 1;
    background: var(--t360-surface-alt);
    border-color: var(--t360-line);
    color: var(--t360-ink-soft);
    cursor: not-allowed;
}

.t360-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.t360-confirm {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.t360-section {
    margin-bottom: 1.5rem;
}

.t360-table-wrapper {
    overflow-x: auto;
    background: var(--t360-surface);
    border: 1px solid var(--t360-line);
    border-radius: 0.5rem;
}

.t360-table {
    border-collapse: collapse;
    width: 100%;
}

.t360-table caption {
    text-align: left;
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.t360-table th,
.t360-table td {
    text-align: left;
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--t360-line);
    vertical-align: top;
}

.t360-table th {
    color: var(--t360-ink-soft);
    white-space: nowrap;
}

.t360-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border: 1px solid var(--t360-ink-soft);
    border-radius: 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.t360-form {
    display: grid;
    gap: 1rem;
    max-width: 32rem;
}

.t360-field {
    display: grid;
    gap: 0.25rem;
}

.t360-field label {
    font-weight: 600;
}

.t360-field input,
.t360-field select,
.t360-field textarea {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--t360-ink-soft);
    border-radius: 0.25rem;
    font: inherit;
    color: var(--t360-ink);
    background: var(--t360-surface);
    width: 100%;
}

.t360-fieldset {
    border: 1px solid var(--t360-line);
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    margin: 0;
    display: grid;
    gap: 0.25rem;
}

.t360-fieldset legend {
    font-weight: 600;
    padding: 0 0.25rem;
}

.t360-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
}

.t360-check input {
    width: 1.25rem;
    height: 1.25rem;
}

.t360-field-error {
    display: grid;
    gap: 0.125rem;
    color: var(--t360-danger-ink);
    font-size: 0.875rem;
    font-weight: 600;
}

.t360-field [aria-invalid="true"] {
    border-color: var(--t360-danger-ink);
    border-width: 2px;
}

.t360-pager-status {
    align-self: center;
}

.t360-hint {
    font-size: 0.875rem;
    color: var(--t360-ink-soft);
}

.t360-notice {
    background: var(--t360-surface);
    border: 1px solid var(--t360-brand);
    border-left-width: 0.375rem;
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    max-width: 48rem;
    overflow-wrap: anywhere;
}

.t360-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.t360-metrics li {
    background: var(--t360-surface);
    border: 1px solid var(--t360-line);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    min-width: 8rem;
}

.t360-metrics strong {
    display: block;
    font-size: 1.5rem;
}

@media (min-width: 48rem) {
    .t360-body {
        flex-direction: row;
        min-height: calc(100vh - 3.5rem);
    }

    .t360-nav {
        width: 15rem;
        flex: none;
        border-bottom: 0;
        border-right: 1px solid var(--t360-line);
    }

    .t360-nav ul {
        flex-direction: column;
    }

    main {
        padding: 2rem;
    }

    .t360-details {
        grid-template-columns: 12rem 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
