:root {
    --surface: #ffffff;
    --ink: #17202a;
    --muted: #687385;
    --line: #dfe5ed;
    --brand: #2364aa;
    --page: #f6f8fb;
}

body {
    background: var(--page);
    color: var(--ink);
}

body.compact-mode {
    font-size: 0.8rem;
}

.navbar-brand {
    letter-spacing: 0;
}

.auth-card,
.metric,
.uat-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(31, 45, 61, 0.06);
}

.auth-card {
    max-width: 460px;
    padding: 1.5rem;
}

.metric {
    padding: 1.25rem;
}

.metric span {
    display: block;
    color: var(--muted);
}

.metric strong {
    display: block;
    font-size: 2rem;
}

.compact-mode .metric {
    padding: 0.85rem;
}

.compact-mode .metric strong {
    font-size: 1.45rem;
}

.uat-shell {
    display: grid;
    gap: 22px;
}

.compact-mode .uat-shell {
    gap: 14px;
}

.uat-hero,
.uat-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.compact-mode .uat-hero,
.compact-mode .uat-titlebar {
    padding: 14px 16px;
}

.compact-mode .uat-titlebar h1,
.compact-mode .uat-hero h1 {
    font-size: 1.35rem;
}

.uat-hero {
    background: linear-gradient(135deg, #132238 0%, #2364aa 58%, #2a9d8f 100%);
    color: #ffffff;
}

.uat-hero h1,
.uat-titlebar h1,
.uat-panel h2 {
    margin: 0;
    letter-spacing: 0;
}

.uat-hero p,
.uat-titlebar p,
.uat-panel-head p {
    margin: 4px 0 0;
    color: inherit;
    opacity: 0.72;
}

.uat-titlebar p,
.uat-panel-head p {
    color: var(--muted);
    opacity: 1;
}

.uat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.uat-grid-two,
.uat-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

.uat-detail-grid {
    align-items: start;
}

.uat-panel {
    overflow: hidden;
}

.uat-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}

.compact-mode .uat-panel-head {
    padding: 10px 12px;
}

.uat-panel h2 {
    font-size: 1.12rem;
}

.compact-mode .uat-panel h2 {
    font-size: 1rem;
}

.uat-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.compact-mode .uat-metrics {
    gap: 8px;
}

.uat-project-list {
    display: grid;
}

.uat-project-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(120px, .7fr) minmax(120px, .55fr);
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #edf1f5;
    color: inherit;
    text-decoration: none;
}

.compact-mode .uat-project-row {
    gap: 10px;
    padding: 10px 12px;
}

.uat-project-row:last-child {
    border-bottom: 0;
}

.uat-project-row small,
.uat-attachment small,
.uat-timeline span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.uat-progress {
    height: 10px;
    background: #e8edf3;
    border-radius: 999px;
    overflow: hidden;
}

.uat-progress i {
    display: block;
    height: 100%;
    background: #2a9d8f;
}

.uat-link-line {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.uat-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.uat-form-grid,
.uat-update-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.compact-mode .uat-form-grid,
.compact-mode .uat-update-form {
    gap: 10px;
}

.uat-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(130px, 0.8fr)) auto;
    gap: 10px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.uat-table-wrap {
    padding: 0 22px 18px;
}

.uat-table-wrap .table {
    margin-bottom: 0;
}

.compact-mode .uat-filters {
    gap: 8px;
    padding: 8px 12px;
}

.compact-mode .uat-table-wrap {
    padding: 0 14px 12px;
}

.uat-result-table th:first-child,
.uat-result-table td:first-child {
    padding-left: 0.7rem;
}

.uat-result-table th:last-child,
.uat-result-table td:last-child {
    padding-right: 0.7rem;
}

.uat-update-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.compact-mode .uat-update-form {
    padding: 12px;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.uat-detail-list {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 0;
    margin: 0;
}

.uat-detail-list dt,
.uat-detail-list dd {
    padding: 14px 20px;
    border-bottom: 1px solid #edf1f5;
}

.compact-mode .uat-detail-list dt,
.compact-mode .uat-detail-list dd {
    padding: 8px 12px;
}

.uat-detail-list dt {
    color: var(--muted);
}

.uat-detail-list dd {
    margin: 0;
}

.uat-attachment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.uat-attachment {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.uat-attachment img,
.uat-attachment span {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px;
    background: #eef2f7;
}

.uat-attachment span {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
}

.uat-attachment strong {
    overflow-wrap: anywhere;
}

.uat-timeline {
    display: grid;
}

.uat-timeline article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #edf1f5;
}

.compact-mode .uat-timeline article {
    padding: 10px 12px;
}

.compact-mode .table {
    font-size: 0.76rem;
    line-height: 1.22;
}

.compact-mode .table > :not(caption) > * > * {
    padding: 0.22rem 0.32rem;
}

.compact-mode .badge {
    font-size: 0.66rem;
    padding: 0.22em 0.42em;
}

.compact-mode .form-control,
.compact-mode .form-select,
.compact-mode .btn {
    font-size: 0.78rem;
    padding-top: 0.22rem;
    padding-bottom: 0.22rem;
}

.compact-mode .navbar {
    --bs-navbar-padding-y: 0.28rem;
}

.compact-mode main {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.compact-mode .container {
    max-width: 98%;
}

.compact-mode .modal-body,
.compact-mode .modal-header,
.compact-mode .modal-footer {
    padding: 0.75rem;
}

.compact-mode textarea.form-control {
    min-height: 58px;
}

.uat-timeline article:last-child {
    border-bottom: 0;
}

.uat-timeline p {
    grid-column: 1 / -1;
    margin: 0;
}

@media (max-width: 1000px) {
    .uat-grid-two,
    .uat-detail-grid,
    .uat-project-row {
        grid-template-columns: 1fr;
    }

    .uat-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .uat-hero,
    .uat-titlebar,
    .uat-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .uat-form-grid,
    .uat-update-form,
    .uat-filters,
    .uat-attachment-grid,
    .uat-detail-list {
        grid-template-columns: 1fr;
    }

    .span-2,
    .span-3 {
        grid-column: span 1;
    }
}
