* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f5f5f5;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: #677b8f;
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}


.logo {
    height: 80px;
}


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

.header h1 {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: #34495e;
}

/* Home Page Styles */
.home-container {
    text-align: center;
    padding: 2rem 1rem;
}

.home-container h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.home-container p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 4rem;
}









/* Quick fix without changing HTML */
.detail-section-full {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.detail-section-full label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 60px;
    margin: 0;
}

.detail-section-full p {
    margin: 0;
    flex: 1;
    color: #333;
}

.parts-list-full {
    flex: 1;
}



/* Alternative: Make entire modal scrollable */
.service-modal-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.service-form-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.large-modal .modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 2rem;
}

.large-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.large-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.large-modal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.large-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Parts section limit height */
.parts-section {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    max-height: 150px;
    overflow-y: auto;
}

.parts-section::-webkit-scrollbar {
    width: 4px;
}

.parts-section::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.parts-section::-webkit-scrollbar-thumb {
    background: #dee2e6;
}

/* Service history list scrolling */
.service-history-list {
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .large-modal .modal-body {
        max-height: calc(100vh - 150px);
        padding: 1rem;
    }
    
    .service-form .form-row {
        grid-template-columns: 1fr;
    }
}
















.cta-button {
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.cta-primary {
    background: #3498db;
    color: white;
}

.cta-primary:hover {
    background: #2980b9;
}

.cta-secondary {
    background: #95a5a6;
    color: white;
}

.cta-secondary:hover {
    background: #7f8c8d;
}

.features-section {
    margin-top: 4rem;
    text-align: left;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.feature-card {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    font-size: 1rem;
}

/* Form Styles */
.machine-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.machine-form h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.submit-btn {
    background: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: #2980b9;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* QR Generator Styles */
.qr-generator {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.qr-container {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    display: inline-block;
}

.qr-url {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    margin: 1rem 0;
    word-break: break-all;
}

.download-btn {
    background: #27ae60;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background: #219a52;
}

.success-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.machine-details-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.machine-details-card p {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.machine-details-card p:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.next-steps {
    background: #e8f4fd;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.next-steps h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.next-steps p {
    margin-bottom: 0.5rem;
    color: #555;
}

/* Machine Details Styles */
.machine-details {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.machine-details h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.details-grid {
    display: grid;
    gap: 2rem;
}

.detail-section {
    border: 1px solid #eee;
    padding: 1.5rem;
    border-radius: 8px;
}

.detail-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-item label {
    font-weight: 600;
    color: #555;
}

.detail-item span {
    color: #333;
}

.status-active { color: #27ae60; font-weight: 600; }
.status-inactive { color: #95a5a6; font-weight: 600; }
.status-scrap { color: #e74c3c; font-weight: 600; }
.status-repair { color: #f39c12; font-weight: 600; }

/* Service History Styles */
.service-history {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.service-history h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.service-item {
    border: 1px solid #eee;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.service-type {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.service-details .detail-item {
    border-bottom: 1px solid #f8f9fa;
}

.parts-list {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.part-item {
    margin-bottom: 0.25rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
}

/* Recent Machines */
.recent-machines {
    margin-top: 4rem;
}

.recent-machines h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.machines-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.machine-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s;
}

.machine-card:hover {
    transform: translateY(-2px);
}

.machine-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.machine-card p {
    margin-bottom: 0.5rem;
    color: #666;
}

.no-machines {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* ===== ALL MACHINES TABLE STYLES ===== */
.machines-table-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.table-header h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.header-actions .cta-button {
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.header-actions .cta-primary {
    background: #3498db;
    color: white;
}

.header-actions .cta-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.header-actions .cta-secondary {
    background: #95a5a6;
    color: white;
}

.header-actions .cta-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    gap: 1rem;
}

.search-box {
    flex: 1;
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

.btn-clear {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-clear:hover {
    background: #7f8c8d;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.machines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 1200px;
}

.machines-table th {
    background: #34495e;
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    font-size: 13px;
}

.machines-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    font-size: 13px;
}

.machines-table tr:hover {
    background: #f8f9fa !important;
}

.machines-table tr:nth-child(even) {
    background: #fafafa;
}

.machines-table tr:nth-child(even):hover {
    background: #f0f0f0 !important;
}

/* Column specific styles */
.qr-cell {
    text-align: center;
    width: 80px;
}

.btn-open-qr {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 600;
    width: 60px;
}

.btn-open-qr:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.machine-uid {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 12px;
    width: 120px;
    color: #2c3e50;
}

.machine-name {
    font-weight: 600;
    color: #2c3e50;
    width: 150px;
}

.machine-model {
    width: 100px;
    color: #555;
}

.serial-number {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 12px;
    width: 150px;
}

.location {
    width: 150px;
    color: #555;
}

.purchase-date, .installation-date, .warranty-date, .created-date {
    width: 110px;
    text-align: center;
    font-size: 12px;
    color: #555;
}

.warranty-date {
    width: 140px;
}

.warranty-days {
    font-size: 11px;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.warranty-ok {
    color: #27ae60;
}

.warranty-warning {
    color: #f39c12;
}

.warranty-expiring {
    color: #e74c3c;
}

.warranty-expired {
    color: #c0392b;
    font-weight: bold;
}

.status {
    width: 120px;
    text-align: center;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    min-width: 90px;
    letter-spacing: 0.5px;
}

.actions {
    width: 120px;
}

.actions-header {
    text-align: center;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.btn-action {
    padding: 6px 10px;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    font-size: 11px;
    transition: all 0.3s;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    font-weight: 600;
    display: block;
}

.btn-view {
    background: #3498db;
    color: white;
}

.btn-service {
    background: #983114;
    color: white;
}

.btn-view-service {
    background: #14982a;
    color: white;
}

.btn-view:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-download {
    background: #27ae60;
    color: white;
}

.btn-download:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.btn-api {
    background: #9b59b6;
    color: white;
}

.btn-api:hover {
    background: #8e44ad;
    transform: translateY(-1px);
}

/* Service History Column */
.service-history-cell {
    width: 100px;
    text-align: center;
}

.btn-service-history {
    background: #e67e22;
    color: white;
    border: none;
    display: flex; 
    margin: auto;
    padding: 7px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 400;
    width: 60px;
}

.btn-service-history:hover {
    background: #d35400;
    transform: translateY(-1px);
}

/* Table Summary */
.table-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 1.5rem;
    border: 1px solid #e0e0e0;
}

.summary-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.summary-left p {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

.summary-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: #555;
}

.stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.summary-right {
    display: flex;
    gap: 1rem;
}

.btn-export, .btn-print {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.btn-export:hover, .btn-print:hover {
    background: #34495e;
    transform: translateY(-1px);
}

/* No Machines Message */
.no-machines-message {
    text-align: center;
    padding: 3rem;
    color: #666;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 2rem 0;
}

.no-machines-message h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.no-machines-message a {
    color: #3498db;
    text-decoration: none;
}

.no-machines-message a:hover {
    text-decoration: underline;
}

/* Status Colors */
.status-active { 
    background: #27ae60; 
    color: white; 
}

.status-inactive { 
    background: #95a5a6; 
    color: white; 
}

.status-under-repair { 
    background: #f39c12; 
    color: white; 
}

.status-scrap { 
    background: #e74c3c; 
    color: white; 
}

.stat-dot.status-active { background: #27ae60; }
.stat-dot.status-inactive { background: #95a5a6; }
.stat-dot.status-under-repair { background: #f39c12; }
.stat-dot.status-scrap { background: #e74c3c; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    background: #2c3e50;
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
}

.close {
    color: white;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* QR Modal Container */
.qr-modal-container {
    text-align: center;
}

.qr-image-container {
    margin-bottom: 1.5rem;
}

.modal-qr-code {
    width: 200px;
    height: 200px;
    border: 2px solid #34495e;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.qr-info {
    text-align: left;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 100px;
    font-size: 14px;
}

.info-value {
    color: #34495e;
    text-align: right;
    flex: 1;
    font-size: 14px;
}

.qr-url {
    font-family: 'Courier New', monospace;
    background: #34495e;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
}

/* Modal Buttons */
.btn-download-modal, .btn-close-modal {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.btn-download-modal {
    background: #27ae60;
    color: white;
}

.btn-download-modal:hover {
    background: #219a52;
}

.btn-close-modal {
    background: #95a5a6;
    color: white;
}

.btn-close-modal:hover {
    background: #7f8c8d;
}

/* Service History Modal Styles */
.large-modal {
    max-width: 800px;
    width: 95%;
}

.service-modal-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.service-form-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.service-form-section h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.service-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.service-form .form-group {
    display: flex;
    flex-direction: column;
}

.service-form .form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.service-form .form-group input,
.service-form .form-group select,
.service-form .form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.service-form .form-group input:focus,
.service-form .form-group select:focus,
.service-form .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.service-form .full-width {
    grid-column: 1 / -1;
}

.service-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Parts Section */
.parts-section {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.parts-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.parts-section .section-header label {
    margin: 0;
    font-weight: 600;
    color: #555;
}

.parts-section .section-header small {
    color: #666;
    font-size: 12px;
}

.part-item {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.part-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.part-item .form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr auto;
    gap: 0.5rem;
    align-items: end;
}

.part-item .form-group {
    margin-bottom: 0;
}

.btn-add-part {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 0.5rem;
}

.btn-add-part:hover {
    background: #219a52;
}

.btn-remove-part {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove-part:hover {
    background: #c0392b;
}

/* Service History Section */
.service-history-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h4 {
    margin: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.btn-toggle-history {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-toggle-history:hover {
    background: #2980b9;
}

/* Service History List */
.service-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.service-record {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.service-record:last-child {
    margin-bottom: 0;
}

.service-record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.service-main-info {
    flex: 1;
}

.service-type-badge {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.service-date-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.service-date {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.service-technician {
    color: #666;
    font-size: 13px;
}

.service-vendor {
    color: #7f8c8d;
    font-size: 12px;
    font-style: italic;
}

.service-technician-info {
    text-align: right;
}

.service-created {
    color: #95a5a6;
    font-size: 11px;
    margin-top: 0.25rem;
}

.service-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-weight: 600;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.attachments-link {
    color: #3498db;
    text-decoration: none;
    font-size: 13px;
}

.attachments-link:hover {
    text-decoration: underline;
}

.parts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.part-replaced {
    background: #e8f4fd;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #2c3e50;
    border-left: 4px solid #3498db;
}

.part-replaced strong {
    color: #2c3e50;
}

.next-service-due {
    background: #e8f6f3;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
    margin-top: 1rem;
}

.next-service-due label {
    font-weight: 600;
    color: #27ae60;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.next-service-date {
    color: #27ae60;
    font-weight: 600;
    font-size: 14px;
}

.no-services-message {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
    background: white;
    border: 2px dashed #ddd;
    border-radius: 6px;
}

/* Form Actions */
.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-submit-service {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-submit-service:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.btn-cancel-service {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-cancel-service:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

/* Service Type Badge Colors */
.service-type-PreventiveMaintenance { background: #27ae60; }
.service-type-BreakdownMaintenance { background: #e74c3c; }
.service-type-AMC { background: #9b59b6; }
.service-type-EmergencyRepair { background: #e67e22; }
.service-type-RoutineCheck { background: #3498db; }
.service-type-Calibration { background: #f39c12; }
.service-type-Installation { background: #1abc9c; }
.service-type-Commissioning { background: #34495e; }

/* Scrollbar Styling for Service History */
.service-history-list::-webkit-scrollbar {
    width: 6px;
}

.service-history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.service-history-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.service-history-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
    
    .filter-controls {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .success-grid {
        grid-template-columns: 1fr;
    }
    
    .home-container h1 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .machines-list {
        grid-template-columns: 1fr;
    }
    
    .machines-table-container {
        padding: 1rem;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .table-summary {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .summary-left {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .summary-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .summary-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .machines-table {
        font-size: 12px;
    }
    
    .machines-table th,
    .machines-table td {
        padding: 8px 6px;
    }
    
    .btn-open-qr, .btn-action, .btn-service-history {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .large-modal {
        margin: 5% auto;
        width: 98%;
    }
    
    .service-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .part-item .form-row {
        grid-template-columns: 1fr;
    }
    
    .service-details-grid {
        grid-template-columns: 1fr;
    }
    
    .service-record-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .service-technician-info {
        text-align: left;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit-service,
    .btn-cancel-service {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    /* Service History Column - Updated for two buttons */
.service-history-cell {
    width: 140px;
    text-align: center;
}

.service-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.btn-service-history {
    background: #e67e22;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 600;
    width: 100%;
}

.btn-service-history:hover {
    background: #d35400;
    transform: translateY(-1px);
}

.btn-view-services {
    background: #3498db;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 400;
    width: 80px;
}

.btn-view-services:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* View Services Modal Styles */
.view-services-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.services-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid #3498db;
}

.summary-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.summary-content {
    flex: 1;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.summary-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.services-list-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.services-list-container h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.all-services-list {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-record-full {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.service-record-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.service-record-header-full {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.service-main-info-full {
    flex: 1;
}

.service-type-badge-full {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.service-date-full {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.service-technician-full {
    text-align: right;
    color: #666;
    font-size: 13px;
}

.service-technician-full small {
    color: #7f8c8d;
    font-style: italic;
}



.service-details-full {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-section-full {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-section-full label {
    font-weight: 600;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section-full p {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.parts-list-full {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.part-replaced-full {
    background: #e8f4fd;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 13px;
    color: #2c3e50;
    border-left: 4px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.part-replaced-full strong {
    color: #2c3e50;
}

.next-service-full {
    color: #27ae60;
    font-weight: 600;
    font-size: 14px;
    background: #e8f6f3;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border-left: 4px solid #27ae60;
}

/* Service Type Badge Colors for View Modal */
.service-type-badge-full.service-type-PreventiveMaintenance { background: #27ae60; }
.service-type-badge-full.service-type-BreakdownMaintenance { background: #e74c3c; }
.service-type-badge-full.service-type-AMC { background: #9b59b6; }
.service-type-badge-full.service-type-EmergencyRepair { background: #e67e22; }
.service-type-badge-full.service-type-RoutineCheck { background: #3498db; }
.service-type-badge-full.service-type-Calibration { background: #f39c12; }
.service-type-badge-full.service-type-Installation { background: #1abc9c; }
.service-type-badge-full.service-type-Commissioning { background: #34495e; }

/* Scrollbar Styling */
.all-services-list::-webkit-scrollbar {
    width: 8px;
}

.all-services-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.all-services-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.all-services-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design for View Services Modal */
@media (max-width: 768px) {
    .service-record-header-full {
        flex-direction: column;
        gap: 1rem;
    }
    
    .service-technician-full {
        text-align: left;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .service-record-full {
        padding: 1rem;
    }
}

}