:root {
    --green: #32c671;
    --blue: #36bbf7;
    --yellow: #f7be39;
    --red: #da4453;
    --black: #000000;
    --dark: #333333;
    --mid: #555555;
    --soft: #888888;
    --light: #f5f7f9;
    --white: #ffffff;
    --border: #e2e6ea;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--light);
    color: var(--dark);
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    min-height: 76px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--dark);
    font-weight: 800;
    font-size: 17px;
    min-width: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    max-height: 42px;
    width: auto;
    flex-shrink: 0;
}

.brand span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav > a,
.nav-dropdown-toggle {
    border: 0;
    background: transparent;
    color: var(--mid);
    font-weight: 700;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
}

.main-nav > a:hover,
.nav-dropdown-toggle:hover {
    background: #f0f4f7;
    color: var(--dark);
    text-decoration: none;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 200;
}

.nav-dropdown-menu-right {
    left: auto;
    right: 0;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--dark);
    font-weight: 700;
    font-size: 14px;
}

.nav-dropdown-menu a:hover {
    background: #f0f4f7;
    text-decoration: none;
}

.mobile-menu-btn {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    padding: 9px;
}

.mobile-menu-btn span {
    display: block;
    height: 2px;
    background: var(--dark);
    margin: 5px 0;
    border-radius: 999px;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 22px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0;
    font-size: 30px;
}

.page-header p {
    margin: 6px 0 0;
    color: var(--soft);
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}

.login-wrap {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    max-height: 70px;
    margin-bottom: 14px;
}

.login-card h1 {
    margin-top: 0;
}

label {
    display: block;
    font-weight: 700;
    margin: 16px 0 7px;
    color: var(--dark);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 13px;
    font-size: 15px;
    background: var(--white);
    color: var(--dark);
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(54, 187, 247, 0.2);
    border-color: var(--blue);
}

textarea {
    resize: vertical;
}

small {
    color: var(--soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--green);
    color: var(--white);
}

.btn-primary:hover {
    background: #28ad60;
}

.btn-secondary {
    background: var(--blue);
    color: var(--white);
}

.btn-secondary:hover {
    background: #1aaeea;
}

.btn-small {
    padding: 8px 11px;
    font-size: 13px;
    background: #eef3f6;
    color: var(--dark);
}

.btn-small:hover {
    background: #e3ebef;
}

.form-card {
    max-width: 680px;
}

.form-card .btn,
.login-card .btn {
    margin-top: 18px;
}

.form-inline {
    display: flex;
    gap: 12px;
    align-items: center;
}

.form-inline input {
    max-width: 420px;
}

.filters {
    display: grid;
    grid-template-columns: 1fr 260px auto;
    gap: 12px;
    align-items: center;
}

.alert {
    padding: 13px 15px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-error {
    background: rgba(218, 68, 83, 0.11);
    color: var(--red);
}

.alert-success {
    background: rgba(50, 198, 113, 0.13);
    color: #178a48;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    font-size: 13px;
    color: var(--soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:last-child td {
    border-bottom: 0;
}

.actions {
    text-align: right;
    white-space: nowrap;
}

.actions form {
    display: inline;
}

.badge {
    display: inline-block;
    background: rgba(50, 198, 113, 0.15);
    color: #178a48;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check input {
    width: auto;
}

@media (max-width: 800px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
        gap: 14px;
    }

    .nav {
        flex-wrap: wrap;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-status {
    color: var(--soft);
    font-weight: 700;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.stat-card span {
    display: block;
    color: var(--soft);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 34px;
    color: var(--dark);
}

.stat-card.warning {
    border-left: 6px solid var(--yellow);
}

.stat-card.danger {
    border-left: 6px solid var(--red);
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0 0 4px;
}

.section-header p {
    margin: 0;
    color: var(--soft);
}

.badge-warning {
    background: rgba(247, 190, 57, 0.2);
    color: #8a6200;
}

.badge-danger {
    background: rgba(218, 68, 83, 0.14);
    color: var(--red);
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 850px) {
    .header-inner {
        min-height: 70px;
        align-items: center;
    }

    .brand span {
        max-width: 210px;
    }

    .mobile-menu-btn {
        display: block;
        flex-shrink: 0;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        padding: 12px 22px 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav > a,
    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        text-align: left;
        padding: 13px 12px;
        background: #f8fafb;
    }

    .nav-dropdown-menu,
    .nav-dropdown-menu-right {
        position: static;
        box-shadow: none;
        border: 0;
        background: #f8fafb;
        padding: 4px 0 8px 14px;
        margin-top: 4px;
        min-width: 0;
    }

    .nav-dropdown-menu a {
        padding: 10px 12px;
        color: var(--mid);
    }

    .container {
        padding: 24px 16px;
    }

    .page-header {
        gap: 12px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .card {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.checkbox-list {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: #f8fafb;
    display: grid;
    gap: 8px;
}

.checkbox-list .check {
    margin: 0;
    font-weight: 600;
}

.checkbox-list small {
    display: block;
    margin-top: 4px;
}