* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-size: 14px; /* ukuran huruf diperkecil */
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.main-header {
    background: #1e1e2f;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.main-header h1 {
    font-weight: 500;
    letter-spacing: 2px;
    font-size: 1.8rem;
}

/* Konten utama */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 100%; /* lebar maksimal */
    width: 100%;
    margin: 0 auto;
}

.container {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    padding: 25px;
    width: 100%;
}

.header h2 {
    font-weight: 400;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.4rem;
}

.filename {
    font-weight: 500;
    color: #5a67d8;
    background: #e9e8ff;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.9rem;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f7fafc;
    padding: 8px 16px;
    border-radius: 40px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.toolbar-group label {
    font-weight: 500;
    color: #4a5568;
}

.toolbar-group input[type="number"] {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 30px;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}

.toolbar-group input[type="number"]:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90,103,216,0.1);
}

.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #5a67d8;
    color: white;
}

.btn-primary:hover {
    background: #4c51bf;
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(90,103,216,0.3);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(72,187,120,0.3);
}

.btn-upload {
    background: #edf2f7;
    color: #2d3748;
    border: 1px dashed #a0aec0;
}

.btn-upload:hover {
    background: #e2e8f0;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 20px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #fed7d7;
    transform: scale(1.1);
}

/* Table wrapper agar bisa scroll horizontal */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background: white;
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
    min-width: 600px;
}

/* Header tabel */
th {
    background: #f8fafc;
    color: #2d3748;
    font-weight: 600;
    padding: 12px 8px;
    text-align: left;
    position: relative;
    white-space: nowrap;
    border-bottom: 2px solid #cbd5e0;
    border-right: 1px solid #cbd5e0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

th:last-child {
    border-right: none;
}

/* Sel tabel */
td {
    padding: 0;
    border: 1px solid #e2e8f0; /* grid diperjelas */
    white-space: nowrap;
}

/* Input dalam sel */
td input {
    width: 100%;
    min-width: 80px;
    padding: 10px 8px;
    border: none;
    background: transparent;
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: background 0.2s;
    border-radius: 0;
}

td input:focus {
    background: #ffffe0;
    box-shadow: inset 0 0 0 2px #f6e05e;
}

td input:hover {
    background: #f7fafc;
}

.action-cell {
    text-align: center;
    padding: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Resizer */
.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    background: transparent;
    transition: background 0.2s;
}

.resizer:hover,
.resizer:active {
    background: #5a67d8;
}

/* Halaman upload */
.upload-card {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    background: white;
    padding: 35px 25px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.upload-card h2 {
    margin-bottom: 12px;
    color: #2d3748;
    font-weight: 500;
    font-size: 1.6rem;
}

.upload-card p {
    color: #718096;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.upload-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

#file-input {
    display: none;
}

/* Footer */
.main-footer {
    background: #1e1e2f;
    color: #a0aec0;
    text-align: center;
    padding: 12px 0;
    font-size: 0.85rem;
    border-top: 1px solid #2d3748;
    position: sticky;
    bottom: 0;
    width: 100%;
}

.main-footer p {
    margin: 0;
}

/* Responsif */
@media (max-width: 768px) {
    .main-content { padding: 10px; }
    .container { padding: 15px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-group { justify-content: center; }
}