:root {
    --blue-dark: #0d4c92;
    --blue: #126db3;
    --blue-light: #d9ecfb;
    --border: #b8c7d9;
    --panel: #f5f8fb;
    --text: #243447;
    --muted: #66758a;
    --error: #a51616;
    --success: #137333;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #e8edf3 linear-gradient(#f5f7fa, #dce4ee) fixed;
}

a { color: #105289; text-decoration: none; }
a:hover { color: #d31141; text-decoration: underline; }

.page {
    width: min(1120px, calc(100% - 24px));
    margin: 18px auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.topline {
    height: 4px;
    background: linear-gradient(90deg, #105289, #4da3d8, #105289);
}

.site-header {
    background: #ebf3fa;
    border-bottom: 1px solid var(--border);
}

.brand-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px 15px;
    background: linear-gradient(#ffffff, #d9eaf8);
}

.brand {
    display: inline-block;
    color: var(--blue-dark);
    font-size: 30px;
    line-height: 1;
    font-weight: bold;
    letter-spacing: -1px;
}

.brand:hover { text-decoration: none; color: #0b3e73; }
.tagline { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 14px 12px;
}

.nav a {
    display: inline-block;
    padding: 8px 12px;
    color: #fff;
    border-radius: 5px;
    background: linear-gradient(#2779b8, #105289);
    border: 1px solid #0b4f89;
    font-size: 12px;
    font-weight: bold;
}

.nav a:hover,
.nav a.active {
    background: linear-gradient(#e8f4fc, #c8dceb);
    color: #105289;
    text-decoration: none;
}

.content { padding: 22px; }

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 7px;
    margin-bottom: 18px;
}

.panel h1,
.panel h2,
.panel h3 {
    margin: 0;
    padding: 12px 14px;
    color: #105289;
    background: linear-gradient(#fff, #e6eff7);
    border-bottom: 1px solid var(--border);
    border-radius: 7px 7px 0 0;
    font-size: 18px;
}

.panel-body { padding: 16px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.card {
    padding: 14px;
    background: #fff;
    border: 1px solid #d1dce8;
    border-radius: 7px;
}

.card h3 { margin: 0 0 8px; color: #105289; }

.form-row { margin-bottom: 13px; }
label { display: block; margin-bottom: 5px; color: #314862; font-weight: bold; }
input, select {
    width: 100%;
    max-width: 460px;
    padding: 9px;
    border: 1px solid #aebbc9;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}
input:focus, select:focus {
    outline: none;
    border-color: #105289;
    box-shadow: 0 0 0 3px rgba(16, 82, 137, .12);
}

.help { color: var(--muted); font-size: 12px; margin-top: 5px; }

.button,
button,
input[type="submit"] {
    display: inline-block;
    width: auto;
    padding: 8px 14px;
    color: #fff;
    background: linear-gradient(#3c8ccb, #105289);
    border: 1px solid #0b4f89;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
.button:hover, button:hover, input[type="submit"]:hover {
    background: linear-gradient(#50a1de, #1260a1);
    color: #fff;
    text-decoration: none;
}
.button.danger, button.danger {
    background: linear-gradient(#cd4a4a, #8f1414);
    border-color: #721111;
}

.flash {
    padding: 10px 12px;
    margin: 0 0 16px;
    border-radius: 6px;
    border: 1px solid;
    background: #fff;
}
.flash.error { color: var(--error); border-color: #e7b8b8; background: #fff4f4; }
.flash.success { color: var(--success); border-color: #b5d7be; background: #f1fff3; }

.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
}
th, td {
    padding: 10px;
    border-bottom: 1px solid #d8e2ee;
    text-align: left;
}
th {
    color: #105289;
    background: #e7f1fa;
    font-size: 12px;
    text-transform: uppercase;
}
tr:nth-child(even) td { background: #f7fafd; }
.inline-form { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 99px;
    background: #d9ecfb;
    color: #105289;
    font-size: 12px;
    font-weight: bold;
}
.footer {
    padding: 12px 22px;
    color: var(--muted);
    background: #eef3f8;
    border-top: 1px solid var(--border);
    font-size: 12px;
}
@media (max-width: 640px) {
    .brand-row { align-items: start; flex-direction: column; }
    .brand { font-size: 26px; }
    .content { padding: 14px; }
    .nav { padding: 0 10px 10px; }
    .nav a { width: calc(50% - 2px); text-align: center; }
}
