/* =========================
   Global Reset & Base
   ========================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background-color: #f4f4f4;
    color: #222;
    line-height: 1.4;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left  { text-align: left; }
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

/* =========================
   Top Bar (Header Strip)
   ========================= */
.top-bar {
    background-color: #006600;
    color: #ffffff;
    padding: 8px 15px;
    font-size: 0.9rem;
}

.top-bar a {
    color: #ffffff;
    text-decoration: none;
}

.top-bar a:hover {
    text-decoration: underline;
}

/* =========================
   Layout for Panels
   ========================= */

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (for Admin, optionally principal/teacher) */
.sidebar {
    width: 220px;
    background-color: #ffffff;
    border-right: 1px solid #dcdcdc;
    padding-bottom: 20px;
}

.sidebar h3 {
    margin: 0;
    padding: 10px 12px;
    font-size: 0.95rem;
    background-color: #eeeeee;
    border-bottom: 1px solid #dcdcdc;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar li {
    border-bottom: 1px solid #f2f2f2;
}

.sidebar a {
    display: block;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #006600;
    text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
    background-color: #f0fff0;
}

/* Main content area */
.content {
    flex: 1;
    padding: 15px;
}

/* Footer */
.footer {
    margin-top: 20px;
    padding-top: 5px;
    border-top: 1px solid #dddddd;
    font-size: 0.8rem;
    color: #666666;
}

/* =========================
   Buttons
   ========================= */
.btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    background-color: #006600;
    color: #ffffff;
}

.btn:hover {
    background-color: #008000;
}

.btn-secondary {
    background-color: #555555;
}

.btn-secondary:hover {
    background-color: #333333;
}

.btn-danger {
    background-color: #c0392b;
}

.btn-danger:hover {
    background-color: #a93226;
}

/* =========================
   Forms
   ========================= */
form label {
    font-size: 0.9rem;
    display: block;
    margin-top: 8px;
    margin-bottom: 3px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 7px 8px;
    font-size: 0.9rem;
    border: 1px solid #cccccc;
    border-radius: 3px;
    background-color: #ffffff;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #006600;
    box-shadow: 0 0 0 1px rgba(0, 102, 0, 0.2);
}

textarea {
    min-height: 60px;
}

/* Form group helper */
.form-row {
    display: flex;
    gap: 10px;
}

.form-row > div {
    flex: 1;
}

/* Messages */
.alert {
    padding: 8px 10px;
    border-radius: 3px;
    margin: 8px 0;
    font-size: 0.9rem;
}

.alert-success {
    background-color: #eafaf1;
    border: 1px solid #2ecc71;
    color: #196f3d;
}

.alert-error {
    background-color: #fdecea;
    border: 1px solid #e74c3c;
    color: #922b21;
}

/* =========================
   Tables
   ========================= */
table {
    border-collapse: collapse;
    width: 100%;
    background-color: #ffffff;
    font-size: 0.85rem;
}

th, td {
    border: 1px solid #cccccc;
    padding: 4px 6px;
    text-align: center;
}

th {
    background-color: #eeeeee;
    font-weight: 600;
}

td.text-left,
th.text-left {
    text-align: left;
}

td.text-right,
th.text-right {
    text-align: right;
}

/* Hover effect for data tables */
tbody tr:hover {
    background-color: #f9f9f9;
}

/* Responsive table wrapper */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

/* =========================
   Cards / Panels
   ========================= */
.card {
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.card h2,
.card h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 4px;
}

/* =========================
   Login & Auth Pages
   ========================= */
.auth-container {
    max-width: 380px;
    margin: 60px auto;
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    padding: 20px 20px 15px;
}

.auth-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.auth-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: #666666;
    margin-bottom: 15px;
}

/* =========================
   Result Sheet Styling
   ========================= */

/* Container for printable result sheet */
.result-container {
    width: 1000px;
    margin: 10px auto;
    border: 1px solid #000000;
    padding: 5px;
    background-color: #ffffff;
}

.school-header {
    text-align: center;
}

.school-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.school-header h4 {
    margin: 0;
    font-size: 0.9rem;
}

/* Tables specific to result sheet */
.info-table,
.subject-table,
.beh-table,
.grade-table,
.comments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 3px;
}

.info-table td {
    border: 1px solid #000000;
    padding: 3px;
}

.subject-table th,
.subject-table td {
    border: 1px solid #000000;
    padding: 2px;
    text-align: center;
}

.subject-table th {
    background-color: #eeeeee;
    font-size: 0.75rem;
}

.beh-table th,
.beh-table td,
.grade-table th,
.grade-table td,
.comments-table th,
.comments-table td {
    border: 1px solid #000000;
    padding: 2px;
}

.passport-box {
    width: 100px;
    height: 100px;
    border: 1px solid #000000;
    text-align: center;
    font-size: 0.7rem;
    overflow: hidden;
}

.passport-box img {
    max-width: 100%;
    max-height: 100%;
}

/* =========================
   Images
   ========================= */
img.passport {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 1px solid #888888;
}

/* =========================
   Links
   ========================= */
a {
    color: #006600;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================
   Print Styles
   ========================= */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background-color: #ffffff;
        font-size: 12px;
    }

    .result-container {
        margin: 0;
        border: none;
        width: 100%;
        padding: 0;
    }
}
