:root {
    --bg-a: #f8fbff;
    --bg-b: #fff8f2;
    --ink: #10223a;
    --ink-soft: #4d5f77;
    --surface: #ffffff;
    --border: #dce6f2;
    --accent: #0e7490;
    --accent-2: #f97316;
    --danger: #b42318;
    --success: #0f766e;
    --radius: 16px;
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(14, 116, 144, 0.2), transparent 65%),
        radial-gradient(760px 360px at -10% 0%, rgba(249, 115, 22, 0.16), transparent 64%),
        linear-gradient(160deg, var(--bg-a), var(--bg-b));
    min-height: 100vh;
}

.page {
    width: min(1080px, 94vw);
    margin: 36px auto;
}

.card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.stack {
    display: grid;
    gap: 16px;
}

h1,
h2,
h3 {
    margin: 0 0 8px;
    letter-spacing: 0.2px;
}

h1 {
    font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem);
}

h2 {
    font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem);
}

.muted {
    color: var(--ink-soft);
    margin: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

form {
    display: grid;
    gap: 10px;
}

label {
    font-weight: 650;
    color: #1f334e;
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    border: 1px solid #c6d6e7;
    border-radius: 12px;
    padding: 12px 13px;
    font-size: 0.98rem;
    background: #ffffff;
}

input:focus {
    outline: 2px solid rgba(14, 116, 144, 0.35);
    border-color: var(--accent);
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 11px 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

button,
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #155e75);
    box-shadow: 0 8px 20px rgba(14, 116, 144, 0.28);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.24);
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-2), #ea580c);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.25);
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
}

.alert {
    border-radius: 12px;
    padding: 11px 12px;
    font-weight: 600;
}

.alert-error {
    color: var(--danger);
    background: #fff1f1;
    border: 1px solid #f5c6cb;
}

.alert-success {
    color: var(--success);
    background: #ecfeff;
    border: 1px solid #a5f3fc;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e9eff7;
    font-size: 0.95rem;
    white-space: nowrap;
}

th {
    background: #f5f9fe;
    color: #1d3557;
}

.right {
    text-align: right;
}

.center {
    text-align: center;
}

a {
    color: #0f5db8;
}

.status-active {
    color: #0f766e;
    font-weight: 700;
}

.status-expired,
.status-deleted {
    color: #b42318;
    font-weight: 700;
}

.auth-page {
    width: min(520px, 94vw);
    margin: 80px auto;
}

.hero {
    text-align: center;
    margin-bottom: 16px;
}

.hero p {
    margin: 0;
}

@media (max-width: 640px) {
    .page {
        width: 94vw;
        margin: 18px auto;
    }

    .card {
        padding: 18px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
