:root {
    --bg: #f6f7f5;
    --panel: #ffffff;
    --text: #1d252b;
    --muted: #6f7b82;
    --line: #dde3e2;
    --brand: #006aa6;
    --brand-dark: #004d79;
    --energy: #f4a51c;
    --green: #77a928;
    --ok: #2f7d48;
    --warn: #9a6200;
    --shadow: 0 14px 34px rgba(29, 37, 43, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

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

a:hover {
    text-decoration: underline;
}

.topbar {
    align-items: center;
    background: #fff;
    border-bottom: 4px solid var(--energy);
    box-shadow: 0 2px 20px rgba(29, 37, 43, 0.08);
    color: var(--text);
    display: flex;
    justify-content: space-between;
    min-height: 78px;
    padding: 0 34px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    color: var(--text);
    display: grid;
    gap: 0;
    line-height: 1;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    align-items: baseline;
    display: flex;
    font-size: 25px;
    font-weight: 800;
    gap: 8px;
    letter-spacing: 0;
}

.brand-mark em {
    color: var(--energy);
    font-style: normal;
    font-weight: 800;
}

.brand-mark::after {
    background: var(--brand);
    content: "";
    display: block;
    height: 4px;
    margin-top: 8px;
    width: 118px;
}

.brand-subline {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin-top: 8px;
    text-transform: uppercase;
}

.nav {
    align-items: center;
    display: flex;
    gap: 8px;
}

.nav a {
    border-radius: 4px;
    color: var(--text);
    font-weight: 700;
    padding: 10px 12px;
}

.nav a:hover {
    background: #eef5f8;
    color: var(--brand);
    text-decoration: none;
}

.nav span {
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-weight: 700;
    margin-left: 6px;
    padding-left: 14px;
}

.page {
    margin: 0 auto;
    max-width: 1280px;
    padding: 34px 28px;
}

.site-footer {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    padding: 0 28px 28px;
    text-align: center;
}

.section,
.login-box,
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    padding: 24px;
}

.login-box {
    border-top: 5px solid var(--brand);
    margin: 90px auto;
    max-width: 440px;
}

h1,
h2 {
    margin: 0 0 16px;
}

h1 {
    font-size: 28px;
    font-weight: 800;
}

h2 {
    font-size: 18px;
    font-weight: 800;
}

.headline {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.headline p {
    color: var(--muted);
    margin: -8px 0 0;
}

.form label,
.filters label {
    color: var(--muted);
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 106, 166, 0.12);
    outline: none;
}

textarea {
    resize: vertical;
}

button,
.button {
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 700;
    padding: 10px 14px;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.secondary {
    background: #fff;
    color: var(--brand);
}

.secondary:hover {
    background: #eef4f9;
}

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

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

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    margin-bottom: 18px;
}

.field-checks {
    margin: 7px 0 0;
}

.checks label {
    align-items: center;
    color: var(--text);
    display: flex;
    font-weight: 700;
    gap: 8px;
}

.checks input {
    width: auto;
}

.image-upload {
    display: grid;
    gap: 14px;
}

.project-image-preview {
    border: 1px solid var(--line);
    border-radius: 4px;
    display: block;
    overflow: hidden;
}

.project-image-preview img {
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    width: 100%;
}

.project-gallery {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.project-gallery-item {
    display: grid;
    gap: 8px;
}

.mobile-image-slots {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.remove-image-option {
    align-items: center;
    color: var(--text);
    display: flex;
    font-weight: 700;
    gap: 8px;
}

.remove-image-option input {
    width: auto;
}

.help-text {
    color: var(--muted);
    font-size: 13px;
    margin: -6px 0 0;
}

.filters {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(240px, 1fr) 180px 170px 210px auto;
    margin-top: 18px;
}

.stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 20px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 5px solid var(--brand);
    border-radius: 4px;
    color: var(--text);
    display: grid;
    gap: 6px;
    padding: 14px;
}

.stat:hover {
    background: #f3f8fb;
    text-decoration: none;
}

.stat span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat strong {
    font-size: 26px;
}

.muted-stat {
    border-left-color: var(--green);
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.delete-project-form {
    margin: -14px 0 30px;
}

.danger-button {
    background: #a33125;
    border-color: #a33125;
}

.danger-button:hover {
    background: #84261d;
}

.calendar-export-link {
    color: var(--brand);
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    margin-top: 8px;
}

.calendar-date-link {
    color: var(--brand);
    font-weight: 800;
}

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

table {
    border-collapse: collapse;
    min-width: 1080px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 15px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f0f4f4;
    color: #344148;
    font-size: 13px;
    text-transform: uppercase;
}

.date-cell {
    white-space: nowrap;
}

tbody tr:hover {
    background: #fafcfb;
}

.project-thumb {
    border: 1px solid var(--line);
    border-radius: 4px;
    display: block;
    height: 52px;
    overflow: hidden;
    position: relative;
    width: 70px;
}

.project-thumb img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.project-thumb span {
    background: rgba(0, 77, 121, 0.9);
    border-radius: 999px;
    bottom: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 4px 6px;
    position: absolute;
    right: 4px;
}

.project-name-link {
    color: var(--text);
    font-weight: 800;
}

.project-name-link:hover {
    color: var(--brand);
}

.pill {
    background: #fff3d6;
    border-radius: 999px;
    color: var(--warn);
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px;
}

.pill.success {
    background: #e7f4ea;
    color: var(--ok);
}

.pill.muted {
    background: #eef1f0;
    color: var(--muted);
}

.alert {
    background: #fdecec;
    border: 1px solid #f3b4b4;
    border-radius: 4px;
    color: #8a1f1f;
    padding: 12px 14px;
}

.notice {
    background: #e5f5ed;
    border: 1px solid #9fd2b8;
    border-radius: 4px;
    color: var(--ok);
    padding: 12px 14px;
}

.compact {
    margin: 16px 0 0;
}

.inline-form {
    margin: 0;
}

.user-actions {
    display: grid;
    gap: 10px;
    min-width: 260px;
}

.password-reset-form {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(150px, 1fr) auto;
}

.password-reset-form input {
    padding: 8px 10px;
}

.link-button {
    background: transparent;
    border: 0;
    color: var(--brand);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
}

.link-button:hover {
    background: transparent;
    text-decoration: underline;
}

.danger-link {
    color: #a33125;
}

.empty {
    color: var(--muted);
    padding: 28px;
    text-align: center;
}

.muted-text {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 760px) {
    .topbar,
    .headline {
        align-items: flex-start;
        flex-direction: column;
        padding-bottom: 16px;
        padding-top: 16px;
    }

    .nav {
        flex-wrap: wrap;
    }

    .page {
        padding: 16px;
    }

    .grid,
    .filters,
    .stats,
    .mobile-image-slots {
        grid-template-columns: 1fr;
    }

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

}
