/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 32px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.title-main {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.025em;
}

.title-sub {
    font-size: 16px;
    font-weight: 400;
    color: #64748b;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: #2F80ED;
    color: white;
    box-shadow: 0 2px 4px rgba(47, 128, 237, 0.2);
}

.btn-primary:hover {
    background: #1e6fdb;
    box-shadow: 0 4px 12px rgba(47, 128, 237, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.search-container {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.search-input:focus {
    outline: none;
    border-color: #2F80ED;
    background: white;
    box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #64748b;
}

.stats {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.stats span {
    color: #2F80ED;
    font-weight: 600;
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 32px;
    position: relative;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Minimum width to prevent cramping */
}

.data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-row {
    transition: all 0.2s ease;
}

.table-row:hover {
    background: #f8fafc;
}

.table-row:last-child td {
    border-bottom: none;
}

/* Cell Styling */
.cell-nomor {
    font-weight: 600;
    color: #1e293b;
    min-width: 120px;
    white-space: nowrap;
}

.cell-nama {
    font-weight: 500;
    color: #1e293b;
    min-width: 200px;
}

.cell-date {
    color: #475569;
    min-width: 120px;
    white-space: nowrap;
}

.cell-letak {
    color: #475569;
    max-width: 200px;
    word-wrap: break-word;
}

.cell-luas {
    font-weight: 500;
    color: #059669;
    text-align: right;
    min-width: 120px;
    white-space: nowrap;
}

.cell-jenis {
    min-width: 140px;
}

.cell-batas {
    color: #475569;
    max-width: 250px;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.5;
}

.cell-keterangan {
    color: #64748b;
    max-width: 200px;
    word-wrap: break-word;
    font-size: 13px;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 8px;
    min-width: 140px;
    justify-content: flex-start;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(100, 116, 139, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: none;
    z-index: 20;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.badge-sawah {
    background: #dcfce7;
    color: #166534;
}

.badge-kebun {
    background: #fef3c7;
    color: #92400e;
}

.badge-pekarangan {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-tegalan {
    background: #fed7aa;
    color: #c2410c;
}

.badge-tambak {
    background: #cffafe;
    color: #0e7490;
}

.badge-default {
    background: #f1f5f9;
    color: #475569;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 32px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state h3 {
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: #64748b;
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 0;
    color: #64748b;
    font-size: 14px;
    border-top: 1px solid #e2e8f0;
    margin-top: 40px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding: 20px 0;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .title-main {
        font-size: 24px;
    }
    
    .search-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .search-input {
        font-size: 16px;
        padding: 14px 16px 14px 44px;
    }
    
    /* Mobile Table Styling */
    .table-container {
        margin: 0 -16px 20px -16px;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid #e2e8f0;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 500px; /* Reduced for mobile */
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .data-table th {
        background: #f1f5f9;
        font-size: 12px;
        font-weight: 600;
    }
    
    .cell-nomor {
        min-width: 100px;
        font-size: 14px;
    }
    
    .cell-nama {
        min-width: 150px;
        font-size: 13px;
    }
    
    .cell-date {
        min-width: 90px;
        font-size: 12px;
    }
    
    .table-actions {
        min-width: 120px;
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-edit, .btn-delete {
        font-size: 11px;
        padding: 4px 8px;
        text-align: center;
        width: 100%;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .data-table {
        min-width: 450px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
    
    .cell-nomor {
        min-width: 90px;
    }
    
    .cell-nama {
        min-width: 130px;
    }
    
    .cell-date {
        min-width: 80px;
        font-size: 11px;
    }
    
    .table-actions {
        min-width: 100px;
    }
}

/* Horizontal scroll indicator */
.table-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, transparent 30%, #e2e8f0 31%, #e2e8f0 69%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

@media (min-width: 769px) {
    .table-wrapper::after {
        display: none;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .header-actions,
    .search-section,
    .footer {
        display: none;
    }
    
    .table-container {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .table-row:hover {
        background: transparent;
    }
}