/* =====================================================
   TECHNICIANS MANAGEMENT SYSTEM - STYLESHEET
   Clean, responsive design
   ===================================================== */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #1e293b;
    color: #fff;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
    margin-bottom: 20px;
}

.sidebar-header h1 {
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #94a3b8;
    transition: all 0.2s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: #334155;
    color: #fff;
    text-decoration: none;
}

.sidebar-nav li a .icon {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px 30px;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.page-header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: #1e293b;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1e293b;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-card .stat-label {
    color: #64748b;
    font-size: 0.875rem;
}

.stat-card.primary { border-left: 4px solid #2563eb; }
.stat-card.success { border-left: 4px solid #10b981; }
.stat-card.warning { border-left: 4px solid #f59e0b; }
.stat-card.danger { border-left: 4px solid #ef4444; }

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table tr:hover {
    background: #f8fafc;
}

table .actions {
    white-space: nowrap;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f3f4f6;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Pagination */
.pagination {
    margin-top: 20px;
}

.pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 5px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #374151;
}

.pagination li a:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.pagination li span.current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* Profile Page */
.profile-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #64748b;
}

.profile-info h2 {
    margin: 0 0 10px;
}

.profile-meta {
    color: #64748b;
}

.profile-meta span {
    margin-right: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: #2563eb;
}

.tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards Overview (kaarten systeem) */
.cards-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.card-type-box {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: #f8fafc;
}

.card-type-box .count {
    font-size: 2rem;
    font-weight: 700;
}

.card-type-box .label {
    font-size: 0.875rem;
    color: #64748b;
}

.card-type-box.warning-1 { background: rgba(255, 193, 7, 0.2); }
.card-type-box.warning-2 { background: rgba(253, 126, 20, 0.2); }
.card-type-box.yellow-card { background: rgba(255, 235, 59, 0.3); }
.card-type-box.red-card { background: rgba(220, 53, 69, 0.2); }
.card-type-box.joker { background: rgba(111, 66, 193, 0.2); }
.card-type-box.total { background: #e2e8f0; }

/* Notes */
.note-item {
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 15px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: #64748b;
}

.note-content {
    white-space: pre-wrap;
}

/* Map */
#map {
    height: 600px;
    border-radius: 8px;
}

/* Info Box */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-item .label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item .value {
    font-size: 1rem;
    color: #1e293b;
    margin-top: 3px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1e293b;
}

/* User Info in Sidebar */
.sidebar-user {
    padding: 15px 20px;
    border-top: 1px solid #334155;
    margin-top: auto;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
}

.sidebar-user .user-name {
    font-weight: 500;
}

.sidebar-user .user-role {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* File Upload */
.file-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload:hover {
    border-color: #2563eb;
    background: #f8fafc;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload .icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 100;
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .cards-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 101;
    background: #1e293b;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #64748b; }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }
.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; }
.hidden { display: none; }

/* Training Module Styles */
.training-status-voltooid {
    background: #d1fae5;
    color: #065f46;
}

.training-status-niet_gedaan,
.training-status-te_laat {
    background: #fee2e2;
    color: #991b1b;
}

.training-status-bezig {
    background: #fef3c7;
    color: #92400e;
}

.penalty-warning {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.penalty-warning h4 {
    color: #991b1b;
    margin: 0 0 10px;
}

.penalty-ok {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.penalty-ok h4 {
    color: #065f46;
    margin: 0 0 10px;
}

/* Progress Bar */
.progress-bar {
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.progress-bar-fill.success {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-bar-fill.danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: #1e293b;
    text-shadow: 0 0 3px white;
}

/* Company Stats Row */
.company-row {
    transition: background-color 0.2s;
}

.company-row.has-penalty {
    background-color: #fee2e2;
}

.company-row.has-penalty:hover {
    background-color: #fecaca;
}

/* Exception Badge */
.badge-exception {
    background: #ede9fe;
    color: #5b21b6;
}

/* Training Card Type Boxes */
.training-box {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    transition: transform 0.2s;
}

.training-box:hover {
    transform: translateY(-2px);
}

.training-box .count {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.training-box .label {
    font-size: 0.875rem;
    margin-top: 5px;
}

.training-box.completed {
    background: rgba(16, 185, 129, 0.15);
}

.training-box.completed .count {
    color: #10b981;
}

.training-box.not-completed {
    background: rgba(239, 68, 68, 0.15);
}

.training-box.not-completed .count {
    color: #ef4444;
}

.training-box.in-progress {
    background: rgba(245, 158, 11, 0.15);
}

.training-box.in-progress .count {
    color: #f59e0b;
}

.training-box.exception {
    background: rgba(139, 92, 246, 0.15);
}

.training-box.exception .count {
    color: #8b5cf6;
}
