:root {
    --primary: #E24E15;
    --background: #f8f9fa;
    --text: #1a1a1a;
    --light-gray: #f5f5f5;
    --accent: #efefef;
}

/* Base */
body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text);
    margin: 0;
    width: 100%;
}

/* Header */
.header_bar {
    background-color: var(--primary);
    color: white;
    padding: 1rem 0;
}

.header_container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header_title {
    font-size: 22px;
    font-weight: bold;
    margin: 0;
    color: white;
}

.header_nav a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    font-size: 15px;
    transition: color 0.2s;
}

.header_nav a:hover {
    color: #ffd4c3;
}

.header_nav a:first-child {
    margin-left: 0;
}

/* Main content */
.main_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
    margin: 0 auto;
}

.main_title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Login card */
.login-card {
    background: white;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 360px;
    margin-top: 20px;
    text-align: left;
}

.login-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

/* Forms */
.form-selection,
.fine-form {
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    margin-bottom: 8px;
}

/* Inputs */
.form-group select,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"] {
    width: 100%;
    max-width: 300px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(226, 78, 21, 0.15);
}

/* Buttons */
button,
.btn {
    background-color: var(--primary);
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.btn:hover {
    background-color: #c43f10;
}

.btn-small {
    padding: 5px 10px;
    font-size: 13px;
}

.btn-danger {
    background-color: #cc3300;
}

.btn-danger:hover {
    background-color: #aa2200;
}

/* Fine row */
.fine-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.fine-row select {
    flex: 2;
    max-width: 300px;
    padding: 7px 10px;
}

.fine-count {
    flex: 1;
    max-width: 100px;
    text-align: center;
}

.fine-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fine-input-group input {
    width: 60px;
    text-align: center;
}

.fine-input-group button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.fine-input-group button:hover {
    background-color: #c43f10;
}

/* Status indicator */
.status-indicator {
    font-weight: bold;
    margin-bottom: 12px;
}

.status-indicator.green {
    color: #2a7a2a;
}

.status-indicator.orange {
    color: var(--primary);
}

/* Error message */
.error {
    color: #cc0000;
    background-color: #fff0f0;
    border: 1px solid #ffcccc;
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 15px;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
    text-align: left;
}

/* Warning message: a caution, not a failure -- same shape as .error, but in
   the app's existing "pay attention" colour (--primary), not error red. */
.warning {
    color: var(--primary);
    background-color: #fff3ec;
    border: 1px solid var(--primary);
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 15px;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
    text-align: left;
}

/* Tables */
table {
    width: 80%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

table th,
table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid var(--accent);
}

table tr:last-child td {
    border-bottom: none;
}

thead {
    background-color: var(--primary);
    color: white;
}

/* Lists (manage page) */
ul {
    list-style-type: none;
    padding: 0;
    width: 100%;
    max-width: 600px;
}

ul li {
    background-color: white;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.li-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 15px;
}

/* Section spacing */
.section {
    margin-bottom: 30px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    align-items: center;
}

.pagination a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    padding: 6px 14px;
    border: 1px solid var(--primary);
    border-radius: 5px;
    transition: background 0.2s;
}

.pagination a:hover {
    background-color: var(--primary);
    color: white;
}

/* Export form */
.export-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.export-form label {
    font-weight: bold;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .fine-row,
    .header_container {
        flex-direction: column;
        align-items: stretch;
    }

    .header_nav {
        margin-top: 10px;
    }

    .header_nav a {
        margin: 0 10px 0 0;
    }

    table {
        width: 100%;
    }

    .export-form {
        flex-direction: column;
        align-items: stretch;
    }
}
