/* Calibri font for all text in the app */
html, body, input, select, button, label, table, th, td, h1, h2, h3, h4, h5, h6, p, span, div, textarea, option, a, small, strong, em, li, .popup, .popup-header, .popup-body, .popup-content, .detail-row, .detail-label, .detail-value {
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
}
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: url('background.jpg') no-repeat center center fixed;
    background-size: cover;
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
}
.container {
    max-width: 900px;
    margin: 50px auto;
    padding: 40px 32px 32px 32px;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
h1 {
    text-align: center;
    margin-bottom: 24px;
    color: #222;
}
.section {
    margin-bottom: 36px;
}
.section-title {
    padding: 16px 22px;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    font-size: 20px;
    color: #333;
    margin-bottom: 0;
}
.item-type {
    display: flex;
    gap: 10px;
    margin: 18px 0 24px 0;
}
.item-type button {
    flex: 1;
    padding: 10px 0;
    border: 1px solid #007bff;
    background: #f8f9fa;
    color: #007bff;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.item-type button.active,
.item-type button:hover {
    background: #007bff;
    color: #fff;
}
/* Table style */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

th, td {
    border: 1px solid #e0e0e0;
    padding: 8px 6px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f3f6fa;
    font-weight: bold;
    font-size: 16px;
}

tr:last-child td {
    border-bottom: 1px solid #e0e0e0;
}

td input[type="text"],
td input[type="number"],
td input[type="date"] {
    width: 100%;
    min-width: unset;
    max-width: unset;
    box-sizing: border-box;
    margin: 0;
}

td input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 auto;
    display: block;
}

/* Optional: Hide scroll bar for horizontal overflow */
div[style*="overflow-x:auto"] {
    scrollbar-width: thin;
    scrollbar-color: #bdbdbd #f3f6fa;
}
.form-row {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
}
.form-row input, .form-row select {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    background: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.form-row label {
    flex: 1;
    font-size: 15px;
    color: #444;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    margin-top: 32px;
}
.form-actions button {
    padding: 12px 36px;
    font-size: 17px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    background: #343a40;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.form-actions button:hover {
    background: #007bff;
}
.nonrec-item {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
}
.nonrec-item input[type="text"],
.nonrec-item input[type="number"],
.nonrec-item input[type="date"] {
    flex: 1 1 140px;
    min-width: 120px;
    max-width: 180px;
    box-sizing: border-box;
}
#nonrec-items {
    width: 100%;
    overflow-x: auto;
}
@media (max-width: 1100px) {
    .container {
        max-width: 98vw;
        padding: 18px 4vw 18px 4vw;
    }
    table, thead, tbody, th, td, tr {
        font-size: 15px;
    }
}
@media (max-width: 800px) {
    .container {
        max-width: 100vw;
        padding: 10px 2vw 10px 2vw;
    }
    h1 {
        font-size: 1.4em;
    }
    .section-title {
        font-size: 1em;
        padding: 10px 8px;
    }
    .form-row, .nonrec-item {
        flex-direction: column;
        gap: 10px;
    }
    .form-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    table, thead, tbody, th, td, tr {
        font-size: 13px;
    }
    #nonrec-items {
        min-width: 0;
    }
}
@media (max-width: 500px) {
    .container {
        max-width: 100vw;
        padding: 2vw 1vw;
        border-radius: 0;
    }
    h1 {
        font-size: 1.1em;
    }
    .section-title {
        font-size: 0.95em;
        padding: 7px 4px;
    }
    .form-row, .nonrec-item {
        flex-direction: column;
        gap: 7px;
    }
    .form-actions {
        flex-direction: column;
        gap: 7px;
        align-items: stretch;
    }
    table, thead, tbody, th, td, tr {
        font-size: 11px;
    }
    #nonrec-items {
        min-width: 0;
    }
}
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 32px 28px 24px 28px;
    background: rgba(255,255,255,0.7);
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
}
.login-container h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #222;
    font-size: 2em;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.login-group {
    margin-bottom: 18px;
}
.login-group label {
    display: block;
    margin-bottom: 6px;
    color: #444;
    font-size: 15px;
}
.login-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    background: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    color: #222;
}
.login-group input:focus {
    border-color: #007bff;
    outline: none;
}
.login-btn {
    width: 100%;
    padding: 12px 36px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: block;
}
.login-btn:hover {
    background: #0056b3;
}
.login-error {
    color: #c00;
    text-align: center;
    margin-bottom: 10px;
}
@media (max-width: 600px) {
    .login-container {
        padding: 10px 2vw 10px 2vw;
        max-width: 98vw;
    }
    .login-group input {
        font-size: 15px;
        padding: 10px 8px;
    }
    .login-container h2 {
        font-size: 1.2em;
    }
    .login-btn {
        font-size: 15px;
        padding: 10px 10px;
    }
}
/* Masquer les boutons clear natifs sur les champs input (X à droite) */
input[type="text"]::-ms-clear,
input[type="password"]::-ms-clear {
    display: none;
}
input[type="text"]::-webkit-clear-button,
input[type="password"]::-webkit-clear-button {
    display: none;
}
input[type="text"]::-webkit-input-clear-button,
input[type="password"]::-webkit-input-clear-button {
    display: none;
}
input[type="text"]::-o-clear,
input[type="password"]::-o-clear {
    display: none;
}
input[type="text"]::-moz-clear,
input[type="password"]::-moz-clear {
    display: none;
} 
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"] {
    width: 100%;
    min-width: 200px;
    max-width: 400px;
    height: 36px;
    border: 2px solid #2196F3;
    border-radius: 8px;
    background: transparent;
    padding: 0 12px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
    border-color: #1976D2;
    box-shadow: 0 0 0 2px #90caf9;
} 
.login-container, .container-login, .container {
    background: transparent;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    border-radius: 18px;
    padding: 32px 24px;
}

/* My Submissions Modal */
#mySubmissionsModal {
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}
.submissions-modal-box {
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.submissions-modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid #e8ecf0;
    background: #2c3e50;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
}
.submissions-modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.submissions-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}
.submissions-modal-close:hover {
    background: rgba(255,255,255,0.15);
}
.submissions-modal-body {
    padding: 28px 32px;
    overflow-y: auto;
    background: #fafbfc;
    font-size: 15px;
    line-height: 1.55;
    color: #2d3748;
}
.submission-card {
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    background: #fff;
}
.submission-card-header {
    background: #2c3e50;
    color: #fff;
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.submission-card-header .req-no {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.submission-card-header .item-type-badge {
    padding: 5px 14px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.submission-card-header .meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
}
.submission-card-body {
    padding: 24px;
}
.submission-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px 24px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e8ecf0;
}
.submission-info-item {
    font-size: 14px;
    color: #2d3748;
}
.submission-info-item strong {
    display: block;
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.submission-items-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 14px;
    letter-spacing: 0.2px;
}
.submissions-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e8ecf0;
}
.submissions-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.submissions-table-wrap th {
    background: #f3f6fa;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 2px solid #e8ecf0;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}
.submissions-table-wrap td {
    padding: 12px 14px;
    border-bottom: 1px solid #e8ecf0;
    color: #2d3748;
}
.submissions-table-wrap tr:last-child td {
    border-bottom: none;
}
.submissions-table-wrap tr:hover td {
    background: #f8fafc;
}
.submission-status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.submissions-loading, .submissions-empty {
    text-align: center;
    padding: 48px 24px;
    color: #4a5568;
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
}
.submissions-loading p, .submissions-empty p {
    margin-top: 16px;
    font-size: 16px;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    #mySubmissionsModal { padding: 12px; align-items: flex-start; }
    .submissions-modal-box { width: 100%; max-height: 95vh; border-radius: 10px; }
    .submissions-modal-header { padding: 16px 20px; flex-wrap: wrap; }
    .submissions-modal-header h2 { font-size: 18px; }
    .submissions-modal-body { padding: 16px 20px; font-size: 14px; }
    .submission-card-header { padding: 14px 18px; flex-direction: column; align-items: flex-start; }
    .submission-card-header .req-no { font-size: 16px; }
    .submission-card-header .meta { font-size: 13px; }
    .submission-card-body { padding: 18px; }
    .submission-info-grid { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px; }
    .submission-info-item { font-size: 13px; }
    .submissions-table-wrap { font-size: 13px; }
    .submissions-table-wrap th, .submissions-table-wrap td { padding: 10px 8px; }
    .submission-status-badge { font-size: 11px; padding: 4px 10px; }
}

@media (max-width: 480px) {
    .submissions-modal-header h2 { font-size: 16px; }
    .submission-card-header .req-no { font-size: 15px; }
}

/* Dashboard mobile responsive */
@media (max-width: 768px) {
    .container { padding: 16px !important; max-width: 100% !important; }
    .header-actions { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
    .header-btn { padding: 10px 16px; font-size: 14px; }
    .stats-container { flex-direction: column; gap: 12px; }
    .stat-card { min-width: 100%; }
    .requests-table-container { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .requests-table, table { display: block; font-size: 13px; }
    .requests-table th, .requests-table td { padding: 10px 8px; }
    .form-row { flex-wrap: wrap; }
    .section-title { font-size: 16px; padding: 12px 16px; }
    .popup-content { width: 98% !important; max-height: 95vh; }
    .popup-body { padding: 16px 20px; font-size: 14px; }
    .popup-header { padding: 14px 18px; }
    .detail-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .detail-label { min-width: 100%; flex: none; }
    .detail-value { flex: none; width: 100%; }
    .popup-actions { flex-wrap: wrap; padding: 12px 16px; }
}

@media (max-width: 480px) {
    h1, #dashboard-title { font-size: 1.25rem !important; }
    .header h1 { font-size: 1.1rem !important; }
    .stat-card .value { font-size: 22px; }
    .header-actions { flex-direction: column; align-items: stretch; }
    .header-btn { width: 100%; }
} 