:root {
    --page: #f4f7f5;
    --surface: #ffffff;
    --surface-soft: #eef4f1;
    --text: #172126;
    --muted: #687782;
    --line: #dce5e1;
    --accent: #0f766e;
    --accent-strong: #0a5d56;
    --accent-soft: #e4f2ee;
    --gold: #b8934b;
    --danger-bg: #fff1f2;
    --danger-text: #9f1239;
    --shadow: 0 18px 50px rgba(23, 33, 38, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(184, 147, 75, 0.08) 46%, transparent 46%),
        var(--page);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

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

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 7px;
    padding: 0 18px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover,
.button:hover {
    background: var(--accent-strong);
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.18);
    transform: translateY(-1px);
}

.button.secondary {
    background: var(--accent-soft);
    color: var(--accent-strong);
    box-shadow: none;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 clamp(18px, 4vw, 42px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 850;
    letter-spacing: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    background: var(--text);
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
}

.topbar-actions span {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-button {
    min-height: auto;
    padding: 0;
    background: transparent;
    color: var(--accent);
    box-shadow: none;
}

.link-button:hover {
    background: transparent;
    color: var(--accent-strong);
    box-shadow: none;
    transform: none;
}

.shell {
    width: min(1160px, calc(100% - 32px));
    margin: 34px auto 56px;
    display: grid;
    gap: 24px;
}

.panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(220, 229, 225, 0.9);
    border-radius: 8px;
    padding: clamp(20px, 3vw, 30px);
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 20px;
    margin-bottom: 22px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.08;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 18px;
    font-size: 21px;
    line-height: 1.2;
}

h3 {
    margin-bottom: 8px;
    font-size: 17px;
}

p {
    margin-bottom: 0;
    color: var(--muted);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

thead th {
    background: var(--surface-soft);
}

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

th:first-child,
td:first-child {
    border-left: 1px solid var(--line);
}

th:last-child,
td:last-child {
    border-right: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #fbfdfc;
}

td span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

form {
    margin: 0;
}

.project-form {
    display: grid;
    gap: 18px;
}

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

label {
    display: block;
    margin-bottom: 7px;
    color: #34454d;
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 11px 13px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

textarea {
    resize: vertical;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.check input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--accent);
}

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth main {
    width: min(430px, 100%);
}

.auth-heading {
    margin-bottom: 20px;
}

.auth-heading span {
    color: var(--accent);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 12px;
}

.auth-heading h1 {
    margin: 6px 0 0;
}

.login-card {
    display: grid;
    gap: 18px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
}

.alert {
    border: 1px solid #fecdd3;
    border-radius: 7px;
    padding: 11px 13px;
    background: var(--danger-bg);
    color: var(--danger-text);
}

@media (max-width: 760px) {
    .topbar,
    .panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions {
        justify-content: space-between;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    th:nth-child(2),
    th:nth-child(3),
    td:nth-child(2),
    td:nth-child(3) {
        display: none;
    }
}
