* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* GANTI: Gradasi → Foto Ruang Komunikasi */
    background: url('../bg-komunikasi.jpg') center/cover fixed no-repeat;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    /* JANGAN DIGANGGU: Foto bg-komunikasi.jpg tetap ada di dalam container */
    background-image: url('../bg-komunikasi.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    position: relative;
}

/* Overlay putih transparan di atas foto untuk readability */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.70);
    border-radius: 15px;
    z-index: 0;
}

/* Semua content form di atas overlay */
.container > * {
    position: relative;
    z-index: 1;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    border-bottom: 3px solid #667eea;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.header-bg-image {
    display: none;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: bold;
}

.subtitle {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.logo {
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="file"] {
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(248, 249, 250, 0.95);
    border-radius: 8px;
    border: 1px solid #e9ecef;
    backdrop-filter: blur(10px);
}

.form-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    font-weight: 600;
    font-size: 13px;
}

.data-table td input,
.data-table td select,
.data-table td textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.98);
}

.data-table td textarea {
    resize: vertical;
    min-height: 40px;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.data-table tbody tr:nth-child(even):hover {
    background: #f0f2f5;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.message-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
}

.message-box.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-box.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-box.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Shift Checkbox Styling */
.shift-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.shift-checkbox:checked + span {
    color: #667eea;
    font-weight: 600;
}

/* List Peralatan Table Styling */
#listPeralatanTable {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#listPeralatanTable thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#listPeralatanTable tbody tr {
    transition: background 0.2s;
}

#listPeralatanTable tbody tr:hover {
    background: #f8f9fa;
}

#listPeralatanTable tbody tr:nth-child(even) {
    background: #fafbfc;
}

#listPeralatanTable tbody tr:nth-child(even):hover {
    background: #f0f2f5;
}

/* Sort Icon */
.sort-icon {
    font-size: 10px;
    margin-left: 5px;
    opacity: 0.6;
}

/* Search Box Styling */
#peralatanSearch {
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

#peralatanSearch:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Pagination Button Styling */
.pagination-btn {
    transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background: #f0f2f5 !important;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-btn.active {
    pointer-events: none;
}

/* Search Button Hover Effect */
#searchBtn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Loading indicator */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 10px;
        background-attachment: scroll;
    }
    
    .container::before {
        background: rgba(255, 255, 255, 0.95);
    }
    
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .logo {
        height: 100px !important;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    #listPeralatanTable {
        font-size: 11px;
    }
    
    #listPeralatanTable th,
    #listPeralatanTable td {
        padding: 6px;
    }
    
    #peralatanSearch {
        width: 150px;
    }
    
    .pagination-btn {
        padding: 4px 8px !important;
        font-size: 12px;
    }
}

/* Signature Canvas Styling */
.signature-container {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 8px;
    backdrop-filter: blur(5px);
}

#signatureCanvas {
    border: 2px dashed #667eea;
    border-radius: 5px;
    cursor: crosshair;
    background: white;
    display: block;
    margin: 0 auto 15px auto;
    transition: border-color 0.3s;
}

#signatureCanvas:hover {
    border-color: #5a6fd8;
}

.signature-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.signature-controls .btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Signature canvas responsive */
@media (max-width: 768px) {
    #signatureCanvas {
        width: 100%;
        max-width: 350px;
        height: 150px;
    }
    
    .signature-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .signature-controls .btn {
        width: 150px;
    }
}

/* Print styles untuk PDF */
@media print {
    body {
        background: white;
    }
    
    body::before {
        display: none;
    }
    
    .container {
        box-shadow: none;
    }
    
    .form-actions,
    .btn {
        display: none;
    }
/* Image Preview Container */
    #imagePreviewContainer {
        background: rgba(248, 249, 250, 0.95);
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #e9ecef;
        backdrop-filter: blur(10px);
    }

    #imagePreviewContainer h4 {
        color: #333;
        font-weight: 600;
        margin-bottom: 10px;
    }

    #imagePreviewGrid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    /* Preview Item Hover Effect */
    #imagePreviewGrid > div:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        transition: all 0.3s ease;
    }

    /* Remove Button Hover */
    #imagePreviewGrid button:hover {
        background: #c82333 !important;
        transform: scale(1.1);
        transition: all 0.2s ease;
    }

    /* Responsive */
    @media (max-width: 768px) {
        #imagePreviewGrid {
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 10px;
        }
    }
    /* Draft List Card Styling */
    .draft-card {
        background: rgba(255, 255, 255, 0.98);
        border: 2px solid #ddd;
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        transition: all 0.3s;
        position: relative;
        z-index: 1;
    }

    .draft-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        border-color: #667eea;
    }

    .draft-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 2px solid #f0f0f0;
    }

    .draft-title {
        font-size: 18px;
        font-weight: bold;
        color: #333;
    }

    .draft-date {
        font-size: 12px;
        color: #999;
        margin-top: 5px;
    }

    .draft-info {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        margin-bottom: 15px;
    }

    .draft-info-item {
        font-size: 13px;
        color: #666;
    }

    .draft-info-item strong {
        color: #667eea;
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
    }

    .draft-actions {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    /* Badge Styling */
    .badge {
        display: inline-block;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .badge-draft {
        background: #ffc107;
        color: #333;
    }

    .badge-submitted {
        background: #28a745;
        color: white;
    }

    /* Empty State */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        color: #999;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 10px;
        backdrop-filter: blur(10px);
    }

    .empty-state img {
        width: 150px;
        opacity: 0.5;
        margin-bottom: 20px;
    }

    /* Existing Photos Container (untuk edit draft) */
    #existingPhotosContainer {
        background: rgba(248, 249, 250, 0.95);
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #e9ecef;
        backdrop-filter: blur(10px);
        margin-top: 15px;
    }

    #existingPhotosContainer h4 {
        color: #333;
        font-weight: 600;
        margin-bottom: 10px;
        font-size: 14px;
    }

    #existingPhotosGrid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .existing-photo-item {
        position: relative;
        border: 2px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        transition: all 0.3s;
    }

    .existing-photo-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .existing-photo-item img {
        width: 100%;
        height: 120px;
        object-fit: cover;
        display: block;
    }

    .existing-photo-item button {
        position: absolute;
        top: 5px;
        right: 5px;
        background: #dc3545;
        color: white;
        border: none;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        cursor: pointer;
        font-size: 18px;
        line-height: 1;
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .existing-photo-item button:hover {
        background: #c82333;
        transform: scale(1.1);
    }

    /* Button Info Style */
    .btn-info {
        background: #17a2b8;
        color: white;
        padding: 10px 20px;
        border-radius: 5px;
        font-weight: 600;
        transition: all 0.3s;
    }

    .btn-info:hover {
        background: #138496;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
    }

    /* Loading Animation */
    .loading {
        opacity: 0.6;
        pointer-events: none;
        position: relative;
    }

    .loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid rgba(255,255,255,0.3);
        border-top-color: white;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    /* Responsive Draft Styles */
    @media (max-width: 768px) {
        .draft-card {
            padding: 15px;
        }
        
        .draft-header {
            flex-direction: column;
            align-items: flex-start;
        }
        
        .draft-title {
            font-size: 16px;
            margin-bottom: 5px;
        }
        
        .draft-info {
            grid-template-columns: 1fr;
            gap: 10px;
        }
        
        .draft-actions {
            width: 100%;
            flex-direction: column;
        }
        
        .draft-actions .btn {
            width: 100%;
        }
        
        #existingPhotosGrid {
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 10px;
        }
        
        .existing-photo-item img {
            height: 100px;
        }
    }

    /* TTD dari Draft Preview */
    .signature-container img {
        max-width: 200px;
        max-height: 100px;
        border: 1px solid #ddd;
        background: white;
        padding: 5px;
        border-radius: 5px;
        display: block;
    }

    /* Enhanced Message Box */
    .message-box.info {
        background: #d1ecf1;
        color: #0c5460;
        border: 1px solid #bee5eb;
    }

    /* Print Styles */
    @media print {
        .draft-card,
        .btn,
        .form-actions,
        #existingPhotosContainer button {
            display: none !important;
        }
    }
}