/* ==========================================
   Modern Reset & Base (Mobile-First)
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f4f6f9;
    color: #333;
    line-height: 1.6;
    padding: 10px;
}

.container {
    max-width: 960px;
    margin: 20px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

/* Typography */
h1, h2, h3, h4 {
    color: #1a2b4c;
    margin-bottom: 15px;
    font-weight: 600;
}
h2 {
    font-size: 22px;
    border-bottom: 2px solid #e9ecf2;
    padding-bottom: 10px;
}

/* Buttons & Links as Buttons */
button, .btn {
    background: #4f6ef7;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 44px;
    min-height: 44px;
    line-height: 1.2;
}

button:hover, .btn:hover {
    background: #3b54d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,110,247,0.3);
}

button:active {
    transform: translateY(0);
}

/* Forms */
label {
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
    color: #4a5568;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="file"],
input[type="password"],
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px; /* mencegah zoom di iOS */
    margin-bottom: 15px;
    transition: border 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #4f6ef7;
    box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
}

/* Tables - Wrapper untuk scroll horizontal di mobile */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    min-width: 650px; /* agar scroll muncul di mobile */
}

th {
    background: #f8fafd;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #1a2b4c;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecf2;
    white-space: nowrap;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f3f7;
    font-size: 14px;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

/* Invoice Box (Halaman Klien) */
.invoice-box {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin: 20px auto;
    max-width: 750px;
}

.bank-info {
    background: #eef1ff;
    border-left: 4px solid #4f6ef7;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.bank-info strong {
    flex: 1 1 auto;
}

/* Status Badge */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.status-sent { background: #fef3c7; color: #92400e; }
.status-waiting { background: #ffedd5; color: #c2410c; }
.status-paid { background: #d1fae5; color: #065f46; }

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }

/* Utility */
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Login Box */
.login-box {
    max-width: 400px;
    margin: 60px auto;
}

/* ==========================================
   RESPONSIVE STYLES (Mobile)
   ========================================== */
@media screen and (max-width: 768px) {
    body {
        padding: 5px;
    }

    .container {
        margin: 10px auto;
        padding: 15px;
        border-radius: 12px;
    }

    h2 {
        font-size: 20px;
    }

    /* Tombol full width di mobile */
    button, .btn {
        width: 100%;
        margin-bottom: 10px;
        font-size: 15px;
    }

    /* Form ukuran lebih kecil padding */
    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="number"],
    input[type="file"],
    input[type="password"],
    select {
        font-size: 16px; /* hindari zoom */
        padding: 12px 10px;
    }

    /* Tabel: pastikan wrapper scroll */
    .table-wrapper {
        margin: 15px -15px;
        width: calc(100% + 30px);
        border-radius: 0;
    }

    /* Flexbox untuk profil upload gambar agar menumpuk */
    .profile-images {
        flex-direction: column;
        gap: 15px;
    }

    /* Invoice box full width */
    .invoice-box {
        border-radius: 0;
        margin: 0 -10px;
        padding: 15px;
        box-shadow: none;
    }

    /* Bank info stack */
    .bank-info {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Tombol "Salin Rekening" di samping? Bisa full width */
    .copy-btn {
        width: auto;
        margin-left: 0;
        margin-top: 5px;
    }

    /* Dashboard header flex column */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    /* Status badge tetap kecil */
    .status-badge {
        font-size: 11px;
    }
}

/* Perbaikan untuk layar sangat kecil (misal 400px) */
@media screen and (max-width: 480px) {
    table {
        min-width: 500px;
    }
}