:root {
    --tc11-navy: #0f2747;
    --tc11-blue: #1f5ea8;
    --tc11-blue-soft: #eaf2fb;
    --tc11-orange: #f28c28;
    --tc11-orange-soft: #fff3e6;
    --tc11-sand: #f7f4ef;
    --tc11-ink: #1f2937;
    --tc11-muted: #64748b;
    --tc11-border: #d8e1eb;
    --tc11-success: #2e8b57;
    --tc11-danger: #b64242;
    --tc11-shadow: 0 14px 30px rgba(15, 39, 71, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--tc11-ink);
    background: linear-gradient(180deg, #f7fbff 0%, var(--tc11-sand) 100%);
    line-height: 1.5;
}

a {
    color: var(--tc11-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: linear-gradient(135deg, var(--tc11-navy), #173a68 70%, var(--tc11-blue));
    color: white;
    padding: 1.4rem 0 1.8rem;
    box-shadow: var(--tc11-shadow);
}

.site-header.compact {
    padding-bottom: 1.2rem;
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.brand {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.brand h1,
.brand p {
    margin: 0;
}

.eyebrow {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.35rem;
}

.header-actions,
.nav-links,
.stack,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.nav-links {
    margin-top: 1rem;
}

.content {
    flex: 1;
    padding: 2rem 0 2.5rem;
}

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

.grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.hero-card,
.auth-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--tc11-border);
    border-radius: 20px;
    box-shadow: var(--tc11-shadow);
}

.card,
.hero-card {
    padding: 1.25rem;
}

.hero-card {
    padding: 1.4rem;
}

.auth-card {
    padding: 1.5rem;
}

.metric-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--tc11-navy);
}

.metric-card-link {
    color: inherit;
    display: block;
}

.metric-card-link:hover {
    text-decoration: none;
}

.metric-card-link .card {
    height: 100%;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.metric-card-link:hover .card,
.metric-card-link:focus-visible .card {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(15, 39, 71, 0.12);
}

.muted {
    color: var(--tc11-muted);
}

.pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pill {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.status-pill {
    background: var(--tc11-blue-soft);
    color: var(--tc11-blue);
}

.status-pill.success {
    background: rgba(46, 139, 87, 0.14);
    color: var(--tc11-success);
}

.status-pill.warning {
    background: var(--tc11-orange-soft);
    color: #9a5b15;
}

.status-pill.neutral {
    background: #eef2f7;
    color: #516276;
}

.button,
button,
input,
select {
    font: inherit;
}

.button,
button {
    border: none;
    border-radius: 999px;
    padding: 0.72rem 1.15rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--tc11-orange);
    color: white;
    box-shadow: 0 10px 18px rgba(242, 140, 40, 0.18);
}

.button.secondary,
button.secondary {
    background: white;
    color: var(--tc11-blue);
    border: 1px solid var(--tc11-border);
    box-shadow: none;
}

.button.danger,
button.danger {
    background: var(--tc11-danger);
    box-shadow: none;
}

.button.small,
button.small {
    padding: 0.45rem 0.9rem;
    font-size: 0.92rem;
}

form.inline {
    display: inline;
}

label {
    display: block;
    font-weight: 600;
    color: var(--tc11-navy);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--tc11-border);
    background: #fff;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.table-card {
    overflow: hidden;
}

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

th,
td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--tc11-border);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tc11-muted);
    background: #f8fbff;
}

th a {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

th a:hover {
    color: var(--tc11-navy);
    text-decoration: none;
}

th.sort-active {
    color: var(--tc11-navy);
}

th.sort-active a {
    color: var(--tc11-navy);
}

tbody tr:hover {
    background: rgba(31, 94, 168, 0.03);
}

@keyframes tc11-row-flash {
    0%   { background: rgba(31, 94, 168, 0.12); }
    100% { background: transparent; }
}

tr.row-highlight {
    animation: tc11-row-flash 1.2s ease-out forwards;
}

.table-actions {
    white-space: nowrap;
}

.alert {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid transparent;
}

.alert.warning {
    background: var(--tc11-orange-soft);
    border-color: rgba(242, 140, 40, 0.25);
}

.alert.info {
    background: var(--tc11-blue-soft);
    border-color: rgba(31, 94, 168, 0.18);
}

.alert.error {
    background: #fff0f0;
    border-color: rgba(182, 66, 66, 0.2);
    color: var(--tc11-danger);
}

.field-list {
    display: grid;
    gap: 0.7rem;
}

.field-list p {
    margin: 0;
}

.inline-levels {
    min-width: 180px;
}

.inline-levels-read {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.inline-levels-edit {
    gap: 0.45rem;
}

.inline-levels [hidden] {
    display: none !important;
}

.inline-levels-edit .inline-actions {
    gap: 0.45rem;
}

.inline-links {
    min-width: 250px;
}

.inline-links-read {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.inline-link-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.inline-link-summary .muted {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inline-links-edit {
    display: grid;
    gap: 0.45rem;
}

.inline-links [hidden] {
    display: none !important;
}

.link-box {
    display: grid;
    gap: 0.75rem;
}

.copy-row {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.copy-row input {
    margin: 0;
}

.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--tc11-navy);
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 0 1.4rem;
}

.footer a {
    color: white;
}

.list-reset {
    margin: 0;
    padding-left: 1.1rem;
}

@media (max-width: 720px) {
    .container {
        width: min(100% - 1rem, 1180px);
    }

    .brand {
        flex-direction: column;
    }

    .copy-row {
        flex-direction: column;
        align-items: stretch;
    }

    th,
    td {
        padding: 0.75rem;
    }
}
