:root {
    --navy: #1f4e78;
    --green: #2e7d32;
    --orange: #c55a11;
    --maroon: #b7472a;
    --teal: #31859c;
    --gray: #6b6b6b;
    --border: #d9d9d9;
    --bg: #f5f6f8;
}

* { box-sizing: border-box; }

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    margin: 0;
    color: #222;
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: var(--navy);
    color: #fff;
    padding: 16px 24px;
}
.brand { font-size: 18px; font-weight: bold; }

.content {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 20px;
}

h1 { font-size: 22px; margin-top: 0; }
h2 { font-size: 16px; margin: 0; }

.section {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 18px;
    overflow: hidden;
}
.section-header {
    color: #fff;
    padding: 10px 16px;
    font-weight: bold;
}
.section-body {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    background: #fff;
}
.section-body.single { grid-template-columns: 1fr; }
@media (max-width: 640px) { .section-body { grid-template-columns: 1fr; } }

.field label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #444;
    margin-bottom: 4px;
}
.field input[type=text],
.field input[type=email],
.field input[type=number],
.field select,
.field textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #c9c9c9;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.field .hint { font-size: 11px; color: var(--gray); margin-top: 3px; }
.field.full { grid-column: 1 / -1; }

.section-header.internet { background: var(--green); }
.section-header.utilities { background: var(--orange); }
.section-header.tv { background: #6a3d9a; }
.section-header.security { background: var(--maroon); }
.section-header.hoa, .section-header.vendors { background: var(--teal); }
.section-header.systems, .section-header.notes { background: var(--gray); }
.section-header.identity { background: var(--navy); }

.btn {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { opacity: 0.9; }
.btn.secondary { background: var(--gray); }

.error {
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: #8a2f2b;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.success {
    background: #e9f7ef;
    border: 1px solid #b7e4c7;
    color: #1e6b34;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
table.admin-table th, table.admin-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    font-size: 13px;
    text-align: left;
}
table.admin-table th { background: #eef1f4; }
.badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: #fff;
}
.badge.pending { background: var(--gray); }
.badge.submitted { background: var(--green); }

.login-box { max-width: 420px; margin: 60px auto; }

/* Looks like a plain text link but is a real <button> inside a <form> - used where an action
   needs to be a POST (not a GET link) for CSRF safety, e.g. "New code" in the admin table. */
.link-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #1a5fb4;
    text-decoration: underline;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
}
.link-btn:hover { opacity: 0.8; }
