:root {
    --color-primary: #0f5c73;
    --color-primary-dark: #0b4456;
    --color-primary-soft: #eef4f7;
    --color-accent: #d4af37;
    --color-text: #172635;
    --color-text-soft: #5f6f82;
    --color-muted: #748091;
    --color-border: #d9e1e7;
    --color-bg: #edf2f5;
    --color-bg-soft: #f7fafc;
    --color-white: #ffffff;
    --color-danger: #a1262d;
    --color-success: #237a3b;
    --shadow-soft: 0 14px 40px rgba(15, 35, 55, 0.08);
    --shadow-card: 0 18px 50px rgba(15, 23, 42, 0.10);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--color-text);
    background: linear-gradient(180deg, #f6fafc 0%, #eaf0f4 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.88;
}

img {
    max-width: 100%;
    height: auto;
}

.page {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(217, 225, 231, 0.9);
}

.topbar__inner,
.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand__logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15, 35, 55, 0.06);
    flex-shrink: 0;
}

.brand__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.brand__subtitle {
    margin: 3px 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav a,
.button,
button {
    border: 0;
    border-radius: 12px;
    padding: 10px 15px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav a,
.button--ghost {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.nav a:hover,
.button--ghost:hover {
    background: #e4eef2;
}

.button,
.button--primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    box-shadow: 0 10px 24px rgba(15, 92, 115, 0.16);
}

.button:hover,
.button--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 92, 115, 0.20);
}

.button--danger {
    background: var(--color-danger);
    color: var(--color-white);
    box-shadow: 0 10px 24px rgba(161, 38, 45, 0.16);
}

.button--danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(161, 38, 45, 0.20);
}

.content {
    padding: 30px 0 42px;
}

.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 24px;
    margin-bottom: 20px;
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
    color: var(--color-text);
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    font-weight: 500;
}

.flash--success {
    background: #edf9f0;
    color: var(--color-success);
    border-color: rgba(35, 122, 59, 0.16);
}

.flash--error {
    background: #fdf0f0;
    color: var(--color-danger);
    border-color: rgba(161, 38, 45, 0.14);
}

.form-row {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.form-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--color-text);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    font: inherit;
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(15, 92, 115, 0.10);
    background: #ffffff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--color-muted);
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    background: #fbfcfd;
}

tr:hover td {
    background: #fafcfd;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 0.84rem;
    font-weight: 600;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    background: linear-gradient(180deg, #eef3f6 0%, #dfe7ec 100%);
}

.login-card {
    width: 100%;
    max-width: 470px;
    background: var(--color-white);
    border: 1px solid rgba(217, 225, 231, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 42px 38px 34px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.login-logo-wrap img {
    max-width: 160px;
    max-height: 60px;
    width: auto;
    height: auto;
    display: block;
}

.login-header h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.login-header p {
    margin: 10px 0 0;
    color: var(--color-text-soft);
    font-size: 1rem;
}

.login-card .muted {
    display: block;
    margin: 0 0 24px;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.98rem;
}

.login-card .form-row {
    margin-bottom: 18px;
}

.login-card label {
    font-size: 0.96rem;
    margin-bottom: 8px;
}

.login-card input {
    height: 54px;
    padding: 0 16px;
    border-radius: 14px;
    background: #fcfcfd;
}

.login-card button,
.login-card .button,
.login-card .button--primary {
    width: 100%;
    height: 54px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 6px;
}

.muted {
    color: var(--color-muted);
}

.inline-form {
    display: inline;
}

@media (max-width: 860px) {
    .form-row--2 {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .topbar__inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .topbar__inner,
    .container {
        width: min(100%, calc(100% - 20px));
    }

    .content {
        padding: 22px 0 32px;
    }

    .card {
        padding: 18px;
        border-radius: 16px;
    }

    .login-shell {
        padding: 20px 14px;
    }

    .login-card {
        padding: 30px 22px 24px;
        border-radius: 18px;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }
}
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(180deg, #eef3f6 0%, #dfe7ec 100%) !important;
}

.login-card {
    width: 100%;
    max-width: 500px;
    background: #ffffff !important;
    border: 1px solid #d9e1e7 !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10) !important;
    padding: 42px 38px 34px !important;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.login-logo-wrap img {
    max-width: 160px;
    max-height: 60px;
    width: auto;
    height: auto;
    display: block;
}

.login-header h1 {
    margin: 0;
    font-size: 2rem !important;
    line-height: 1.1;
    font-weight: 700;
    color: #172635 !important;
}

.login-header p {
    margin: 10px 0 0;
    color: #5f6f82 !important;
    font-size: 1rem !important;
}

.login-card .muted {
    display: block;
    margin: 0 0 24px;
    text-align: center;
    color: #748091 !important;
    font-size: 0.98rem !important;
}

.login-card label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #172635;
}

.login-card input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border-radius: 14px !important;
    border: 1px solid #d9e1e7 !important;
    background: #fcfcfd !important;
    font: inherit;
}

.login-card button {
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #0f5c73 0%, #0b4456 100%) !important;
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 10px 24px rgba(15, 92, 115, 0.16);
}

.login-card .form-row {
    margin-bottom: 18px;
}