*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #222;
    line-height: 1.5;
}

/* ---- nav ---- */
.topnav {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #1a1a2e;
    color: #eee;
    padding: 0 24px;
    height: 48px;
}
.topnav .brand { font-weight: 700; font-size: 1.1rem; margin-right: auto; }
.topnav a { color: #aac; text-decoration: none; }
.topnav a:hover { color: #fff; }
.topnav .logout { color: #f88; }

/* ---- main ---- */
main {
    max-width: 960px;
    margin: 24px auto;
    padding: 0 16px;
}

h1 { margin-bottom: 16px; font-size: 1.5rem; }
h2 { margin: 16px 0 8px; font-size: 1.15rem; }
h3 { margin: 12px 0 6px; font-size: 1rem; }

/* ---- cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #eee; }
th { font-weight: 600; color: #555; }

/* ---- forms ---- */
form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
input, select, textarea {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: .9rem;
}
input[type="number"] { width: 80px; }
input[type="text"], input[type="password"] { width: 240px; }
textarea { width: 100%; font-family: monospace; font-size: .85rem; resize: vertical; }
button {
    align-self: flex-start;
    padding: 8px 20px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: .9rem;
}
button:hover { background: #2a2a4e; }

fieldset { border: 1px solid #ddd; border-radius: 6px; padding: 12px; }
legend { font-weight: 600; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { background: #e0e0e0; border: none; border-radius: 4px 4px 0 0; padding: 8px 16px; cursor: pointer; color: #333; }
.tab:hover { background: #d0d0d0; }
.tab.active { background: #fff; font-weight: 600; }
.tab-content { display: none; background: #fff; padding: 16px; border-radius: 0 6px 6px 6px; }
.tab-content.active { display: block; }

/* ---- login ---- */
.login-box { max-width: 360px; margin: 80px auto; background: #fff; padding: 32px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.12); text-align: center; }
.login-box h1 { margin-bottom: 24px; }
.login-box form { align-items: center; }
.login-box input { width: 100%; }

/* ---- misc ---- */
pre { background: #1a1a2e; color: #aac; padding: 12px; border-radius: 4px; overflow-x: auto; font-size: .8rem; max-height: 500px; overflow-y: auto; }
.ok { color: #2a7; font-weight: 600; }
.fail { color: #d33; font-weight: 600; }
.dim { color: #888; font-size: .85rem; }
.error { color: #d33; font-size: .85rem; }
code { background: #eee; padding: 1px 4px; border-radius: 3px; font-size: .85rem; }
.spacer { flex: 1; }
hr { margin: 16px 0; border: none; border-top: 1px solid #ddd; }
