:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-alt: #f9fafb;
    --text: #18202a;
    --muted: #687386;
    --border: #dfe3e8;
    --primary: #1769e0;
    --primary-hover: #105ac5;
    --danger: #d9363e;
    --danger-hover: #bd2931;
    --success: #18864b;
    --warning: #b46900;
    --shadow:
        0 1px 2px rgba(0, 0, 0, .05),
        0 6px 20px rgba(0, 0, 0, .04);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    line-height: 1.5;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

main.container {
    padding-top: 36px;
    padding-bottom: 60px;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nav {
    min-height: 68px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}

.brand-icon {
    font-size: 24px;
}

nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav a,
.link-button {
    color: var(--muted);
    text-decoration: none;
    font: inherit;
    font-weight: 600;
}

nav a:hover,
.link-button:hover {
    color: var(--primary);
}

.inline {
    display: inline;
    margin: 0;
}

.link-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

h1 {
    margin: 0 0 5px;
    font-size: 28px;
}

h2 {
    margin-top: 0;
}

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

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-header p {
    margin: 5px 0 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.table-card {
    overflow: hidden;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    background: var(--surface-alt);
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

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

.actions-col {
    width: 190px;
}

.actions {
    white-space: nowrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--primary-hover);
}

.button.secondary {
    background: #edf1f5;
    color: #283444;
}

.button.secondary:hover {
    background: #dfe5eb;
}

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

.button.danger:hover {
    background: var(--danger-hover);
}

.button.small {
    padding: 7px 11px;
    font-size: 13px;
}

.button.full {
    width: 100%;
}

.badge {
    display: inline-block;
    border-radius: 100px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

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

.badge.inactive {
    background: #eef0f2;
    color: #687386;
}

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

.badge.pending {
    background: #fff2d8;
    color: var(--warning);
}

.form-card {
    max-width: 650px;
    padding: 25px;
}

label {
    display: block;
    margin-bottom: 20px;
    font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"] {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 11px 12px;
    border: 1px solid #cbd2da;
    border-radius: 7px;
    background: white;
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px rgba(23, 105, 224, .12);
}

label small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-weight: 400;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
}

.checkbox input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
}

.flashes {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 15px;
    border-radius: 7px;
    margin-bottom: 10px;
}

.flash.success {
    background: #e8f6ee;
    color: #146d3e;
    border: 1px solid #bfe5cf;
}

.flash.error {
    background: #fcebed;
    color: #a72830;
    border: 1px solid #efc2c6;
}

.empty {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
}

.info-box {
    margin-top: 20px;
    padding: 14px 17px;
    background: #eef5ff;
    border: 1px solid #cadfff;
    border-radius: 8px;
    color: #315074;
}

.login-wrapper {
    min-height: calc(100vh - 100px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(420px, 100%);
    padding: 35px;
}

.login-card h1,
.login-card .muted {
    text-align: center;
}

.login-icon {
    text-align: center;
    font-size: 54px;
}

.login-card form {
    margin-top: 28px;
}

.details pre {
    max-width: 500px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
}

details summary {
    cursor: pointer;
    color: var(--primary);
}

@media (max-width: 760px) {

    .nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px 0;
    }

    nav {
        flex-wrap: wrap;
        gap: 14px;
    }

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

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

    .actions {
        display: flex;
        gap: 6px;
    }
}
