:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-soft: #eef3f1;
    --text: #18201f;
    --muted: #65706d;
    --line: #dfe6e3;
    --primary: #16735f;
    --primary-dark: #0f5446;
    --accent: #e0a629;
    --danger: #b42318;
    --success: #157347;
    --shadow: 0 18px 45px rgba(22, 35, 31, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, "Noto Sans Hebrew", sans-serif;
    letter-spacing: 0;
}

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

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: #16231f;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--accent);
    color: #16130b;
    font-weight: 800;
}

.brand small {
    display: block;
    color: #b7c7c1;
    margin-top: 3px;
}

.nav-list {
    display: grid;
    gap: 7px;
}

.nav-list a {
    padding: 12px 13px;
    border-radius: 8px;
    color: #d7e4df;
    transition: background .16s ease, color .16s ease;
}

.nav-list a.active,
.nav-list a:hover {
    background: rgba(255, 255, 255, .11);
    color: #fff;
}

.sidebar-user {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.14);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #d7e4df;
}

.sidebar-user a {
    color: #ffd982;
}

.main {
    padding: 28px;
    width: 100%;
    max-width: 1320px;
}

.auth-main {
    max-width: none;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.auth-card {
    width: min(440px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 26px;
    box-shadow: var(--shadow);
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

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

h1 {
    font-size: clamp(26px, 4vw, 38px);
    margin-bottom: 7px;
}

.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.card,
.stat-card,
.table-wrap,
.form-panel,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.card,
.form-panel,
.empty-state {
    padding: 20px;
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
}

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

.field {
    display: grid;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(22, 115, 95, .15);
    border-color: var(--primary);
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn {
    border: 0;
    border-radius: 8px;
    padding: 12px 16px;
    min-height: 44px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.secondary {
    background: var(--surface-soft);
    color: var(--text);
}

.btn.danger {
    background: var(--danger);
}

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

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

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

th {
    color: var(--muted);
    font-size: 13px;
    background: #fbfcfc;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    background: var(--surface-soft);
    color: var(--primary-dark);
    font-weight: 700;
}

.badge.danger {
    background: #fff1f0;
    color: var(--danger);
}

.badge.success {
    background: #ecfdf3;
    color: var(--success);
}

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

.check-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.check-item input {
    width: auto;
    min-height: auto;
}

.flash {
    margin-bottom: 16px;
    padding: 13px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.flash.success {
    border-color: #b7ebc6;
    background: #f0fff4;
}

.flash.error {
    border-color: #ffd1cf;
    background: #fff5f5;
}

.mini-form {
    display: inline;
}

.empty-state {
    text-align: center;
    padding: 42px 18px;
}

@media (max-width: 920px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 14px;
        border-radius: 0 0 16px 16px;
    }

    .nav-list {
        display: flex;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .nav-list a {
        white-space: nowrap;
    }

    .sidebar-user {
        margin-top: 0;
    }

    .main {
        padding: 18px;
    }

    .stats-grid,
    .two-col,
    .form-grid,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        display: grid;
    }

    .btn {
        width: 100%;
    }
}

