:root {
    --bg: #030504;
    --panel: #08100b;
    --panel-strong: #0d1710;
    --line: #1f3325;
    --muted: #9aa89f;
    --text: #f6f8f6;
    --green: #38d64b;
    --green-dark: #1fa933;
    --danger: #ff6b6b;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

table {
    border-collapse: collapse;
}

input:not([type="email"]):not([type="password"]) {
    text-transform: uppercase;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 48px;
    min-height: 100vh;
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    align-items: center;
    padding: 48px 0;
}

.brand-panel {
    min-width: 0;
}

.brand-logo {
    display: block;
    width: min(420px, 100%);
    height: auto;
}

.brand-slogan {
    max-width: 620px;
    margin: 34px 0 30px;
    color: var(--text);
    font-size: 40px;
    line-height: 1.1;
    font-weight: 700;
}

.brand-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-tags span {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    padding: 10px 12px;
}

.login-card,
.message-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.login-card {
    padding: 32px;
}

.login-card h1,
.message-panel h1,
.selected-company h1,
.page-heading h1 {
    margin: 0;
    letter-spacing: 0;
}

.login-card h1 {
    margin-bottom: 28px;
    font-size: 30px;
}

.login-card form {
    display: grid;
    gap: 12px;
}

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

.login-card input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #040806;
    color: var(--text);
    outline: none;
    padding: 0 14px;
}

.login-card input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(56, 214, 75, 0.16);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
    padding: 0 18px;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button-primary {
    background: var(--green);
    color: #031006;
}

.button-primary:hover,
.button-primary:focus {
    background: #5dec68;
}

.button-ghost {
    border-color: var(--line);
    background: transparent;
    color: var(--text);
}

.button-ghost:hover,
.button-ghost:focus {
    border-color: var(--green);
    color: var(--green);
}

.login-card .button {
    width: 100%;
    margin-top: 10px;
}

.alert {
    border: 1px solid rgba(255, 107, 107, 0.44);
    border-radius: 8px;
    margin: 0 0 18px;
    background: rgba(255, 107, 107, 0.08);
    color: #ffd7d7;
    padding: 12px 14px;
}

.app-shell {
    width: min(1120px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 0 56px;
}

.compact-shell {
    display: grid;
    align-content: start;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
}

.topbar-brand img {
    display: block;
    width: 170px;
    height: auto;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.page-heading {
    margin: 62px 0 28px;
}

.page-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.page-heading p,
.selected-company p {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
}

.page-heading h1 {
    font-size: 40px;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.company-card {
    display: grid;
    min-height: 132px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 20px;
    align-content: space-between;
}

.company-card:hover,
.company-card:focus {
    border-color: var(--green);
    background: var(--panel-strong);
}

.company-card span {
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.company-card strong {
    color: var(--green);
    font-size: 13px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
    gap: 14px;
}

.menu-card {
    display: grid;
    min-height: 120px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 20px;
    align-content: space-between;
}

.menu-card:hover,
.menu-card:focus {
    border-color: var(--green);
    background: var(--panel-strong);
}

.menu-card span {
    font-size: 22px;
    font-weight: 900;
}

.menu-card strong,
.table-action {
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
}

.empty-state {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
    background: var(--panel);
    color: var(--muted);
    padding: 18px;
}

.table-wrap,
.form-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

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

.data-table {
    width: 100%;
    min-width: 760px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 16px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.data-table td {
    color: var(--text);
    font-size: 14px;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.form-card {
    padding: 24px;
}

.form-card form {
    display: grid;
    gap: 22px;
}

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

.form-grid label {
    display: grid;
    gap: 8px;
}

.form-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.form-grid input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #040806;
    color: var(--text);
    outline: none;
    padding: 0 14px;
}

.form-grid input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(56, 214, 75, 0.16);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-company {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: 82px;
    background: var(--panel);
    padding: 34px;
}

.selected-company h1 {
    font-size: 34px;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.message-panel {
    width: min(520px, 100%);
    margin: 82px auto 0;
    padding: 32px;
    text-align: center;
}

.message-logo {
    width: 190px;
    height: auto;
    margin-bottom: 28px;
}

.message-panel h1 {
    margin-bottom: 24px;
    font-size: 28px;
    line-height: 1.2;
}

@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 28px;
        width: min(100% - 32px, 520px);
        align-content: center;
    }

    .brand-slogan {
        margin: 24px 0 22px;
        font-size: 30px;
    }

    .login-card {
        padding: 24px;
    }

    .app-shell {
        width: min(100% - 28px, 720px);
        padding-top: 20px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .page-heading {
        margin-top: 42px;
    }

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

    .page-heading h1,
    .selected-company h1 {
        font-size: 30px;
    }

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

@media (max-width: 420px) {
    .brand-tags {
        display: none;
    }

    .brand-slogan {
        font-size: 26px;
    }

    .topbar-brand img {
        width: 145px;
    }

    .topbar-user {
        align-items: flex-start;
        flex-direction: column;
    }
}
