/* ?? MvL Progress Portal ?? */

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --primary-dark: #0e3651;
    --accent: #e67e22;
  --accent-hover: #d35400;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-500: #6c757d;
    --gray-700: #495057;
    --gray-900: #212529;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
 background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ?? Navbar ?? */
.navbar {
    background: var(--primary);
 color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
  box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover { color: var(--gray-100); }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  list-style: none;
}

.navbar-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.navbar-nav a:hover { color: white; }

.navbar-user {
    display: flex;
    align-items: center;
 gap: 1rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
}

/* ?? Main content ?? */
.main-content {
  flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Wide variant — completely removes the max-width cap so content fills viewport */
.main-content--wide {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* ?? Cards ?? */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Utility to make a card fill the available horizontal space (ignore global max-width containers) */
.card--fluid {
    width: 100%;
    max-width: none;
    margin: 0 0 1.5rem 0;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
  color: var(--primary);
    margin-bottom: 1.5rem;
 padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

/* ?? Forms ?? */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
margin-bottom: 0.4rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.form-control.input-error {
 border-color: var(--danger);
}

select.form-control {
    appearance: auto;
}

/* ?? Buttons ?? */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-light); }

.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #219a52; }

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
 border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.85rem 2rem;
  font-size: 1.05rem;
}

/* ?? Alerts ?? */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fdeaea;
    color: var(--danger);
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #eaf7ef;
  color: #1a7a3a;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff8e1;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #e8f4fd;
  color: var(--primary);
  border: 1px solid #b8daff;
}

/* ?? Tables ?? */
.table-container {
    overflow-x: auto;
    width: 100%; /* ensure it fills parent width */
}

table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

table th {
 background: var(--gray-50);
  color: var(--gray-700);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
}

table td {
    padding: 0.75rem 1rem;
 border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

/* Make form controls inside table responsive */
.table-container input[type="text"],
.table-container select,
.table-container .form-control {
    max-width: 100%;
    box-sizing: border-box;
}

/* Specific smaller defaults for inputs/selects used inside admin tables */
.table-input {
    min-width: 0; /* allow to shrink */
    width: 12rem; /* reasonable default */
    max-width: 100%;
}

.table-select {
    min-width: 0;
    width: 14rem;
    max-width: 100%;
}

@media (max-width: 900px) {
    .table-input, .table-select {
        width: 10rem;
    }
}

table tr:hover {
    background: var(--gray-50);
}

/* ?? Status badges ?? */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-validating { background: #cce5ff; color: #004085; }
.badge-ready { background: #d4edda; color: #155724; }
.badge-processing { background: #cce5ff; color: #004085; }
.badge-done { background: #d4edda; color: #155724; }
.badge-failed { background: #f8d7da; color: #721c24; }
.badge-validation_failed, .badge-validationfailed { background: #f8d7da; color: #721c24; }
.badge-partial { background: #fff3cd; color: #856404; }
.badge-awaitingapproval { background: #e8f4fd; color: #0c5460; }

/* ?? Upload area ?? */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary-light);
    background: #f0f7fc;
}

.upload-area input[type="file"] { display: none; }

/* ?? SubJob row in upload form ?? */
.subjob-row {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.subjob-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.subjob-row-header h4 {
    font-size: 0.95rem;
    color: var(--primary);
}

.subjob-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ?? Pricing summary ?? */
.pricing-summary {
    background: var(--gray-50);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.pricing-total {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--gray-200);
    margin-top: 0.5rem;
padding-top: 0.5rem;
}

/* ?? Auth pages ?? */
.auth-container {
    max-width: 440px;
    margin: 3rem auto;
}

.auth-container .card {
    padding: 2.5rem;
}

.auth-container .card-header {
    text-align: center;
    font-size: 1.5rem;
}

/* ?? Footer ?? */
.footer {
    background: var(--gray-900);
    color: var(--gray-500);
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    margin-top: auto;
}

/* ?? Utilities ?? */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .main-content { padding: 0 1rem; margin: 1rem auto; }
    .subjob-fields { grid-template-columns: 1fr; }
    .navbar-nav { gap: 0.75rem; }
}
