/*
 * MOBILE-FRIENDLY STYLESHEET
 * This design is mobile-first, meaning the default styles are for small screens.
 * Media queries are used to add styles for larger screens.
*/

/* --- General Body & Font Styles --- */
html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

body {
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box; /* Makes layout math much easier */
}

h1, h2, h3 {
    color: #2c3e50;
    line-height: 1.2;
}

a {
    color: #3498db;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* --- Main Layout Container --- */
.container {
    width: 100%;
    padding: 15px; /* Less padding on mobile */
}

/* --- Header Section --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.header h1 {
    font-size: 1.5em; /* Smaller H1 on mobile */
    margin: 0;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%; /* Full width to be touch-friendly */
    padding: 12px;
    font-size: 16px; /* Prevents iOS from zooming in on focus */
    border: 1px solid #ccc;
    border-radius: 5px;
}

button, input[type="submit"] {
    width: 100%; /* Full-width buttons are easier to tap */
    background-color: #3498db;
    color: white;
    padding: 12px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
}
button:hover {
    background-color: #2980b9;
}
button.danger {
    background-color: #e74c3c;
}

/* --- Responsive Tables --- */
.section {
    margin-bottom: 40px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* This makes the table container scrollable on small screens if the table is too wide */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    display: block;
    overflow-x: auto; /* IMPORTANT for responsive tables */
    white-space: nowrap;
}
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
th {
    background-color: #f2f2f2;
}

/* --- Misc & Utility Classes --- */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #c0392b;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
}
span.required {
    color: #e74c3c;
}

/*
 * ===================================================================
 * MEDIA QUERY FOR TABLETS AND DESKTOPS (Screens wider than 768px)
 * ===================================================================
*/
@media (min-width: 768px) {
    .container {
        max-width: 960px;
        margin: 30px auto; /* Center the container on larger screens */
        padding: 30px;
    }

    button, input[type="submit"] {
        width: auto; /* Allow buttons to be their natural width */
    }

    .header h1 {
        font-size: 2.2em;
    }
}