
:root {
    --bg-soft: #eef2f5;
    --bg-accent: #dde7ef;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text-main: #122338;
    --text-muted: #4b6377;
    --primary: #0e5a8a;
    --primary-strong: #0a4468;
    --line: #ccd8e4;
    --danger: #b61f2d;
    --shadow: 0 16px 36px rgba(18, 35, 56, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body,
#root {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text-main);
    font-family: "IBM Plex Sans", "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 8%, var(--bg-accent) 0%, rgba(221, 231, 239, 0) 42%),
        radial-gradient(circle at 90% 20%, #e8f3ee 0%, rgba(232, 243, 238, 0) 38%),
        linear-gradient(180deg, #f6f8fa 0%, var(--bg-soft) 100%);
    animation: pageFadeIn 240ms ease-out;
}

main {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto 2rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 16px;
}

h1 {
    margin-top: 0;
    font-size: 26px;
}

h2 {
    margin: 0 0 0.85rem;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 700;
}

.used-in {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.55rem;
    align-items: baseline;
}

.used-in-row {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 0.3rem 0.55rem;
    align-items: baseline;
}

.used-in-label {
    color: var(--text-muted);
    font-weight: 600;
}

.used-in-value {
    color: var(--primary-strong);
    font-weight: 700;
}

.used-in-field {
    padding-left: 0.55rem;
    border-left: 1px solid var(--line);
}

p {
    color: var(--text-main);
}

form {
    margin: 0;
    margin-bottom: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: flex-start;
}

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

textarea,
input,
select {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-main);
}

textarea {
    width: min(820px, 100%);
    min-height: 6.75rem;
    padding: 0.75rem;
    resize: vertical;
    line-height: 1.4;
}

input {
    min-height: 2.2rem;
    padding: 0.35rem 0.55rem;
}

input[type="text"] {
    width: 8.25rem;
    text-align: center;
    font-weight: 600;
}

input[type="file"] {
    max-width: 100%;
    min-height: 2.45rem;
    padding: 0.35rem;
    text-align: left;
}

input[type="checkbox"] {
    width: 1rem;
    min-height: 1rem;
    margin-top: 0.6rem;
    accent-color: var(--primary);
}

button {
    min-height: 2.2rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--primary);
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
    cursor: pointer;
    transition: transform 130ms ease, filter 130ms ease;
}

button:hover:not(:disabled) {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

section {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
}

details {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line);
}

summary {
    cursor: pointer;
    color: var(--primary-strong);
    font-weight: 600;
}

nav {
    width: min(1180px, calc(100% - 2rem));
    margin: 1.3rem auto 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

nav a,
nav button {
    margin: 0;
    min-height: 2.3rem;
    border-radius: 999px;
    padding: 0.4rem 1rem;
    border: 1px solid #b3c2cf;
    background: #f6f8fa;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

nav a:hover,
nav button:hover {
    text-decoration: none;
    background: #ebf1f6;
}

nav a.active {
    border-color: var(--primary);
    color: #fff;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.translation-line {
    align-items: flex-start;
}

.translation-line.requires-manual-translation {
    border: 1px solid #d33;
    border-radius: 4px;
    padding: 0.25rem;
}

.requires-manual-translation-icon {
    color: #d33;
    font-size: 0.9rem;
    line-height: 1;
    align-self: center;
}

.override-icon {
    color: var(--primary);
    font-size: 1.05rem;
    line-height: 1;
    align-self: center;
}

.locale-label {
    width: 5.4rem;
    text-align: center;
    letter-spacing: 0.02em;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--primary-strong);
    background: #edf4f9;
}

.locale-label:disabled {
    opacity: 1;
    color: var(--primary-strong);
    -webkit-text-fill-color: var(--primary-strong);
}

.translation-text {
    flex: 1;
    min-width: 320px;
    min-height: 0;
    field-sizing: content;
}

.search-toolbar {
    margin-bottom: 1rem;
}

.search-filters-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.requires-manual-translations-only,
.lookup-exclude-en-gb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.requires-manual-translations-only input[type='checkbox'],
.lookup-exclude-en-gb input[type='checkbox'] {
    width: 1.4rem;
    height: 1.4rem;
    cursor: pointer;
}

.search-locale {
    width: 6rem;
}

.search-filter-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.search-filter-select {
    min-width: 12rem;
    height: 2.4rem;
    padding: 0.3rem 0.6rem;
    font-size: 1rem;
    font-weight: 400;
}

.bulk-locales {
    width: 13rem;
    text-align: left;
}

.page-action {
    margin-top: 0.4rem;
}

.pagination-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

table {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface);
}

th,
td {
    border: 1px solid var(--line);
    padding: 0.5rem 0.6rem;
    text-align: center;
}

thead {
    background: #edf3f8;
}

.error {
    color: var(--danger);
    font-weight: 600;
}

.sign-in-page {
    min-height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.sign-in-panel {
    width: min(640px, 100%);
    padding: 2rem 1.6rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(247, 251, 254, 0.97) 100%);
    box-shadow: var(--shadow);
    text-align: center;
}

.sign-in-panel h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    letter-spacing: 0.01em;
}

.sign-in-panel p {
    margin: 0.7rem 0 1.35rem;
    color: var(--text-muted);
    font-size: 1.08rem;
    font-weight: 600;
}

.sign-in-button {
    min-height: 3rem;
    min-width: 220px;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    font-size: 1.08rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    main {
        width: calc(100% - 1rem);
        padding: 0.9rem;
        border-radius: 10px;
    }

    nav {
        width: calc(100% - 1rem);
    }

    textarea,
    .translation-text {
        min-width: 100%;
        width: 100%;
    }

    .sign-in-panel {
        padding: 1.4rem 1rem;
        border-radius: 12px;
    }

    .sign-in-button {
        min-width: 100%;
    }
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.lookup-banner {
    border: 1px solid #e0b400;
    border-radius: 4px;
    background: #fff8db;
    padding: 0.5rem 0.75rem;
}

/* a full-width row in the flex form, so Search stays below the codes box however narrow the other controls are */
.lookup-search-actions {
    flex-basis: 100%;
    display: flex;
    gap: 0.55rem;
}

/* wide enough for the whole placeholder */
.lookup-filter-input {
    width: 13rem;
}

.lookup-code-count {
    align-self: center;
    white-space: nowrap;
}

.lookup-field {
    margin-top: 0.75rem;
}

.lookup-field-label {
    font-weight: 700;
}

.lookup-line-status {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 0.25rem 0 0.5rem;
}

.lookup-pending-badge {
    border-radius: 999px;
    background: #edf4f9;
    color: var(--primary-strong);
    font-weight: 700;
    padding: 0.1rem 0.6rem;
}

.lookup-hint {
    color: #8a6d00;
    font-size: 0.9rem;
    margin: 0.25rem 0 0.5rem;
}

/* read-only en-GB row: lays out like the editable <form> rows so labels and boxes line up */
.lookup-readonly-line {
    margin-bottom: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: flex-start;
}

.lookup-save-spacer {
    visibility: hidden;
}

/* other locales sit indented under their en-GB line, tinted so they read as its children */
.lookup-other-locales {
    margin: 0 0 0.9rem 1.75rem;
    padding: 0.5rem 0.75rem;
    border-top: none;
    border-left: 3px solid #2a8c82;
    border-radius: 0 8px 8px 0;
    background: #eef7f6;
}

.lookup-other-locales > summary {
    color: #1d6b63;
}

/* set on <html> while a search is fetching; cancel stays clickable */
html.fetching,
html.fetching * {
    cursor: wait;
}

html.fetching .cancel-fetch {
    cursor: pointer;
}
