:root {
    --ink: #0a2438;
    --ink-soft: #1f425e;
    --paper: #f4f8fb;
    --accent: #ef7b2d;
    --accent-strong: #d95f0e;
    --line: #c7d6e2;
    --success: #0c8b58;
    --error: #b6422c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--ink);
    background: #0a2438;
    min-height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(4px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 2px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand h1 {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 2rem;
    margin: 0;
    line-height: 1;
    letter-spacing: 0.03em;
}

.brand p {
    margin: 0;
    color: var(--ink-soft);
}

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

nav a,
button,
.chip-btn,
.mini-btn,
.ghost-btn {
    border: 0;
    text-decoration: none;
    color: #fff;
    background: var(--ink);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

nav a:hover,
button:hover,
.chip-btn:hover,
.mini-btn:hover,
.ghost-btn:hover {
    background: var(--accent-strong);
    color: #fff;
}

.inline-form {
    margin: 0;
}

.content {
    max-width: 1120px;
    margin: 1.25rem auto;
    padding: 0 1rem 2rem;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 14px 40px rgba(0, 35, 70, 0.15);
    animation: reveal 320ms ease-out;
}

.narrow {
    max-width: 640px;
}

@keyframes reveal {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

h2, h3 {
    font-family: "Barlow Condensed", sans-serif;
    letter-spacing: 0.02em;
}

.form-grid p {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0 0 0.8rem;
}

input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem;
    font: inherit;
}

.maintenance-shell { display: grid; gap: 1rem; }
.maintenance-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.8rem; color: var(--accent-strong); font-weight: 700; }
.subtle { color: var(--ink-soft); }
.chip-row, .action-row, .form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.chip-btn, .mini-btn, .ghost-btn { display: inline-flex; align-items: center; gap: 0.45rem; }
.ghost-btn { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(10, 36, 56, 0.08); }
.chip-btn { padding: 0.65rem 0.9rem; border-radius: 999px; background: linear-gradient(135deg, #0f5f89, #0a2438); color: #fff; border-color: transparent; font-weight: 700; }
.hub-tile { border-radius: 14px; padding: 2.5rem 2rem; font-size: 1.35rem; justify-content: center; flex-direction: column; gap: 1rem; background: linear-gradient(135deg, #5bbde8, #1a7fc4); }
.tile-icon { width: 88px; height: 88px; object-fit: contain; }
.page-icon-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-icon { width: 140px; height: 140px; object-fit: contain; flex-shrink: 0; }
.chip-btn.chip-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; font-weight: 600; }
.chip-btn:hover { background: linear-gradient(135deg, #ef7b2d, #d95f0e); }
.chip-icon { font-size: 1rem; line-height: 1; }
.mini-btn.danger, button.danger { background: #b6422c; color: #fff; }
.mini-btn.danger:hover, button.danger:hover { background: #9b3724; }
.maintenance-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.soft-card { background: linear-gradient(145deg, #ffffff, #edf4fa); }
.record-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.record-meta { display: flex; align-items: center; gap: 0.75rem; }
.center-icon { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.inactive-row { opacity: 0.6; }
.bowler-name-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.2rem; }
.active-check-label { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); cursor: default; }
.form-hero { border-radius: 18px; }
.modern-form p { margin-bottom: 0.9rem; }
.modern-form label { font-weight: 600; color: var(--ink-soft); }

.bf-form { display: flex; flex-direction: column; gap: 1rem; }
.bf-row { display: grid; grid-template-columns: 1fr 1fr 100px; gap: 1rem; align-items: end; }
.bf-col { display: flex; flex-direction: column; gap: 0.3rem; }
.bf-col label { font-weight: 600; font-size: 0.85rem; color: var(--ink-soft); }
.bf-col input, .bf-col select { width: 100%; }
.bf-col--span { grid-column: 1 / -1; }
.bf-check { flex-direction: row; align-items: center; gap: 0.4rem; padding-bottom: 0.55rem; }
.bf-check input[type="checkbox"] { width: 1.1rem; height: 1.1rem; flex-shrink: 0; cursor: pointer; }
.bf-check label { font-size: 0.95rem; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; }
.bf-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 0.5rem; }
.label-allcaps { text-transform: uppercase !important; letter-spacing: 0.06em; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

th,
td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.5rem;
}

th {
    background: #edf4fa;
}

.messages {
    list-style: none;
    padding: 0;
}

.message {
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.message.success {
    background: var(--success);
}

.message.error {
    background: var(--error);
}

.message.warning {
    background: #d97706;
}

.plain-list {
    padding-left: 1rem;
}

.qr-code {
    width: min(100%, 240px);
    display: block;
    margin: 1rem auto;
    background: #fff;
    padding: 0.5rem;
    border-radius: 12px;
}

.mono-wrap {
    font-family: monospace;
    word-break: break-all;
}

.trend-chart {
    margin-bottom: 1.25rem;
}

.trend-chart svg {
    width: 100%;
    max-width: 720px;
    height: auto;
    background: #f8fbfd;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.axis {
    stroke: #98afc3;
    stroke-width: 1;
}

.trend {
    fill: none;
    stroke-width: 3;
}

.trend-1 { stroke: #ef7b2d; color: #ef7b2d; }
.trend-2 { stroke: #0f7c90; color: #0f7c90; }
.trend-3 { stroke: #7c9c2b; color: #7c9c2b; }
.trend-4 { stroke: #ad3f74; color: #ad3f74; }

.legend-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding: 0;
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    margin-right: 0.45rem;
    vertical-align: middle;
    background: currentColor;
}

@media (max-width: 840px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        width: 100%;
    }
}
