/* General Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Card Styling */
.card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

h1, h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Form Elements */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input, select, button {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px; /* Prevents auto-zoom on iOS */
}

button {
    background-color: #27ae60;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background-color: #219150;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    color: #7f8c8d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Progress Bar Customization */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

progress {
    flex-grow: 1;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    appearance: none;
    border: none;
}

/* Progress Colors */
progress::-webkit-progress-bar {
    background-color: #eee;
}

progress::-webkit-progress-value {
    background-color: #27ae60;
}

progress::-moz-progress-bar {
    background-color: #27ae60;
}

/* Alert State for Exceeding Limit */
.alert {
    background-color: #fff5f5;
}

.alert td {
    color: #c0392b;
    font-weight: bold;
}

.alert progress::-webkit-progress-value {
    background-color: #e74c3c;
}

.alert progress::-moz-progress-bar {
    background-color: #e74c3c;
}

.percent-text {
    font-size: 0.9rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Helper Classes */
.filters {
    flex-direction: row;
    align-items: center;
}

.filters input {
    width: 100px;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
    }

    td {
        border: none;
        padding: 5px 0;
        position: relative;
    }
}
