/* EMDIN Junior School - Main Stylesheet */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f6f9;
    color: #1f2937;
    font-size: 15px;
}

.topbar {
    background: #1f4e79;
    color: #fff;
    padding: 0 16px;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 10px 0;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
}

.topnav a {
    color: #d9e8f5;
    text-decoration: none;
    margin-left: 18px;
    font-size: 14px;
    font-weight: 600;
}

.topnav a:hover { color: #fff; }

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

h1 { font-size: 22px; margin: 0 0 16px; color: #1f4e79; }
h2 { font-size: 18px; margin: 24px 0 10px; color: #1f4e79; }

.card {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}
.flash-success { background: #d9ead3; color: #274e13; }
.flash-error { background: #f4cccc; color: #990000; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    border: 1px solid #e0e4e9;
    padding: 8px 10px;
    text-align: center;
}
th {
    background: #2e75b6;
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
}
td.name-col, th.name-col { text-align: left; min-width: 160px; }
tr:nth-child(even) td { background: #f6f9fc; }

.table-scroll {
    overflow-x: auto;
    border-radius: 8px;
}

input[type=text], input[type=number], input[type=tel], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cfd6dd;
    border-radius: 6px;
    font-size: 14px;
}
input[type=number] { text-align: center; max-width: 70px; }

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    color: #fff;
    background: #2e75b6;
}
.btn:hover { background: #245a8d; }
.btn-green { background: #4caf50; }
.btn-green:hover { background: #3d8b40; }
.btn-blue { background: #2e75b6; }
.btn-blue:hover { background: #1f5a8d; }
.btn-red { background: #c0392b; }
.btn-red:hover { background: #962d22; }
.btn-grey { background: #6c757d; }
.btn-grey:hover { background: #555; }
.btn-small { padding: 5px 10px; font-size: 12px; }

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar select, .toolbar input { width: auto; }

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.grid-form label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #5a6472;
    margin-bottom: 4px;
}

.level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.footer {
    text-align: center;
    color: #9aa3ad;
    font-size: 12px;
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #8a94a0;
}

.badge-count {
    background: #e8eef5;
    color: #1f4e79;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; }
    .topnav { margin-top: 8px; }
    .topnav a { margin-left: 0; margin-right: 14px; }
    table { font-size: 12px; }
    th, td { padding: 6px; }
}
