/* --- TABLES & STATUS TAGS --- */
.data-table, .record-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.data-table th, .data-table td, .record-table th, .record-table td { text-align: left; padding: 14px; border: 1px solid var(--border-color); }
.data-table th, .record-table th { background-color: var(--bg-color); color: var(--muted-text); font-size: 0.85em; text-transform: uppercase; }
.data-table tfoot td, .record-table tfoot td { background-color: var(--bg-color); font-weight: bold; border-top: 2px solid var(--border-color); text-transform: uppercase; font-size: 0.95em; }
.record-table th { width: 30%; }

.status-tag { padding: 6px 12px; border-radius: 20px; font-size: 0.7em; font-weight: bold; text-transform: uppercase; display: inline-block; }
.status-pending { background: #ffebee; color: #c62828; }
.status-progress { background: #e3f2fd; color: #1565c0; }
.status-ready { background: #fff3e0; color: #ef6c00; }
.status-completed { background: #e8f5e9; color: #2e7d32; }

.log-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #2e7d32; }
.log-fail { background: #ffebee; color: #c62828; border: 1px solid #c62828; }
.log-info { background: #e3f2fd; color: #1565c0; border: 1px solid #1565c0; }
.log-warn { background: #fff3e0; color: #ef6c00; border: 1px solid #ef6c00; }
.log-paused { background: #9e9e9e; color: white; border: 1px solid #9e9e9e; }
.table-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.action-form { margin: 0; }

/* --- FORMS & INPUTS --- */
.form-card { background: var(--stat-box-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 25px; margin-bottom: 25px; }
.card-title-group { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; border-bottom: 2px solid var(--bg-color); padding-bottom: 10px; }
.card-title-group h3 { margin: 0; color: var(--accent-color); }
.job-form label { display: block; margin-top: 15px; font-weight: bold; color: var(--muted-text); }
.job-form input, .job-form select, .job-form textarea { width: 100%; padding: 12px; margin-top: 5px; border: 1px solid var(--input-border); border-radius: 6px; background-color: var(--input-bg); color: var(--text-color); box-sizing: border-box; font-size: 1em; }
.job-form input:focus, .job-form select:focus, .job-form textarea:focus { border-color: var(--accent-color); outline: none; box-shadow: 0 0 0 3px rgba(14, 93, 3, 0.1); }
.parts-highlight { background: var(--bg-color); border-left: 6px solid var(--accent-color); }

/* --- BUTTON FORMATTING --- */
.btn-submit { background-color: var(--accent-color); color: white; padding: 0 24px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; height: 44px; font-family: inherit; font-size: 1em; box-sizing: border-box; }
.btn-submit:hover { text-decoration: none; }
.btn-small { background: var(--accent-color); color: white; padding: 0 14px; text-decoration: none; border-radius: 4px; font-weight: bold; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; height: 32px; font-family: inherit; font-size: 0.9em; box-sizing: border-box; }
.btn-excel { background-color: #1e7e34 !important; }
.btn-excel:hover { background-color: #155724 !important; }
.btn-edit { background-color: #ffc107; color: #333333 !important; }
.btn-edit:hover { background-color: #e0a800; }
.btn-pause { background-color: #f57c00; }
.btn-pause:hover { background-color: #e65100; }
.btn-resume { background-color: #388e3c; }
.btn-resume:hover { background-color: #2e7d32; }
.btn-delete { background-color: #d32f2f; color: white; }
.btn-delete:hover { background-color: #b71c1c; }
#theme-toggle { background: var(--accent-color); color: white; border: none; padding: 8px 15px; cursor: pointer; border-radius: 20px; font-size: 0.85em; }

/* --- LIGHTBOX GALLERY --- */
.lightbox-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 1000; flex-direction: column; align-items: center; justify-content: center; }
.lightbox-toolbar { position: absolute; top: 20px; right: 20px; display: flex; gap: 10px; z-index: 1001; }
.lightbox-content-wrapper { display: flex; align-items: center; justify-content: space-between; width: 95%; max-width: 1200px; height: 80vh; }
.lb-content { flex-grow: 1; display: flex; justify-content: center; align-items: center; height: 100%; padding: 0 20px; }
.lb-nav-btn { background: rgba(255, 255, 255, 0.15); color: white; border: 2px solid rgba(255,255,255,0.3); font-size: 2em; cursor: pointer; padding: 15px 25px; border-radius: 8px; transition: background 0.3s; }
.lb-nav-btn:hover { background: rgba(255, 255, 255, 0.4); }
.lb-counter { position: absolute; bottom: 30px; color: white; font-size: 1.2em; font-weight: bold; background: rgba(0,0,0,0.5); padding: 10px 20px; border-radius: 20px; }

/* --- MULTI-COLUMN FORM GRIDS --- */
.grid-header {
    font-weight: bold;
    font-size: 0.85em;
    color: var(--muted-text);
}

.labor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 0.5fr 0.5fr;
    gap: 10px;
}

.parts-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 0.5fr 0.5fr 0.5fr;
    gap: 10px;
}

.row-spacing { margin-bottom: 10px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

/* Secondary Button (Grey) */
.btn-secondary {
    background-color: #444444 !important;
}
.btn-secondary:hover {
    background-color: #333333 !important;
}

/* Helper Utilities */
.text-center { text-align: center; }
.cursor-help { cursor: help; }
.checkbox-cell { text-align: center; padding-top: 10px; }

/* --- FORM COMPONENT UTILITIES --- */
.file-upload-box {
    padding: 15px; 
    background: var(--bg-color); 
    border: 1px dashed var(--border-color); 
    border-radius: 4px;
}

.file-input {
    padding: 8px 0; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    width: 100%;
}

.padded-box {
    padding: 15px;
    border-radius: 4px;
}

.mb-40 { margin-bottom: 40px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-0 { margin-top: 0 !important; }

/* --- FORM COMPONENT UTILITIES --- */

/* Icons */
.card-icon {
    width: 24px; 
    height: 24px; 
    color: var(--accent-color);
}

/* Checkboxes & Labels */
.checkbox-label {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    cursor: pointer;
}
.large-checkbox {
    width: 20px; 
    height: 20px; 
    margin: 0;
}

/* Layout Boxes */
.parts-details-box {
    margin-top: 15px; 
    border-top: 2px dashed var(--border-color); 
    padding-top: 15px;
}
.info-box {
    background: #f9f9f9; 
    padding: 15px; 
    border-radius: 4px; 
    border: 1px solid #eee;
}

/* Actions & Links */
.action-row {
    display: flex; 
    align-items: center; 
    gap: 20px;
    flex-wrap: wrap;
}
.btn-discard {
    background-color: #444444;
    color: #ffffff !important;
    padding: 0 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    font-size: 1em;
    box-sizing: border-box;
}
.btn-discard:hover {
    background-color: #333333;
    text-decoration: none;
    color: #ffffff !important;
}

/* Typography & Spacing Utilities */
.fw-bold { font-weight: bold !important; }
.lg-text { font-size: 1.1em; }
.small-text { font-size: 0.85em; }
.mb-10 { margin-bottom: 10px !important; }
.mt-15 { margin-top: 15px !important; }
.mt-40 { margin-top: 40px !important; }

/* --- WARNING CARD STYLING --- */
.card-warning {
    border-left: 6px solid #ef6c00 !important;
}

.icon-warning {
    color: #ef6c00 !important;
}

.text-warning {
    color: #ef6c00 !important;
}

.text-dark {
    color: #333333 !important;
}

.mt-30 { 
    margin-top: 30px !important; 
}
/* Width constraint utility */
.max-w-500 {
    max-width: 500px;
}
/* --- LAYOUT UTILITIES --- */
.action-row-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.align-center {
    align-self: center;
}

.text-success {
    color: #2e7d32 !important;
}
/* --- LOGIN & SECURITY LAYOUTS --- */
.login-wrapper {
    max-width: 450px;
    margin: 60px auto;
    text-align: center;
}

.criteria-box {
    background: var(--container-bg);
    padding: 15px;
    border-radius: 6px;
    text-align: left;
    font-size: 0.9em;
    color: var(--muted-text);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.criteria-box ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.logo-small {
    max-height: 80px;
    margin-bottom: 10px;
}

/* --- UTILITY CLASSES --- */
.bg-nav { background-color: var(--nav-bg); }
.text-left { text-align: left; }
.text-center { text-align: center; }
.mb-25 { margin-bottom: 25px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-15 { margin-bottom: 15px !important; }
.mt-25 { margin-top: 25px !important; }
.mt-15 { margin-top: 15px !important; }
.d-block { display: block !important; }
.w-100 { width: 100% !important; }
.fw-bold { font-weight: bold !important; }
/* Login specific elements */
.login-logo {
    max-height: 80px;
    margin-bottom: 20px;
}

.totp-input {
    text-align: center;
    font-size: 1.5em;
    letter-spacing: 5px;
}

.w-100 {
    width: 100%;
}
/* Success Box Style */
.success-box {
    background: #e8f5e9;
    border: 1px solid #2e7d32;
    color: #2e7d32;
    padding: 15px;
    border-radius: 6px;
}

/* 2FA Elements */
.active-2fa-badge {
    font-size: 1.1em;
    padding: 12px 24px;
    display: inline-block;
    margin-bottom: 20px;
}

.qr-container {
    text-align: center;
    margin: 20px 0;
}

.qr-image {
    border: 2px solid var(--border-color);
    padding: 10px;
    background: white;
    border-radius: 8px;
}

/* Big Input for TOTP codes */
.totp-input {
    text-align: center;
    font-size: 1.5em;
    letter-spacing: 5px;
}

/* Specific Button Colors */
.btn-danger { background-color: #c62828 !important; }
.btn-primary { background-color: #1565c0 !important; }

/* General utility classes if not present */
.p-20 { padding: 20px; }
.m-0 { margin: 0 !important; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px !important; }
.w-100 { width: 100%; }
/* User Identity Layouts */
.user-identity-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.bg-accent { background: var(--accent-color); }
.bg-muted { background: #999; }

/* IP Address Formatting */
.ip-address-cell {
    font-family: monospace;
    font-weight: bold;
}

/* Red-border for stats */
.stat-box.border-danger {
    border-left: 4px solid #c62828;
}

.stat-box.border-accent {
    border-left: 4px solid var(--accent-color);
}

.text-danger {
    color: #c62828 !important;
}
/* Pagination Navigation Styles */
.pagination-nav {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.disabled-btn {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #999 !important;
}

.fw-bold {
    font-weight: bold;
}
/* --- AUDIT LOG SVG ICONS --- */
.log-icon-svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    stroke-width: 2.5px; /* Makes icons look solid and bold */
}

/* Inherit colors from the status-tag classes */
.log-success .log-icon-svg { color: #2e7d32; }
.log-fail .log-icon-svg    { color: #c62828; }
.log-info .log-icon-svg    { color: #1565c0; }
.log-warn .log-icon-svg    { color: #ef6c00; }

/* Printer Icon in Button */
.btn-icon-svg {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: middle;
    margin-bottom: 2px;
}