/* ============================================================
   NOTA AMAKA - Frontend Styles
   ============================================================ */

.nota-amaka-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 25px 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

.nota-amaka-container * {
    box-sizing: border-box;
}

.nota-amaka-container h2 {
    margin: 0;
    padding-bottom: 15px;
    color: #333;
    font-size: 22px;
    font-weight: 700;
}

/* Header row: judul + tombol riwayat */
.nota-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.nota-btn-riwayat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1F3A5F 0%, #2C4A6F 100%);
    color: #fff !important;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(31, 58, 95, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nota-btn-riwayat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(31, 58, 95, 0.4);
    color: #fff !important;
}

@media (max-width: 600px) {
    .nota-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .nota-btn-riwayat {
        width: 100%;
        justify-content: center;
    }
}

.nota-amaka-container h3 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   GRID HEADER (No Invoice, Tanggal, Jatuh Tempo, Customer)
   ============================================================ */
.nota-grid-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 25px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #e5e8f5;
}

.nota-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* penting untuk mencegah overflow di grid */
}

.nota-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nota-field input,
.nota-field select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
    max-width: 100%;
}

.nota-field input:focus,
.nota-field select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================================
   TABLE DAFTAR BARANG
   ============================================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.nota-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    min-width: 750px; /* agar tabel tidak terlalu sempit */
}

.nota-table thead th {
    background: #f0f2fa;
    color: #333;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 12px 10px;
    border-bottom: 2px solid #667eea;
    text-align: left;
    white-space: nowrap;
}

.nota-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #333;
}

.nota-table tbody tr:last-child td {
    border-bottom: none;
}

.nota-table tbody tr:hover {
    background: #fafbff;
}

.input-full {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
    transition: all 0.2s ease;
}

.input-full:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Harga display (readonly) */
.harga-display {
    display: inline-block;
    padding: 8px 12px;
    background: #f0f2fa;
    border-radius: 6px;
    color: #555;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

.subtotal-text {
    font-weight: 700;
    color: #11998e;
    font-size: 14px;
    white-space: nowrap;
}

/* Tombol-tombol */
.nota-amaka-container .button {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 600;
}

.nota-amaka-container .button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 15px;
    padding: 12px 30px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nota-amaka-container .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.nota-amaka-container .button-secondary {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    font-weight: 700;
}

.nota-amaka-container .button-secondary:hover {
    background: #667eea;
    color: #fff;
}

.nota-amaka-container .remove-row {
    background: #dc3232;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
}

.nota-amaka-container .remove-row:hover {
    background: #b71c1c;
}

/* Alert */
.nota-alert {
    padding: 14px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    border-left: 4px solid;
}
.nota-alert.success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}
.nota-alert.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3232;
}

/* ============================================================
   RESPONSIVE (MOBILE)
   ============================================================ */
@media (max-width: 768px) {
    .nota-amaka-container {
        padding: 20px 15px;
        margin: 10px;
    }

    .nota-amaka-container h2 {
        font-size: 18px;
    }

    .nota-grid-header {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .nota-amaka-container .button-primary {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }

    /* Grand total responsive */
    #grand-total-display {
        font-size: 18px !important;
    }
}

@media (max-width: 480px) {
    .nota-amaka-container {
        padding: 15px 10px;
    }

    .nota-amaka-container h2 {
        font-size: 16px;
    }

    .nota-table {
        font-size: 12px;
    }

    .nota-table thead th,
    .nota-table tbody td {
        padding: 8px 6px;
    }
}